rategame-shared 1.1.367 → 1.1.369

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.
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { triviaSchema, createTriviaSchema, searchTriviaSchema, triviaThreadCommentSchema, triviaThreadCommentLikeSchema, triviaTypeSchema, entityInfoSchema } from "../schemas/trivia";
2
+ import { triviaSchema, createTriviaSchema, searchTriviaSchema, triviaThreadCommentSchema, triviaThreadCommentLikeSchema, triviaTypeSchema, entityInfoSchema, triviaContentEntitySchema } from "../schemas/trivia";
3
3
  export type Trivia = z.infer<typeof triviaSchema>;
4
4
  export type CreateTrivia = z.infer<typeof createTriviaSchema>;
5
5
  export type SearchTrivia = z.infer<typeof searchTriviaSchema>;
@@ -7,3 +7,4 @@ export type TriviaThreadComment = z.infer<typeof triviaThreadCommentSchema>;
7
7
  export type TriviaThreadCommentLike = z.infer<typeof triviaThreadCommentLikeSchema>;
8
8
  export type TriviaType = z.infer<typeof triviaTypeSchema>;
9
9
  export type EntityInfo = z.infer<typeof entityInfoSchema>;
10
+ export type TriviaContentEntity = z.infer<typeof triviaContentEntitySchema>;
@@ -66,6 +66,24 @@ export declare const entityInfoSchema: z.ZodObject<{
66
66
  label: string;
67
67
  }[] | undefined;
68
68
  }>;
