@timothyw/pat-common 1.0.150 → 1.0.152

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.
@@ -2,7 +2,9 @@
2
2
  "permissions": {
3
3
  "allow": [
4
4
  "Read(//Users/timothy/Documents/_development/webstorm-projects/pat-app/src/**)",
5
- "Read(//Users/timothy/Documents/_development/webstorm-projects/pat-app/**)"
5
+ "Read(//Users/timothy/Documents/_development/webstorm-projects/pat-app/**)",
6
+ "Read(//Users/timothy/Documents/_development/webstorm-projects/pat-api/server/src/notifications/**)",
7
+ "Read(//Users/timothy/Documents/_development/webstorm-projects/pat-api/server/src/**)"
6
8
  ],
7
9
  "deny": [],
8
10
  "ask": []
@@ -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
  }>;
@@ -261,19 +279,25 @@ export declare const updateHabitRequestSchema: z.ZodObject<{
261
279
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
262
280
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
263
281
  frequency: z.ZodOptional<z.ZodNativeEnum<typeof HabitFrequency>>;
264
- rolloverTime: z.ZodOptional<z.ZodString>;
282
+ rolloverTime: z.ZodString;
283
+ startOffsetMinutes: z.ZodNumber;
284
+ endOffsetMinutes: z.ZodNumber;
265
285
  }, "strip", z.ZodTypeAny, {
286
+ rolloverTime: string;
287
+ startOffsetMinutes: number;
288
+ endOffsetMinutes: number;
266
289
  name?: string | undefined;
267
290
  description?: string | null | undefined;
268
291
  notes?: string | null | undefined;
269
292
  frequency?: HabitFrequency | undefined;
270
- rolloverTime?: string | undefined;
271
293
  }, {
294
+ rolloverTime: string;
295
+ startOffsetMinutes: number;
296
+ endOffsetMinutes: number;
272
297
  name?: string | undefined;
273
298
  description?: string | null | undefined;
274
299
  notes?: string | null | undefined;
275
300
  frequency?: HabitFrequency | undefined;
276
- rolloverTime?: string | 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(), // TODO: deprecated
70
+ startOffsetMinutes: zod_1.z.number(),
71
+ endOffsetMinutes: zod_1.z.number(),
66
72
  });
67
73
  exports.createHabitEntryRequestSchema = zod_1.z.object({
68
74
  date: misc_types_1.dateOnlyStringSchema,
@@ -19,7 +19,8 @@ export declare enum NotificationEntityType {
19
19
  AGENDA_ITEM = "agenda_item",
20
20
  HABIT = "habit",
21
21
  AGENDA_PANEL = "agenda_panel",
22
- INBOX_PANEL = "inbox_panel"
22
+ INBOX_PANEL = "inbox_panel",
23
+ HABIT_PANEL = "habit_panel"
23
24
  }
24
25
  export declare enum NotificationSchedulerType {
25
26
  DAY_TIME = "day_time",
@@ -20,6 +20,7 @@ var NotificationEntityType;
20
20
  NotificationEntityType["HABIT"] = "habit";
21
21
  NotificationEntityType["AGENDA_PANEL"] = "agenda_panel";
22
22
  NotificationEntityType["INBOX_PANEL"] = "inbox_panel";
23
+ NotificationEntityType["HABIT_PANEL"] = "habit_panel";
23
24
  })(NotificationEntityType || (exports.NotificationEntityType = NotificationEntityType = {}));
24
25
  var NotificationSchedulerType;
25
26
  (function (NotificationSchedulerType) {
@@ -42,6 +43,7 @@ exports.ENTITY_TYPE_VARIANT_MAP = {
42
43
  ],
43
44
  [NotificationEntityType.AGENDA_PANEL]: [],
44
45
  [NotificationEntityType.INBOX_PANEL]: [],
46
+ [NotificationEntityType.HABIT_PANEL]: [],
45
47
  };
46
48
  exports.notificationSchedulerDataSchema = zod_1.z.discriminatedUnion('type', [
47
49
  zod_1.z.object({
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.150",
5
+ "version": "1.0.152",
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(), // TODO: deprecated
74
+ startOffsetMinutes: z.number(),
75
+ endOffsetMinutes: z.number(),
70
76
  });
71
77
 
72
78
  export const createHabitEntryRequestSchema = z.object({
@@ -26,6 +26,7 @@ export enum NotificationEntityType {
26
26
 
27
27
  AGENDA_PANEL = 'agenda_panel',
28
28
  INBOX_PANEL = 'inbox_panel',
29
+ HABIT_PANEL = 'habit_panel',
29
30
  }
30
31
 
31
32
  export enum NotificationSchedulerType {
@@ -49,6 +50,7 @@ export const ENTITY_TYPE_VARIANT_MAP: Record<NotificationEntityType, Notificatio
49
50
  ],
50
51
  [NotificationEntityType.AGENDA_PANEL]: [],
51
52
  [NotificationEntityType.INBOX_PANEL]: [],
53
+ [NotificationEntityType.HABIT_PANEL]: [],
52
54
  } as const;
53
55
 
54
56
  export const notificationSchedulerDataSchema = z.discriminatedUnion('type', [