@sankira-dev/event-types 0.0.1 → 0.0.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 CHANGED
@@ -1,8 +1,39 @@
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 ModerationReportResolvedSchema: z.ZodObject<{
9
+ action_taken: z.ZodString;
10
+ entity_type: z.ZodEnum<["comment", "post", "user"]>;
11
+ report_id: z.ZodNumber;
12
+ reporter_email: z.ZodString;
13
+ reporter_first_name: z.ZodString;
14
+ reporter_last_name: z.ZodString;
15
+ reporter_user_id: z.ZodNumber;
16
+ resolved_at: z.ZodDate;
17
+ }, "strip", z.ZodTypeAny, {
18
+ action_taken: string;
19
+ entity_type: "user" | "comment" | "post";
20
+ report_id: number;
21
+ reporter_email: string;
22
+ reporter_first_name: string;
23
+ reporter_last_name: string;
24
+ reporter_user_id: number;
25
+ resolved_at: Date;
26
+ }, {
27
+ action_taken: string;
28
+ entity_type: "user" | "comment" | "post";
29
+ report_id: number;
30
+ reporter_email: string;
31
+ reporter_first_name: string;
32
+ reporter_last_name: string;
33
+ reporter_user_id: number;
34
+ resolved_at: Date;
35
+ }>;
36
+ export type ModerationReportResolved = z.infer<typeof ModerationReportResolvedSchema>;
6
37
  export declare const NotificationActorSchema: z.ZodObject<{
7
38
  full_name: z.ZodString;
8
39
  id: z.ZodNumber;
@@ -106,6 +137,7 @@ export declare const DigestItemSchema: z.ZodObject<{
106
137
  event_type: z.ZodEnum<["comment_replied", "comment_voted", "post_replied", "post_voted", "user_followed", "user_mentioned"]>;
107
138
  last_activity: z.ZodDate;
108
139
  }, "strip", z.ZodTypeAny, {
140
+ entity_type: "user" | "comment" | "post" | "space";
109
141
  actors: {
110
142
  id: number;
111
143
  username: string;
@@ -115,10 +147,10 @@ export declare const DigestItemSchema: z.ZodObject<{
115
147
  count: number;
116
148
  entity_id: number;
117
149
  entity_slug: string;
118
- entity_type: "user" | "comment" | "post" | "space";
119
150
  event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
120
151
  last_activity: Date;
121
152
  }, {
153
+ entity_type: "user" | "comment" | "post" | "space";
122
154
  actors: {
123
155
  id: number;
124
156
  username: string;
@@ -128,7 +160,6 @@ export declare const DigestItemSchema: z.ZodObject<{
128
160
  count: number;
129
161
  entity_id: number;
130
162
  entity_slug: string;
131
- entity_type: "user" | "comment" | "post" | "space";
132
163
  event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
133
164
  last_activity: Date;
134
165
  }>;
@@ -161,6 +192,7 @@ export declare const EmailDigestSchema: z.ZodObject<{
161
192
  event_type: z.ZodEnum<["comment_replied", "comment_voted", "post_replied", "post_voted", "user_followed", "user_mentioned"]>;
162
193
  last_activity: z.ZodDate;
163
194
  }, "strip", z.ZodTypeAny, {
195
+ entity_type: "user" | "comment" | "post" | "space";
164
196
  actors: {
165
197
  id: number;
166
198
  username: string;
@@ -170,10 +202,10 @@ export declare const EmailDigestSchema: z.ZodObject<{
170
202
  count: number;
171
203
  entity_id: number;
172
204
  entity_slug: string;
173
- entity_type: "user" | "comment" | "post" | "space";
174
205
  event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
175
206
  last_activity: Date;
176
207
  }, {
208
+ entity_type: "user" | "comment" | "post" | "space";
177
209
  actors: {
178
210
  id: number;
179
211
  username: string;
@@ -183,7 +215,6 @@ export declare const EmailDigestSchema: z.ZodObject<{
183
215
  count: number;
184
216
  entity_id: number;
185
217
  entity_slug: string;
186
- entity_type: "user" | "comment" | "post" | "space";
187
218
  event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
188
219
  last_activity: Date;
189
220
  }>, "many">;
@@ -193,6 +224,7 @@ export declare const EmailDigestSchema: z.ZodObject<{
193
224
  email: string;
194
225
  date: Date;
195
226
  items: {
227
+ entity_type: "user" | "comment" | "post" | "space";
196
228
  actors: {
197
229
  id: number;
198
230
  username: string;
@@ -202,7 +234,6 @@ export declare const EmailDigestSchema: z.ZodObject<{
202
234
  count: number;
203
235
  entity_id: number;
204
236
  entity_slug: string;
205
- entity_type: "user" | "comment" | "post" | "space";
206
237
  event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
207
238
  last_activity: Date;
208
239
  }[];
@@ -213,6 +244,7 @@ export declare const EmailDigestSchema: z.ZodObject<{
213
244
  email: string;
214
245
  date: Date;
215
246
  items: {
247
+ entity_type: "user" | "comment" | "post" | "space";
216
248
  actors: {
217
249
  id: number;
218
250
  username: string;
@@ -222,7 +254,6 @@ export declare const EmailDigestSchema: z.ZodObject<{
222
254
  count: number;
223
255
  entity_id: number;
224
256
  entity_slug: string;
225
- entity_type: "user" | "comment" | "post" | "space";
226
257
  event_type: "comment_replied" | "comment_voted" | "post_replied" | "post_voted" | "user_followed" | "user_mentioned";
227
258
  last_activity: Date;
228
259
  }[];
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.WriterApplicationSubmittedSchema = exports.TwoFactorOtpRequestedSchema = exports.SignupLinkRequestedSchema = exports.PasswordResetSchema = exports.NotificationActorSchema = exports.ModerationReportResolvedSchema = 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,16 @@ exports.NotificationEventTypeSchema = z.enum([
49
54
  "user_followed",
50
55
  "user_mentioned",
51
56
  ]);
57
+ exports.ModerationReportResolvedSchema = z.object({
58
+ "action_taken": z.string(),
59
+ "entity_type": exports.EntityTypeSchema,
60
+ "report_id": z.number(),
61
+ "reporter_email": z.string(),
62
+ "reporter_first_name": z.string(),
63
+ "reporter_last_name": z.string(),
64
+ "reporter_user_id": z.number(),
65
+ "resolved_at": z.coerce.date(),
66
+ });
52
67
  exports.NotificationActorSchema = z.object({
53
68
  "full_name": z.string(),
54
69
  "id": z.number(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankira-dev/event-types",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Event Types for Sankira",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",