@timothyw/pat-common 1.0.151 → 1.0.153

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.
@@ -53,6 +53,8 @@ export declare const habitDataSchema: z.ZodObject<{
53
53
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
54
  frequency: z.ZodNativeEnum<typeof HabitFrequency>;
55
55
  rolloverTime: z.ZodString;
56
+ startOffsetMinutes: z.ZodNumber;
57
+ endOffsetMinutes: z.ZodNumber;
56
58
  firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc/misc-types").DateOnlyString, string>;
57
59
  createdAt: z.ZodDate;
58
60
  updatedAt: z.ZodDate;
@@ -68,6 +70,8 @@ export declare const habitDataSchema: z.ZodObject<{
68
70
  name: string;
69
71
  frequency: HabitFrequency;
70
72
  rolloverTime: string;
73
+ startOffsetMinutes: number;
74
+ endOffsetMinutes: number;
71
75
  firstDay: string & {
72
76
  readonly __brand: "DateOnlyString";
73
77
  };
@@ -81,6 +85,8 @@ export declare const habitDataSchema: z.ZodObject<{
81
85
  name: string;
82
86
  frequency: HabitFrequency;
83
87
  rolloverTime: string;
88
+ startOffsetMinutes: number;
89
+ endOffsetMinutes: number;
84
90
  firstDay: string;
85
91
  description?: string | null | undefined;
86
92
  notes?: string | null | undefined;
@@ -112,6 +118,8 @@ export declare const habitSchema: z.ZodObject<{
112
118
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
113
119
  frequency: z.ZodNativeEnum<typeof HabitFrequency>;
114
120
  rolloverTime: z.ZodString;
121
+ startOffsetMinutes: z.ZodNumber;
122
+ endOffsetMinutes: z.ZodNumber;
115
123
  firstDay: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc/misc-types").DateOnlyString, string>;
116
124
  createdAt: z.ZodDate;
117
125
  updatedAt: z.ZodDate;
@@ -197,6 +205,8 @@ export declare const habitSchema: z.ZodObject<{
197
205
  name: string;
198
206
  frequency: HabitFrequency;
199
207
  rolloverTime: string;
208
+ startOffsetMinutes: number;
209
+ endOffsetMinutes: number;
200
210
  firstDay: string & {
201
211
  readonly __brand: "DateOnlyString";
202
212
  };
@@ -226,6 +236,8 @@ export declare const habitSchema: z.ZodObject<{
226
236
  name: string;
227
237
  frequency: HabitFrequency;
228
238
  rolloverTime: string;
239
+ startOffsetMinutes: number;
240
+ endOffsetMinutes: number;
229
241
  firstDay: string;
230
242
  stats: {
231
243
  totalDays: number;
@@ -243,16 +255,22 @@ export declare const createHabitRequestSchema: z.ZodObject<{
243
255
  notes: z.ZodOptional<z.ZodString>;
244
256
  frequency: z.ZodNativeEnum<typeof HabitFrequency>;
245
257
  rolloverTime: z.ZodString;
258
+ startOffsetMinutes: z.ZodNumber;
259
+ endOffsetMinutes: z.ZodNumber;
246
260
  }, "strip", z.ZodTypeAny, {
247
261
  name: string;
248
262
  frequency: HabitFrequency;
249
263
  rolloverTime: string;
264
+ startOffsetMinutes: number;
265
+ endOffsetMinutes: number;
250
266
  description?: string | undefined;
251
267
  notes?: string | undefined;
252
268
  }, {
253
269
  name: string;
254
270
  frequency: HabitFrequency;
255
271
  rolloverTime: string;
272
+ startOffsetMinutes: number;
273
+ endOffsetMinutes: number;
256
274
  description?: string | undefined;
257
275
  notes?: string | undefined;
258
276
  }>;
@@ -262,18 +280,24 @@ export declare const updateHabitRequestSchema: z.ZodObject<{
262
280
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
263
281
  frequency: z.ZodOptional<z.ZodNativeEnum<typeof HabitFrequency>>;
264
282
  rolloverTime: z.ZodOptional<z.ZodString>;
283
+ startOffsetMinutes: z.ZodOptional<z.ZodNumber>;
284
+ endOffsetMinutes: z.ZodOptional<z.ZodNumber>;
265
285
  }, "strip", z.ZodTypeAny, {
266
286
  name?: string | undefined;
267
287
  description?: string | null | undefined;
268
288
  notes?: string | null | undefined;
269
289
  frequency?: HabitFrequency | undefined;
270
290
  rolloverTime?: string | undefined;
291
+ startOffsetMinutes?: number | undefined;
292
+ endOffsetMinutes?: number | undefined;
271
293
  }, {
272
294
  name?: string | undefined;
273
295
  description?: string | null | undefined;
274
296
  notes?: string | null | undefined;
275
297
  frequency?: HabitFrequency | undefined;
276
298
  rolloverTime?: string | undefined;
299
+ startOffsetMinutes?: number | undefined;
300
+ endOffsetMinutes?: number | undefined;
277
301
  }>;
278
302
  export declare const createHabitEntryRequestSchema: z.ZodObject<{
279
303
  date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("./misc/misc-types").DateOnlyString, string>;
@@ -34,7 +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(),
37
+ rolloverTime: zod_1.z.string(), // TODO: deprecated
38
+ startOffsetMinutes: zod_1.z.number(),
39
+ endOffsetMinutes: zod_1.z.number(),
38
40
  firstDay: misc_types_1.dateOnlyStringSchema,
39
41
  createdAt: zod_1.z.date(),
40
42
  updatedAt: zod_1.z.date()
@@ -55,14 +57,18 @@ exports.createHabitRequestSchema = zod_1.z.object({
55
57
  description: zod_1.z.string().trim().optional(),
56
58
  notes: zod_1.z.string().trim().optional(),
57
59
  frequency: zod_1.z.nativeEnum(HabitFrequency),
58
- rolloverTime: zod_1.z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/)
60
+ rolloverTime: zod_1.z.string(), // TODO: deprecated
61
+ startOffsetMinutes: zod_1.z.number(),
62
+ endOffsetMinutes: zod_1.z.number(),
59
63
  });
60
64
  exports.updateHabitRequestSchema = zod_1.z.object({
61
65
  name: zod_1.z.string().min(1).trim().optional(),
62
66
  description: zod_1.z.string().trim().nullish(),
63
67
  notes: zod_1.z.string().trim().nullish(),
64
68
  frequency: zod_1.z.nativeEnum(HabitFrequency).optional(),
65
- rolloverTime: zod_1.z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/).optional()
69
+ rolloverTime: zod_1.z.string().optional(), // TODO: deprecated
70
+ startOffsetMinutes: zod_1.z.number().optional(),
71
+ endOffsetMinutes: zod_1.z.number().optional(),
66
72
  });
67
73
  exports.createHabitEntryRequestSchema = zod_1.z.object({
68
74
  date: misc_types_1.dateOnlyStringSchema,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@timothyw/pat-common",
3
3
  "description": "",
4
4
  "author": "Timothy Washburn",
5
- "version": "1.0.151",
5
+ "version": "1.0.153",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -34,7 +34,9 @@ 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(),
37
+ rolloverTime: z.string(), // TODO: deprecated
38
+ startOffsetMinutes: z.number(),
39
+ endOffsetMinutes: z.number(),
38
40
  firstDay: dateOnlyStringSchema,
39
41
  createdAt: z.date(),
40
42
  updatedAt: z.date()
@@ -58,7 +60,9 @@ export const createHabitRequestSchema = z.object({
58
60
  description: z.string().trim().optional(),
59
61
  notes: z.string().trim().optional(),
60
62
  frequency: z.nativeEnum(HabitFrequency),
61
- rolloverTime: z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/)
63
+ rolloverTime: z.string(), // TODO: deprecated
64
+ startOffsetMinutes: z.number(),
65
+ endOffsetMinutes: z.number(),
62
66
  });
63
67
 
64
68
  export const updateHabitRequestSchema = z.object({
@@ -66,7 +70,9 @@ export const updateHabitRequestSchema = z.object({
66
70
  description: z.string().trim().nullish(),
67
71
  notes: z.string().trim().nullish(),
68
72
  frequency: z.nativeEnum(HabitFrequency).optional(),
69
- rolloverTime: z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/).optional()
73
+ rolloverTime: z.string().optional(), // TODO: deprecated
74
+ startOffsetMinutes: z.number().optional(),
75
+ endOffsetMinutes: z.number().optional(),
70
76
  });
71
77
 
72
78
  export const createHabitEntryRequestSchema = z.object({