@timothyw/pat-common 1.0.155 → 1.0.157

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.
@@ -29,21 +29,22 @@ export declare enum NotificationSchedulerType {
29
29
  export declare enum NotificationVariantType {
30
30
  AGENDA_ITEM_DUE = "agenda_item_due",
31
31
  HABIT_TIMED_REMINDER = "habit_timed_reminder",
32
- HABIT_DUE = "habit_due"
32
+ HABIT_DUE = "habit_due",
33
+ CLEAR_INBOX_TIMED_REMINDER = "clear_inbox_timed_reminder"
33
34
  }
34
35
  export declare const ENTITY_TYPE_VARIANT_MAP: Record<NotificationEntityType, NotificationVariantType[]>;
35
36
  export declare const notificationSchedulerDataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
36
37
  type: z.ZodLiteral<NotificationSchedulerType.DAY_TIME>;
37
38
  days: z.ZodArray<z.ZodNumber, "many">;
38
- time: z.ZodString;
39
+ offsetMinutes: z.ZodNumber;
39
40
  }, "strip", z.ZodTypeAny, {
40
41
  type: NotificationSchedulerType.DAY_TIME;
41
42
  days: number[];
42
- time: string;
43
+ offsetMinutes: number;
43
44
  }, {
44
45
  type: NotificationSchedulerType.DAY_TIME;
45
46
  days: number[];
46
- time: string;
47
+ offsetMinutes: number;
47
48
  }>, z.ZodObject<{
48
49
  type: z.ZodLiteral<NotificationSchedulerType.RELATIVE_DATE>;
49
50
  offsetMinutes: z.ZodNumber;
@@ -72,6 +73,12 @@ export declare const notificationVariantDataSchema: z.ZodDiscriminatedUnion<"typ
72
73
  type: NotificationVariantType.HABIT_DUE;
73
74
  }, {
74
75
  type: NotificationVariantType.HABIT_DUE;
76
+ }>, z.ZodObject<{
77
+ type: z.ZodLiteral<NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
80
+ }, {
81
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
75
82
  }>]>;
76
83
  export declare const notificationTemplateSchema: z.ZodObject<{
77
84
  _id: z.ZodEffects<z.ZodString, import("./id-types").NotificationTemplateId, string>;
@@ -82,15 +89,15 @@ export declare const notificationTemplateSchema: z.ZodObject<{
82
89
  schedulerData: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
83
90
  type: z.ZodLiteral<NotificationSchedulerType.DAY_TIME>;
84
91
  days: z.ZodArray<z.ZodNumber, "many">;
85
- time: z.ZodString;
92
+ offsetMinutes: z.ZodNumber;
86
93
  }, "strip", z.ZodTypeAny, {
87
94
  type: NotificationSchedulerType.DAY_TIME;
88
95
  days: number[];
89
- time: string;
96
+ offsetMinutes: number;
90
97
  }, {
91
98
  type: NotificationSchedulerType.DAY_TIME;
92
99
  days: number[];
93
- time: string;
100
+ offsetMinutes: number;
94
101
  }>, z.ZodObject<{
95
102
  type: z.ZodLiteral<NotificationSchedulerType.RELATIVE_DATE>;
96
103
  offsetMinutes: z.ZodNumber;
@@ -119,6 +126,12 @@ export declare const notificationTemplateSchema: z.ZodObject<{
119
126
  type: NotificationVariantType.HABIT_DUE;
120
127
  }, {
121
128
  type: NotificationVariantType.HABIT_DUE;
129
+ }>, z.ZodObject<{
130
+ type: z.ZodLiteral<NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
133
+ }, {
134
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
122
135
  }>]>;
123
136
  active: z.ZodBoolean;
124
137
  createdAt: z.ZodDate;
@@ -138,7 +151,7 @@ export declare const notificationTemplateSchema: z.ZodObject<{
138
151
  schedulerData: {
139
152
  type: NotificationSchedulerType.DAY_TIME;
140
153
  days: number[];
141
- time: string;
154
+ offsetMinutes: number;
142
155
  } | {
143
156
  type: NotificationSchedulerType.RELATIVE_DATE;
144
157
  offsetMinutes: number;
@@ -149,6 +162,8 @@ export declare const notificationTemplateSchema: z.ZodObject<{
149
162
  type: NotificationVariantType.HABIT_TIMED_REMINDER;
150
163
  } | {
151
164
  type: NotificationVariantType.HABIT_DUE;
165
+ } | {
166
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
152
167
  };
153
168
  active: boolean;
154
169
  }, {
@@ -162,7 +177,7 @@ export declare const notificationTemplateSchema: z.ZodObject<{
162
177
  schedulerData: {
163
178
  type: NotificationSchedulerType.DAY_TIME;
164
179
  days: number[];
165
- time: string;
180
+ offsetMinutes: number;
166
181
  } | {
167
182
  type: NotificationSchedulerType.RELATIVE_DATE;
168
183
  offsetMinutes: number;
@@ -173,6 +188,8 @@ export declare const notificationTemplateSchema: z.ZodObject<{
173
188
  type: NotificationVariantType.HABIT_TIMED_REMINDER;
174
189
  } | {
175
190
  type: NotificationVariantType.HABIT_DUE;
191
+ } | {
192
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
176
193
  };
177
194
  active: boolean;
178
195
  }>;
@@ -183,15 +200,15 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
183
200
  schedulerData: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
184
201
  type: z.ZodLiteral<NotificationSchedulerType.DAY_TIME>;
185
202
  days: z.ZodArray<z.ZodNumber, "many">;
186
- time: z.ZodString;
203
+ offsetMinutes: z.ZodNumber;
187
204
  }, "strip", z.ZodTypeAny, {
188
205
  type: NotificationSchedulerType.DAY_TIME;
189
206
  days: number[];
190
- time: string;
207
+ offsetMinutes: number;
191
208
  }, {
192
209
  type: NotificationSchedulerType.DAY_TIME;
193
210
  days: number[];
194
- time: string;
211
+ offsetMinutes: number;
195
212
  }>, z.ZodObject<{
196
213
  type: z.ZodLiteral<NotificationSchedulerType.RELATIVE_DATE>;
197
214
  offsetMinutes: z.ZodNumber;
@@ -220,6 +237,12 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
220
237
  type: NotificationVariantType.HABIT_DUE;
221
238
  }, {
222
239
  type: NotificationVariantType.HABIT_DUE;
240
+ }>, z.ZodObject<{
241
+ type: z.ZodLiteral<NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER>;
242
+ }, "strip", z.ZodTypeAny, {
243
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
244
+ }, {
245
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
223
246
  }>]>;
224
247
  active: z.ZodDefault<z.ZodBoolean>;
225
248
  }, "strip", z.ZodTypeAny, {
@@ -228,7 +251,7 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
228
251
  schedulerData: {
229
252
  type: NotificationSchedulerType.DAY_TIME;
230
253
  days: number[];
231
- time: string;
254
+ offsetMinutes: number;
232
255
  } | {
233
256
  type: NotificationSchedulerType.RELATIVE_DATE;
234
257
  offsetMinutes: number;
@@ -239,6 +262,8 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
239
262
  type: NotificationVariantType.HABIT_TIMED_REMINDER;
240
263
  } | {
241
264
  type: NotificationVariantType.HABIT_DUE;
265
+ } | {
266
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
242
267
  };
243
268
  active: boolean;
244
269
  targetId?: string | undefined;
@@ -248,7 +273,7 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
248
273
  schedulerData: {
249
274
  type: NotificationSchedulerType.DAY_TIME;
250
275
  days: number[];
251
- time: string;
276
+ offsetMinutes: number;
252
277
  } | {
253
278
  type: NotificationSchedulerType.RELATIVE_DATE;
254
279
  offsetMinutes: number;
@@ -259,6 +284,8 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
259
284
  type: NotificationVariantType.HABIT_TIMED_REMINDER;
260
285
  } | {
261
286
  type: NotificationVariantType.HABIT_DUE;
287
+ } | {
288
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
262
289
  };
263
290
  targetId?: string | undefined;
264
291
  active?: boolean | undefined;
@@ -267,15 +294,15 @@ export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
267
294
  schedulerData: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
268
295
  type: z.ZodLiteral<NotificationSchedulerType.DAY_TIME>;
269
296
  days: z.ZodArray<z.ZodNumber, "many">;
270
- time: z.ZodString;
297
+ offsetMinutes: z.ZodNumber;
271
298
  }, "strip", z.ZodTypeAny, {
272
299
  type: NotificationSchedulerType.DAY_TIME;
273
300
  days: number[];
274
- time: string;
301
+ offsetMinutes: number;
275
302
  }, {
276
303
  type: NotificationSchedulerType.DAY_TIME;
277
304
  days: number[];
278
- time: string;
305
+ offsetMinutes: number;
279
306
  }>, z.ZodObject<{
280
307
  type: z.ZodLiteral<NotificationSchedulerType.RELATIVE_DATE>;
281
308
  offsetMinutes: z.ZodNumber;
@@ -304,13 +331,19 @@ export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
304
331
  type: NotificationVariantType.HABIT_DUE;
305
332
  }, {
306
333
  type: NotificationVariantType.HABIT_DUE;
334
+ }>, z.ZodObject<{
335
+ type: z.ZodLiteral<NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER>;
336
+ }, "strip", z.ZodTypeAny, {
337
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
338
+ }, {
339
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
307
340
  }>]>>;
