dink-pets-shared 1.0.5 → 1.0.7
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/src/activity-details.d.ts +130 -23
- package/dist/src/activity-details.js +69 -99
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/reminder-schemas.d.ts +371 -0
- package/dist/src/reminder-schemas.js +68 -0
- package/dist/src/schemas.d.ts +7 -0
- package/dist/src/schemas.js +40 -7
- package/dist/src/theme.d.ts +1 -1
- package/dist/src/theme.js +9 -0
- package/dist/src/uploads.js +8 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/feature-flags.d.ts +0 -35
- package/dist/src/feature-flags.js +0 -41
|
@@ -1,4 +1,89 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const WalkDetails: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"WALK">;
|
|
4
|
+
durationMin: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export declare const MealDetails: z.ZodObject<{
|
|
7
|
+
type: z.ZodLiteral<"MEAL">;
|
|
8
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
10
|
+
foodType: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export declare const BathroomDetails: z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"BATHROOM">;
|
|
14
|
+
subtype: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
pee: "pee";
|
|
16
|
+
poo: "poo";
|
|
17
|
+
}>>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export declare const TreatDetails: z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<"TREAT">;
|
|
21
|
+
treatType: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
export declare const PlaytimeDetails: z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"PLAYTIME">;
|
|
25
|
+
durationMin: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export declare const MedicationDetails: z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"MEDICATION">;
|
|
29
|
+
name: z.ZodOptional<z.ZodString>;
|
|
30
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
export declare const VetDetails: z.ZodObject<{
|
|
34
|
+
type: z.ZodLiteral<"VET_APPOINTMENT">;
|
|
35
|
+
visitType: z.ZodOptional<z.ZodString>;
|
|
36
|
+
location: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export declare const GroomingDetails: z.ZodObject<{
|
|
39
|
+
type: z.ZodLiteral<"GROOMING">;
|
|
40
|
+
groomingType: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
export declare const BathDetails: z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"BATH">;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export declare const NailTrimDetails: z.ZodObject<{
|
|
46
|
+
type: z.ZodLiteral<"NAIL_TRIM">;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
/** Discriminated union of all activity/reminder detail types */
|
|
49
|
+
export declare const Details: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"WALK">;
|
|
51
|
+
durationMin: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"MEAL">;
|
|
54
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
56
|
+
foodType: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
58
|
+
type: z.ZodLiteral<"BATHROOM">;
|
|
59
|
+
subtype: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
pee: "pee";
|
|
61
|
+
poo: "poo";
|
|
62
|
+
}>>;
|
|
63
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
+
type: z.ZodLiteral<"TREAT">;
|
|
65
|
+
treatType: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"PLAYTIME">;
|
|
68
|
+
durationMin: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"MEDICATION">;
|
|
71
|
+
name: z.ZodOptional<z.ZodString>;
|
|
72
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
75
|
+
type: z.ZodLiteral<"VET_APPOINTMENT">;
|
|
76
|
+
visitType: z.ZodOptional<z.ZodString>;
|
|
77
|
+
location: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
79
|
+
type: z.ZodLiteral<"GROOMING">;
|
|
80
|
+
groomingType: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
82
|
+
type: z.ZodLiteral<"BATH">;
|
|
83
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
84
|
+
type: z.ZodLiteral<"NAIL_TRIM">;
|
|
85
|
+
}, z.core.$strict>], "type">;
|
|
86
|
+
export type Details = z.infer<typeof Details>;
|
|
2
87
|
export declare const WalkActivityDetails: z.ZodObject<{
|
|
3
88
|
type: z.ZodLiteral<"WALK">;
|
|
4
89
|
durationMin: z.ZodOptional<z.ZodNumber>;
|
|
@@ -11,10 +96,10 @@ export declare const MealActivityDetails: z.ZodObject<{
|
|
|
11
96
|
}, z.core.$strict>;
|
|
12
97
|
export declare const BathroomActivityDetails: z.ZodObject<{
|
|
13
98
|
type: z.ZodLiteral<"BATHROOM">;
|
|
14
|
-
subtype: z.ZodEnum<{
|
|
99
|
+
subtype: z.ZodOptional<z.ZodEnum<{
|
|
15
100
|
pee: "pee";
|
|
16
101
|
poo: "poo";
|
|
17
|
-
}
|
|
102
|
+
}>>;
|
|
18
103
|
}, z.core.$strict>;
|
|
19
104
|
export declare const TreatActivityDetails: z.ZodObject<{
|
|
20
105
|
type: z.ZodLiteral<"TREAT">;
|
|
@@ -41,7 +126,6 @@ export declare const GroomingActivityDetails: z.ZodObject<{
|
|
|
41
126
|
}, z.core.$strict>;
|
|
42
127
|
export declare const BathActivityDetails: z.ZodObject<{
|
|
43
128
|
type: z.ZodLiteral<"BATH">;
|
|
44
|
-
durationMin: z.ZodOptional<z.ZodNumber>;
|
|
45
129
|
}, z.core.$strict>;
|
|
46
130
|
export declare const NailTrimActivityDetails: z.ZodObject<{
|
|
47
131
|
type: z.ZodLiteral<"NAIL_TRIM">;
|
|
@@ -56,10 +140,10 @@ export declare const ActivityDetails: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
56
140
|
foodType: z.ZodOptional<z.ZodString>;
|
|
57
141
|
}, z.core.$strict>, z.ZodObject<{
|
|
58
142
|
type: z.ZodLiteral<"BATHROOM">;
|
|
59
|
-
subtype: z.ZodEnum<{
|
|
143
|
+
subtype: z.ZodOptional<z.ZodEnum<{
|
|
60
144
|
pee: "pee";
|
|
61
145
|
poo: "poo";
|
|
62
|
-
}
|
|
146
|
+
}>>;
|
|
63
147
|
}, z.core.$strict>, z.ZodObject<{
|
|
64
148
|
type: z.ZodLiteral<"TREAT">;
|
|
65
149
|
treatType: z.ZodOptional<z.ZodString>;
|
|
@@ -80,11 +164,10 @@ export declare const ActivityDetails: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
80
164
|
groomingType: z.ZodOptional<z.ZodString>;
|
|
81
165
|
}, z.core.$strict>, z.ZodObject<{
|
|
82
166
|
type: z.ZodLiteral<"BATH">;
|
|
83
|
-
durationMin: z.ZodOptional<z.ZodNumber>;
|
|
84
167
|
}, z.core.$strict>, z.ZodObject<{
|
|
85
168
|
type: z.ZodLiteral<"NAIL_TRIM">;
|
|
86
169
|
}, z.core.$strict>], "type">;
|
|
87
|
-
export type ActivityDetails =
|
|
170
|
+
export type ActivityDetails = Details;
|
|
88
171
|
export declare const WalkReminderDetails: z.ZodObject<{
|
|
89
172
|
type: z.ZodLiteral<"WALK">;
|
|
90
173
|
durationMin: z.ZodOptional<z.ZodNumber>;
|
|
@@ -97,6 +180,10 @@ export declare const MealReminderDetails: z.ZodObject<{
|
|
|
97
180
|
}, z.core.$strict>;
|
|
98
181
|
export declare const BathroomReminderDetails: z.ZodObject<{
|
|
99
182
|
type: z.ZodLiteral<"BATHROOM">;
|
|
183
|
+
subtype: z.ZodOptional<z.ZodEnum<{
|
|
184
|
+
pee: "pee";
|
|
185
|
+
poo: "poo";
|
|
186
|
+
}>>;
|
|
100
187
|
}, z.core.$strict>;
|
|
101
188
|
export declare const TreatReminderDetails: z.ZodObject<{
|
|
102
189
|
type: z.ZodLiteral<"TREAT">;
|
|
@@ -108,7 +195,9 @@ export declare const PlaytimeReminderDetails: z.ZodObject<{
|
|
|
108
195
|
}, z.core.$strict>;
|
|
109
196
|
export declare const MedicationReminderDetails: z.ZodObject<{
|
|
110
197
|
type: z.ZodLiteral<"MEDICATION">;
|
|
111
|
-
name: z.ZodString
|
|
198
|
+
name: z.ZodOptional<z.ZodString>;
|
|
199
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
112
201
|
}, z.core.$strict>;
|
|
113
202
|
export declare const VetReminderDetails: z.ZodObject<{
|
|
114
203
|
type: z.ZodLiteral<"VET_APPOINTMENT">;
|
|
@@ -135,6 +224,10 @@ export declare const ReminderDetails: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
135
224
|
foodType: z.ZodOptional<z.ZodString>;
|
|
136
225
|
}, z.core.$strict>, z.ZodObject<{
|
|
137
226
|
type: z.ZodLiteral<"BATHROOM">;
|
|
227
|
+
subtype: z.ZodOptional<z.ZodEnum<{
|
|
228
|
+
pee: "pee";
|
|
229
|
+
poo: "poo";
|
|
230
|
+
}>>;
|
|
138
231
|
}, z.core.$strict>, z.ZodObject<{
|
|
139
232
|
type: z.ZodLiteral<"TREAT">;
|
|
140
233
|
treatType: z.ZodOptional<z.ZodString>;
|
|
@@ -143,7 +236,9 @@ export declare const ReminderDetails: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
143
236
|
durationMin: z.ZodOptional<z.ZodNumber>;
|
|
144
237
|
}, z.core.$strict>, z.ZodObject<{
|
|
145
238
|
type: z.ZodLiteral<"MEDICATION">;
|
|
146
|
-
name: z.ZodString
|
|
239
|
+
name: z.ZodOptional<z.ZodString>;
|
|
240
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
147
242
|
}, z.core.$strict>, z.ZodObject<{
|
|
148
243
|
type: z.ZodLiteral<"VET_APPOINTMENT">;
|
|
149
244
|
visitType: z.ZodOptional<z.ZodString>;
|
|
@@ -156,17 +251,27 @@ export declare const ReminderDetails: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
156
251
|
}, z.core.$strict>, z.ZodObject<{
|
|
157
252
|
type: z.ZodLiteral<"NAIL_TRIM">;
|
|
158
253
|
}, z.core.$strict>], "type">;
|
|
159
|
-
export type ReminderDetails =
|
|
160
|
-
export type
|
|
161
|
-
export type
|
|
162
|
-
export type
|
|
163
|
-
export type
|
|
164
|
-
export type
|
|
165
|
-
export type
|
|
166
|
-
export type
|
|
167
|
-
export type
|
|
168
|
-
export type
|
|
169
|
-
export type
|
|
254
|
+
export type ReminderDetails = Details;
|
|
255
|
+
export type WalkDetailsType = z.infer<typeof WalkDetails>;
|
|
256
|
+
export type MealDetailsType = z.infer<typeof MealDetails>;
|
|
257
|
+
export type BathroomDetailsType = z.infer<typeof BathroomDetails>;
|
|
258
|
+
export type TreatDetailsType = z.infer<typeof TreatDetails>;
|
|
259
|
+
export type PlaytimeDetailsType = z.infer<typeof PlaytimeDetails>;
|
|
260
|
+
export type MedicationDetailsType = z.infer<typeof MedicationDetails>;
|
|
261
|
+
export type VetDetailsType = z.infer<typeof VetDetails>;
|
|
262
|
+
export type GroomingDetailsType = z.infer<typeof GroomingDetails>;
|
|
263
|
+
export type BathDetailsType = z.infer<typeof BathDetails>;
|
|
264
|
+
export type NailTrimDetailsType = z.infer<typeof NailTrimDetails>;
|
|
265
|
+
export type WalkReminderDetailsType = WalkDetailsType;
|
|
266
|
+
export type PlaytimeReminderDetailsType = PlaytimeDetailsType;
|
|
267
|
+
export type MedicationReminderDetailsType = MedicationDetailsType;
|
|
268
|
+
export type MealReminderDetailsType = MealDetailsType;
|
|
269
|
+
export type BathroomReminderDetailsType = BathroomDetailsType;
|
|
270
|
+
export type TreatReminderDetailsType = TreatDetailsType;
|
|
271
|
+
export type VetReminderDetailsType = VetDetailsType;
|
|
272
|
+
export type GroomingReminderDetailsType = GroomingDetailsType;
|
|
273
|
+
export type BathReminderDetailsType = BathDetailsType;
|
|
274
|
+
export type NailTrimReminderDetailsType = NailTrimDetailsType;
|
|
170
275
|
export declare function validateActivityDetails(details: unknown): {
|
|
171
276
|
type: "WALK";
|
|
172
277
|
durationMin?: number | undefined;
|
|
@@ -177,7 +282,7 @@ export declare function validateActivityDetails(details: unknown): {
|
|
|
177
282
|
foodType?: string | undefined;
|
|
178
283
|
} | {
|
|
179
284
|
type: "BATHROOM";
|
|
180
|
-
subtype
|
|
285
|
+
subtype?: "pee" | "poo" | undefined;
|
|
181
286
|
} | {
|
|
182
287
|
type: "TREAT";
|
|
183
288
|
treatType?: string | undefined;
|
|
@@ -198,7 +303,6 @@ export declare function validateActivityDetails(details: unknown): {
|
|
|
198
303
|
groomingType?: string | undefined;
|
|
199
304
|
} | {
|
|
200
305
|
type: "BATH";
|
|
201
|
-
durationMin?: number | undefined;
|
|
202
306
|
} | {
|
|
203
307
|
type: "NAIL_TRIM";
|
|
204
308
|
};
|
|
@@ -212,6 +316,7 @@ export declare function validateReminderDetails(details: unknown): {
|
|
|
212
316
|
foodType?: string | undefined;
|
|
213
317
|
} | {
|
|
214
318
|
type: "BATHROOM";
|
|
319
|
+
subtype?: "pee" | "poo" | undefined;
|
|
215
320
|
} | {
|
|
216
321
|
type: "TREAT";
|
|
217
322
|
treatType?: string | undefined;
|
|
@@ -220,7 +325,9 @@ export declare function validateReminderDetails(details: unknown): {
|
|
|
220
325
|
durationMin?: number | undefined;
|
|
221
326
|
} | {
|
|
222
327
|
type: "MEDICATION";
|
|
223
|
-
name
|
|
328
|
+
name?: string | undefined;
|
|
329
|
+
amount?: number | undefined;
|
|
330
|
+
unit?: string | undefined;
|
|
224
331
|
} | {
|
|
225
332
|
type: "VET_APPOINTMENT";
|
|
226
333
|
visitType?: string | undefined;
|
|
@@ -2,15 +2,30 @@ import { z } from "zod";
|
|
|
2
2
|
import { ActivityType } from "./enums.js";
|
|
3
3
|
import { Amount, AmountUnit, BathroomActivitySubtype, DurationMin, TinyText, } from "./schemas.js";
|
|
4
4
|
// =============================================================================
|
|
5
|
-
//
|
|
5
|
+
// UNIFIED DETAILS SCHEMAS
|
|
6
6
|
// =============================================================================
|
|
7
|
-
|
|
7
|
+
// Single set of detail schemas used for both Activities and Reminders.
|
|
8
|
+
// The structure is identical - only the semantic context differs:
|
|
9
|
+
//
|
|
10
|
+
// REMINDER DETAILS = What SHOULD be done
|
|
11
|
+
// "Walk the dog for 30 minutes", "Give 2mg of medication"
|
|
12
|
+
// Attached to a Reminder record. Describes the planned/expected action.
|
|
13
|
+
//
|
|
14
|
+
// ACTIVITY DETAILS = What WAS done
|
|
15
|
+
// "Walked for 25 minutes", "Gave 2mg of medication"
|
|
16
|
+
// Attached to an Activity record. Describes what actually happened.
|
|
17
|
+
//
|
|
18
|
+
// Using the same schema ensures consistency: if you can plan it, you can log it,
|
|
19
|
+
// and vice versa. The fields are all optional to allow partial logging
|
|
20
|
+
// (e.g., "I walked the dog" without specifying duration).
|
|
21
|
+
// =============================================================================
|
|
22
|
+
export const WalkDetails = z
|
|
8
23
|
.object({
|
|
9
24
|
type: z.literal(ActivityType.enum.WALK),
|
|
10
25
|
durationMin: DurationMin.optional(),
|
|
11
26
|
})
|
|
12
27
|
.strict();
|
|
13
|
-
export const
|
|
28
|
+
export const MealDetails = z
|
|
14
29
|
.object({
|
|
15
30
|
type: z.literal(ActivityType.enum.MEAL),
|
|
16
31
|
amount: Amount.optional(),
|
|
@@ -18,25 +33,25 @@ export const MealActivityDetails = z
|
|
|
18
33
|
foodType: TinyText.optional(),
|
|
19
34
|
})
|
|
20
35
|
.strict();
|
|
21
|
-
export const
|
|
36
|
+
export const BathroomDetails = z
|
|
22
37
|
.object({
|
|
23
38
|
type: z.literal(ActivityType.enum.BATHROOM),
|
|
24
|
-
subtype: BathroomActivitySubtype,
|
|
39
|
+
subtype: BathroomActivitySubtype.optional(),
|
|
25
40
|
})
|
|
26
41
|
.strict();
|
|
27
|
-
export const
|
|
42
|
+
export const TreatDetails = z
|
|
28
43
|
.object({
|
|
29
44
|
type: z.literal(ActivityType.enum.TREAT),
|
|
30
45
|
treatType: TinyText.optional(),
|
|
31
46
|
})
|
|
32
47
|
.strict();
|
|
33
|
-
export const
|
|
48
|
+
export const PlaytimeDetails = z
|
|
34
49
|
.object({
|
|
35
50
|
type: z.literal(ActivityType.enum.PLAYTIME),
|
|
36
51
|
durationMin: DurationMin.optional(),
|
|
37
52
|
})
|
|
38
53
|
.strict();
|
|
39
|
-
export const
|
|
54
|
+
export const MedicationDetails = z
|
|
40
55
|
.object({
|
|
41
56
|
type: z.literal(ActivityType.enum.MEDICATION),
|
|
42
57
|
name: TinyText.optional(),
|
|
@@ -44,123 +59,78 @@ export const MedicationActivityDetails = z
|
|
|
44
59
|
unit: AmountUnit.optional(),
|
|
45
60
|
})
|
|
46
61
|
.strict();
|
|
47
|
-
export const
|
|
62
|
+
export const VetDetails = z
|
|
48
63
|
.object({
|
|
49
64
|
type: z.literal(ActivityType.enum.VET_APPOINTMENT),
|
|
50
65
|
visitType: TinyText.optional(),
|
|
51
66
|
location: TinyText.optional(),
|
|
52
67
|
})
|
|
53
68
|
.strict();
|
|
54
|
-
export const
|
|
69
|
+
export const GroomingDetails = z
|
|
55
70
|
.object({
|
|
56
71
|
type: z.literal(ActivityType.enum.GROOMING),
|
|
57
72
|
groomingType: TinyText.optional(),
|
|
58
73
|
})
|
|
59
74
|
.strict();
|
|
60
|
-
export const
|
|
75
|
+
export const BathDetails = z
|
|
61
76
|
.object({
|
|
62
77
|
type: z.literal(ActivityType.enum.BATH),
|
|
63
|
-
durationMin: DurationMin.optional(),
|
|
64
78
|
})
|
|
65
79
|
.strict();
|
|
66
|
-
export const
|
|
80
|
+
export const NailTrimDetails = z
|
|
67
81
|
.object({
|
|
68
82
|
type: z.literal(ActivityType.enum.NAIL_TRIM),
|
|
69
83
|
})
|
|
70
84
|
.strict();
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
/** Discriminated union of all activity/reminder detail types */
|
|
86
|
+
export const Details = z.discriminatedUnion("type", [
|
|
87
|
+
WalkDetails,
|
|
88
|
+
MealDetails,
|
|
89
|
+
BathroomDetails,
|
|
90
|
+
TreatDetails,
|
|
91
|
+
PlaytimeDetails,
|
|
92
|
+
MedicationDetails,
|
|
93
|
+
VetDetails,
|
|
94
|
+
GroomingDetails,
|
|
95
|
+
BathDetails,
|
|
96
|
+
NailTrimDetails,
|
|
82
97
|
]);
|
|
83
98
|
// =============================================================================
|
|
84
|
-
//
|
|
99
|
+
// LEGACY ALIASES (for backwards compatibility)
|
|
85
100
|
// =============================================================================
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
export const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
export const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
export const TreatReminderDetails =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
export const
|
|
112
|
-
|
|
113
|
-
type: z.literal(ActivityType.enum.PLAYTIME),
|
|
114
|
-
durationMin: DurationMin.optional(),
|
|
115
|
-
})
|
|
116
|
-
.strict();
|
|
117
|
-
export const MedicationReminderDetails = z
|
|
118
|
-
.object({
|
|
119
|
-
type: z.literal(ActivityType.enum.MEDICATION),
|
|
120
|
-
name: TinyText.min(1),
|
|
121
|
-
})
|
|
122
|
-
.strict();
|
|
123
|
-
export const VetReminderDetails = z
|
|
124
|
-
.object({
|
|
125
|
-
type: z.literal(ActivityType.enum.VET_APPOINTMENT),
|
|
126
|
-
visitType: TinyText.optional(),
|
|
127
|
-
location: TinyText.optional(),
|
|
128
|
-
})
|
|
129
|
-
.strict();
|
|
130
|
-
export const GroomingReminderDetails = z
|
|
131
|
-
.object({
|
|
132
|
-
type: z.literal(ActivityType.enum.GROOMING),
|
|
133
|
-
groomingType: TinyText.optional(),
|
|
134
|
-
})
|
|
135
|
-
.strict();
|
|
136
|
-
export const BathReminderDetails = z
|
|
137
|
-
.object({
|
|
138
|
-
type: z.literal(ActivityType.enum.BATH),
|
|
139
|
-
})
|
|
140
|
-
.strict();
|
|
141
|
-
export const NailTrimReminderDetails = z
|
|
142
|
-
.object({
|
|
143
|
-
type: z.literal(ActivityType.enum.NAIL_TRIM),
|
|
144
|
-
})
|
|
145
|
-
.strict();
|
|
146
|
-
export const ReminderDetails = z.discriminatedUnion("type", [
|
|
147
|
-
WalkReminderDetails,
|
|
148
|
-
MealReminderDetails,
|
|
149
|
-
BathroomReminderDetails,
|
|
150
|
-
TreatReminderDetails,
|
|
151
|
-
PlaytimeReminderDetails,
|
|
152
|
-
MedicationReminderDetails,
|
|
153
|
-
VetReminderDetails,
|
|
154
|
-
GroomingReminderDetails,
|
|
155
|
-
BathReminderDetails,
|
|
156
|
-
NailTrimReminderDetails,
|
|
157
|
-
]);
|
|
101
|
+
// These aliases maintain compatibility with existing code that imports
|
|
102
|
+
// Activity-specific or Reminder-specific schema names.
|
|
103
|
+
// =============================================================================
|
|
104
|
+
// Activity aliases
|
|
105
|
+
export const WalkActivityDetails = WalkDetails;
|
|
106
|
+
export const MealActivityDetails = MealDetails;
|
|
107
|
+
export const BathroomActivityDetails = BathroomDetails;
|
|
108
|
+
export const TreatActivityDetails = TreatDetails;
|
|
109
|
+
export const PlaytimeActivityDetails = PlaytimeDetails;
|
|
110
|
+
export const MedicationActivityDetails = MedicationDetails;
|
|
111
|
+
export const VetActivityDetails = VetDetails;
|
|
112
|
+
export const GroomingActivityDetails = GroomingDetails;
|
|
113
|
+
export const BathActivityDetails = BathDetails;
|
|
114
|
+
export const NailTrimActivityDetails = NailTrimDetails;
|
|
115
|
+
export const ActivityDetails = Details;
|
|
116
|
+
// Reminder aliases
|
|
117
|
+
export const WalkReminderDetails = WalkDetails;
|
|
118
|
+
export const MealReminderDetails = MealDetails;
|
|
119
|
+
export const BathroomReminderDetails = BathroomDetails;
|
|
120
|
+
export const TreatReminderDetails = TreatDetails;
|
|
121
|
+
export const PlaytimeReminderDetails = PlaytimeDetails;
|
|
122
|
+
export const MedicationReminderDetails = MedicationDetails;
|
|
123
|
+
export const VetReminderDetails = VetDetails;
|
|
124
|
+
export const GroomingReminderDetails = GroomingDetails;
|
|
125
|
+
export const BathReminderDetails = BathDetails;
|
|
126
|
+
export const NailTrimReminderDetails = NailTrimDetails;
|
|
127
|
+
export const ReminderDetails = Details;
|
|
158
128
|
// =============================================================================
|
|
159
129
|
// HELPERS
|
|
160
130
|
// =============================================================================
|
|
161
131
|
export function validateActivityDetails(details) {
|
|
162
|
-
return
|
|
132
|
+
return Details.parse(details);
|
|
163
133
|
}
|
|
164
134
|
export function validateReminderDetails(details) {
|
|
165
|
-
return
|
|
135
|
+
return Details.parse(details);
|
|
166
136
|
}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED