rategame-shared 1.1.218 → 1.1.220

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
@@ -6,6 +6,7 @@ export * from "./schemas/notification";
6
6
  export * from "./schemas/chat";
7
7
  export * from "./schemas/feedback";
8
8
  export * from "./schemas/list";
9
+ export * from "./schemas/moderation";
9
10
  export * from "./models/user";
10
11
  export * from "./models/rating";
11
12
  export * from "./models/game";
@@ -14,4 +15,5 @@ export * from "./models/notification";
14
15
  export * from "./models/chat";
15
16
  export * from "./models/feedback";
16
17
  export * from "./models/list";
18
+ export * from "./models/moderation";
17
19
  export * from "./helpers/index";
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ __exportStar(require("./schemas/notification"), exports);
22
22
  __exportStar(require("./schemas/chat"), exports);
23
23
  __exportStar(require("./schemas/feedback"), exports);
24
24
  __exportStar(require("./schemas/list"), exports);
25
+ __exportStar(require("./schemas/moderation"), exports);
25
26
  __exportStar(require("./models/user"), exports);
26
27
  __exportStar(require("./models/rating"), exports);
27
28
  __exportStar(require("./models/game"), exports);
@@ -30,4 +31,5 @@ __exportStar(require("./models/notification"), exports);
30
31
  __exportStar(require("./models/chat"), exports);
31
32
  __exportStar(require("./models/feedback"), exports);
32
33
  __exportStar(require("./models/list"), exports);