308
341
  active: z.ZodOptional<z.ZodBoolean>;
309
342
  }, "strip", z.ZodTypeAny, {
310
343
  schedulerData?: {
311
344
  type: NotificationSchedulerType.DAY_TIME;
312
345
  days: number[];
313
- time: string;
346
+ offsetMinutes: number;
314
347
  } | {
315
348
  type: NotificationSchedulerType.RELATIVE_DATE;
316
349
  offsetMinutes: number;
@@ -321,13 +354,15 @@ export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
321
354
  type: NotificationVariantType.HABIT_TIMED_REMINDER;
322
355
  } | {
323
356
  type: NotificationVariantType.HABIT_DUE;
357
+ } | {
358
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
324
359
  } | undefined;
325
360
  active?: boolean | undefined;
326
361
  }, {
327
362
  schedulerData?: {
328
363
  type: NotificationSchedulerType.DAY_TIME;
329
364
  days: number[];
330
- time: string;
365
+ offsetMinutes: number;
331
366
  } | {
332
367
  type: NotificationSchedulerType.RELATIVE_DATE;
333
368
  offsetMinutes: number;
@@ -338,6 +373,8 @@ export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
338
373
  type: NotificationVariantType.HABIT_TIMED_REMINDER;
339
374
  } | {
340
375
  type: NotificationVariantType.HABIT_DUE;
376
+ } | {
377
+ type: NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER;
341
378
  } | undefined;
342
379
  active?: boolean | undefined;
343
380
  }>;
@@ -32,6 +32,7 @@ var NotificationVariantType;
32
32
  NotificationVariantType["AGENDA_ITEM_DUE"] = "agenda_item_due";
33
33
  NotificationVariantType["HABIT_TIMED_REMINDER"] = "habit_timed_reminder";
34
34
  NotificationVariantType["HABIT_DUE"] = "habit_due";
35
+ NotificationVariantType["CLEAR_INBOX_TIMED_REMINDER"] = "clear_inbox_timed_reminder";
35
36
  })(NotificationVariantType || (exports.NotificationVariantType = NotificationVariantType = {}));
