@sankira-dev/event-types 0.0.1 → 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 +390 -29
- package/dist/index.js +55 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
export declare const EntityTypeSchema: z.ZodEnum<["comment", "post", "user"]>;
|
|
3
|
+
export type EntityType = z.infer<typeof EntityTypeSchema>;
|
|
2
4
|
export declare const NotificationEntityTypeSchema: z.ZodEnum<["comment", "post", "space", "user"]>;
|
|
3
5
|
export type NotificationEntityType = z.infer<typeof NotificationEntityTypeSchema>;
|
|
4
6
|
export declare const NotificationEventTypeSchema: z.ZodEnum<["comment_replied", "comment_voted", "post_replied", "post_voted", "user_followed", "user_mentioned"]>;
|
|
5
7
|
export type NotificationEventType = z.infer<typeof NotificationEventTypeSchema>;
|
|
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;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
username: string;
|
|
16
|
+
email: string;
|
|
17
|
+
first_name: string;
|
|
18
|
+
last_name: string;
|
|
19
|
+
user_id: number;
|
|
20
|
+
}, {
|
|
21
|
+
username: string;
|
|
22
|
+
email: string;
|
|
23
|
+
first_name: string;
|
|
24
|
+
last_name: string;
|
|
25
|
+
user_id: number;
|
|
26
|
+
}>;
|
|
27
|
+
export type EmailRecipient = z.infer<typeof EmailRecipientSchema>;
|
|
6
28
|
export declare const NotificationActorSchema: z.ZodObject<{
|
|
7
29
|
full_name: z.ZodString;
|
|
8
30
|
id: z.ZodNumber;
|
|
@@ -48,6 +70,159 @@ export declare const SignupLinkRequestedSchema: z.ZodObject<{
|
|
|
48
70
|
signup_link: string;
|
|
49
71
|
}>;
|
|
50
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>;
|
|
51
226
|
export declare const TwoFactorOtpRequestedSchema: z.ZodObject<{
|
|
52
227
|
email: z.ZodString;
|
|
53
228
|
otp: z.ZodString;
|
|
@@ -62,26 +237,191 @@ export declare const TwoFactorOtpRequestedSchema: z.ZodObject<{
|
|
|
62
237
|
otp: string;
|
|
63
238
|
}>;
|
|
64
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>;
|
|
65
331
|
export declare const WriterApplicationSubmittedSchema: z.ZodObject<{
|
|
66
332
|
application_id: z.ZodNumber;
|
|
67
|
-
|
|
68
|
-
|
|
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
|
+
}>;
|
|
69
352
|
submitted_at: z.ZodDate;
|
|
70
|
-
user_id: z.ZodNumber;
|
|
71
353
|
}, "strip", z.ZodTypeAny, {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
354
|
+
recipient: {
|
|
355
|
+
username: string;
|
|
356
|
+
email: string;
|
|
357
|
+
first_name: string;
|
|
358
|
+
last_name: string;
|
|
359
|
+
user_id: number;
|
|
360
|
+
};
|
|
75
361
|
submitted_at: Date;
|
|
76
|
-
user_id: number;
|
|
77
|
-
}, {
|
|
78
|
-
email: string;
|
|
79
|
-
full_name: string;
|
|
80
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
|
+
};
|
|
81
371
|
submitted_at: Date;
|
|
82
|
-
|
|
372
|
+
application_id: number;
|
|
83
373
|
}>;
|
|
84
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>;
|
|
85
425
|
export declare const DigestItemSchema: z.ZodObject<{
|
|
86
426
|
actors: z.ZodArray<z.ZodObject<{
|
|
87
427
|
full_name: z.ZodString;
|
|
@@ -106,6 +446,7 @@ export declare const DigestItemSchema: z.ZodObject<{
|
|
|
106
446
|
event_type: z.ZodEnum<["comment_replied", "comment_voted", "post_replied", "post_voted", "user_followed", "user_mentioned"]>;
|
|
107
447
|
last_activity: z.ZodDate;
|
|
108
448
|
}, "strip", z.ZodTypeAny, {
|
|
449
|
+
entity_type: "user" | "comment" | "post" | "space";
|
|
109
450
|
actors: {
|
|
110
451
|
id: number;
|
|
111
452
|
username: string;
|
|
@@ -115,10 +456,10 @@ export declare const DigestItemSchema: z.ZodObject<{
|
|
|
115
456
|
count: number;
|
|
116
457
|
entity_id: number;
|
|
117
458
|
entity_slug: string;
|
|
118
|
-
entity_type: "user" | "comment" | "post" | "space";
|
|
119
459
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
120
460
|
last_activity: Date;
|
|
121
461
|
}, {
|
|
462
|
+
entity_type: "user" | "comment" | "post" | "space";
|
|
122
463
|
actors: {
|
|
123
464
|
id: number;
|
|
124
465
|
username: string;
|
|
@@ -128,15 +469,12 @@ export declare const DigestItemSchema: z.ZodObject<{
|
|
|
128
469
|
count: number;
|
|
129
470
|
entity_id: number;
|
|
130
471
|
entity_slug: string;
|
|
131
|
-
entity_type: "user" | "comment" | "post" | "space";
|
|
132
472
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
133
473
|
last_activity: Date;
|
|
134
474
|
}>;
|
|
135
475
|
export type DigestItem = z.infer<typeof DigestItemSchema>;
|
|
136
476
|
export declare const EmailDigestSchema: z.ZodObject<{
|
|
137
477
|
date: z.ZodDate;
|
|
138
|
-
email: z.ZodString;
|
|
139
|
-
first_name: z.ZodString;
|
|
140
478
|
items: z.ZodArray<z.ZodObject<{
|
|
141
479
|
actors: z.ZodArray<z.ZodObject<{
|
|
142
480
|
full_name: z.ZodString;
|
|
@@ -161,6 +499,7 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
161
499
|
event_type: z.ZodEnum<["comment_replied", "comment_voted", "post_replied", "post_voted", "user_followed", "user_mentioned"]>;
|
|
162
500
|
last_activity: z.ZodDate;
|
|
163
501
|
}, "strip", z.ZodTypeAny, {
|
|
502
|
+
entity_type: "user" | "comment" | "post" | "space";
|
|
164
503
|
actors: {
|
|
165
504
|
id: number;
|
|
166
505
|
username: string;
|
|
@@ -170,10 +509,10 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
170
509
|
count: number;
|
|
171
510
|
entity_id: number;
|
|
172
511
|
entity_slug: string;
|
|
173
|
-
entity_type: "user" | "comment" | "post" | "space";
|
|
174
512
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
175
513
|
last_activity: Date;
|
|
176
514
|
}, {
|
|
515
|
+
entity_type: "user" | "comment" | "post" | "space";
|
|
177
516
|
actors: {
|
|
178
517
|
id: number;
|
|
179
518
|
username: string;
|
|
@@ -183,16 +522,32 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
183
522
|
count: number;
|
|
184
523
|
entity_id: number;
|
|
185
524
|
entity_slug: string;
|
|
186
|
-
entity_type: "user" | "comment" | "post" | "space";
|
|
187
525
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
188
526
|
last_activity: Date;
|
|
189
527
|
}>, "many">;
|
|
190
|
-
|
|
191
|
-
|
|
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
|
+
}>;
|
|
192
547
|
}, "strip", z.ZodTypeAny, {
|
|
193
|
-
email: string;
|
|
194
548
|
date: Date;
|
|
195
549
|
items: {
|
|
550
|
+
entity_type: "user" | "comment" | "post" | "space";
|
|
196
551
|
actors: {
|
|
197
552
|
id: number;
|
|
198
553
|
username: string;
|
|
@@ -202,17 +557,20 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
202
557
|
count: number;
|
|
203
558
|
entity_id: number;
|
|
204
559
|
entity_slug: string;
|
|
205
|
-
entity_type: "user" | "comment" | "post" | "space";
|
|
206
560
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
207
561
|
last_activity: Date;
|
|
208
562
|
}[];
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
563
|
+
recipient: {
|
|
564
|
+
username: string;
|
|
565
|
+
email: string;
|
|
566
|
+
first_name: string;
|
|
567
|
+
last_name: string;
|
|
568
|
+
user_id: number;
|
|
569
|
+
};
|
|
212
570
|
}, {
|
|
213
|
-
email: string;
|
|
214
571
|
date: Date;
|
|
215
572
|
items: {
|
|
573
|
+
entity_type: "user" | "comment" | "post" | "space";
|
|
216
574
|
actors: {
|
|
217
575
|
id: number;
|
|
218
576
|
username: string;
|
|
@@ -222,12 +580,15 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
222
580
|
count: number;
|
|
223
581
|
entity_id: number;
|
|
224
582
|
entity_slug: string;
|
|
225
|
-
entity_type: "user" | "comment" | "post" | "space";
|
|
226
583
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
227
584
|
last_activity: Date;
|
|
228
585
|
}[];
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
586
|
+
recipient: {
|
|
587
|
+
username: string;
|
|
588
|
+
email: string;
|
|
589
|
+
first_name: string;
|
|
590
|
+
last_name: string;
|
|
591
|
+
user_id: number;
|
|
592
|
+
};
|
|
232
593
|
}>;
|
|
233
594
|
export type EmailDigest = z.infer<typeof EmailDigestSchema>;
|
package/dist/index.js
CHANGED
|
@@ -33,8 +33,13 @@ 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.NotificationEventTypeSchema = exports.NotificationEntityTypeSchema = void 0;
|
|
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
|
+
exports.EntityTypeSchema = z.enum([
|
|
39
|
+
"comment",
|
|
40
|
+
"post",
|
|
41
|
+
"user",
|
|
42
|
+
]);
|
|
38
43
|
exports.NotificationEntityTypeSchema = z.enum([
|
|
39
44
|
"comment",
|
|
40
45
|
"post",
|
|
@@ -49,6 +54,13 @@ exports.NotificationEventTypeSchema = z.enum([
|
|
|
49
54
|
"user_followed",
|
|
50
55
|
"user_mentioned",
|
|
51
56
|
]);
|
|
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(),
|
|
63
|
+
});
|
|
52
64
|
exports.NotificationActorSchema = z.object({
|
|
53
65
|
"full_name": z.string(),
|
|
54
66
|
"id": z.number(),
|
|
@@ -65,17 +77,55 @@ exports.SignupLinkRequestedSchema = z.object({
|
|
|
65
77
|
"sent_at": z.coerce.date(),
|
|
66
78
|
"signup_link": z.string(),
|
|
67
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
|
+
});
|
|
68
102
|
exports.TwoFactorOtpRequestedSchema = z.object({
|
|
69
103
|
"email": z.string(),
|
|
70
104
|
"otp": z.string(),
|
|
71
105
|
"sent_at": z.coerce.date(),
|
|
72
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
|
+
});
|
|
73
118
|
exports.WriterApplicationSubmittedSchema = z.object({
|
|
74
119
|
"application_id": z.number(),
|
|
75
|
-
"
|
|
76
|
-
"full_name": z.string(),
|
|
120
|
+
"recipient": exports.EmailRecipientSchema,
|
|
77
121
|
"submitted_at": z.coerce.date(),
|
|
78
|
-
|
|
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(),
|
|
79
129
|
});
|
|
80
130
|
exports.DigestItemSchema = z.object({
|
|
81
131
|
"actors": z.array(exports.NotificationActorSchema),
|
|
@@ -88,9 +138,6 @@ exports.DigestItemSchema = z.object({
|
|
|
88
138
|
});
|
|
89
139
|
exports.EmailDigestSchema = z.object({
|
|
90
140
|
"date": z.coerce.date(),
|
|
91
|
-
"email": z.string(),
|
|
92
|
-
"first_name": z.string(),
|
|
93
141
|
"items": z.array(exports.DigestItemSchema),
|
|
94
|
-
"
|
|
95
|
-
"user_id": z.number(),
|
|
142
|
+
"recipient": exports.EmailRecipientSchema,
|
|
96
143
|
});
|