@timothyw/pat-common 1.0.128 → 1.0.130

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.
@@ -11,9 +11,9 @@ export declare enum NotificationTemplateLevel {
11
11
  ENTITY = "entity"
12
12
  }
13
13
  export declare enum NotificationEntityType {
14
- INBOX_PANEL = "inbox_panel",
14
+ AGENDA_ITEM = "agenda_item",
15
15
  AGENDA_PANEL = "agenda_item",
16
- AGENDA_ITEM = "agenda_item"
16
+ INBOX_PANEL = "inbox_panel"
17
17
  }
18
18
  export declare enum NotificationTriggerType {
19
19
  TIME_BASED = "time_based",
@@ -31,7 +31,8 @@ export declare const notificationTriggerSchema: z.ZodObject<{
31
31
  export declare const notificationTemplateSchema: z.ZodObject<{
32
32
  _id: z.ZodEffects<z.ZodString, import("./id-types").NotificationTemplateId, string>;
33
33
  userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
34
- targetType: z.ZodNativeEnum<typeof NotificationTemplateLevel>;
34
+ targetLevel: z.ZodNativeEnum<typeof NotificationTemplateLevel>;
35
+ targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
35
36
  targetId: z.ZodString;
36
37
  trigger: z.ZodObject<{
37
38
  type: z.ZodNativeEnum<typeof NotificationTriggerType>;
@@ -52,7 +53,8 @@ export declare const notificationTemplateSchema: z.ZodObject<{
52
53
  userId: string & {
53
54
  readonly __brand: "UserId";
54
55
  };
55
- targetType: NotificationTemplateLevel;
56
+ targetLevel: NotificationTemplateLevel;
57
+ targetEntityType: NotificationEntityType;
56
58
  targetId: string;
57
59
  trigger: {
58
60
  type: NotificationTriggerType;
@@ -63,7 +65,8 @@ export declare const notificationTemplateSchema: z.ZodObject<{
63
65
  createdAt: Date;
64
66
  updatedAt: Date;
65
67
  userId: string;
66
- targetType: NotificationTemplateLevel;
68
+ targetLevel: NotificationTemplateLevel;
69
+ targetEntityType: NotificationEntityType;
67
70
  targetId: string;
68
71
  trigger: {
69
72
  type: NotificationTriggerType;
@@ -71,8 +74,9 @@ export declare const notificationTemplateSchema: z.ZodObject<{
71
74
  active: boolean;
72
75
  }>;
73
76
  export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
74
- entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
75
- entityId: z.ZodOptional<z.ZodString>;
77
+ targetLevel: z.ZodNativeEnum<typeof NotificationTemplateLevel>;
78
+ targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
79
+ targetId: z.ZodOptional<z.ZodString>;
76
80
  trigger: z.ZodObject<{
77
81
  type: z.ZodNativeEnum<typeof NotificationTriggerType>;
78
82
  }, "strip", z.ZodTypeAny, {
@@ -82,19 +86,21 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
82
86
  }>;
83
87
  active: z.ZodDefault<z.ZodBoolean>;
84
88
  }, "strip", z.ZodTypeAny, {
89
+ targetLevel: NotificationTemplateLevel;
90
+ targetEntityType: NotificationEntityType;
85
91
  trigger: {
86
92
  type: NotificationTriggerType;
87
93
  };
88
94
  active: boolean;
89
- entityType: NotificationEntityType;
90
- entityId?: string | undefined;
95
+ targetId?: string | undefined;
91
96
  }, {
97
+ targetLevel: NotificationTemplateLevel;
98
+ targetEntityType: NotificationEntityType;
92
99
  trigger: {
93
100
  type: NotificationTriggerType;
94
101
  };
95
- entityType: NotificationEntityType;
102
+ targetId?: string | undefined;
96
103
  active?: boolean | undefined;
97
- entityId?: string | undefined;
98
104
  }>;
99
105
  export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
100
106
  trigger: z.ZodOptional<z.ZodObject<{
@@ -117,27 +123,27 @@ export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
117
123
  active?: boolean | undefined;
118
124
  }>;
119
125
  export declare const entitySyncRequestSchema: z.ZodObject<{
120
- entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
121
- entityId: z.ZodString;
126
+ targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
127
+ targetId: z.ZodString;
122
128
  synced: z.ZodBoolean;
123
129
  }, "strip", z.ZodTypeAny, {
124
- entityType: NotificationEntityType;
125
- entityId: string;
130
+ targetEntityType: NotificationEntityType;
131
+ targetId: string;
126
132
  synced: boolean;
127
133
  }, {
128
- entityType: NotificationEntityType;
129
- entityId: string;
134
+ targetEntityType: NotificationEntityType;
135
+ targetId: string;
130
136
  synced: boolean;
131
137
  }>;
132
138
  export declare const getEntitySyncRequestSchema: z.ZodObject<{
133
- entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
134
- entityId: z.ZodString;
139
+ targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
140
+ targetId: z.ZodString;
135
141
  }, "strip", z.ZodTypeAny, {
136
- entityType: NotificationEntityType;
137
- entityId: string;
142
+ targetEntityType: NotificationEntityType;
143
+ targetId: string;
138
144
  }, {
139
- entityType: NotificationEntityType;
140
- entityId: string;
145
+ targetEntityType: NotificationEntityType;
146
+ targetId: string;
141
147
  }>;
142
148
  export type NotificationTrigger = z.infer<typeof notificationTriggerSchema>;
143
149
  export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
@@ -10,9 +10,9 @@ var NotificationTemplateLevel;
10
10
  })(NotificationTemplateLevel || (exports.NotificationTemplateLevel = NotificationTemplateLevel = {}));
11
11
  var NotificationEntityType;
12
12
  (function (NotificationEntityType) {
13
- NotificationEntityType["INBOX_PANEL"] = "inbox_panel";
14
- NotificationEntityType["AGENDA_PANEL"] = "agenda_item";
15
13
  NotificationEntityType["AGENDA_ITEM"] = "agenda_item";
14
+ NotificationEntityType["AGENDA_PANEL"] = "agenda_item";
15
+ NotificationEntityType["INBOX_PANEL"] = "inbox_panel";
16
16
  })(NotificationEntityType || (exports.NotificationEntityType = NotificationEntityType = {}));
17
17
  var NotificationTriggerType;
18
18
  (function (NotificationTriggerType) {
@@ -27,7 +27,8 @@ exports.notificationTriggerSchema = zod_1.z.object({
27
27
  exports.notificationTemplateSchema = zod_1.z.object({
28
28
  _id: id_types_1.notificationTemplateIdSchema,
29
29
  userId: id_types_1.userIdSchema,
30
- targetType: zod_1.z.nativeEnum(NotificationTemplateLevel),
30
+ targetLevel: zod_1.z.nativeEnum(NotificationTemplateLevel),
31
+ targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
31
32
  targetId: zod_1.z.string(),
32
33
  // entityType: z.nativeEnum(NotificationEntityType),
33
34
  // entityId: z.string().optional(),
@@ -37,8 +38,9 @@ exports.notificationTemplateSchema = zod_1.z.object({
37
38
  updatedAt: zod_1.z.date()
38
39
  });
39
40
  exports.createNotificationTemplateRequestSchema = zod_1.z.object({
40
- entityType: zod_1.z.nativeEnum(NotificationEntityType),
41
- entityId: zod_1.z.string().optional(),
41
+ targetLevel: zod_1.z.nativeEnum(NotificationTemplateLevel),
42
+ targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
43
+ targetId: zod_1.z.string().optional(),
42
44
  trigger: zod_1.z.object({
43
45
  type: exports.notificationTriggerTypeSchema,
44
46
  }),
@@ -51,11 +53,11 @@ exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
51
53
  active: zod_1.z.boolean().optional()
52
54
  });
53
55
  exports.entitySyncRequestSchema = zod_1.z.object({
54
- entityType: zod_1.z.nativeEnum(NotificationEntityType),
55
- entityId: zod_1.z.string(),
56
+ targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
57
+ targetId: zod_1.z.string(),
56
58
  synced: zod_1.z.boolean()
57
59
  });
58
60
  exports.getEntitySyncRequestSchema = zod_1.z.object({
59
- entityType: zod_1.z.nativeEnum(NotificationEntityType),
60
- entityId: zod_1.z.string()
61
+ targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
62
+ targetId: zod_1.z.string()
61
63
  });
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.128",
5
+ "version": "1.0.130",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -15,9 +15,10 @@ export enum NotificationTemplateLevel {
15
15
  }
16
16
 
17
17
  export enum NotificationEntityType {
18
- INBOX_PANEL = 'inbox_panel',
19
- AGENDA_PANEL = 'agenda_item',
20
18
  AGENDA_ITEM = 'agenda_item',
19
+
20
+ AGENDA_PANEL = 'agenda_item',
21
+ INBOX_PANEL = 'inbox_panel',
21
22
  }
22
23
 
23
24
  export enum NotificationTriggerType {
@@ -35,7 +36,8 @@ export const notificationTriggerSchema = z.object({
35
36
  export const notificationTemplateSchema = z.object({
36
37
  _id: notificationTemplateIdSchema,
37
38
  userId: userIdSchema,
38
- targetType: z.nativeEnum(NotificationTemplateLevel),
39
+ targetLevel: z.nativeEnum(NotificationTemplateLevel),
40
+ targetEntityType: z.nativeEnum(NotificationEntityType),
39
41
  targetId: z.string(),
40
42
  // entityType: z.nativeEnum(NotificationEntityType),
41
43
  // entityId: z.string().optional(),
@@ -46,8 +48,9 @@ export const notificationTemplateSchema = z.object({
46
48
  });
47
49
 
48
50
  export const createNotificationTemplateRequestSchema = z.object({
49
- entityType: z.nativeEnum(NotificationEntityType),
50
- entityId: z.string().optional(),
51
+ targetLevel: z.nativeEnum(NotificationTemplateLevel),
52
+ targetEntityType: z.nativeEnum(NotificationEntityType),
53
+ targetId: z.string().optional(),
51
54
  trigger: z.object({
52
55
  type: notificationTriggerTypeSchema,
53
56
  }),
@@ -62,14 +65,14 @@ export const updateNotificationTemplateRequestSchema = z.object({
62
65
  });
63
66
 
64
67
  export const entitySyncRequestSchema = z.object({
65
- entityType: z.nativeEnum(NotificationEntityType),
66
- entityId: z.string(),
68
+ targetEntityType: z.nativeEnum(NotificationEntityType),
69
+ targetId: z.string(),
67
70
  synced: z.boolean()
68
71
  });
69
72
 
70
73
  export const getEntitySyncRequestSchema = z.object({
71
- entityType: z.nativeEnum(NotificationEntityType),
72
- entityId: z.string()
74
+ targetEntityType: z.nativeEnum(NotificationEntityType),
75
+ targetId: z.string()
73
76
  });
74
77
 
75
78
  export type NotificationTrigger = z.infer<typeof notificationTriggerSchema>;