36
37
  exports.ENTITY_TYPE_VARIANT_MAP = {
37
38
  [NotificationEntityType.AGENDA_ITEM]: [
@@ -42,14 +43,16 @@ exports.ENTITY_TYPE_VARIANT_MAP = {
42
43
  NotificationVariantType.HABIT_DUE,
43
44
  ],
44
45
  [NotificationEntityType.AGENDA_PANEL]: [],
45
- [NotificationEntityType.INBOX_PANEL]: [],
46
+ [NotificationEntityType.INBOX_PANEL]: [
47
+ NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER,
48
+ ],
46
49
  [NotificationEntityType.HABIT_PANEL]: [],
47
50
  };
48
51
  exports.notificationSchedulerDataSchema = zod_1.z.discriminatedUnion('type', [
49
52
  zod_1.z.object({
50
53
  type: zod_1.z.literal(NotificationSchedulerType.DAY_TIME),
51
54
  days: zod_1.z.array(zod_1.z.number().min(0).max(6)),
52
- time: zod_1.z.string().regex(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/), // HH:mm format
55
+ offsetMinutes: zod_1.z.number().int()
53
56
  }),
54
57
  zod_1.z.object({
55
58
  type: zod_1.z.literal(NotificationSchedulerType.RELATIVE_DATE),
@@ -65,6 +68,9 @@ exports.notificationVariantDataSchema = zod_1.z.discriminatedUnion('type', [
65
68
  }),
66
69
  zod_1.z.object({
67
70
  type: zod_1.z.literal(NotificationVariantType.HABIT_DUE),
71
+ }),
72
+ zod_1.z.object({
73
+ type: zod_1.z.literal(NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER),
68
74
  })
69
75
  ]);
70
76
  exports.notificationTemplateSchema = 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.155",
5
+ "version": "1.0.157",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -38,6 +38,7 @@ export enum NotificationVariantType {
38
38
  AGENDA_ITEM_DUE = 'agenda_item_due',
39
39
  HABIT_TIMED_REMINDER = 'habit_timed_reminder',
40
40
  HABIT_DUE = 'habit_due',
41
+ CLEAR_INBOX_TIMED_REMINDER = 'clear_inbox_timed_reminder',
41
42
  }
42
43
 
43
44
  export const ENTITY_TYPE_VARIANT_MAP: Record<NotificationEntityType, NotificationVariantType[]> = {
@@ -49,7 +50,9 @@ export const ENTITY_TYPE_VARIANT_MAP: Record<NotificationEntityType, Notificatio
49
50
  NotificationVariantType.HABIT_DUE,
50
51
  ],
51
52
  [NotificationEntityType.AGENDA_PANEL]: [],
52
- [NotificationEntityType.INBOX_PANEL]: [],
53
+ [NotificationEntityType.INBOX_PANEL]: [
54
+ NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER,
55
+ ],
53
56
  [NotificationEntityType.HABIT_PANEL]: [],
54
57
  } as const;
55
58
 
@@ -57,7 +60,7 @@ export const notificationSchedulerDataSchema = z.discriminatedUnion('type', [
57
60
  z.object({
58
61
  type: z.literal(NotificationSchedulerType.DAY_TIME),
59
62
  days: z.array(z.number().min(0).max(6)),
60
- time: z.string().regex(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/), // HH:mm format
63
+ offsetMinutes: z.number().int()
61
64
  }),
62
65
  z.object({
63
66
  type: z.literal(NotificationSchedulerType.RELATIVE_DATE),
@@ -74,6 +77,9 @@ export const notificationVariantDataSchema = z.discriminatedUnion('type', [
74
77
  }),
75
78
  z.object({
76
79
  type: z.literal(NotificationVariantType.HABIT_DUE),
80
+ }),
81
+ z.object({
82
+ type: z.literal(NotificationVariantType.CLEAR_INBOX_TIMED_REMINDER),
77
83
  })
78
84
  ]);
79
85