34
+ __exportStar(require("./models/moderation"), exports);
33
35
  __exportStar(require("./helpers/index"), exports);
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ import { banUserSchema, unbanUserSchema, searchBannedUsersSchema, banInfoSchema, moderationUserStatsSchema, bannedUserSchema, bannedUsersResponseSchema, banActionResponseSchema, banStatusResponseSchema } from "../schemas/moderation";
3
+ export type BanUser = z.infer<typeof banUserSchema>;
4
+ export type UnbanUser = z.infer<typeof unbanUserSchema>;
5
+ export type SearchBannedUsers = z.infer<typeof searchBannedUsersSchema>;
6
+ export type BanInfo = z.infer<typeof banInfoSchema>;
7
+ export type ModerationUserStats = z.infer<typeof moderationUserStatsSchema>;
8
+ export type BannedUser = z.infer<typeof bannedUserSchema>;
9
+ export type BannedUsersResponse = z.infer<typeof bannedUsersResponseSchema>;
10
+ export type BanActionResponse = z.infer<typeof banActionResponseSchema>;
11
+ export type BanStatusResponse = z.infer<typeof banStatusResponseSchema>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,294 @@
1
+ import { z } from "zod";
2
+ export declare const banUserSchema: z.ZodObject<{
3
+ userId: z.ZodString;
4
+ reason: z.ZodString;
5
+ details: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ reason: string;
8
+ userId: string;
9
+ details?: string | undefined;
10
+ }, {
11
+ reason: string;
12
+ userId: string;
13
+ details?: string | undefined;
14
+ }>;
15
+ export declare const unbanUserSchema: z.ZodObject<{
16
+ userId: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ userId: string;
19
+ }, {
20
+ userId: string;
21
+ }>;
22
+ export declare const searchBannedUsersSchema: z.ZodObject<{
23
+ query: z.ZodOptional<z.ZodString>;
24
+ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
25
+ offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ offset: number;
28
+ limit: number;
29
+ query?: string | undefined;
30
+ }, {
31
+ offset?: number | undefined;
32
+ limit?: number | undefined;
33
+ query?: string | undefined;
34
+ }>;
35
+ export declare const banInfoSchema: z.ZodObject<{
36
+ bannedAt: z.ZodDate;
37
+ bannedBy: z.ZodString;
38
+ reason: z.ZodString;
39
+ details: z.ZodOptional<z.ZodString>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ reason: string;
42
+ bannedAt: Date;
43
+ bannedBy: string;
44
+ details?: string | undefined;
45
+ }, {
46
+ reason: string;
47
+ bannedAt: Date;
48
+ bannedBy: string;
49
+ details?: string | undefined;
50
+ }>;
51
+ export declare const moderationUserStatsSchema: z.ZodObject<{
52
+ followersCount: z.ZodDefault<z.ZodNumber>;
53
+ ratingsCount: z.ZodDefault<z.ZodNumber>;
54
+ topPercentage: z.ZodOptional<z.ZodNumber>;
55
+ }, "strip", z.ZodTypeAny, {
56
+ followersCount: number;
57
+ ratingsCount: number;
58
+ topPercentage?: number | undefined;
59
+ }, {
60
+ followersCount?: number | undefined;
61
+ ratingsCount?: number | undefined;
62
+ topPercentage?: number | undefined;
63
+ }>;
64
+ export declare const bannedUserSchema: z.ZodObject<{
65
+ id: z.ZodString;
66
+ username: z.ZodString;
67
+ email: z.ZodString;
68
+ avatarUrl: z.ZodOptional<z.ZodString>;
69
+ badge: z.ZodOptional<z.ZodString>;
70
+ banInfo: z.ZodObject<{
71
+ bannedAt: z.ZodDate;
72
+ bannedBy: z.ZodString;
73
+ reason: z.ZodString;
74
+ details: z.ZodOptional<z.ZodString>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ reason: string;
77
+ bannedAt: Date;
78
+ bannedBy: string;
79
+ details?: string | undefined;
80
+ }, {
81
+ reason: string;
82
+ bannedAt: Date;
83
+ bannedBy: string;
84
+ details?: string | undefined;
85
+ }>;
86
+ stats: z.ZodObject<{
87
+ followersCount: z.ZodDefault<z.ZodNumber>;
88
+ ratingsCount: z.ZodDefault<z.ZodNumber>;
89
+ topPercentage: z.ZodOptional<z.ZodNumber>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ followersCount: number;
92
+ ratingsCount: number;
93
+ topPercentage?: number | undefined;
94
+ }, {
95
+ followersCount?: number | undefined;
96
+ ratingsCount?: number | undefined;
97
+ topPercentage?: number | undefined;
98
+ }>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ id: string;
101
+ email: string;
102
+ username: string;
103
+ banInfo: {
104
+ reason: string;
105
+ bannedAt: Date;
106
+ bannedBy: string;
107
+ details?: string | undefined;
108
+ };
109
+ stats: {
110
+ followersCount: number;
111
+ ratingsCount: number;
112
+ topPercentage?: number | undefined;
113
+ };
114
+ avatarUrl?: string | undefined;
115
+ badge?: string | undefined;
116
+ }, {
117
+ id: string;
118
+ email: string;
119
+ username: string;
120
+ banInfo: {
121
+ reason: string;
122
+ bannedAt: Date;
123
+ bannedBy: string;
124
+ details?: string | undefined;
125
+ };
126
+ stats: {
127
+ followersCount?: number | undefined;
128
+ ratingsCount?: number | undefined;
129
+ topPercentage?: number | undefined;
130
+ };
131
+ avatarUrl?: string | undefined;
132
+ badge?: string | undefined;
133
+ }>;
134
+ export declare const bannedUsersResponseSchema: z.ZodObject<{
135
+ users: z.ZodArray<z.ZodObject<{
136
+ id: z.ZodString;
137
+ username: z.ZodString;
138
+ email: z.ZodString;
139
+ avatarUrl: z.ZodOptional<z.ZodString>;
140
+ badge: z.ZodOptional<z.ZodString>;
141
+ banInfo: z.ZodObject<{
142
+ bannedAt: z.ZodDate;
143
+ bannedBy: z.ZodString;
144
+ reason: z.ZodString;
145
+ details: z.ZodOptional<z.ZodString>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ reason: string;
148
+ bannedAt: Date;
149
+ bannedBy: string;
150
+ details?: string | undefined;
151
+ }, {
152
+ reason: string;
153
+ bannedAt: Date;
154
+ bannedBy: string;
155
+ details?: string | undefined;
156
+ }>;
157
+ stats: z.ZodObject<{
158
+ followersCount: z.ZodDefault<z.ZodNumber>;
159
+ ratingsCount: z.ZodDefault<z.ZodNumber>;
160
+ topPercentage: z.ZodOptional<z.ZodNumber>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ followersCount: number;
163
+ ratingsCount: number;
164
+ topPercentage?: number | undefined;
165
+ }, {
166
+ followersCount?: number | undefined;
167
+ ratingsCount?: number | undefined;
168
+ topPercentage?: number | undefined;
169
+ }>;
170
+ }, "strip", z.ZodTypeAny, {
171
+ id: string;
172
+ email: string;
173
+ username: string;
174
+ banInfo: {
175
+ reason: string;
176
+ bannedAt: Date;
177
+ bannedBy: string;
178
+ details?: string | undefined;
179
+ };
180
+ stats: {
181
+ followersCount: number;
182
+ ratingsCount: number;
183
+ topPercentage?: number | undefined;
184
+ };
185
+ avatarUrl?: string | undefined;
186
+ badge?: string | undefined;
187
+ }, {
188
+ id: string;
189
+ email: string;
190
+ username: string;
191
+ banInfo: {
192
+ reason: string;
193
+ bannedAt: Date;
194
+ bannedBy: string;
195
+ details?: string | undefined;
196
+ };
197
+ stats: {
198
+ followersCount?: number | undefined;
199
+ ratingsCount?: number | undefined;
200
+ topPercentage?: number | undefined;
201
+ };
202
+ avatarUrl?: string | undefined;
203
+ badge?: string | undefined;
204
+ }>, "many">;
205
+ total: z.ZodNumber;
206
+ hasMore: z.ZodBoolean;
207
+ }, "strip", z.ZodTypeAny, {
208
+ total: number;
209
+ users: {
210
+ id: string;
211
+ email: string;
212
+ username: string;
213
+ banInfo: {
214
+ reason: string;
215
+ bannedAt: Date;
216
+ bannedBy: string;
217
+ details?: string | undefined;
218
+ };
219
+ stats: {
220
+ followersCount: number;
221
+ ratingsCount: number;
222
+ topPercentage?: number | undefined;
223
+ };
224
+ avatarUrl?: string | undefined;
225
+ badge?: string | undefined;
226
+ }[];
227
+ hasMore: boolean;
228
+ }, {
229
+ total: number;
230
+ users: {
231
+ id: string;
232
+ email: string;
233
+ username: string;
234
+ banInfo: {
235
+ reason: string;
236
+ bannedAt: Date;
237
+ bannedBy: string;
238
+ details?: string | undefined;
239
+ };
240
+ stats: {
241
+ followersCount?: number | undefined;
242
+ ratingsCount?: number | undefined;
243
+ topPercentage?: number | undefined;
244
+ };
245
+ avatarUrl?: string | undefined;
246
+ badge?: string | undefined;
247
+ }[];
248
+ hasMore: boolean;
249
+ }>;
250
+ export declare const banActionResponseSchema: z.ZodObject<{
251
+ success: z.ZodBoolean;
252
+ message: z.ZodString;
253
+ }, "strip", z.ZodTypeAny, {
254
+ message: string;
255
+ success: boolean;
256
+ }, {
257
+ message: string;
258
+ success: boolean;
259
+ }>;
260
+ export declare const banStatusResponseSchema: z.ZodObject<{
261
+ isBanned: z.ZodBoolean;
262
+ banInfo: z.ZodOptional<z.ZodObject<{
263
+ bannedAt: z.ZodDate;
264
+ bannedBy: z.ZodString;
265
+ reason: z.ZodString;
266
+ details: z.ZodOptional<z.ZodString>;
267
+ }, "strip", z.ZodTypeAny, {
268
+ reason: string;
269
+ bannedAt: Date;
270
+ bannedBy: string;
271
+ details?: string | undefined;
272
+ }, {
273
+ reason: string;
274
+ bannedAt: Date;
275
+ bannedBy: string;
276
+ details?: string | undefined;
277
+ }>>;
278
+ }, "strip", z.ZodTypeAny, {
279
+ isBanned: boolean;
280
+ banInfo?: {
281
+ reason: string;
282
+ bannedAt: Date;
283
+ bannedBy: string;
284
+ details?: string | undefined;
285
+ } | undefined;
286
+ }, {
287
+ isBanned: boolean;
288
+ banInfo?: {
289
+ reason: string;
290
+ bannedAt: Date;
291
+ bannedBy: string;
292
+ details?: string | undefined;
293
+ } | undefined;
294
+ }>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.banStatusResponseSchema = exports.banActionResponseSchema = exports.bannedUsersResponseSchema = exports.bannedUserSchema = exports.moderationUserStatsSchema = exports.banInfoSchema = exports.searchBannedUsersSchema = exports.unbanUserSchema = exports.banUserSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ // Ban User Schema
6
+ exports.banUserSchema = zod_1.z.object({
7
+ userId: zod_1.z.string().min(1, { message: "User ID is required" }),
8
+ reason: zod_1.z
9
+ .string()
10
+ .min(5, { message: "Ban reason must be at least 5 characters long" }),
11
+ details: zod_1.z.string().optional(),
12
+ });
13
+ // Unban User Schema
14
+ exports.unbanUserSchema = zod_1.z.object({
15
+ userId: zod_1.z.string().min(1, { message: "User ID is required" }),
16
+ });
17
+ // Search Banned Users Schema
18
+ exports.searchBannedUsersSchema = zod_1.z.object({
19
+ query: zod_1.z.string().optional(),
20
+ limit: zod_1.z.number().min(1).max(100).optional().default(20),
21
+ offset: zod_1.z.number().min(0).optional().default(0),
22
+ });
23
+ // Ban Info Schema
24
+ exports.banInfoSchema = zod_1.z.object({
25
+ bannedAt: zod_1.z.date(),
26
+ bannedBy: zod_1.z.string(),
27
+ reason: zod_1.z.string(),
28
+ details: zod_1.z.string().optional(),
29
+ });
30
+ // User Stats Schema for moderation
31
+ exports.moderationUserStatsSchema = zod_1.z.object({
32
+ followersCount: zod_1.z.number().default(0),
33
+ ratingsCount: zod_1.z.number().default(0),
34
+ topPercentage: zod_1.z.number().optional(),
35
+ });
36
+ // Banned User Schema
37
+ exports.bannedUserSchema = zod_1.z.object({
38
+ id: zod_1.z.string(),
39
+ username: zod_1.z.string(),
40
+ email: zod_1.z.string(),
41
+ avatarUrl: zod_1.z.string().optional(),
42
+ badge: zod_1.z.string().optional(),
43
+ banInfo: exports.banInfoSchema,
44
+ stats: exports.moderationUserStatsSchema,
45
+ });
46
+ // Banned Users Response Schema
47
+ exports.bannedUsersResponseSchema = zod_1.z.object({
48
+ users: zod_1.z.array(exports.bannedUserSchema),
49
+ total: zod_1.z.number(),
50
+ hasMore: zod_1.z.boolean(),
51
+ });
52
+ // Ban/Unban Response Schema
53
+ exports.banActionResponseSchema = zod_1.z.object({
54
+ success: zod_1.z.boolean(),
55
+ message: zod_1.z.string(),
56
+ });
57
+ // Check Ban Status Response Schema
58
+ exports.banStatusResponseSchema = zod_1.z.object({
59
+ isBanned: zod_1.z.boolean(),
60
+ banInfo: exports.banInfoSchema.optional(),
61
+ });
@@ -855,6 +855,7 @@ export declare const createRatingSchema: import("zod").ZodObject<import("zod").o
855
855
  seasonType?: number | undefined;
