@sankira-dev/event-types 0.0.2 → 0.0.3
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.
- package/dist/index.d.ts +379 -49
- package/dist/index.js +49 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,35 +5,26 @@ export declare const NotificationEntityTypeSchema: z.ZodEnum<["comment", "post",
|
|
|
5
5
|
export type NotificationEntityType = z.infer<typeof NotificationEntityTypeSchema>;
|
|
6
6
|
export declare const NotificationEventTypeSchema: z.ZodEnum<["comment_replied", "comment_voted", "post_replied", "post_voted", "user_followed", "user_mentioned"]>;
|
|
7
7
|
export type NotificationEventType = z.infer<typeof NotificationEventTypeSchema>;
|
|
8
|
-
export declare const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
reporter_last_name: z.ZodString;
|
|
15
|
-
reporter_user_id: z.ZodNumber;
|
|
16
|
-
resolved_at: z.ZodDate;
|
|
8
|
+
export declare const EmailRecipientSchema: z.ZodObject<{
|
|
9
|
+
email: z.ZodString;
|
|
10
|
+
first_name: z.ZodString;
|
|
11
|
+
last_name: z.ZodString;
|
|
12
|
+
user_id: z.ZodNumber;
|
|
13
|
+
username: z.ZodString;
|
|
17
14
|
}, "strip", z.ZodTypeAny, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
reporter_last_name: string;
|
|
24
|
-
reporter_user_id: number;
|
|
25
|
-
resolved_at: Date;
|
|
15
|
+
username: string;
|
|
16
|
+
email: string;
|
|
17
|
+
first_name: string;
|
|
18
|
+
last_name: string;
|
|
19
|
+
user_id: number;
|
|
26
20
|
}, {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
reporter_last_name: string;
|
|
33
|
-
reporter_user_id: number;
|
|
34
|
-
resolved_at: Date;
|
|
21
|
+
username: string;
|
|
22
|
+
email: string;
|
|
23
|
+
first_name: string;
|
|
24
|
+
last_name: string;
|
|
25
|
+
user_id: number;
|
|
35
26
|
}>;
|
|
36
|
-
export type
|
|
27
|
+
export type EmailRecipient = z.infer<typeof EmailRecipientSchema>;
|
|
37
28
|
export declare const NotificationActorSchema: z.ZodObject<{
|
|
38
29
|
full_name: z.ZodString;
|
|
39
30
|
id: z.ZodNumber;
|
|
@@ -79,6 +70,159 @@ export declare const SignupLinkRequestedSchema: z.ZodObject<{
|
|
|
79
70
|
signup_link: string;
|
|
80
71
|
}>;
|
|
81
72
|
export type SignupLinkRequested = z.infer<typeof SignupLinkRequestedSchema>;
|
|
73
|
+
export declare const StaffPostApprovedSchema: z.ZodObject<{
|
|
74
|
+
approved_at: z.ZodDate;
|
|
75
|
+
post_id: z.ZodNumber;
|
|
76
|
+
post_slug: z.ZodString;
|
|
77
|
+
post_title: z.ZodString;
|
|
78
|
+
recipient: z.ZodObject<{
|
|
79
|
+
email: z.ZodString;
|
|
80
|
+
first_name: z.ZodString;
|
|
81
|
+
last_name: z.ZodString;
|
|
82
|
+
user_id: z.ZodNumber;
|
|
83
|
+
username: z.ZodString;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
username: string;
|
|
86
|
+
email: string;
|
|
87
|
+
first_name: string;
|
|
88
|
+
last_name: string;
|
|
89
|
+
user_id: number;
|
|
90
|
+
}, {
|
|
91
|
+
username: string;
|
|
92
|
+
email: string;
|
|
93
|
+
first_name: string;
|
|
94
|
+
last_name: string;
|
|
95
|
+
user_id: number;
|
|
96
|
+
}>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
approved_at: Date;
|
|
99
|
+
post_id: number;
|
|
100
|
+
post_slug: string;
|
|
101
|
+
post_title: string;
|
|
102
|
+
recipient: {
|
|
103
|
+
username: string;
|
|
104
|
+
email: string;
|
|
105
|
+
first_name: string;
|
|
106
|
+
last_name: string;
|
|
107
|
+
user_id: number;
|
|
108
|
+
};
|
|
109
|
+
}, {
|
|
110
|
+
approved_at: Date;
|
|
111
|
+
post_id: number;
|
|
112
|
+
post_slug: string;
|
|
113
|
+
post_title: string;
|
|
114
|
+
recipient: {
|
|
115
|
+
username: string;
|
|
116
|
+
email: string;
|
|
117
|
+
first_name: string;
|
|
118
|
+
last_name: string;
|
|
119
|
+
user_id: number;
|
|
120
|
+
};
|
|
121
|
+
}>;
|
|
122
|
+
export type StaffPostApproved = z.infer<typeof StaffPostApprovedSchema>;
|
|
123
|
+
export declare const StaffPostRejectedSchema: z.ZodObject<{
|
|
124
|
+
post_id: z.ZodNumber;
|
|
125
|
+
post_slug: z.ZodString;
|
|
126
|
+
post_title: z.ZodString;
|
|
127
|
+
recipient: z.ZodObject<{
|
|
128
|
+
email: z.ZodString;
|
|
129
|
+
first_name: z.ZodString;
|
|
130
|
+
last_name: z.ZodString;
|
|
131
|
+
user_id: z.ZodNumber;
|
|
132
|
+
username: z.ZodString;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
username: string;
|
|
135
|
+
email: string;
|
|
136
|
+
first_name: string;
|
|
137
|
+
last_name: string;
|
|
138
|
+
user_id: number;
|
|
139
|
+
}, {
|
|
140
|
+
username: string;
|
|
141
|
+
email: string;
|
|
142
|
+
first_name: string;
|
|
143
|
+
last_name: string;
|
|
144
|
+
user_id: number;
|
|
145
|
+
}>;
|
|
146
|
+
rejected_at: z.ZodDate;
|
|
147
|
+
rejection_reason: z.ZodString;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
post_id: number;
|
|
150
|
+
post_slug: string;
|
|
151
|
+
post_title: string;
|
|
152
|
+
recipient: {
|
|
153
|
+
username: string;
|
|
154
|
+
email: string;
|
|
155
|
+
first_name: string;
|
|
156
|
+
last_name: string;
|
|
157
|
+
user_id: number;
|
|
158
|
+
};
|
|
159
|
+
rejected_at: Date;
|
|
160
|
+
rejection_reason: string;
|
|
161
|
+
}, {
|
|
162
|
+
post_id: number;
|
|
163
|
+
post_slug: string;
|
|
164
|
+
post_title: string;
|
|
165
|
+
recipient: {
|
|
166
|
+
username: string;
|
|
167
|
+
email: string;
|
|
168
|
+
first_name: string;
|
|
169
|
+
last_name: string;
|
|
170
|
+
user_id: number;
|
|
171
|
+
};
|
|
172
|
+
rejected_at: Date;
|
|
173
|
+
rejection_reason: string;
|
|
174
|
+
}>;
|
|
175
|
+
export type StaffPostRejected = z.infer<typeof StaffPostRejectedSchema>;
|
|
176
|
+
export declare const StaffPostSubmittedSchema: z.ZodObject<{
|
|
177
|
+
post_id: z.ZodNumber;
|
|
178
|
+
post_slug: z.ZodString;
|
|
179
|
+
post_title: z.ZodString;
|
|
180
|
+
recipient: z.ZodObject<{
|
|
181
|
+
email: z.ZodString;
|
|
182
|
+
first_name: z.ZodString;
|
|
183
|
+
last_name: z.ZodString;
|
|
184
|
+
user_id: z.ZodNumber;
|
|
185
|
+
username: z.ZodString;
|
|
186
|
+
}, "strip", z.ZodTypeAny, {
|
|
187
|
+
username: string;
|
|
188
|
+
email: string;
|
|
189
|
+
first_name: string;
|
|
190
|
+
last_name: string;
|
|
191
|
+
user_id: number;
|
|
192
|
+
}, {
|
|
193
|
+
username: string;
|
|
194
|
+
email: string;
|
|
195
|
+
first_name: string;
|
|
196
|
+
last_name: string;
|
|
197
|
+
user_id: number;
|
|
198
|
+
}>;
|
|
199
|
+
submitted_at: z.ZodDate;
|
|
200
|
+
}, "strip", z.ZodTypeAny, {
|
|
201
|
+
post_id: number;
|
|
202
|
+
post_slug: string;
|
|
203
|
+
post_title: string;
|
|
204
|
+
recipient: {
|
|
205
|
+
username: string;
|
|
206
|
+
email: string;
|
|
207
|
+
first_name: string;
|
|
208
|
+
last_name: string;
|
|
209
|
+
user_id: number;
|
|
210
|
+
};
|
|
211
|
+
submitted_at: Date;
|
|
212
|
+
}, {
|
|
213
|
+
post_id: number;
|
|
214
|
+
post_slug: string;
|
|
215
|
+
post_title: string;
|
|
216
|
+
recipient: {
|
|
217
|
+
username: string;
|
|
218
|
+
email: string;
|
|
219
|
+
first_name: string;
|
|
220
|
+
last_name: string;
|
|
221
|
+
user_id: number;
|
|
222
|
+
};
|
|
223
|
+
submitted_at: Date;
|
|
224
|
+
}>;
|
|
225
|
+
export type StaffPostSubmitted = z.infer<typeof StaffPostSubmittedSchema>;
|
|
82
226
|
export declare const TwoFactorOtpRequestedSchema: z.ZodObject<{
|
|
83
227
|
email: z.ZodString;
|
|
84
228
|
otp: z.ZodString;
|
|
@@ -93,26 +237,191 @@ export declare const TwoFactorOtpRequestedSchema: z.ZodObject<{
|
|
|
93
237
|
otp: string;
|
|
94
238
|
}>;
|
|
95
239
|
export type TwoFactorOtpRequested = z.infer<typeof TwoFactorOtpRequestedSchema>;
|
|
240
|
+
export declare const WriterApplicationAcceptedSchema: z.ZodObject<{
|
|
241
|
+
accepted_at: z.ZodDate;
|
|
242
|
+
application_slug: z.ZodString;
|
|
243
|
+
recipient: z.ZodObject<{
|
|
244
|
+
email: z.ZodString;
|
|
245
|
+
first_name: z.ZodString;
|
|
246
|
+
last_name: z.ZodString;
|
|
247
|
+
user_id: z.ZodNumber;
|
|
248
|
+
username: z.ZodString;
|
|
249
|
+
}, "strip", z.ZodTypeAny, {
|
|
250
|
+
username: string;
|
|
251
|
+
email: string;
|
|
252
|
+
first_name: string;
|
|
253
|
+
last_name: string;
|
|
254
|
+
user_id: number;
|
|
255
|
+
}, {
|
|
256
|
+
username: string;
|
|
257
|
+
email: string;
|
|
258
|
+
first_name: string;
|
|
259
|
+
last_name: string;
|
|
260
|
+
user_id: number;
|
|
261
|
+
}>;
|
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
recipient: {
|
|
264
|
+
username: string;
|
|
265
|
+
email: string;
|
|
266
|
+
first_name: string;
|
|
267
|
+
last_name: string;
|
|
268
|
+
user_id: number;
|
|
269
|
+
};
|
|
270
|
+
accepted_at: Date;
|
|
271
|
+
application_slug: string;
|
|
272
|
+
}, {
|
|
273
|
+
recipient: {
|
|
274
|
+
username: string;
|
|
275
|
+
email: string;
|
|
276
|
+
first_name: string;
|
|
277
|
+
last_name: string;
|
|
278
|
+
user_id: number;
|
|
279
|
+
};
|
|
280
|
+
accepted_at: Date;
|
|
281
|
+
application_slug: string;
|
|
282
|
+
}>;
|
|
283
|
+
export type WriterApplicationAccepted = z.infer<typeof WriterApplicationAcceptedSchema>;
|
|
284
|
+
export declare const WriterApplicationRejectedSchema: z.ZodObject<{
|
|
285
|
+
application_slug: z.ZodString;
|
|
286
|
+
recipient: z.ZodObject<{
|
|
287
|
+
email: z.ZodString;
|
|
288
|
+
first_name: z.ZodString;
|
|
289
|
+
last_name: z.ZodString;
|
|
290
|
+
user_id: z.ZodNumber;
|
|
291
|
+
username: z.ZodString;
|
|
292
|
+
}, "strip", z.ZodTypeAny, {
|
|
293
|
+
username: string;
|
|
294
|
+
email: string;
|
|
295
|
+
first_name: string;
|
|
296
|
+
last_name: string;
|
|
297
|
+
user_id: number;
|
|
298
|
+
}, {
|
|
299
|
+
username: string;
|
|
300
|
+
email: string;
|
|
301
|
+
first_name: string;
|
|
302
|
+
last_name: string;
|
|
303
|
+
user_id: number;
|
|
304
|
+
}>;
|
|
305
|
+
rejected_at: z.ZodDate;
|
|
306
|
+
rejection_reason: z.ZodOptional<z.ZodUnion<[z.ZodNull, z.ZodString]>>;
|
|
307
|
+
}, "strip", z.ZodTypeAny, {
|
|
308
|
+
recipient: {
|
|
309
|
+
username: string;
|
|
310
|
+
email: string;
|
|
311
|
+
first_name: string;
|
|
312
|
+
last_name: string;
|
|
313
|
+
user_id: number;
|
|
314
|
+
};
|
|
315
|
+
rejected_at: Date;
|
|
316
|
+
application_slug: string;
|
|
317
|
+
rejection_reason?: string | null | undefined;
|
|
318
|
+
}, {
|
|
319
|
+
recipient: {
|
|
320
|
+
username: string;
|
|
321
|
+
email: string;
|
|
322
|
+
first_name: string;
|
|
323
|
+
last_name: string;
|
|
324
|
+
user_id: number;
|
|
325
|
+
};
|
|
326
|
+
rejected_at: Date;
|
|
327
|
+
application_slug: string;
|
|
328
|
+
rejection_reason?: string | null | undefined;
|
|
329
|
+
}>;
|
|
330
|
+
export type WriterApplicationRejected = z.infer<typeof WriterApplicationRejectedSchema>;
|
|
96
331
|
export declare const WriterApplicationSubmittedSchema: z.ZodObject<{
|
|
97
332
|
application_id: z.ZodNumber;
|
|
98
|
-
|
|
99
|
-
|
|
333
|
+
recipient: z.ZodObject<{
|
|
334
|
+
email: z.ZodString;
|
|
335
|
+
first_name: z.ZodString;
|
|
336
|
+
last_name: z.ZodString;
|
|
337
|
+
user_id: z.ZodNumber;
|
|
338
|
+
username: z.ZodString;
|
|
339
|
+
}, "strip", z.ZodTypeAny, {
|
|
340
|
+
username: string;
|
|
341
|
+
email: string;
|
|
342
|
+
first_name: string;
|
|
343
|
+
last_name: string;
|
|
344
|
+
user_id: number;
|
|
345
|
+
}, {
|
|
346
|
+
username: string;
|
|
347
|
+
email: string;
|
|
348
|
+
first_name: string;
|
|
349
|
+
last_name: string;
|
|
350
|
+
user_id: number;
|
|
351
|
+
}>;
|
|
100
352
|
submitted_at: z.ZodDate;
|
|
101
|
-
user_id: z.ZodNumber;
|
|
102
353
|
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
354
|
+
recipient: {
|
|
355
|
+
username: string;
|
|
356
|
+
email: string;
|
|
357
|
+
first_name: string;
|
|
358
|
+
last_name: string;
|
|
359
|
+
user_id: number;
|
|
360
|
+
};
|
|
106
361
|
submitted_at: Date;
|
|
107
|
-
user_id: number;
|
|
108
|
-
}, {
|
|
109
|
-
email: string;
|
|
110
|
-
full_name: string;
|
|
111
362
|
application_id: number;
|
|
363
|
+
}, {
|
|
364
|
+
recipient: {
|
|
365
|
+
username: string;
|
|
366
|
+
email: string;
|
|
367
|
+
first_name: string;
|
|
368
|
+
last_name: string;
|
|
369
|
+
user_id: number;
|
|
370
|
+
};
|
|
112
371
|
submitted_at: Date;
|
|
113
|
-
|
|
372
|
+
application_id: number;
|
|
114
373
|
}>;
|
|
115
374
|
export type WriterApplicationSubmitted = z.infer<typeof WriterApplicationSubmittedSchema>;
|
|
375
|
+
export declare const ModerationReportResolvedSchema: z.ZodObject<{
|
|
376
|
+
action_taken: z.ZodString;
|
|
377
|
+
entity_type: z.ZodEnum<["comment", "post", "user"]>;
|
|
378
|
+
report_id: z.ZodNumber;
|
|
379
|
+
reporter: z.ZodObject<{
|
|
380
|
+
email: z.ZodString;
|
|
381
|
+
first_name: z.ZodString;
|
|
382
|
+
last_name: z.ZodString;
|
|
383
|
+
user_id: z.ZodNumber;
|
|
384
|
+
username: z.ZodString;
|
|
385
|
+
}, "strip", z.ZodTypeAny, {
|
|
386
|
+
username: string;
|
|
387
|
+
email: string;
|
|
388
|
+
first_name: string;
|
|
389
|
+
last_name: string;
|
|
390
|
+
user_id: number;
|
|
391
|
+
}, {
|
|
392
|
+
username: string;
|
|
393
|
+
email: string;
|
|
394
|
+
first_name: string;
|
|
395
|
+
last_name: string;
|
|
396
|
+
user_id: number;
|
|
397
|
+
}>;
|
|
398
|
+
resolved_at: z.ZodDate;
|
|
399
|
+
}, "strip", z.ZodTypeAny, {
|
|
400
|
+
action_taken: string;
|
|
401
|
+
entity_type: "user" | "comment" | "post";
|
|
402
|
+
report_id: number;
|
|
403
|
+
reporter: {
|
|
404
|
+
username: string;
|
|
405
|
+
email: string;
|
|
406
|
+
first_name: string;
|
|
407
|
+
last_name: string;
|
|
408
|
+
user_id: number;
|
|
409
|
+
};
|
|
410
|
+
resolved_at: Date;
|
|
411
|
+
}, {
|
|
412
|
+
action_taken: string;
|
|
413
|
+
entity_type: "user" | "comment" | "post";
|
|
414
|
+
report_id: number;
|
|
415
|
+
reporter: {
|
|
416
|
+
username: string;
|
|
417
|
+
email: string;
|
|
418
|
+
first_name: string;
|
|
419
|
+
last_name: string;
|
|
420
|
+
user_id: number;
|
|
421
|
+
};
|
|
422
|
+
resolved_at: Date;
|
|
423
|
+
}>;
|
|
424
|
+
export type ModerationReportResolved = z.infer<typeof ModerationReportResolvedSchema>;
|
|
116
425
|
export declare const DigestItemSchema: z.ZodObject<{
|
|
117
426
|
actors: z.ZodArray<z.ZodObject<{
|
|
118
427
|
full_name: z.ZodString;
|
|
@@ -166,8 +475,6 @@ export declare const DigestItemSchema: z.ZodObject<{
|
|
|
166
475
|
export type DigestItem = z.infer<typeof DigestItemSchema>;
|
|
167
476
|
export declare const EmailDigestSchema: z.ZodObject<{
|
|
168
477
|
date: z.ZodDate;
|
|
169
|
-
email: z.ZodString;
|
|
170
|
-
first_name: z.ZodString;
|
|
171
478
|
items: z.ZodArray<z.ZodObject<{
|
|
172
479
|
actors: z.ZodArray<z.ZodObject<{
|
|
173
480
|
full_name: z.ZodString;
|
|
@@ -218,10 +525,26 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
218
525
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
219
526
|
last_activity: Date;
|
|
220
527
|
}>, "many">;
|
|
221
|
-
|
|
222
|
-
|
|
528
|
+
recipient: z.ZodObject<{
|
|
529
|
+
email: z.ZodString;
|
|
530
|
+
first_name: z.ZodString;
|
|
531
|
+
last_name: z.ZodString;
|
|
532
|
+
user_id: z.ZodNumber;
|
|
533
|
+
username: z.ZodString;
|
|
534
|
+
}, "strip", z.ZodTypeAny, {
|
|
535
|
+
username: string;
|
|
536
|
+
email: string;
|
|
537
|
+
first_name: string;
|
|
538
|
+
last_name: string;
|
|
539
|
+
user_id: number;
|
|
540
|
+
}, {
|
|
541
|
+
username: string;
|
|
542
|
+
email: string;
|
|
543
|
+
first_name: string;
|
|
544
|
+
last_name: string;
|
|
545
|
+
user_id: number;
|
|
546
|
+
}>;
|
|
223
547
|
}, "strip", z.ZodTypeAny, {
|
|
224
|
-
email: string;
|
|
225
548
|
date: Date;
|
|
226
549
|
items: {
|
|
227
550
|
entity_type: "user" | "comment" | "post" | "space";
|
|
@@ -237,11 +560,14 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
237
560
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
238
561
|
last_activity: Date;
|
|
239
562
|
}[];
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
563
|
+
recipient: {
|
|
564
|
+
username: string;
|
|
565
|
+
email: string;
|
|
566
|
+
first_name: string;
|
|
567
|
+
last_name: string;
|
|
568
|
+
user_id: number;
|
|
569
|
+
};
|
|
243
570
|
}, {
|
|
244
|
-
email: string;
|
|
245
571
|
date: Date;
|
|
246
572
|
items: {
|
|
247
573
|
entity_type: "user" | "comment" | "post" | "space";
|
|
@@ -257,8 +583,12 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
257
583
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
258
584
|
last_activity: Date;
|
|
259
585
|
}[];
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
586
|
+
recipient: {
|
|
587
|
+
username: string;
|
|
588
|
+
email: string;
|
|
589
|
+
first_name: string;
|
|
590
|
+
last_name: string;
|
|
591
|
+
user_id: number;
|
|
592
|
+
};
|
|
263
593
|
}>;
|
|
264
594
|
export type EmailDigest = z.infer<typeof EmailDigestSchema>;
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.EmailDigestSchema = exports.DigestItemSchema = exports.WriterApplicationSubmittedSchema = exports.TwoFactorOtpRequestedSchema = exports.SignupLinkRequestedSchema = exports.PasswordResetSchema = exports.NotificationActorSchema = exports.
|
|
36
|
+
exports.EmailDigestSchema = exports.DigestItemSchema = exports.ModerationReportResolvedSchema = exports.WriterApplicationSubmittedSchema = exports.WriterApplicationRejectedSchema = exports.WriterApplicationAcceptedSchema = exports.TwoFactorOtpRequestedSchema = exports.StaffPostSubmittedSchema = exports.StaffPostRejectedSchema = exports.StaffPostApprovedSchema = exports.SignupLinkRequestedSchema = exports.PasswordResetSchema = exports.NotificationActorSchema = exports.EmailRecipientSchema = exports.NotificationEventTypeSchema = exports.NotificationEntityTypeSchema = exports.EntityTypeSchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
38
|
exports.EntityTypeSchema = z.enum([
|
|
39
39
|
"comment",
|
|
@@ -54,15 +54,12 @@ exports.NotificationEventTypeSchema = z.enum([
|
|
|
54
54
|
"user_followed",
|
|
55
55
|
"user_mentioned",
|
|
56
56
|
]);
|
|
57
|
-
exports.
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"reporter_last_name": z.string(),
|
|
64
|
-
"reporter_user_id": z.number(),
|
|
65
|
-
"resolved_at": z.coerce.date(),
|
|
57
|
+
exports.EmailRecipientSchema = z.object({
|
|
58
|
+
"email": z.string(),
|
|
59
|
+
"first_name": z.string(),
|
|
60
|
+
"last_name": z.string(),
|
|
61
|
+
"user_id": z.number(),
|
|
62
|
+
"username": z.string(),
|
|
66
63
|
});
|
|
67
64
|
exports.NotificationActorSchema = z.object({
|
|
68
65
|
"full_name": z.string(),
|
|
@@ -80,17 +77,55 @@ exports.SignupLinkRequestedSchema = z.object({
|
|
|
80
77
|
"sent_at": z.coerce.date(),
|
|
81
78
|
"signup_link": z.string(),
|
|
82
79
|
});
|
|
80
|
+
exports.StaffPostApprovedSchema = z.object({
|
|
81
|
+
"approved_at": z.coerce.date(),
|
|
82
|
+
"post_id": z.number(),
|
|
83
|
+
"post_slug": z.string(),
|
|
84
|
+
"post_title": z.string(),
|
|
85
|
+
"recipient": exports.EmailRecipientSchema,
|
|
86
|
+
});
|
|
87
|
+
exports.StaffPostRejectedSchema = z.object({
|
|
88
|
+
"post_id": z.number(),
|
|
89
|
+
"post_slug": z.string(),
|
|
90
|
+
"post_title": z.string(),
|
|
91
|
+
"recipient": exports.EmailRecipientSchema,
|
|
92
|
+
"rejected_at": z.coerce.date(),
|
|
93
|
+
"rejection_reason": z.string(),
|
|
94
|
+
});
|
|
95
|
+
exports.StaffPostSubmittedSchema = z.object({
|
|
96
|
+
"post_id": z.number(),
|
|
97
|
+
"post_slug": z.string(),
|
|
98
|
+
"post_title": z.string(),
|
|
99
|
+
"recipient": exports.EmailRecipientSchema,
|
|
100
|
+
"submitted_at": z.coerce.date(),
|
|
101
|
+
});
|
|
83
102
|
exports.TwoFactorOtpRequestedSchema = z.object({
|
|
84
103
|
"email": z.string(),
|
|
85
104
|
"otp": z.string(),
|
|
86
105
|
"sent_at": z.coerce.date(),
|
|
87
106
|
});
|
|
107
|
+
exports.WriterApplicationAcceptedSchema = z.object({
|
|
108
|
+
"accepted_at": z.coerce.date(),
|
|
109
|
+
"application_slug": z.string(),
|
|
110
|
+
"recipient": exports.EmailRecipientSchema,
|
|
111
|
+
});
|
|
112
|
+
exports.WriterApplicationRejectedSchema = z.object({
|
|
113
|
+
"application_slug": z.string(),
|
|
114
|
+
"recipient": exports.EmailRecipientSchema,
|
|
115
|
+
"rejected_at": z.coerce.date(),
|
|
116
|
+
"rejection_reason": z.union([z.null(), z.string()]).optional(),
|
|
117
|
+
});
|
|
88
118
|
exports.WriterApplicationSubmittedSchema = z.object({
|
|
89
119
|
"application_id": z.number(),
|
|
90
|
-
"
|
|
91
|
-
"full_name": z.string(),
|
|
120
|
+
"recipient": exports.EmailRecipientSchema,
|
|
92
121
|
"submitted_at": z.coerce.date(),
|
|
93
|
-
|
|
122
|
+
});
|
|
123
|
+
exports.ModerationReportResolvedSchema = z.object({
|
|
124
|
+
"action_taken": z.string(),
|
|
125
|
+
"entity_type": exports.EntityTypeSchema,
|
|
126
|
+
"report_id": z.number(),
|
|
127
|
+
"reporter": exports.EmailRecipientSchema,
|
|
128
|
+
"resolved_at": z.coerce.date(),
|
|
94
129
|
});
|
|
95
130
|
exports.DigestItemSchema = z.object({
|
|
96
131
|
"actors": z.array(exports.NotificationActorSchema),
|
|
@@ -103,9 +138,6 @@ exports.DigestItemSchema = z.object({
|
|
|
103
138
|
});
|
|
104
139
|
exports.EmailDigestSchema = z.object({
|
|
105
140
|
"date": z.coerce.date(),
|
|
106
|
-
"email": z.string(),
|
|
107
|
-
"first_name": z.string(),
|
|
108
141
|
"items": z.array(exports.DigestItemSchema),
|
|
109
|
-
"
|
|
110
|
-
"user_id": z.number(),
|
|
142
|
+
"recipient": exports.EmailRecipientSchema,
|
|
111
143
|
});
|