69
+ /**
70
+ * Mini content entity stored on the trivia document.
71
+ * Used in feed contexts (profile trivia, league trivia tab) to show what
72
+ * the trivia is about without fetching the full entity.
73
+ */
74
+ export declare const triviaContentEntitySchema: z.ZodObject<{
75
+ name: z.ZodString;
76
+ image: z.ZodOptional<z.ZodString>;
77
+ league: z.ZodOptional<z.ZodString>;
78
+ }, "strip", z.ZodTypeAny, {
79
+ name: string;
80
+ image?: string | undefined;
81
+ league?: string | undefined;
82
+ }, {
83
+ name: string;
84
+ image?: string | undefined;
85
+ league?: string | undefined;
86
+ }>;
69
87
  /**
70
88
  * Trivia document schema
71
89
  * Represents a user-submitted fan contribution (trivia) for a team, league, or stadium.
@@ -79,6 +97,20 @@ export declare const triviaSchema: z.ZodObject<{
79
97
  teamId: z.ZodOptional<z.ZodString>;
80
98
  league: z.ZodOptional<z.ZodString>;
81
99
  stadiumId: z.ZodOptional<z.ZodString>;
100
+ stadiumLeagues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
101
+ contentEntity: z.ZodNullable<z.ZodOptional<z.ZodObject<{
102
+ name: z.ZodString;
103
+ image: z.ZodOptional<z.ZodString>;
104
+ league: z.ZodOptional<z.ZodString>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ name: string;
107
+ image?: string | undefined;
108
+ league?: string | undefined;
109
+ }, {
110
+ name: string;
111
+ image?: string | undefined;
112
+ league?: string | undefined;
113
+ }>>>;
82
114
  user: z.ZodObject<Pick<{
83
115
  id: z.ZodString;
84
116
  email: z.ZodString;
@@ -1197,6 +1229,12 @@ export declare const triviaSchema: z.ZodObject<{
1197
1229
  teamId?: string | undefined;
1198
1230
  userLikes?: number | undefined;
1199
1231
  imageUrl?: string | null | undefined;
1232
+ stadiumLeagues?: string[] | undefined;
1233
+ contentEntity?: {
1234
+ name: string;
1235
+ image?: string | undefined;
1236
+ league?: string | undefined;
1237
+ } | null | undefined;
1200
1238
  }, {
1201
1239
  type: "league" | "stadium" | "team";
1202
1240
  id: string;
@@ -1215,6 +1253,12 @@ export declare const triviaSchema: z.ZodObject<{
1215
1253
  teamId?: string | undefined;
1216
1254
  userLikes?: number | undefined;
1217
1255
  imageUrl?: string | null | undefined;
1256
+ stadiumLeagues?: string[] | undefined;
1257
+ contentEntity?: {
1258
+ name: string;
1259
+ image?: string | undefined;
1260
+ league?: string | undefined;
1261
+ } | null | undefined;
1218
1262
  }>;
1219
1263
  /**
1220
1264
  * Schema for creating a new trivia - id and createdAt are generated by the backend.
@@ -1227,6 +1271,20 @@ export declare const createTriviaSchema: z.ZodObject<{
1227
1271
  teamId: z.ZodOptional<z.ZodString>;
1228
1272
  league: z.ZodOptional<z.ZodString>;
1229
1273
  stadiumId: z.ZodOptional<z.ZodString>;
1274
+ stadiumLeagues: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1275
+ contentEntity: z.ZodNullable<z.ZodOptional<z.ZodObject<{
1276
+ name: z.ZodString;
1277
+ image: z.ZodOptional<z.ZodString>;
1278
+ league: z.ZodOptional<z.ZodString>;
1279
+ }, "strip", z.ZodTypeAny, {
1280
+ name: string;
1281
+ image?: string | undefined;
1282
+ league?: string | undefined;
1283
+ }, {
1284
+ name: string;
1285
+ image?: string | undefined;
1286
+ league?: string | undefined;
1287
+ }>>>;
1230
1288
  user: z.ZodObject<Pick<{
1231
1289
  id: z.ZodString;
1232
1290
  email: z.ZodString;
@@ -2340,6 +2398,12 @@ export declare const createTriviaSchema: z.ZodObject<{
2340
2398
  stadiumId?: string | undefined;
2341
2399
  teamId?: string | undefined;
2342
2400
  imageUrl?: string | null | undefined;
2401
+ stadiumLeagues?: string[] | undefined;
2402
+ contentEntity?: {
2403
+ name: string;
2404
+ image?: string | undefined;
2405
+ league?: string | undefined;
2406
+ } | null | undefined;
2343
2407
  }, {
2344
2408
  type: "league" | "stadium" | "team";
2345
2409
  title: string;
@@ -2355,6 +2419,12 @@ export declare const createTriviaSchema: z.ZodObject<{
2355
2419
  stadiumId?: string | undefined;
2356
2420
  teamId?: string | undefined;
2357
2421
  imageUrl?: string | null | undefined;
2422
+ stadiumLeagues?: string[] | undefined;
2423
+ contentEntity?: {
2424
+ name: string;
2425
+ image?: string | undefined;
2426
+ league?: string | undefined;
2427
+ } | null | undefined;
2358
2428
  }>;
2359
2429
  /**
2360
2430
  * Search/filter parameters for trivia
@@ -2365,6 +2435,7 @@ export declare const searchTriviaSchema: z.ZodObject<{
2365
2435
  league: z.ZodOptional<z.ZodString>;
2366
2436
  stadiumId: z.ZodOptional<z.ZodString>;
2367
2437
  userId: z.ZodOptional<z.ZodString>;
2438
+ leagueOrStadiumLeague: z.ZodOptional<z.ZodString>;
2368
2439
  limit: z.ZodDefault<z.ZodOptional<z.ZodString>>;
2369
2440
  offset: z.ZodDefault<z.ZodOptional<z.ZodString>>;
2370
2441
  sortBy: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"createdAt:desc">, z.ZodLiteral<"userLikes:desc">]>>;
@@ -2377,6 +2448,7 @@ export declare const searchTriviaSchema: z.ZodObject<{
2377
2448
  teamId?: string | undefined;
2378
2449
  sortBy?: "createdAt:desc" | "userLikes:desc" | undefined;
2379
2450
  userId?: string | undefined;
2451
+ leagueOrStadiumLeague?: string | undefined;
2380
2452
  }, {
2381
2453
  type?: "league" | "stadium" | "team" | undefined;
2382
2454
  offset?: string | undefined;
@@ -2386,6 +2458,7 @@ export declare const searchTriviaSchema: z.ZodObject<{
2386
2458
  teamId?: string | undefined;
2387
2459
  sortBy?: "createdAt:desc" | "userLikes:desc" | undefined;
2388
2460
  userId?: string | undefined;
2461
+ leagueOrStadiumLeague?: string | undefined;
2389
2462
  }>;
2390
2463
  /**
2391
2464
  * Thread comment schema for trivia
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.triviaThreadCommentLikeSchema = exports.triviaThreadCommentSchema = exports.searchTriviaSchema = exports.createTriviaSchema = exports.triviaSchema = exports.entityInfoSchema = exports.triviaTypeSchema = void 0;
3
+ exports.triviaThreadCommentLikeSchema = exports.triviaThreadCommentSchema = exports.searchTriviaSchema = exports.createTriviaSchema = exports.triviaSchema = exports.triviaContentEntitySchema = exports.entityInfoSchema = exports.triviaTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const user_1 = require("./user");
6
6
  /**
@@ -32,6 +32,16 @@ exports.entityInfoSchema = zod_1.z.object({
32
32
  }))
33
33
  .optional(),
34
34
  });
35
+ /**
36
+ * Mini content entity stored on the trivia document.
37
+ * Used in feed contexts (profile trivia, league trivia tab) to show what
38
+ * the trivia is about without fetching the full entity.
39
+ */
40
+ exports.triviaContentEntitySchema = zod_1.z.object({
41
+ name: zod_1.z.string(),
42
+ image: zod_1.z.string().optional(),
43
+ league: zod_1.z.string().optional(),
44
+ });
35
45
  /**
36
46
  * Trivia document schema
37
47
  * Represents a user-submitted fan contribution (trivia) for a team, league, or stadium.
@@ -46,6 +56,9 @@ exports.triviaSchema = zod_1.z.object({
46
56
  teamId: zod_1.z.string().optional(),
47
57
  league: zod_1.z.string().optional(),
48
58
  stadiumId: zod_1.z.string().optional(),
59
+ stadiumLeagues: zod_1.z.array(zod_1.z.string()).optional(),
60
+ // Mini display info for the entity the trivia is written about
61
+ contentEntity: exports.triviaContentEntitySchema.optional().nullable(),
49
62
  // Metadata
50
63
  user: user_1.reducedUserSchema,
51
64
  createdAt: zod_1.z.number(),
@@ -63,6 +76,8 @@ exports.createTriviaSchema = zod_1.z.object({
63
76
  teamId: zod_1.z.string().optional(),
64
77
  league: zod_1.z.string().optional(),
65
78
  stadiumId: zod_1.z.string().optional(),
79
+ stadiumLeagues: zod_1.z.array(zod_1.z.string()).optional(),
80
+ contentEntity: exports.triviaContentEntitySchema.optional().nullable(),
66
81
  user: user_1.reducedUserSchema,
67
82
  });
68
83
  /**
@@ -74,6 +89,7 @@ exports.searchTriviaSchema = zod_1.z.object({
74
89
  league: zod_1.z.string().optional(),
75
90
  stadiumId: zod_1.z.string().optional(),
76
91
  userId: zod_1.z.string().optional(),
92
+ leagueOrStadiumLeague: zod_1.z.string().optional(),
77
93
  limit: zod_1.z.string().optional().default("20"),
78
94
  offset: zod_1.z.string().optional().default("0"),
79
95
  sortBy: zod_1.z
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rategame-shared",
3
- "version": "1.1.367",
3
+ "version": "1.1.369",
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",