@sankira-dev/event-types 0.0.3 → 0.0.5-beta.0
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 +83 -19
- package/dist/index.js +32 -15
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
export declare const FeedbackCategorySchema: z.ZodEnum<["bug", "feature_request", "general", "other"]>;
|
|
3
|
+
export type FeedbackCategory = z.infer<typeof FeedbackCategorySchema>;
|
|
2
4
|
export declare const EntityTypeSchema: z.ZodEnum<["comment", "post", "user"]>;
|
|
3
5
|
export type EntityType = z.infer<typeof EntityTypeSchema>;
|
|
4
6
|
export declare const NotificationEntityTypeSchema: z.ZodEnum<["comment", "post", "space", "user"]>;
|
|
5
7
|
export type NotificationEntityType = z.infer<typeof NotificationEntityTypeSchema>;
|
|
6
8
|
export declare const NotificationEventTypeSchema: z.ZodEnum<["comment_replied", "comment_voted", "post_replied", "post_voted", "user_followed", "user_mentioned"]>;
|
|
7
9
|
export type NotificationEventType = z.infer<typeof NotificationEventTypeSchema>;
|
|
8
|
-
export declare const
|
|
10
|
+
export declare const UserSchema: z.ZodObject<{
|
|
9
11
|
email: z.ZodString;
|
|
10
12
|
first_name: z.ZodString;
|
|
11
13
|
last_name: z.ZodString;
|
|
@@ -24,7 +26,57 @@ export declare const EmailRecipientSchema: z.ZodObject<{
|
|
|
24
26
|
last_name: string;
|
|
25
27
|
user_id: number;
|
|
26
28
|
}>;
|
|
27
|
-
export type
|
|
29
|
+
export type User = z.infer<typeof UserSchema>;
|
|
30
|
+
export declare const ModerationReportResolvedSchema: z.ZodObject<{
|
|
31
|
+
action_taken: z.ZodString;
|
|
32
|
+
entity_type: z.ZodEnum<["comment", "post", "user"]>;
|
|
33
|
+
report_id: z.ZodNumber;
|
|
34
|
+
reporter: z.ZodObject<{
|
|
35
|
+
email: z.ZodString;
|
|
36
|
+
first_name: z.ZodString;
|
|
37
|
+
last_name: z.ZodString;
|
|
38
|
+
user_id: z.ZodNumber;
|
|
39
|
+
username: z.ZodString;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
username: string;
|
|
42
|
+
email: string;
|
|
43
|
+
first_name: string;
|
|
44
|
+
last_name: string;
|
|
45
|
+
user_id: number;
|
|
46
|
+
}, {
|
|
47
|
+
username: string;
|
|
48
|
+
email: string;
|
|
49
|
+
first_name: string;
|
|
50
|
+
last_name: string;
|
|
51
|
+
user_id: number;
|
|
52
|
+
}>;
|
|
53
|
+
resolved_at: z.ZodDate;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
action_taken: string;
|
|
56
|
+
entity_type: "user" | "comment" | "post";
|
|
57
|
+
report_id: number;
|
|
58
|
+
reporter: {
|
|
59
|
+
username: string;
|
|
60
|
+
email: string;
|
|
61
|
+
first_name: string;
|
|
62
|
+
last_name: string;
|
|
63
|
+
user_id: number;
|
|
64
|
+
};
|
|
65
|
+
resolved_at: Date;
|
|
66
|
+
}, {
|
|
67
|
+
action_taken: string;
|
|
68
|
+
entity_type: "user" | "comment" | "post";
|
|
69
|
+
report_id: number;
|
|
70
|
+
reporter: {
|
|
71
|
+
username: string;
|
|
72
|
+
email: string;
|
|
73
|
+
first_name: string;
|
|
74
|
+
last_name: string;
|
|
75
|
+
user_id: number;
|
|
76
|
+
};
|
|
77
|
+
resolved_at: Date;
|
|
78
|
+
}>;
|
|
79
|
+
export type ModerationReportResolved = z.infer<typeof ModerationReportResolvedSchema>;
|
|
28
80
|
export declare const NotificationActorSchema: z.ZodObject<{
|
|
29
81
|
full_name: z.ZodString;
|
|
30
82
|
id: z.ZodNumber;
|
|
@@ -372,11 +424,14 @@ export declare const WriterApplicationSubmittedSchema: z.ZodObject<{
|
|
|
372
424
|
application_id: number;
|
|
373
425
|
}>;
|
|
374
426
|
export type WriterApplicationSubmitted = z.infer<typeof WriterApplicationSubmittedSchema>;
|
|
375
|
-
export declare const
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
427
|
+
export declare const FeedbackSubmittedSchema: z.ZodObject<{
|
|
428
|
+
contact_me: z.ZodBoolean;
|
|
429
|
+
feedback_category: z.ZodEnum<["bug", "feature_request", "general", "other"]>;
|
|
430
|
+
message: z.ZodString;
|
|
431
|
+
page_url: z.ZodOptional<z.ZodString>;
|
|
432
|
+
recipient_email: z.ZodString;
|
|
433
|
+
submitted_at: z.ZodDate;
|
|
434
|
+
user: z.ZodObject<{
|
|
380
435
|
email: z.ZodString;
|
|
381
436
|
first_name: z.ZodString;
|
|
382
437
|
last_name: z.ZodString;
|
|
@@ -395,33 +450,39 @@ export declare const ModerationReportResolvedSchema: z.ZodObject<{
|
|
|
395
450
|
last_name: string;
|
|
396
451
|
user_id: number;
|
|
397
452
|
}>;
|
|
398
|
-
|
|
453
|
+
user_profile_url: z.ZodString;
|
|
399
454
|
}, "strip", z.ZodTypeAny, {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
report_id: number;
|
|
403
|
-
reporter: {
|
|
455
|
+
message: string;
|
|
456
|
+
user: {
|
|
404
457
|
username: string;
|
|
405
458
|
email: string;
|
|
406
459
|
first_name: string;
|
|
407
460
|
last_name: string;
|
|
408
461
|
user_id: number;
|
|
409
462
|
};
|
|
410
|
-
|
|
463
|
+
submitted_at: Date;
|
|
464
|
+
contact_me: boolean;
|
|
465
|
+
feedback_category: "other" | "bug" | "feature_request" | "general";
|
|
466
|
+
recipient_email: string;
|
|
467
|
+
user_profile_url: string;
|
|
468
|
+
page_url?: string | undefined;
|
|
411
469
|
}, {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
report_id: number;
|
|
415
|
-
reporter: {
|
|
470
|
+
message: string;
|
|
471
|
+
user: {
|
|
416
472
|
username: string;
|
|
417
473
|
email: string;
|
|
418
474
|
first_name: string;
|
|
419
475
|
last_name: string;
|
|
420
476
|
user_id: number;
|
|
421
477
|
};
|
|
422
|
-
|
|
478
|
+
submitted_at: Date;
|
|
479
|
+
contact_me: boolean;
|
|
480
|
+
feedback_category: "other" | "bug" | "feature_request" | "general";
|
|
481
|
+
recipient_email: string;
|
|
482
|
+
user_profile_url: string;
|
|
483
|
+
page_url?: string | undefined;
|
|
423
484
|
}>;
|
|
424
|
-
export type
|
|
485
|
+
export type FeedbackSubmitted = z.infer<typeof FeedbackSubmittedSchema>;
|
|
425
486
|
export declare const DigestItemSchema: z.ZodObject<{
|
|
426
487
|
actors: z.ZodArray<z.ZodObject<{
|
|
427
488
|
full_name: z.ZodString;
|
|
@@ -525,6 +586,7 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
525
586
|
event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
|
|
526
587
|
last_activity: Date;
|
|
527
588
|
}>, "many">;
|
|
589
|
+
omitted_item_count: z.ZodNumber;
|
|
528
590
|
recipient: z.ZodObject<{
|
|
529
591
|
email: z.ZodString;
|
|
530
592
|
first_name: z.ZodString;
|
|
@@ -567,6 +629,7 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
567
629
|
last_name: string;
|
|
568
630
|
user_id: number;
|
|
569
631
|
};
|
|
632
|
+
omitted_item_count: number;
|
|
570
633
|
}, {
|
|
571
634
|
date: Date;
|
|
572
635
|
items: {
|
|
@@ -590,5 +653,6 @@ export declare const EmailDigestSchema: z.ZodObject<{
|
|
|
590
653
|
last_name: string;
|
|
591
654
|
user_id: number;
|
|
592
655
|
};
|
|
656
|
+
omitted_item_count: number;
|
|
593
657
|
}>;
|
|
594
658
|
export type EmailDigest = z.infer<typeof EmailDigestSchema>;
|
package/dist/index.js
CHANGED
|
@@ -33,8 +33,14 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.EmailDigestSchema = exports.DigestItemSchema = exports.
|
|
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;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
|
+
exports.FeedbackCategorySchema = z.enum([
|
|
39
|
+
"bug",
|
|
40
|
+
"feature_request",
|
|
41
|
+
"general",
|
|
42
|
+
"other",
|
|
43
|
+
]);
|
|
38
44
|
exports.EntityTypeSchema = z.enum([
|
|
39
45
|
"comment",
|
|
40
46
|
"post",
|
|
@@ -54,13 +60,20 @@ exports.NotificationEventTypeSchema = z.enum([
|
|
|
54
60
|
"user_followed",
|
|
55
61
|
"user_mentioned",
|
|
56
62
|
]);
|
|
57
|
-
exports.
|
|
63
|
+
exports.UserSchema = z.object({
|
|
58
64
|
"email": z.string(),
|
|
59
65
|
"first_name": z.string(),
|
|
60
66
|
"last_name": z.string(),
|
|
61
67
|
"user_id": z.number(),
|
|
62
68
|
"username": z.string(),
|
|
63
69
|
});
|
|
70
|
+
exports.ModerationReportResolvedSchema = z.object({
|
|
71
|
+
"action_taken": z.string(),
|
|
72
|
+
"entity_type": exports.EntityTypeSchema,
|
|
73
|
+
"report_id": z.number(),
|
|
74
|
+
"reporter": exports.UserSchema,
|
|
75
|
+
"resolved_at": z.coerce.date(),
|
|
76
|
+
});
|
|
64
77
|
exports.NotificationActorSchema = z.object({
|
|
65
78
|
"full_name": z.string(),
|
|
66
79
|
"id": z.number(),
|
|
@@ -82,13 +95,13 @@ exports.StaffPostApprovedSchema = z.object({
|
|
|
82
95
|
"post_id": z.number(),
|
|
83
96
|
"post_slug": z.string(),
|
|
84
97
|
"post_title": z.string(),
|
|
85
|
-
"recipient": exports.
|
|
98
|
+
"recipient": exports.UserSchema,
|
|
86
99
|
});
|
|
87
100
|
exports.StaffPostRejectedSchema = z.object({
|
|
88
101
|
"post_id": z.number(),
|
|
89
102
|
"post_slug": z.string(),
|
|
90
103
|
"post_title": z.string(),
|
|
91
|
-
"recipient": exports.
|
|
104
|
+
"recipient": exports.UserSchema,
|
|
92
105
|
"rejected_at": z.coerce.date(),
|
|
93
106
|
"rejection_reason": z.string(),
|
|
94
107
|
});
|
|
@@ -96,7 +109,7 @@ exports.StaffPostSubmittedSchema = z.object({
|
|
|
96
109
|
"post_id": z.number(),
|
|
97
110
|
"post_slug": z.string(),
|
|
98
111
|
"post_title": z.string(),
|
|
99
|
-
"recipient": exports.
|
|
112
|
+
"recipient": exports.UserSchema,
|
|
100
113
|
"submitted_at": z.coerce.date(),
|
|
101
114
|
});
|
|
102
115
|
exports.TwoFactorOtpRequestedSchema = z.object({
|
|
@@ -107,25 +120,28 @@ exports.TwoFactorOtpRequestedSchema = z.object({
|
|
|
107
120
|
exports.WriterApplicationAcceptedSchema = z.object({
|
|
108
121
|
"accepted_at": z.coerce.date(),
|
|
109
122
|
"application_slug": z.string(),
|
|
110
|
-
"recipient": exports.
|
|
123
|
+
"recipient": exports.UserSchema,
|
|
111
124
|
});
|
|
112
125
|
exports.WriterApplicationRejectedSchema = z.object({
|
|
113
126
|
"application_slug": z.string(),
|
|
114
|
-
"recipient": exports.
|
|
127
|
+
"recipient": exports.UserSchema,
|
|
115
128
|
"rejected_at": z.coerce.date(),
|
|
116
129
|
"rejection_reason": z.union([z.null(), z.string()]).optional(),
|
|
117
130
|
});
|
|
118
131
|
exports.WriterApplicationSubmittedSchema = z.object({
|
|
119
132
|
"application_id": z.number(),
|
|
120
|
-
"recipient": exports.
|
|
133
|
+
"recipient": exports.UserSchema,
|
|
121
134
|
"submitted_at": z.coerce.date(),
|
|
122
135
|
});
|
|
123
|
-
exports.
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
136
|
+
exports.FeedbackSubmittedSchema = z.object({
|
|
137
|
+
"contact_me": z.boolean(),
|
|
138
|
+
"feedback_category": exports.FeedbackCategorySchema,
|
|
139
|
+
"message": z.string(),
|
|
140
|
+
"page_url": z.string().optional(),
|
|
141
|
+
"recipient_email": z.string(),
|
|
142
|
+
"submitted_at": z.coerce.date(),
|
|
143
|
+
"user": exports.UserSchema,
|
|
144
|
+
"user_profile_url": z.string(),
|
|
129
145
|
});
|
|
130
146
|
exports.DigestItemSchema = z.object({
|
|
131
147
|
"actors": z.array(exports.NotificationActorSchema),
|
|
@@ -139,5 +155,6 @@ exports.DigestItemSchema = z.object({
|
|
|
139
155
|
exports.EmailDigestSchema = z.object({
|
|
140
156
|
"date": z.coerce.date(),
|
|
141
157
|
"items": z.array(exports.DigestItemSchema),
|
|
142
|
-
"
|
|
158
|
+
"omitted_item_count": z.number(),
|
|
159
|
+
"recipient": exports.UserSchema,
|
|
143
160
|
});
|