@timothyw/pat-common 1.0.132 → 1.0.133
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.
|
@@ -15,32 +15,32 @@ export declare enum NotificationEntityType {
|
|
|
15
15
|
AGENDA_PANEL = "agenda_item",
|
|
16
16
|
INBOX_PANEL = "inbox_panel"
|
|
17
17
|
}
|
|
18
|
-
export declare enum
|
|
18
|
+
export declare enum NotificationSchedulerType {
|
|
19
19
|
DAY_TIME = "day_time",
|
|
20
20
|
RELATIVE_DATE = "relative_date"
|
|
21
21
|
}
|
|
22
22
|
export declare const notificationSchedulerDataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
23
|
-
type: z.ZodLiteral<
|
|
23
|
+
type: z.ZodLiteral<NotificationSchedulerType.DAY_TIME>;
|
|
24
24
|
days: z.ZodArray<z.ZodNumber, "many">;
|
|
25
25
|
time: z.ZodString;
|
|
26
26
|
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
type:
|
|
27
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
28
28
|
days: number[];
|
|
29
29
|
time: string;
|
|
30
30
|
}, {
|
|
31
|
-
type:
|
|
31
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
32
32
|
days: number[];
|
|
33
33
|
time: string;
|
|
34
34
|
}>, z.ZodObject<{
|
|
35
|
-
type: z.ZodLiteral<
|
|
35
|
+
type: z.ZodLiteral<NotificationSchedulerType.RELATIVE_DATE>;
|
|
36
36
|
date: z.ZodString;
|
|
37
37
|
offsetMinutes: z.ZodNumber;
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
type:
|
|
39
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
40
40
|
date: string;
|
|
41
41
|
offsetMinutes: number;
|
|
42
42
|
}, {
|
|
43
|
-
type:
|
|
43
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
44
44
|
date: string;
|
|
45
45
|
offsetMinutes: number;
|
|
46
46
|
}>]>;
|
|
@@ -51,31 +51,31 @@ export declare const notificationTemplateSchema: z.ZodObject<{
|
|
|
51
51
|
targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
52
52
|
targetId: z.ZodString;
|
|
53
53
|
schedulerData: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
54
|
-
type: z.ZodLiteral<
|
|
54
|
+
type: z.ZodLiteral<NotificationSchedulerType.DAY_TIME>;
|
|
55
55
|
days: z.ZodArray<z.ZodNumber, "many">;
|
|
56
56
|
time: z.ZodString;
|
|
57
57
|
}, "strip", z.ZodTypeAny, {
|
|
58
|
-
type:
|
|
58
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
59
59
|
days: number[];
|
|
60
60
|
time: string;
|
|
61
61
|
}, {
|
|
62
|
-
type:
|
|
62
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
63
63
|
days: number[];
|
|
64
64
|
time: string;
|
|
65
65
|
}>, z.ZodObject<{
|
|
66
|
-
type: z.ZodLiteral<
|
|
66
|
+
type: z.ZodLiteral<NotificationSchedulerType.RELATIVE_DATE>;
|
|
67
67
|
date: z.ZodString;
|
|
68
68
|
offsetMinutes: z.ZodNumber;
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
type:
|
|
70
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
71
71
|
date: string;
|
|
72
72
|
offsetMinutes: number;
|
|
73
73
|
}, {
|
|
74
|
-
type:
|
|
74
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
75
75
|
date: string;
|
|
76
76
|
offsetMinutes: number;
|
|
77
77
|
}>]>;
|
|
78
|
-
variantData: z.
|
|
78
|
+
variantData: z.ZodAny;
|
|
79
79
|
active: z.ZodBoolean;
|
|
80
80
|
createdAt: z.ZodDate;
|
|
81
81
|
updatedAt: z.ZodDate;
|
|
@@ -92,11 +92,11 @@ export declare const notificationTemplateSchema: z.ZodObject<{
|
|
|
92
92
|
targetEntityType: NotificationEntityType;
|
|
93
93
|
targetId: string;
|
|
94
94
|
schedulerData: {
|
|
95
|
-
type:
|
|
95
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
96
96
|
days: number[];
|
|
97
97
|
time: string;
|
|
98
98
|
} | {
|
|
99
|
-
type:
|
|
99
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
100
100
|
date: string;
|
|
101
101
|
offsetMinutes: number;
|
|
102
102
|
};
|
|
@@ -111,11 +111,11 @@ export declare const notificationTemplateSchema: z.ZodObject<{
|
|
|
111
111
|
targetEntityType: NotificationEntityType;
|
|
112
112
|
targetId: string;
|
|
113
113
|
schedulerData: {
|
|
114
|
-
type:
|
|
114
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
115
115
|
days: number[];
|
|
116
116
|
time: string;
|
|
117
117
|
} | {
|
|
118
|
-
type:
|
|
118
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
119
119
|
date: string;
|
|
120
120
|
offsetMinutes: number;
|
|
121
121
|
};
|
|
@@ -127,41 +127,41 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
|
|
|
127
127
|
targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
128
128
|
targetId: z.ZodOptional<z.ZodString>;
|
|
129
129
|
schedulerData: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
130
|
-
type: z.ZodLiteral<
|
|
130
|
+
type: z.ZodLiteral<NotificationSchedulerType.DAY_TIME>;
|
|
131
131
|
days: z.ZodArray<z.ZodNumber, "many">;
|
|
132
132
|
time: z.ZodString;
|
|
133
133
|
}, "strip", z.ZodTypeAny, {
|
|
134
|
-
type:
|
|
134
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
135
135
|
days: number[];
|
|
136
136
|
time: string;
|
|
137
137
|
}, {
|
|
138
|
-
type:
|
|
138
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
139
139
|
days: number[];
|
|
140
140
|
time: string;
|
|
141
141
|
}>, z.ZodObject<{
|
|
142
|
-
type: z.ZodLiteral<
|
|
142
|
+
type: z.ZodLiteral<NotificationSchedulerType.RELATIVE_DATE>;
|
|
143
143
|
date: z.ZodString;
|
|
144
144
|
offsetMinutes: z.ZodNumber;
|
|
145
145
|
}, "strip", z.ZodTypeAny, {
|
|
146
|
-
type:
|
|
146
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
147
147
|
date: string;
|
|
148
148
|
offsetMinutes: number;
|
|
149
149
|
}, {
|
|
150
|
-
type:
|
|
150
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
151
151
|
date: string;
|
|
152
152
|
offsetMinutes: number;
|
|
153
153
|
}>]>;
|
|
154
|
-
variantData: z.
|
|
154
|
+
variantData: z.ZodAny;
|
|
155
155
|
active: z.ZodDefault<z.ZodBoolean>;
|
|
156
156
|
}, "strip", z.ZodTypeAny, {
|
|
157
157
|
targetLevel: NotificationTemplateLevel;
|
|
158
158
|
targetEntityType: NotificationEntityType;
|
|
159
159
|
schedulerData: {
|
|
160
|
-
type:
|
|
160
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
161
161
|
days: number[];
|
|
162
162
|
time: string;
|
|
163
163
|
} | {
|
|
164
|
-
type:
|
|
164
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
165
165
|
date: string;
|
|
166
166
|
offsetMinutes: number;
|
|
167
167
|
};
|
|
@@ -172,11 +172,11 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
|
|
|
172
172
|
targetLevel: NotificationTemplateLevel;
|
|
173
173
|
targetEntityType: NotificationEntityType;
|
|
174
174
|
schedulerData: {
|
|
175
|
-
type:
|
|
175
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
176
176
|
days: number[];
|
|
177
177
|
time: string;
|
|
178
178
|
} | {
|
|
179
|
-
type:
|
|
179
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
180
180
|
date: string;
|
|
181
181
|
offsetMinutes: number;
|
|
182
182
|
};
|
|
@@ -185,55 +185,55 @@ export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
|
|
|
185
185
|
active?: boolean | undefined;
|
|
186
186
|
}>;
|
|
187
187
|
export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
|
|
188
|
-
schedulerData: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
189
|
-
type: z.ZodLiteral<
|
|
188
|
+
schedulerData: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
189
|
+
type: z.ZodLiteral<NotificationSchedulerType.DAY_TIME>;
|
|
190
190
|
days: z.ZodArray<z.ZodNumber, "many">;
|
|
191
191
|
time: z.ZodString;
|
|
192
192
|
}, "strip", z.ZodTypeAny, {
|
|
193
|
-
type:
|
|
193
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
194
194
|
days: number[];
|
|
195
195
|
time: string;
|
|
196
196
|
}, {
|
|
197
|
-
type:
|
|
197
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
198
198
|
days: number[];
|
|
199
199
|
time: string;
|
|
200
200
|
}>, z.ZodObject<{
|
|
201
|
-
type: z.ZodLiteral<
|
|
201
|
+
type: z.ZodLiteral<NotificationSchedulerType.RELATIVE_DATE>;
|
|
202
202
|
date: z.ZodString;
|
|
203
203
|
offsetMinutes: z.ZodNumber;
|
|
204
204
|
}, "strip", z.ZodTypeAny, {
|
|
205
|
-
type:
|
|
205
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
206
206
|
date: string;
|
|
207
207
|
offsetMinutes: number;
|
|
208
208
|
}, {
|
|
209
|
-
type:
|
|
209
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
210
210
|
date: string;
|
|
211
211
|
offsetMinutes: number;
|
|
212
|
-
}>]
|
|
212
|
+
}>]>>;
|
|
213
213
|
variantData: z.ZodOptional<z.ZodAny>;
|
|
214
214
|
active: z.ZodOptional<z.ZodBoolean>;
|
|
215
215
|
}, "strip", z.ZodTypeAny, {
|
|
216
|
-
schedulerData
|
|
217
|
-
type:
|
|
216
|
+
schedulerData?: {
|
|
217
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
218
218
|
days: number[];
|
|
219
219
|
time: string;
|
|
220
220
|
} | {
|
|
221
|
-
type:
|
|
221
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
222
222
|
date: string;
|
|
223
223
|
offsetMinutes: number;
|
|
224
|
-
};
|
|
224
|
+
} | undefined;
|
|
225
225
|
variantData?: any;
|
|
226
226
|
active?: boolean | undefined;
|
|
227
227
|
}, {
|
|
228
|
-
schedulerData
|
|
229
|
-
type:
|
|
228
|
+
schedulerData?: {
|
|
229
|
+
type: NotificationSchedulerType.DAY_TIME;
|
|
230
230
|
days: number[];
|
|
231
231
|
time: string;
|
|
232
232
|
} | {
|
|
233
|
-
type:
|
|
233
|
+
type: NotificationSchedulerType.RELATIVE_DATE;
|
|
234
234
|
date: string;
|
|
235
235
|
offsetMinutes: number;
|
|
236
|
-
};
|
|
236
|
+
} | undefined;
|
|
237
237
|
variantData?: any;
|
|
238
238
|
active?: boolean | undefined;
|
|
239
239
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEntitySyncRequestSchema = exports.entitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationTemplateSchema = exports.notificationSchedulerDataSchema = exports.
|
|
3
|
+
exports.getEntitySyncRequestSchema = exports.entitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationTemplateSchema = exports.notificationSchedulerDataSchema = exports.NotificationSchedulerType = exports.NotificationEntityType = exports.NotificationTemplateLevel = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const id_types_1 = require("./id-types");
|
|
6
6
|
var NotificationTemplateLevel;
|
|
@@ -14,19 +14,19 @@ var NotificationEntityType;
|
|
|
14
14
|
NotificationEntityType["AGENDA_PANEL"] = "agenda_item";
|
|
15
15
|
NotificationEntityType["INBOX_PANEL"] = "inbox_panel";
|
|
16
16
|
})(NotificationEntityType || (exports.NotificationEntityType = NotificationEntityType = {}));
|
|
17
|
-
var
|
|
18
|
-
(function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})(
|
|
17
|
+
var NotificationSchedulerType;
|
|
18
|
+
(function (NotificationSchedulerType) {
|
|
19
|
+
NotificationSchedulerType["DAY_TIME"] = "day_time";
|
|
20
|
+
NotificationSchedulerType["RELATIVE_DATE"] = "relative_date";
|
|
21
|
+
})(NotificationSchedulerType || (exports.NotificationSchedulerType = NotificationSchedulerType = {}));
|
|
22
22
|
exports.notificationSchedulerDataSchema = zod_1.z.discriminatedUnion('type', [
|
|
23
23
|
zod_1.z.object({
|
|
24
|
-
type: zod_1.z.literal(
|
|
24
|
+
type: zod_1.z.literal(NotificationSchedulerType.DAY_TIME),
|
|
25
25
|
days: zod_1.z.array(zod_1.z.number().min(0).max(6)),
|
|
26
26
|
time: zod_1.z.string().regex(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/), // HH:mm format
|
|
27
27
|
}),
|
|
28
28
|
zod_1.z.object({
|
|
29
|
-
type: zod_1.z.literal(
|
|
29
|
+
type: zod_1.z.literal(NotificationSchedulerType.RELATIVE_DATE),
|
|
30
30
|
date: zod_1.z.string(),
|
|
31
31
|
offsetMinutes: zod_1.z.number().int()
|
|
32
32
|
})
|
|
@@ -38,7 +38,7 @@ exports.notificationTemplateSchema = zod_1.z.object({
|
|
|
38
38
|
targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
|
|
39
39
|
targetId: zod_1.z.string(),
|
|
40
40
|
schedulerData: exports.notificationSchedulerDataSchema,
|
|
41
|
-
variantData: zod_1.z.any()
|
|
41
|
+
variantData: zod_1.z.any(),
|
|
42
42
|
active: zod_1.z.boolean(),
|
|
43
43
|
createdAt: zod_1.z.date(),
|
|
44
44
|
updatedAt: zod_1.z.date()
|
|
@@ -48,11 +48,11 @@ exports.createNotificationTemplateRequestSchema = zod_1.z.object({
|
|
|
48
48
|
targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
|
|
49
49
|
targetId: zod_1.z.string().optional(),
|
|
50
50
|
schedulerData: exports.notificationSchedulerDataSchema,
|
|
51
|
-
variantData: zod_1.z.any()
|
|
51
|
+
variantData: zod_1.z.any(),
|
|
52
52
|
active: zod_1.z.boolean().default(true)
|
|
53
53
|
});
|
|
54
54
|
exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
|
|
55
|
-
schedulerData: exports.notificationSchedulerDataSchema,
|
|
55
|
+
schedulerData: exports.notificationSchedulerDataSchema.optional(),
|
|
56
56
|
variantData: zod_1.z.any().optional(),
|
|
57
57
|
active: zod_1.z.boolean().optional()
|
|
58
58
|
});
|
package/package.json
CHANGED
|
@@ -21,19 +21,19 @@ export enum NotificationEntityType {
|
|
|
21
21
|
INBOX_PANEL = 'inbox_panel',
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export enum
|
|
24
|
+
export enum NotificationSchedulerType {
|
|
25
25
|
DAY_TIME = 'day_time',
|
|
26
26
|
RELATIVE_DATE = 'relative_date',
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const notificationSchedulerDataSchema = z.discriminatedUnion('type', [
|
|
30
30
|
z.object({
|
|
31
|
-
type: z.literal(
|
|
31
|
+
type: z.literal(NotificationSchedulerType.DAY_TIME),
|
|
32
32
|
days: z.array(z.number().min(0).max(6)),
|
|
33
33
|
time: z.string().regex(/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/), // HH:mm format
|
|
34
34
|
}),
|
|
35
35
|
z.object({
|
|
36
|
-
type: z.literal(
|
|
36
|
+
type: z.literal(NotificationSchedulerType.RELATIVE_DATE),
|
|
37
37
|
date: z.string(),
|
|
38
38
|
offsetMinutes: z.number().int()
|
|
39
39
|
})
|
|
@@ -46,7 +46,7 @@ export const notificationTemplateSchema = z.object({
|
|
|
46
46
|
targetEntityType: z.nativeEnum(NotificationEntityType),
|
|
47
47
|
targetId: z.string(),
|
|
48
48
|
schedulerData: notificationSchedulerDataSchema,
|
|
49
|
-
variantData: z.any()
|
|
49
|
+
variantData: z.any(),
|
|
50
50
|
active: z.boolean(),
|
|
51
51
|
createdAt: z.date(),
|
|
52
52
|
updatedAt: z.date()
|
|
@@ -57,12 +57,12 @@ export const createNotificationTemplateRequestSchema = z.object({
|
|
|
57
57
|
targetEntityType: z.nativeEnum(NotificationEntityType),
|
|
58
58
|
targetId: z.string().optional(),
|
|
59
59
|
schedulerData: notificationSchedulerDataSchema,
|
|
60
|
-
variantData: z.any()
|
|
60
|
+
variantData: z.any(),
|
|
61
61
|
active: z.boolean().default(true)
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
export const updateNotificationTemplateRequestSchema = z.object({
|
|
65
|
-
schedulerData: notificationSchedulerDataSchema,
|
|
65
|
+
schedulerData: notificationSchedulerDataSchema.optional(),
|
|
66
66
|
variantData: z.any().optional(),
|
|
67
67
|
active: z.boolean().optional()
|
|
68
68
|
});
|