856
856
  }>;
857
857
  id: import("zod").ZodOptional<import("zod").ZodString>;
858
+ category: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodLiteral<"watched">, import("zod").ZodLiteral<"attended">, import("zod").ZodLiteral<"highlights">]>, import("zod").ZodLiteral<"">]>>>;
858
859
  }>, "strip", import("zod").ZodTypeAny, {
859
860
  rating: number;
860
861
  game: {
@@ -879,7 +880,7 @@ export declare const createRatingSchema: import("zod").ZodObject<import("zod").o
879
880
  weight?: number | undefined;
880
881
  fanCategory?: "homeTeam" | "awayTeam" | "winningTeam" | "losingTeam" | "neutral" | undefined;
881
882
  edited?: boolean | undefined;
882
- category?: "watched" | "attended" | "highlights" | undefined;
883
+ category?: "" | "watched" | "attended" | "highlights" | null | undefined;
883
884
  }, {
884
885
  rating: number;
885
886
  game: {
@@ -904,7 +905,7 @@ export declare const createRatingSchema: import("zod").ZodObject<import("zod").o
904
905
  weight?: number | undefined;
905
906
  fanCategory?: "homeTeam" | "awayTeam" | "winningTeam" | "losingTeam" | "neutral" | undefined;
906
907
  edited?: boolean | undefined;
907
- category?: "watched" | "attended" | "highlights" | undefined;
908
+ category?: "" | "watched" | "attended" | "highlights" | null | undefined;
908
909
  }>;
909
910
  export declare const threadCommentSchema: import("zod").ZodObject<{
910
911
  id: import("zod").ZodString;
@@ -109,6 +109,9 @@ exports.createRatingSchema = exports.ratingSchema
109
109
  roundName: true,
110
110
  }),
111
111
  id: (0, zod_1.string)().optional(),
112
+ category: (0, zod_1.union)([exports.ratingCategorySchema, (0, zod_1.literal)("")])
113
+ .nullable()
114
+ .optional(),
112
115
  });
113
116
  exports.threadCommentSchema = (0, zod_1.object)({
114
117
  id: (0, zod_1.string)(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rategame-shared",
3
- "version": "1.1.218",
3
+ "version": "1.1.220",
4
4
  "description": "This package contains shared resources for the Rate Game project.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",