rategame-shared 1.1.459 → 1.1.461
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/helpers/index.js +33 -0
- package/dist/lib/consoleColors.d.ts +5 -0
- package/dist/lib/consoleColors.js +19 -0
- package/dist/models/user.d.ts +2 -1
- package/dist/schemas/achievementUnlockSource.d.ts +2 -2
- package/dist/schemas/article.d.ts +46 -36
- package/dist/schemas/chat.d.ts +19 -4
- package/dist/schemas/communityGame.d.ts +47 -18
- package/dist/schemas/experience.d.ts +21 -9
- package/dist/schemas/game.d.ts +1518 -727
- package/dist/schemas/game.js +15 -0
- package/dist/schemas/list.d.ts +15 -0
- package/dist/schemas/moderation.d.ts +12 -0
- package/dist/schemas/notification.d.ts +39 -12
- package/dist/schemas/pick.d.ts +4363 -2414
- package/dist/schemas/pick.js +1 -1
- package/dist/schemas/poll.d.ts +1746 -1002
- package/dist/schemas/rating.d.ts +57 -9
- package/dist/schemas/scorePrediction.d.ts +3400 -1927
- package/dist/schemas/stadium.d.ts +43 -3
- package/dist/schemas/team.d.ts +21 -0
- package/dist/schemas/team.js +1 -0
- package/dist/schemas/trivia.d.ts +21 -6
- package/dist/schemas/user.d.ts +17 -0
- package/dist/schemas/user.js +12 -1
- package/dist/schemas/userEvent.d.ts +13 -4
- package/dist/schemas/voting.d.ts +577 -256
- package/package.json +1 -1
package/dist/helpers/index.js
CHANGED
|
@@ -69,6 +69,7 @@ exports.achievementsMap = {
|
|
|
69
69
|
gold: { threshold: 1000 },
|
|
70
70
|
},
|
|
71
71
|
type: "global",
|
|
72
|
+
category: "voting",
|
|
72
73
|
},
|
|
73
74
|
pin_drop: {
|
|
74
75
|
id: "pin_drop",
|
|
@@ -80,18 +81,21 @@ exports.achievementsMap = {
|
|
|
80
81
|
gold: { threshold: 1000 },
|
|
81
82
|
},
|
|
82
83
|
type: "global",
|
|
84
|
+
category: "rating",
|
|
83
85
|
},
|
|
84
86
|
card_complete: {
|
|
85
87
|
id: "card_complete",
|
|
86
88
|
name: "Card Complete",
|
|
87
89
|
description: "Complete every field of your profile card (picture, bio, favorite team, pinned ratings, favorite games, gradient color).",
|
|
88
90
|
type: "global",
|
|
91
|
+
category: "profile",
|
|
89
92
|
},
|
|
90
93
|
pride_of_a_nation: {
|
|
91
94
|
id: "pride_of_a_nation",
|
|
92
95
|
name: "Pride of a Nation",
|
|
93
96
|
description: "Choose your country and rate a game your chosen country played in.",
|
|
94
97
|
type: "global",
|
|
98
|
+
category: "profile",
|
|
95
99
|
},
|
|
96
100
|
speed_rater: {
|
|
97
101
|
id: "speed_rater",
|
|
@@ -103,6 +107,7 @@ exports.achievementsMap = {
|
|
|
103
107
|
gold: { threshold: 50 },
|
|
104
108
|
},
|
|
105
109
|
type: "global",
|
|
110
|
+
category: "rating",
|
|
106
111
|
},
|
|
107
112
|
take_this: {
|
|
108
113
|
id: "take_this",
|
|
@@ -114,6 +119,7 @@ exports.achievementsMap = {
|
|
|
114
119
|
gold: { threshold: 50 },
|
|
115
120
|
},
|
|
116
121
|
type: "global",
|
|
122
|
+
category: "takes",
|
|
117
123
|
},
|
|
118
124
|
front_runner: {
|
|
119
125
|
id: "front_runner",
|
|
@@ -125,6 +131,7 @@ exports.achievementsMap = {
|
|
|
125
131
|
gold: { threshold: 50 },
|
|
126
132
|
},
|
|
127
133
|
type: "global",
|
|
134
|
+
category: "rating",
|
|
128
135
|
},
|
|
129
136
|
loyal_till_the_end: {
|
|
130
137
|
id: "loyal_till_the_end",
|
|
@@ -136,6 +143,7 @@ exports.achievementsMap = {
|
|
|
136
143
|
gold: { threshold: 50 },
|
|
137
144
|
},
|
|
138
145
|
type: "global",
|
|
146
|
+
category: "rating",
|
|
139
147
|
},
|
|
140
148
|
around_the_world: {
|
|
141
149
|
id: "around_the_world",
|
|
@@ -147,12 +155,14 @@ exports.achievementsMap = {
|
|
|
147
155
|
gold: { threshold: 8 },
|
|
148
156
|
},
|
|
149
157
|
type: "global",
|
|
158
|
+
category: "rating",
|
|
150
159
|
},
|
|
151
160
|
superfan: {
|
|
152
161
|
id: "superfan",
|
|
153
162
|
name: "Superfan",
|
|
154
163
|
description: "Rate every game played by your favorite team in a season.",
|
|
155
164
|
type: "global",
|
|
165
|
+
category: "rating",
|
|
156
166
|
},
|
|
157
167
|
ride_or_die: {
|
|
158
168
|
id: "ride_or_die",
|
|
@@ -164,24 +174,28 @@ exports.achievementsMap = {
|
|
|
164
174
|
gold: { threshold: 5 },
|
|
165
175
|
},
|
|
166
176
|
type: "global",
|
|
177
|
+
category: "rating",
|
|
167
178
|
},
|
|
168
179
|
through_thick_n_thin: {
|
|
169
180
|
id: "through_thick_n_thin",
|
|
170
181
|
name: "Through Thick & Thin",
|
|
171
182
|
description: "Rate every game of your favorite team during a losing (sub-.500) season.",
|
|
172
183
|
type: "global",
|
|
184
|
+
category: "rating",
|
|
173
185
|
},
|
|
174
186
|
rookie_rater: {
|
|
175
187
|
id: "rookie_rater",
|
|
176
188
|
name: "Rookie Rater",
|
|
177
189
|
description: "Rate your First Game.",
|
|
178
190
|
type: "global",
|
|
191
|
+
category: "rating",
|
|
179
192
|
},
|
|
180
193
|
"fan-tastic": {
|
|
181
194
|
id: "fan-tastic",
|
|
182
195
|
name: "Fan-Tastic",
|
|
183
196
|
description: "Select your favorite teams in the app\n(at least 3).",
|
|
184
197
|
type: "global",
|
|
198
|
+
category: "profile",
|
|
185
199
|
},
|
|
186
200
|
marathon_fan: {
|
|
187
201
|
id: "marathon_fan",
|
|
@@ -193,6 +207,7 @@ exports.achievementsMap = {
|
|
|
193
207
|
gold: { threshold: 20 },
|
|
194
208
|
},
|
|
195
209
|
type: "global",
|
|
210
|
+
category: "rating",
|
|
196
211
|
},
|
|
197
212
|
new_years_resolution: {
|
|
198
213
|
id: "new_years_resolution",
|
|
@@ -204,6 +219,7 @@ exports.achievementsMap = {
|
|
|
204
219
|
gold: { threshold: 9 },
|
|
205
220
|
},
|
|
206
221
|
type: "global",
|
|
222
|
+
category: "rating",
|
|
207
223
|
},
|
|
208
224
|
dog_days_of_summer: {
|
|
209
225
|
id: "dog_days_of_summer",
|
|
@@ -215,12 +231,14 @@ exports.achievementsMap = {
|
|
|
215
231
|
gold: { threshold: 100 },
|
|
216
232
|
},
|
|
217
233
|
type: "global",
|
|
234
|
+
category: "rating",
|
|
218
235
|
},
|
|
219
236
|
"50_50_club": {
|
|
220
237
|
id: "50_50_club",
|
|
221
238
|
name: "50/50 Club",
|
|
222
239
|
description: "Rate at least 50% of all games in a single season for one league.",
|
|
223
240
|
type: "global",
|
|
241
|
+
category: "rating",
|
|
224
242
|
},
|
|
225
243
|
take_off: {
|
|
226
244
|
id: "take_off",
|
|
@@ -232,6 +250,7 @@ exports.achievementsMap = {
|
|
|
232
250
|
gold: { threshold: 8 },
|
|
233
251
|
},
|
|
234
252
|
type: "global",
|
|
253
|
+
category: "takes",
|
|
235
254
|
},
|
|
236
255
|
embrace_debate: {
|
|
237
256
|
id: "embrace_debate",
|
|
@@ -243,6 +262,7 @@ exports.achievementsMap = {
|
|
|
243
262
|
gold: { threshold: 100 },
|
|
244
263
|
},
|
|
245
264
|
type: "global",
|
|
265
|
+
category: "takes",
|
|
246
266
|
},
|
|
247
267
|
fan_of_the_people: {
|
|
248
268
|
id: "fan_of_the_people",
|
|
@@ -254,6 +274,7 @@ exports.achievementsMap = {
|
|
|
254
274
|
gold: { threshold: 100 },
|
|
255
275
|
},
|
|
256
276
|
type: "global",
|
|
277
|
+
category: "social",
|
|
257
278
|
},
|
|
258
279
|
the_peoples_fan: {
|
|
259
280
|
id: "the_peoples_fan",
|
|
@@ -265,6 +286,7 @@ exports.achievementsMap = {
|
|
|
265
286
|
gold: { threshold: 100 },
|
|
266
287
|
},
|
|
267
288
|
type: "global",
|
|
289
|
+
category: "social",
|
|
268
290
|
},
|
|
269
291
|
take_titan: {
|
|
270
292
|
id: "take_titan",
|
|
@@ -276,6 +298,7 @@ exports.achievementsMap = {
|
|
|
276
298
|
gold: { threshold: 1000 },
|
|
277
299
|
},
|
|
278
300
|
type: "global",
|
|
301
|
+
category: "takes",
|
|
279
302
|
},
|
|
280
303
|
take_first: {
|
|
281
304
|
id: "take_first",
|
|
@@ -287,6 +310,7 @@ exports.achievementsMap = {
|
|
|
287
310
|
gold: { threshold: 100 },
|
|
288
311
|
},
|
|
289
312
|
type: "global",
|
|
313
|
+
category: "takes",
|
|
290
314
|
},
|
|
291
315
|
hall_of_takes: {
|
|
292
316
|
id: "hall_of_takes",
|
|
@@ -298,6 +322,7 @@ exports.achievementsMap = {
|
|
|
298
322
|
gold: { threshold: 1000 },
|
|
299
323
|
},
|
|
300
324
|
type: "global",
|
|
325
|
+
category: "takes",
|
|
301
326
|
},
|
|
302
327
|
ball_knower: {
|
|
303
328
|
id: "ball_knower",
|
|
@@ -694,6 +719,7 @@ exports.achievementsMap = {
|
|
|
694
719
|
gold: { threshold: 50 },
|
|
695
720
|
},
|
|
696
721
|
type: "global",
|
|
722
|
+
category: "lists",
|
|
697
723
|
},
|
|
698
724
|
fan_in_the_arena: {
|
|
699
725
|
id: "fan_in_the_arena",
|
|
@@ -705,6 +731,7 @@ exports.achievementsMap = {
|
|
|
705
731
|
gold: { threshold: 50 },
|
|
706
732
|
},
|
|
707
733
|
type: "global",
|
|
734
|
+
category: "stadium",
|
|
708
735
|
},
|
|
709
736
|
stadium_pulse: {
|
|
710
737
|
id: "stadium_pulse",
|
|
@@ -716,6 +743,7 @@ exports.achievementsMap = {
|
|
|
716
743
|
gold: { threshold: 50 },
|
|
717
744
|
},
|
|
718
745
|
type: "global",
|
|
746
|
+
category: "stadium",
|
|
719
747
|
},
|
|
720
748
|
flow_state: {
|
|
721
749
|
id: "flow_state",
|
|
@@ -727,6 +755,7 @@ exports.achievementsMap = {
|
|
|
727
755
|
gold: { threshold: 15 },
|
|
728
756
|
},
|
|
729
757
|
type: "global",
|
|
758
|
+
category: "picks",
|
|
730
759
|
},
|
|
731
760
|
crystal_ball: {
|
|
732
761
|
id: "crystal_ball",
|
|
@@ -738,23 +767,27 @@ exports.achievementsMap = {
|
|
|
738
767
|
gold: { threshold: 100 },
|
|
739
768
|
},
|
|
740
769
|
type: "global",
|
|
770
|
+
category: "picks",
|
|
741
771
|
},
|
|
742
772
|
strive_for_greatness: {
|
|
743
773
|
id: "strive_for_greatness",
|
|
744
774
|
name: "Strive for Greatness",
|
|
745
775
|
description: "Correctly pick 23 games in a row.",
|
|
746
776
|
type: "global",
|
|
777
|
+
category: "picks",
|
|
747
778
|
},
|
|
748
779
|
like_mike: {
|
|
749
780
|
id: "like_mike",
|
|
750
781
|
name: "Like Mike",
|
|
751
782
|
description: "Correctly pick 45 games in a row.",
|
|
752
783
|
type: "global",
|
|
784
|
+
category: "picks",
|
|
753
785
|
},
|
|
754
786
|
joltin_joe: {
|
|
755
787
|
id: "joltin_joe",
|
|
756
788
|
name: "Joltin' Joe",
|
|
757
789
|
description: "Correctly pick 56 games in a row (the DiMaggio streak).",
|
|
758
790
|
type: "global",
|
|
791
|
+
category: "picks",
|
|
759
792
|
},
|
|
760
793
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.colorLog = void 0;
|
|
4
|
+
const ansi = (hex) => {
|
|
5
|
+
const value = hex.replace("#", "");
|
|
6
|
+
const red = parseInt(value.slice(0, 2), 16);
|
|
7
|
+
const green = parseInt(value.slice(2, 4), 16);
|
|
8
|
+
const blue = parseInt(value.slice(4, 6), 16);
|
|
9
|
+
return `\x1b[38;2;${red};${green};${blue}m`;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @param value - The value to log in the format of 'value:color'.
|
|
13
|
+
* @returns The value logged in the color.
|
|
14
|
+
*/
|
|
15
|
+
const colorLog = (value) => {
|
|
16
|
+
const [logValue, color] = value.split(":");
|
|
17
|
+
return `${ansi(color)}${logValue}\x1b[0m`;
|
|
18
|
+
};
|
|
19
|
+
exports.colorLog = colorLog;
|
package/dist/models/user.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { leagueStatsSchema, createUserSchema, userSchema, reducedUserSchema, searchUserSchema, achievementSchema, changeUsernameSchema } from "../schemas/user";
|
|
2
|
+
import { leagueStatsSchema, createUserSchema, userSchema, reducedUserSchema, searchUserSchema, achievementSchema, changeUsernameSchema, globalAchievementCategorySchema } from "../schemas/user";
|
|
3
3
|
export type User = z.infer<typeof userSchema>;
|
|
4
4
|
export type SearchUser = z.infer<typeof searchUserSchema>;
|
|
5
5
|
export type CreateUser = z.infer<typeof createUserSchema>;
|
|
6
6
|
export type LeagueStats = z.infer<typeof leagueStatsSchema>;
|
|
7
7
|
export type ReducedUser = z.infer<typeof reducedUserSchema>;
|
|
8
8
|
export type Achievement = z.infer<typeof achievementSchema>;
|
|
9
|
+
export type GlobalAchievementCategory = z.infer<typeof globalAchievementCategorySchema>;
|
|
9
10
|
export type ChangeUsername = z.infer<typeof changeUsernameSchema>;
|
|
10
11
|
export interface UsernameClaim {
|
|
11
12
|
userId: string;
|
|
@@ -6,12 +6,12 @@ export declare const achievementUnlockSourceSchema: z.ZodObject<{
|
|
|
6
6
|
gameId: z.ZodOptional<z.ZodString>;
|
|
7
7
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
type: "none" | "pick" | "rating" | "
|
|
9
|
+
type: "none" | "pick" | "rating" | "profile" | "comment" | "games" | "list" | "stadium_rating" | "experience_rating" | "player_vote" | "follower";
|
|
10
10
|
id?: string | undefined;
|
|
11
11
|
metadata?: Record<string, unknown> | undefined;
|
|
12
12
|
gameId?: string | undefined;
|
|
13
13
|
}, {
|
|
14
|
-
type: "none" | "pick" | "rating" | "
|
|
14
|
+
type: "none" | "pick" | "rating" | "profile" | "comment" | "games" | "list" | "stadium_rating" | "experience_rating" | "player_vote" | "follower";
|
|
15
15
|
id?: string | undefined;
|
|
16
16
|
metadata?: Record<string, unknown> | undefined;
|
|
17
17
|
gameId?: string | undefined;
|