@timothyw/pat-common 1.0.129 → 1.0.131

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",
@@ -74,8 +74,9 @@ export declare const notificationTemplateSchema: z.ZodObject<{
74
74
  active: boolean;
75
75
  }>;
76
76
  export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
77
- entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
78
- entityId: z.ZodOptional<z.ZodString>;
77
+ targetLevel: z.ZodNativeEnum<typeof NotificationTemplateLevel>;
78
+ targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
79
+ targetId: z.ZodOptional<z.ZodString>;
79
80
  trigger: z.ZodObject<{
80
81
  type: z.ZodNativeEnum<typeof NotificationTriggerType>;
81
82
  }, "strip", z.ZodTypeAny, {
@@ -85,19 +86,21 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
85
86
  }>;
86
87
  active: z.ZodDefault<z.ZodBoolean>;
87
88
  }, "strip", z.ZodTypeAny, {
89
+ targetLevel: NotificationTemplateLevel;
90
+ targetEntityType: NotificationEntityType;
88
91
  trigger: {
89
92
  type: NotificationTriggerType;
90
93
  };
91
94
  active: boolean;
92
- entityType: NotificationEntityType;
93
- entityId?: string | undefined;
95
+ targetId?: string | undefined;
94
96
  }, {
97
+ targetLevel: NotificationTemplateLevel;
98
+ targetEntityType: NotificationEntityType;
95
99
  trigger: {
96
100
  type: NotificationTriggerType;
97
101
  };
98
- entityType: NotificationEntityType;
102
+ targetId?: string | undefined;
99
103
  active?: boolean | undefined;
100
- entityId?: string | undefined;
101
104
  }>;
102
105
  export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
103
106
  trigger: z.ZodOptional<z.ZodObject<{
@@ -120,27 +123,27 @@ export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
120
123
  active?: boolean | undefined;
121
124
  }>;
122
125
  export declare const entitySyncRequestSchema: z.ZodObject<{
123
- entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
124
- entityId: z.ZodString;
126
+ targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
127
+ targetId: z.ZodString;
125
128
  synced: z.ZodBoolean;
126
129
  }, "strip", z.ZodTypeAny, {
127
- entityType: NotificationEntityType;
128
- entityId: string;
130
+ targetEntityType: NotificationEntityType;
131
+ targetId: string;
129
132
  synced: boolean;
130
133
  }, {
131
- entityType: NotificationEntityType;
132
- entityId: string;
134
+ targetEntityType: NotificationEntityType;
135
+ targetId: string;
133
136
  synced: boolean;
134
137
  }>;
135
138
  export declare const getEntitySyncRequestSchema: z.ZodObject<{
136
- entityType: z.ZodNativeEnum<typeof NotificationEntityType>;
137
- entityId: z.ZodString;
139
+ targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
140
+ targetId: z.ZodString;
138
141
  }, "strip", z.ZodTypeAny, {
139
- entityType: NotificationEntityType;
140
- entityId: string;
142
+ targetEntityType: NotificationEntityType;
143
+ targetId: string;
141
144
  }, {
142
- entityType: NotificationEntityType;
143
- entityId: string;
145
+ targetEntityType: NotificationEntityType;
146
+ targetId: string;
144
147
  }>;
145
148
  export type NotificationTrigger = z.infer<typeof notificationTriggerSchema>;
146
149
  export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
@@ -171,6 +174,5 @@ export interface EntitySyncResponse {
171
174
  export interface GetEntitySyncResponse {
172
175
  success: boolean;
173
176
  synced: boolean;
174
- hasParentTemplates: boolean;
175
177
  error?: string;
176
178
  }
@@ -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) {
@@ -38,11 +38,10 @@ exports.notificationTemplateSchema = zod_1.z.object({
38
38
  updatedAt: zod_1.z.date()
39
39
  });
40
40
  exports.createNotificationTemplateRequestSchema = zod_1.z.object({
41
- entityType: zod_1.z.nativeEnum(NotificationEntityType),
42
- entityId: zod_1.z.string().optional(),
43
- trigger: zod_1.z.object({
44
- type: exports.notificationTriggerTypeSchema,
45
- }),
41
+ targetLevel: zod_1.z.nativeEnum(NotificationTemplateLevel),
42
+ targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
43
+ targetId: zod_1.z.string().optional(),
44
+ trigger: exports.notificationTriggerSchema,
46
45
  active: zod_1.z.boolean().default(true)
47
46
  });
48
47
  exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
@@ -52,11 +51,11 @@ exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
52
51
  active: zod_1.z.boolean().optional()
53
52
  });
54
53
  exports.entitySyncRequestSchema = zod_1.z.object({
55
- entityType: zod_1.z.nativeEnum(NotificationEntityType),
56
- entityId: zod_1.z.string(),
54
+ targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
55
+ targetId: zod_1.z.string(),
57
56
  synced: zod_1.z.boolean()
58
57
  });
59
58
  exports.getEntitySyncRequestSchema = zod_1.z.object({
60
- entityType: zod_1.z.nativeEnum(NotificationEntityType),
61
- entityId: zod_1.z.string()
59
+ targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
60
+ targetId: zod_1.z.string()
62
61
  });
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.129",
5
+ "version": "1.0.131",
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 {
@@ -47,11 +48,10 @@ export const notificationTemplateSchema = z.object({
47
48
  });
48
49
 
49
50
  export const createNotificationTemplateRequestSchema = z.object({
50
- entityType: z.nativeEnum(NotificationEntityType),
51
- entityId: z.string().optional(),
52
- trigger: z.object({
53
- type: notificationTriggerTypeSchema,
54
- }),
51
+ targetLevel: z.nativeEnum(NotificationTemplateLevel),
52
+ targetEntityType: z.nativeEnum(NotificationEntityType),
53
+ targetId: z.string().optional(),
54
+ trigger: notificationTriggerSchema,
55
55
  active: z.boolean().default(true)
56
56
  });
57
57
 
@@ -63,14 +63,14 @@ export const updateNotificationTemplateRequestSchema = z.object({
63
63
  });
64
64
 
65
65
  export const entitySyncRequestSchema = z.object({
66
- entityType: z.nativeEnum(NotificationEntityType),
67
- entityId: z.string(),
66
+ targetEntityType: z.nativeEnum(NotificationEntityType),
67
+ targetId: z.string(),
68
68
  synced: z.boolean()
69
69
  });
70
70
 
71
71
  export const getEntitySyncRequestSchema = z.object({
72
- entityType: z.nativeEnum(NotificationEntityType),
73
- entityId: z.string()
72
+ targetEntityType: z.nativeEnum(NotificationEntityType),
73
+ targetId: z.string()
74
74
  });
75
75
 
76
76
  export type NotificationTrigger = z.infer<typeof notificationTriggerSchema>;
@@ -109,6 +109,5 @@ export interface EntitySyncResponse {
109
109
  export interface GetEntitySyncResponse {
110
110
  success: boolean;
111
111
  synced: boolean;
112
- hasParentTemplates: boolean;
113
112
  error?: string;
114
113
  }