@timothyw/pat-common 1.0.156 → 1.0.158

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.
@@ -10,23 +10,31 @@ export declare const authTokensSchema: z.ZodObject<{
10
10
  refreshToken: string;
11
11
  }>;
12
12
  export declare const tokenPayloadSchema: z.ZodObject<{
13
- authId: z.ZodString;
14
- userId: z.ZodString;
13
+ authId: z.ZodEffects<z.ZodString, import("./id-types").AuthId, string>;
14
+ userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
15
15
  }, "strip", z.ZodTypeAny, {
16
- userId: string;
17
- authId: string;
16
+ userId: string & {
17
+ readonly __brand: "UserId";
18
+ };
19
+ authId: string & {
20
+ readonly __brand: "AuthId";
21
+ };
18
22
  }, {
19
23
  userId: string;
20
24
  authId: string;
21
25
  }>;
22
26
  export declare const refreshTokenPayloadSchema: z.ZodObject<{
23
- authId: z.ZodString;
24
- userId: z.ZodString;
27
+ authId: z.ZodEffects<z.ZodString, import("./id-types").AuthId, string>;
28
+ userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
25
29
  } & {
26
30
  tokenId: z.ZodString;
27
31
  }, "strip", z.ZodTypeAny, {
28
- userId: string;
29
- authId: string;
32
+ userId: string & {
33
+ readonly __brand: "UserId";
34
+ };
35
+ authId: string & {
36
+ readonly __brand: "AuthId";
37
+ };
30
38
  tokenId: string;
31
39
  }, {
32
40
  userId: string;
@@ -8,8 +8,8 @@ exports.authTokensSchema = zod_1.z.object({
8
8
  refreshToken: zod_1.z.string()
9
9
  });
10
10
  exports.tokenPayloadSchema = zod_1.z.object({
11
- authId: zod_1.z.string(),
12
- userId: zod_1.z.string()
11
+ authId: id_types_1.authIdSchema,
12
+ userId: id_types_1.userIdSchema
13
13
  });
14
14
  exports.refreshTokenPayloadSchema = exports.tokenPayloadSchema.extend({
15
15
  tokenId: zod_1.z.string()
@@ -29,7 +29,8 @@ 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<{
@@ -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>;
@@ -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;
@@ -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
  }, {
@@ -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
  }>;
@@ -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, {
@@ -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;
@@ -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;
@@ -304,6 +331,12 @@ 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, {
@@ -321,6 +354,8 @@ 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
  }, {
@@ -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,7 +43,9 @@ 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', [
@@ -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.156",
5
+ "version": "1.0.158",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -7,8 +7,8 @@ export const authTokensSchema = z.object({
7
7
  });
8
8
 
9
9
  export const tokenPayloadSchema = z.object({
10
- authId: z.string(),
11
- userId: z.string()
10
+ authId: authIdSchema,
11
+ userId: userIdSchema
12
12
  });
13
13
 
14
14
  export const refreshTokenPayloadSchema = tokenPayloadSchema.extend({
@@ -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
 
@@ -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