@timothyw/pat-common 1.0.152 → 1.0.154
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.
|
@@ -16,7 +16,7 @@ export declare const habitEntrySchema: z.ZodObject<{
|
|
|
16
16
|
_id: z.ZodEffects<z.ZodString, import("./id-types").HabitEntryId, string>;
|
|
17
17
|
habitId: z.ZodEffects<z.ZodString, import("./id-types").HabitId, string>;
|
|
18
18
|
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
19
|
-
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
19
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
20
20
|
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
21
21
|
createdAt: z.ZodDate;
|
|
22
22
|
updatedAt: z.ZodDate;
|
|
@@ -52,10 +52,9 @@ export declare const habitDataSchema: z.ZodObject<{
|
|
|
52
52
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
53
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
54
|
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
55
|
-
rolloverTime: z.ZodString;
|
|
56
55
|
startOffsetMinutes: z.ZodNumber;
|
|
57
56
|
endOffsetMinutes: z.ZodNumber;
|
|
58
|
-
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
57
|
+
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
59
58
|
createdAt: z.ZodDate;
|
|
60
59
|
updatedAt: z.ZodDate;
|
|
61
60
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -69,7 +68,6 @@ export declare const habitDataSchema: z.ZodObject<{
|
|
|
69
68
|
};
|
|
70
69
|
name: string;
|
|
71
70
|
frequency: HabitFrequency;
|
|
72
|
-
rolloverTime: string;
|
|
73
71
|
startOffsetMinutes: number;
|
|
74
72
|
endOffsetMinutes: number;
|
|
75
73
|
firstDay: string & {
|
|
@@ -84,7 +82,6 @@ export declare const habitDataSchema: z.ZodObject<{
|
|
|
84
82
|
userId: string;
|
|
85
83
|
name: string;
|
|
86
84
|
frequency: HabitFrequency;
|
|
87
|
-
rolloverTime: string;
|
|
88
85
|
startOffsetMinutes: number;
|
|
89
86
|
endOffsetMinutes: number;
|
|
90
87
|
firstDay: string;
|
|
@@ -117,10 +114,9 @@ export declare const habitSchema: z.ZodObject<{
|
|
|
117
114
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
115
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
116
|
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
120
|
-
rolloverTime: z.ZodString;
|
|
121
117
|
startOffsetMinutes: z.ZodNumber;
|
|
122
118
|
endOffsetMinutes: z.ZodNumber;
|
|
123
|
-
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
119
|
+
firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
124
120
|
createdAt: z.ZodDate;
|
|
125
121
|
updatedAt: z.ZodDate;
|
|
126
122
|
} & {
|
|
@@ -128,7 +124,7 @@ export declare const habitSchema: z.ZodObject<{
|
|
|
128
124
|
_id: z.ZodEffects<z.ZodString, import("./id-types").HabitEntryId, string>;
|
|
129
125
|
habitId: z.ZodEffects<z.ZodString, import("./id-types").HabitId, string>;
|
|
130
126
|
userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
|
|
131
|
-
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
127
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
132
128
|
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
133
129
|
createdAt: z.ZodDate;
|
|
134
130
|
updatedAt: z.ZodDate;
|
|
@@ -204,7 +200,6 @@ export declare const habitSchema: z.ZodObject<{
|
|
|
204
200
|
};
|
|
205
201
|
name: string;
|
|
206
202
|
frequency: HabitFrequency;
|
|
207
|
-
rolloverTime: string;
|
|
208
203
|
startOffsetMinutes: number;
|
|
209
204
|
endOffsetMinutes: number;
|
|
210
205
|
firstDay: string & {
|
|
@@ -235,7 +230,6 @@ export declare const habitSchema: z.ZodObject<{
|
|
|
235
230
|
userId: string;
|
|
236
231
|
name: string;
|
|
237
232
|
frequency: HabitFrequency;
|
|
238
|
-
rolloverTime: string;
|
|
239
233
|
startOffsetMinutes: number;
|
|
240
234
|
endOffsetMinutes: number;
|
|
241
235
|
firstDay: string;
|
|
@@ -254,13 +248,11 @@ export declare const createHabitRequestSchema: z.ZodObject<{
|
|
|
254
248
|
description: z.ZodOptional<z.ZodString>;
|
|
255
249
|
notes: z.ZodOptional<z.ZodString>;
|
|
256
250
|
frequency: z.ZodNativeEnum<typeof HabitFrequency>;
|
|
257
|
-
rolloverTime: z.ZodString;
|
|
258
251
|
startOffsetMinutes: z.ZodNumber;
|
|
259
252
|
endOffsetMinutes: z.ZodNumber;
|
|
260
253
|
}, "strip", z.ZodTypeAny, {
|
|
261
254
|
name: string;
|
|
262
255
|
frequency: HabitFrequency;
|
|
263
|
-
rolloverTime: string;
|
|
264
256
|
startOffsetMinutes: number;
|
|
265
257
|
endOffsetMinutes: number;
|
|
266
258
|
description?: string | undefined;
|
|
@@ -268,7 +260,6 @@ export declare const createHabitRequestSchema: z.ZodObject<{
|
|
|
268
260
|
}, {
|
|
269
261
|
name: string;
|
|
270
262
|
frequency: HabitFrequency;
|
|
271
|
-
rolloverTime: string;
|
|
272
263
|
startOffsetMinutes: number;
|
|
273
264
|
endOffsetMinutes: number;
|
|
274
265
|
description?: string | undefined;
|
|
@@ -279,28 +270,25 @@ export declare const updateHabitRequestSchema: z.ZodObject<{
|
|
|
279
270
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
280
271
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
281
272
|
frequency: z.ZodOptional<z.ZodNativeEnum<typeof HabitFrequency>>;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
endOffsetMinutes: z.ZodNumber;
|
|
273
|
+
startOffsetMinutes: z.ZodOptional<z.ZodNumber>;
|
|
274
|
+
endOffsetMinutes: z.ZodOptional<z.ZodNumber>;
|
|
285
275
|
}, "strip", z.ZodTypeAny, {
|
|
286
|
-
rolloverTime: string;
|
|
287
|
-
startOffsetMinutes: number;
|
|
288
|
-
endOffsetMinutes: number;
|
|
289
276
|
name?: string | undefined;
|
|
290
277
|
description?: string | null | undefined;
|
|
291
278
|
notes?: string | null | undefined;
|
|
292
279
|
frequency?: HabitFrequency | undefined;
|
|
280
|
+
startOffsetMinutes?: number | undefined;
|
|
281
|
+
endOffsetMinutes?: number | undefined;
|
|
293
282
|
}, {
|
|
294
|
-
rolloverTime: string;
|
|
295
|
-
startOffsetMinutes: number;
|
|
296
|
-
endOffsetMinutes: number;
|
|
297
283
|
name?: string | undefined;
|
|
298
284
|
description?: string | null | undefined;
|
|
299
285
|
notes?: string | null | undefined;
|
|
300
286
|
frequency?: HabitFrequency | undefined;
|
|
287
|
+
startOffsetMinutes?: number | undefined;
|
|
288
|
+
endOffsetMinutes?: number | undefined;
|
|
301
289
|
}>;
|
|
302
290
|
export declare const createHabitEntryRequestSchema: z.ZodObject<{
|
|
303
|
-
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc
|
|
291
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc").DateOnlyString, string>;
|
|
304
292
|
status: z.ZodNativeEnum<typeof HabitEntryStatus>;
|
|
305
293
|
}, "strip", z.ZodTypeAny, {
|
|
306
294
|
status: HabitEntryStatus;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createHabitEntryRequestSchema = exports.updateHabitRequestSchema = exports.createHabitRequestSchema = exports.habitSchema = exports.habitStatsSchema = exports.habitDataSchema = exports.habitEntrySchema = exports.HabitEntryStatus = exports.HabitFrequency = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const id_types_1 = require("./id-types");
|
|
6
|
-
const
|
|
6
|
+
const misc_1 = require("./misc");
|
|
7
7
|
var HabitFrequency;
|
|
8
8
|
(function (HabitFrequency) {
|
|
9
9
|
HabitFrequency["DAILY"] = "daily";
|
|
@@ -22,7 +22,7 @@ exports.habitEntrySchema = zod_1.z.object({
|
|
|
22
22
|
_id: id_types_1.habitEntryIdSchema,
|
|
23
23
|
habitId: id_types_1.habitIdSchema,
|
|
24
24
|
userId: id_types_1.userIdSchema,
|
|
25
|
-
date:
|
|
25
|
+
date: misc_1.dateOnlyStringSchema,
|
|
26
26
|
status: zod_1.z.nativeEnum(HabitEntryStatus),
|
|
27
27
|
createdAt: zod_1.z.date(),
|
|
28
28
|
updatedAt: zod_1.z.date()
|
|
@@ -34,10 +34,9 @@ exports.habitDataSchema = zod_1.z.object({
|
|
|
34
34
|
description: zod_1.z.string().nullable().optional(),
|
|
35
35
|
notes: zod_1.z.string().nullable().optional(),
|
|
36
36
|
frequency: zod_1.z.nativeEnum(HabitFrequency),
|
|
37
|
-
rolloverTime: zod_1.z.string(), // TODO: deprecated
|
|
38
37
|
startOffsetMinutes: zod_1.z.number(),
|
|
39
38
|
endOffsetMinutes: zod_1.z.number(),
|
|
40
|
-
firstDay:
|
|
39
|
+
firstDay: misc_1.dateOnlyStringSchema,
|
|
41
40
|
createdAt: zod_1.z.date(),
|
|
42
41
|
updatedAt: zod_1.z.date()
|
|
43
42
|
});
|
|
@@ -57,7 +56,6 @@ exports.createHabitRequestSchema = zod_1.z.object({
|
|
|
57
56
|
description: zod_1.z.string().trim().optional(),
|
|
58
57
|
notes: zod_1.z.string().trim().optional(),
|
|
59
58
|
frequency: zod_1.z.nativeEnum(HabitFrequency),
|
|
60
|
-
rolloverTime: zod_1.z.string(), // TODO: deprecated
|
|
61
59
|
startOffsetMinutes: zod_1.z.number(),
|
|
62
60
|
endOffsetMinutes: zod_1.z.number(),
|
|
63
61
|
});
|
|
@@ -66,11 +64,10 @@ exports.updateHabitRequestSchema = zod_1.z.object({
|
|
|
66
64
|
description: zod_1.z.string().trim().nullish(),
|
|
67
65
|
notes: zod_1.z.string().trim().nullish(),
|
|
68
66
|
frequency: zod_1.z.nativeEnum(HabitFrequency).optional(),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
endOffsetMinutes: zod_1.z.number(),
|
|
67
|
+
startOffsetMinutes: zod_1.z.number().optional(),
|
|
68
|
+
endOffsetMinutes: zod_1.z.number().optional(),
|
|
72
69
|
});
|
|
73
70
|
exports.createHabitEntryRequestSchema = zod_1.z.object({
|
|
74
|
-
date:
|
|
71
|
+
date: misc_1.dateOnlyStringSchema,
|
|
75
72
|
status: zod_1.z.nativeEnum(HabitEntryStatus)
|
|
76
73
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { habitIdSchema, habitEntryIdSchema, userIdSchema } from './id-types';
|
|
3
|
-
import { dateOnlyStringSchema } from './misc
|
|
3
|
+
import { dateOnlyStringSchema } from './misc';
|
|
4
4
|
import { Serialized } from '../utils';
|
|
5
5
|
|
|
6
6
|
export enum HabitFrequency {
|
|
@@ -34,7 +34,6 @@ export const habitDataSchema = z.object({
|
|
|
34
34
|
description: z.string().nullable().optional(),
|
|
35
35
|
notes: z.string().nullable().optional(),
|
|
36
36
|
frequency: z.nativeEnum(HabitFrequency),
|
|
37
|
-
rolloverTime: z.string(), // TODO: deprecated
|
|
38
37
|
startOffsetMinutes: z.number(),
|
|
39
38
|
endOffsetMinutes: z.number(),
|
|
40
39
|
firstDay: dateOnlyStringSchema,
|
|
@@ -60,7 +59,6 @@ export const createHabitRequestSchema = z.object({
|
|
|
60
59
|
description: z.string().trim().optional(),
|
|
61
60
|
notes: z.string().trim().optional(),
|
|
62
61
|
frequency: z.nativeEnum(HabitFrequency),
|
|
63
|
-
rolloverTime: z.string(), // TODO: deprecated
|
|
64
62
|
startOffsetMinutes: z.number(),
|
|
65
63
|
endOffsetMinutes: z.number(),
|
|
66
64
|
});
|
|
@@ -70,9 +68,8 @@ export const updateHabitRequestSchema = z.object({
|
|
|
70
68
|
description: z.string().trim().nullish(),
|
|
71
69
|
notes: z.string().trim().nullish(),
|
|
72
70
|
frequency: z.nativeEnum(HabitFrequency).optional(),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
endOffsetMinutes: z.number(),
|
|
71
|
+
startOffsetMinutes: z.number().optional(),
|
|
72
|
+
endOffsetMinutes: z.number().optional(),
|
|
76
73
|
});
|
|
77
74
|
|
|
78
75
|
export const createHabitEntryRequestSchema = z.object({
|