@sankira-dev/event-types 0.0.5-beta.0 → 0.0.5-beta.2
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 +184 -16
- package/dist/index.js +21 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare const NotificationEntityTypeSchema: z.ZodEnum<["comment", "post",
|
|
|
7
7
|
export type NotificationEntityType = z.infer<typeof NotificationEntityTypeSchema>;
|
|
8
8
|
export declare const NotificationEventTypeSchema: z.ZodEnum<["comment_replied", "comment_voted", "post_replied", "post_voted", "user_followed", "user_mentioned"]>;
|
|
9
9
|
export type NotificationEventType = z.infer<typeof NotificationEventTypeSchema>;
|
|
10
|
+
export declare const BanTypeSchema: z.ZodEnum<["permanent", "temporary"]>;
|
|
11
|
+
export type BanType = z.infer<typeof BanTypeSchema>;
|
|
10
12
|
export declare const UserSchema: z.ZodObject<{
|
|
11
13
|
email: z.ZodString;
|
|
12
14
|
first_name: z.ZodString;
|
|
@@ -96,16 +98,49 @@ export declare const NotificationActorSchema: z.ZodObject<{
|
|
|
96
98
|
export type NotificationActor = z.infer<typeof NotificationActorSchema>;
|
|
97
99
|
export declare const PasswordResetSchema: z.ZodObject<{
|
|
98
100
|
email: z.ZodString;
|
|
101
|
+
recipient: z.ZodOptional<z.ZodObject<{
|
|
102
|
+
email: z.ZodString;
|
|
103
|
+
first_name: z.ZodString;
|
|
104
|
+
last_name: z.ZodString;
|
|
105
|
+
user_id: z.ZodNumber;
|
|
106
|
+
username: z.ZodString;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
username: string;
|
|
109
|
+
email: string;
|
|
110
|
+
first_name: string;
|
|
111
|
+
last_name: string;
|
|
112
|
+
user_id: number;
|
|
113
|
+
}, {
|
|
114
|
+
username: string;
|
|
115
|
+
email: string;
|
|
116
|
+
first_name: string;
|
|
117
|
+
last_name: string;
|
|
118
|
+
user_id: number;
|
|
119
|
+
}>>;
|
|
99
120
|
reset_link: z.ZodString;
|
|
100
121
|
sent_at: z.ZodDate;
|
|
101
122
|
}, "strip", z.ZodTypeAny, {
|
|
102
123
|
email: string;
|
|
103
124
|
reset_link: string;
|
|
104
125
|
sent_at: Date;
|
|
126
|
+
recipient?: {
|
|
127
|
+
username: string;
|
|
128
|
+
email: string;
|
|
129
|
+
first_name: string;
|
|
130
|
+
last_name: string;
|
|
131
|
+
user_id: number;
|
|
132
|
+
} | undefined;
|
|
105
133
|
}, {
|
|
106
134
|
email: string;
|
|
107
135
|
reset_link: string;
|
|
108
136
|
sent_at: Date;
|
|
137
|
+
recipient?: {
|
|
138
|
+
username: string;
|
|
139
|
+
email: string;
|
|
140
|
+
first_name: string;
|
|
141
|
+
last_name: string;
|
|
142
|
+
user_id: number;
|
|
143
|
+
} | undefined;
|
|
109
144
|
}>;
|
|
110
145
|
export type PasswordReset = z.infer<typeof PasswordResetSchema>;
|
|
111
146
|
export declare const SignupLinkRequestedSchema: z.ZodObject<{
|
|
@@ -147,10 +182,6 @@ export declare const StaffPostApprovedSchema: z.ZodObject<{
|
|
|
147
182
|
user_id: number;
|
|
148
183
|
}>;
|
|
149
184
|
}, "strip", z.ZodTypeAny, {
|
|
150
|
-
approved_at: Date;
|
|
151
|
-
post_id: number;
|
|
152
|
-
post_slug: string;
|
|
153
|
-
post_title: string;
|
|
154
185
|
recipient: {
|
|
155
186
|
username: string;
|
|
156
187
|
email: string;
|
|
@@ -158,11 +189,11 @@ export declare const StaffPostApprovedSchema: z.ZodObject<{
|
|
|
158
189
|
last_name: string;
|
|
159
190
|
user_id: number;
|
|
160
191
|
};
|
|
161
|
-
}, {
|
|
162
192
|
approved_at: Date;
|
|
163
193
|
post_id: number;
|
|
164
194
|
post_slug: string;
|
|
165
195
|
post_title: string;
|
|
196
|
+
}, {
|
|
166
197
|
recipient: {
|
|
167
198
|
username: string;
|
|
168
199
|
email: string;
|
|
@@ -170,6 +201,10 @@ export declare const StaffPostApprovedSchema: z.ZodObject<{
|
|
|
170
201
|
last_name: string;
|
|
171
202
|
user_id: number;
|
|
172
203
|
};
|
|
204
|
+
approved_at: Date;
|
|
205
|
+
post_id: number;
|
|
206
|
+
post_slug: string;
|
|
207
|
+
post_title: string;
|
|
173
208
|
}>;
|
|
174
209
|
export type StaffPostApproved = z.infer<typeof StaffPostApprovedSchema>;
|
|
175
210
|
export declare const StaffPostRejectedSchema: z.ZodObject<{
|
|
@@ -198,9 +233,6 @@ export declare const StaffPostRejectedSchema: z.ZodObject<{
|
|
|
198
233
|
rejected_at: z.ZodDate;
|
|
199
234
|
rejection_reason: z.ZodString;
|
|
200
235
|
}, "strip", z.ZodTypeAny, {
|
|
201
|
-
post_id: number;
|
|
202
|
-
post_slug: string;
|
|
203
|
-
post_title: string;
|
|
204
236
|
recipient: {
|
|
205
237
|
username: string;
|
|
206
238
|
email: string;
|
|
@@ -208,12 +240,12 @@ export declare const StaffPostRejectedSchema: z.ZodObject<{
|
|
|
208
240
|
last_name: string;
|
|
209
241
|
user_id: number;
|
|
210
242
|
};
|
|
211
|
-
rejected_at: Date;
|
|
212
|
-
rejection_reason: string;
|
|
213
|
-
}, {
|
|
214
243
|
post_id: number;
|
|
215
244
|
post_slug: string;
|
|
216
245
|
post_title: string;
|
|
246
|
+
rejected_at: Date;
|
|
247
|
+
rejection_reason: string;
|
|
248
|
+
}, {
|
|
217
249
|
recipient: {
|
|
218
250
|
username: string;
|
|
219
251
|
email: string;
|
|
@@ -221,6 +253,9 @@ export declare const StaffPostRejectedSchema: z.ZodObject<{
|
|
|
221
253
|
last_name: string;
|
|
222
254
|
user_id: number;
|
|
223
255
|
};
|
|
256
|
+
post_id: number;
|
|
257
|
+
post_slug: string;
|
|
258
|
+
post_title: string;
|
|
224
259
|
rejected_at: Date;
|
|
225
260
|
rejection_reason: string;
|
|
226
261
|
}>;
|
|
@@ -250,9 +285,6 @@ export declare const StaffPostSubmittedSchema: z.ZodObject<{
|
|
|
250
285
|
}>;
|
|
251
286
|
submitted_at: z.ZodDate;
|
|
252
287
|
}, "strip", z.ZodTypeAny, {
|
|
253
|
-
post_id: number;
|
|
254
|
-
post_slug: string;
|
|
255
|
-
post_title: string;
|
|
256
288
|
recipient: {
|
|
257
289
|
username: string;
|
|
258
290
|
email: string;
|
|
@@ -260,11 +292,11 @@ export declare const StaffPostSubmittedSchema: z.ZodObject<{
|
|
|
260
292
|
last_name: string;
|
|
261
293
|
user_id: number;
|
|
262
294
|
};
|
|
263
|
-
submitted_at: Date;
|
|
264
|
-
}, {
|
|
265
295
|
post_id: number;
|
|
266
296
|
post_slug: string;
|
|
267
297
|
post_title: string;
|
|
298
|
+
submitted_at: Date;
|
|
299
|
+
}, {
|
|
268
300
|
recipient: {
|
|
269
301
|
username: string;
|
|
270
302
|
email: string;
|
|
@@ -272,23 +304,159 @@ export declare const StaffPostSubmittedSchema: z.ZodObject<{
|
|
|
272
304
|
last_name: string;
|
|
273
305
|
user_id: number;
|
|
274
306
|
};
|
|
307
|
+
post_id: number;
|
|
308
|
+
post_slug: string;
|
|
309
|
+
post_title: string;
|
|
275
310
|
submitted_at: Date;
|
|
276
311
|
}>;
|
|
277
312
|
export type StaffPostSubmitted = z.infer<typeof StaffPostSubmittedSchema>;
|
|
278
313
|
export declare const TwoFactorOtpRequestedSchema: z.ZodObject<{
|
|
279
314
|
email: z.ZodString;
|
|
280
315
|
otp: z.ZodString;
|
|
316
|
+
recipient: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
email: z.ZodString;
|
|
318
|
+
first_name: z.ZodString;
|
|
319
|
+
last_name: z.ZodString;
|
|
320
|
+
user_id: z.ZodNumber;
|
|
321
|
+
username: z.ZodString;
|
|
322
|
+
}, "strip", z.ZodTypeAny, {
|
|
323
|
+
username: string;
|
|
324
|
+
email: string;
|
|
325
|
+
first_name: string;
|
|
326
|
+
last_name: string;
|
|
327
|
+
user_id: number;
|
|
328
|
+
}, {
|
|
329
|
+
username: string;
|
|
330
|
+
email: string;
|
|
331
|
+
first_name: string;
|
|
332
|
+
last_name: string;
|
|
333
|
+
user_id: number;
|
|
334
|
+
}>>;
|
|
281
335
|
sent_at: z.ZodDate;
|
|
282
336
|
}, "strip", z.ZodTypeAny, {
|
|
283
337
|
email: string;
|
|
284
338
|
sent_at: Date;
|
|
285
339
|
otp: string;
|
|
340
|
+
recipient?: {
|
|
341
|
+
username: string;
|
|
342
|
+
email: string;
|
|
343
|
+
first_name: string;
|
|
344
|
+
last_name: string;
|
|
345
|
+
user_id: number;
|
|
346
|
+
} | undefined;
|
|
286
347
|
}, {
|
|
287
348
|
email: string;
|
|
288
349
|
sent_at: Date;
|
|
289
350
|
otp: string;
|
|
351
|
+
recipient?: {
|
|
352
|
+
username: string;
|
|
353
|
+
email: string;
|
|
354
|
+
first_name: string;
|
|
355
|
+
last_name: string;
|
|
356
|
+
user_id: number;
|
|
357
|
+
} | undefined;
|
|
290
358
|
}>;
|
|
291
359
|
export type TwoFactorOtpRequested = z.infer<typeof TwoFactorOtpRequestedSchema>;
|
|
360
|
+
export declare const UserBannedSchema: z.ZodObject<{
|
|
361
|
+
ban_duration_days: z.ZodOptional<z.ZodNumber>;
|
|
362
|
+
ban_type: z.ZodEnum<["permanent", "temporary"]>;
|
|
363
|
+
banned_at: z.ZodDate;
|
|
364
|
+
banned_until: z.ZodOptional<z.ZodDate>;
|
|
365
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
366
|
+
user: z.ZodObject<{
|
|
367
|
+
email: z.ZodString;
|
|
368
|
+
first_name: z.ZodString;
|
|
369
|
+
last_name: z.ZodString;
|
|
370
|
+
user_id: z.ZodNumber;
|
|
371
|
+
username: z.ZodString;
|
|
372
|
+
}, "strip", z.ZodTypeAny, {
|
|
373
|
+
username: string;
|
|
374
|
+
email: string;
|
|
375
|
+
first_name: string;
|
|
376
|
+
last_name: string;
|
|
377
|
+
user_id: number;
|
|
378
|
+
}, {
|
|
379
|
+
username: string;
|
|
380
|
+
email: string;
|
|
381
|
+
first_name: string;
|
|
382
|
+
last_name: string;
|
|
383
|
+
user_id: number;
|
|
384
|
+
}>;
|
|
385
|
+
}, "strip", z.ZodTypeAny, {
|
|
386
|
+
user: {
|
|
387
|
+
username: string;
|
|
388
|
+
email: string;
|
|
389
|
+
first_name: string;
|
|
390
|
+
last_name: string;
|
|
391
|
+
user_id: number;
|
|
392
|
+
};
|
|
393
|
+
ban_type: "temporary" | "permanent";
|
|
394
|
+
banned_at: Date;
|
|
395
|
+
reason?: string | undefined;
|
|
396
|
+
ban_duration_days?: number | undefined;
|
|
397
|
+
banned_until?: Date | undefined;
|
|
398
|
+
}, {
|
|
399
|
+
user: {
|
|
400
|
+
username: string;
|
|
401
|
+
email: string;
|
|
402
|
+
first_name: string;
|
|
403
|
+
last_name: string;
|
|
404
|
+
user_id: number;
|
|
405
|
+
};
|
|
406
|
+
ban_type: "temporary" | "permanent";
|
|
407
|
+
banned_at: Date;
|
|
408
|
+
reason?: string | undefined;
|
|
409
|
+
ban_duration_days?: number | undefined;
|
|
410
|
+
banned_until?: Date | undefined;
|
|
411
|
+
}>;
|
|
412
|
+
export type UserBanned = z.infer<typeof UserBannedSchema>;
|
|
413
|
+
export declare const UserUnbannedSchema: z.ZodObject<{
|
|
414
|
+
auto_unbanned: z.ZodBoolean;
|
|
415
|
+
ban_type: z.ZodEnum<["permanent", "temporary"]>;
|
|
416
|
+
unbanned_at: z.ZodDate;
|
|
417
|
+
user: z.ZodObject<{
|
|
418
|
+
email: z.ZodString;
|
|
419
|
+
first_name: z.ZodString;
|
|
420
|
+
last_name: z.ZodString;
|
|
421
|
+
user_id: z.ZodNumber;
|
|
422
|
+
username: z.ZodString;
|
|
423
|
+
}, "strip", z.ZodTypeAny, {
|
|
424
|
+
username: string;
|
|
425
|
+
email: string;
|
|
426
|
+
first_name: string;
|
|
427
|
+
last_name: string;
|
|
428
|
+
user_id: number;
|
|
429
|
+
}, {
|
|
430
|
+
username: string;
|
|
431
|
+
email: string;
|
|
432
|
+
first_name: string;
|
|
433
|
+
last_name: string;
|
|
434
|
+
user_id: number;
|
|
435
|
+
}>;
|
|
436
|
+
}, "strip", z.ZodTypeAny, {
|
|
437
|
+
user: {
|
|
438
|
+
username: string;
|
|
439
|
+
email: string;
|
|
440
|
+
first_name: string;
|
|
441
|
+
last_name: string;
|
|
442
|
+
user_id: number;
|
|
443
|
+
};
|
|
444
|
+
ban_type: "temporary" | "permanent";
|
|
445
|
+
auto_unbanned: boolean;
|
|
446
|
+
unbanned_at: Date;
|
|
447
|
+
}, {
|
|
448
|
+
user: {
|
|
449
|
+
username: string;
|
|
450
|
+
email: string;
|
|
451
|
+
first_name: string;
|
|
452
|
+
last_name: string;
|
|
453
|
+
user_id: number;
|
|
454
|
+
};
|
|
455
|
+
ban_type: "temporary" | "permanent";
|
|
456
|
+
auto_unbanned: boolean;
|
|
457
|
+
unbanned_at: Date;
|
|
458
|
+
}>;
|
|
459
|
+
export type UserUnbanned = z.infer<typeof UserUnbannedSchema>;
|
|
292
460
|
export declare const WriterApplicationAcceptedSchema: z.ZodObject<{
|
|
293
461
|
accepted_at: z.ZodDate;
|
|
294
462
|
application_slug: z.ZodString;
|
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.FeedbackSubmittedSchema = exports.WriterApplicationSubmittedSchema = exports.WriterApplicationRejectedSchema = exports.WriterApplicationAcceptedSchema = exports.TwoFactorOtpRequestedSchema = exports.StaffPostSubmittedSchema = exports.StaffPostRejectedSchema = exports.StaffPostApprovedSchema = exports.SignupLinkRequestedSchema = exports.PasswordResetSchema = exports.NotificationActorSchema = exports.ModerationReportResolvedSchema = exports.UserSchema = exports.NotificationEventTypeSchema = exports.NotificationEntityTypeSchema = exports.EntityTypeSchema = exports.FeedbackCategorySchema = void 0;
|
|
36
|
+
exports.EmailDigestSchema = exports.DigestItemSchema = exports.FeedbackSubmittedSchema = exports.WriterApplicationSubmittedSchema = exports.WriterApplicationRejectedSchema = exports.WriterApplicationAcceptedSchema = exports.UserUnbannedSchema = exports.UserBannedSchema = exports.TwoFactorOtpRequestedSchema = exports.StaffPostSubmittedSchema = exports.StaffPostRejectedSchema = exports.StaffPostApprovedSchema = exports.SignupLinkRequestedSchema = exports.PasswordResetSchema = exports.NotificationActorSchema = exports.ModerationReportResolvedSchema = exports.UserSchema = exports.BanTypeSchema = exports.NotificationEventTypeSchema = exports.NotificationEntityTypeSchema = exports.EntityTypeSchema = exports.FeedbackCategorySchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
38
|
exports.FeedbackCategorySchema = z.enum([
|
|
39
39
|
"bug",
|
|
@@ -60,6 +60,10 @@ exports.NotificationEventTypeSchema = z.enum([
|
|
|
60
60
|
"user_followed",
|
|
61
61
|
"user_mentioned",
|
|
62
62
|
]);
|
|
63
|
+
exports.BanTypeSchema = z.enum([
|
|
64
|
+
"permanent",
|
|
65
|
+
"temporary",
|
|
66
|
+
]);
|
|
63
67
|
exports.UserSchema = z.object({
|
|
64
68
|
"email": z.string(),
|
|
65
69
|
"first_name": z.string(),
|
|
@@ -82,6 +86,7 @@ exports.NotificationActorSchema = z.object({
|
|
|
82
86
|
});
|
|
83
87
|
exports.PasswordResetSchema = z.object({
|
|
84
88
|
"email": z.string(),
|
|
89
|
+
"recipient": exports.UserSchema.optional(),
|
|
85
90
|
"reset_link": z.string(),
|
|
86
91
|
"sent_at": z.coerce.date(),
|
|
87
92
|
});
|
|
@@ -115,8 +120,23 @@ exports.StaffPostSubmittedSchema = z.object({
|
|
|
115
120
|
exports.TwoFactorOtpRequestedSchema = z.object({
|
|
116
121
|
"email": z.string(),
|
|
117
122
|
"otp": z.string(),
|
|
123
|
+
"recipient": exports.UserSchema.optional(),
|
|
118
124
|
"sent_at": z.coerce.date(),
|
|
119
125
|
});
|
|
126
|
+
exports.UserBannedSchema = z.object({
|
|
127
|
+
"ban_duration_days": z.number().optional(),
|
|
128
|
+
"ban_type": exports.BanTypeSchema,
|
|
129
|
+
"banned_at": z.coerce.date(),
|
|
130
|
+
"banned_until": z.coerce.date().optional(),
|
|
131
|
+
"reason": z.string().optional(),
|
|
132
|
+
"user": exports.UserSchema,
|
|
133
|
+
});
|
|
134
|
+
exports.UserUnbannedSchema = z.object({
|
|
135
|
+
"auto_unbanned": z.boolean(),
|
|
136
|
+
"ban_type": exports.BanTypeSchema,
|
|
137
|
+
"unbanned_at": z.coerce.date(),
|
|
138
|
+
"user": exports.UserSchema,
|
|
139
|
+
});
|
|
120
140
|
exports.WriterApplicationAcceptedSchema = z.object({
|
|
121
141
|
"accepted_at": z.coerce.date(),
|
|
122
142
|
"application_slug": z.string(),
|