rategame-shared 1.1.441 → 1.1.442

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,7 +1,8 @@
1
1
  import { z } from "zod";
2
- import { articleSchema, articleEntitySchema, createArticleSchema, updateArticleSchema, searchArticleSchema, articleThreadCommentSchema, articleThreadCommentLikeSchema } from "../schemas/article";
2
+ import { articleSchema, articleEntitySchema, articleEntityTypeSchema, createArticleSchema, updateArticleSchema, searchArticleSchema, articleThreadCommentSchema, articleThreadCommentLikeSchema } from "../schemas/article";
3
3
  export type Article = z.infer<typeof articleSchema>;
4
4
  export type ArticleEntity = z.infer<typeof articleEntitySchema>;
5
+ export type ArticleEntityType = z.infer<typeof articleEntityTypeSchema>;
5
6
  export type CreateArticle = z.infer<typeof createArticleSchema>;
6
7
  export type UpdateArticle = z.infer<typeof updateArticleSchema>;
7
8
  export type SearchArticle = z.infer<typeof searchArticleSchema>;
@@ -1,11 +1,18 @@
1
1
  import { z } from "zod";
2
+ /**
3
+ * Tag types available on an article. Extends the trivia entity types
4
+ * (team/league/stadium/game) with article-only tags. `rategame` marks an
5
+ * article as being about the RateGame app itself; it carries no foreign id and
6
+ * links to the app home (Discover on web, the Games tab on mobile).
7
+ */
8
+ export declare const articleEntityTypeSchema: z.ZodEnum<["team", "league", "stadium", "game", "rategame"]>;
2
9
  /**
3
10
  * A single entity tag on an article. Reuses the trivia entity model so the
4
11
  * existing entity pickers (league/team/stadium/game) can be shared. An article
5
12
  * may be tagged with up to 10 of these.
6
13
  */
7
14
  export declare const articleEntitySchema: z.ZodObject<{
8
- type: z.ZodEnum<["team", "league", "stadium", "game"]>;
15
+ type: z.ZodEnum<["team", "league", "stadium", "game", "rategame"]>;
9
16
  teamId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
10
17
  league: z.ZodOptional<z.ZodString>;
11
18
  stadiumId: z.ZodOptional<z.ZodString>;
@@ -26,7 +33,7 @@ export declare const articleEntitySchema: z.ZodObject<{
26
33
  }>>>;
27
34
  gameEntity: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
28
35
  }, "strip", z.ZodTypeAny, {
29
- type: "league" | "stadium" | "game" | "team";
36
+ type: "league" | "stadium" | "game" | "team" | "rategame";
30
37
  league?: string | undefined;
31
38
  stadiumId?: string | undefined;
32
39
  teamId?: string | number | undefined;
@@ -39,7 +46,7 @@ export declare const articleEntitySchema: z.ZodObject<{
39
46
  } | null | undefined;
40
47
  gameEntity?: any;
41
48
  }, {
42
- type: "league" | "stadium" | "game" | "team";
49
+ type: "league" | "stadium" | "game" | "team" | "rategame";
43
50
  league?: string | undefined;
44
51
  stadiumId?: string | undefined;
45
52
  teamId?: string | number | undefined;
@@ -66,7 +73,7 @@ export declare const articleSchema: z.ZodObject<{
66
73
  imageUrlMedium: z.ZodNullable<z.ZodOptional<z.ZodString>>;
67
74
  imageUrlSmall: z.ZodNullable<z.ZodOptional<z.ZodString>>;
68
75
  entities: z.ZodOptional<z.ZodArray<z.ZodObject<{
69
- type: z.ZodEnum<["team", "league", "stadium", "game"]>;
76
+ type: z.ZodEnum<["team", "league", "stadium", "game", "rategame"]>;
70
77
  teamId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
71
78
  league: z.ZodOptional<z.ZodString>;
72
79
  stadiumId: z.ZodOptional<z.ZodString>;
@@ -87,7 +94,7 @@ export declare const articleSchema: z.ZodObject<{
87
94
  }>>>;
88
95
  gameEntity: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
89
96
  }, "strip", z.ZodTypeAny, {
90
- type: "league" | "stadium" | "game" | "team";
97
+ type: "league" | "stadium" | "game" | "team" | "rategame";
91
98
  league?: string | undefined;
92
99
  stadiumId?: string | undefined;
93
100
  teamId?: string | number | undefined;
@@ -100,7 +107,7 @@ export declare const articleSchema: z.ZodObject<{
100
107
  } | null | undefined;
101
108
  gameEntity?: any;
102
109
  }, {
103
- type: "league" | "stadium" | "game" | "team";
110
+ type: "league" | "stadium" | "game" | "team" | "rategame";
104
111
  league?: string | undefined;
105
112
  stadiumId?: string | undefined;
106
113
  teamId?: string | number | undefined;
@@ -1317,7 +1324,7 @@ export declare const articleSchema: z.ZodObject<{
1317
1324
  imageUrlMedium?: string | null | undefined;
1318
1325
  imageUrlSmall?: string | null | undefined;
1319
1326
  entities?: {
1320
- type: "league" | "stadium" | "game" | "team";
1327
+ type: "league" | "stadium" | "game" | "team" | "rategame";
1321
1328
  league?: string | undefined;
1322
1329
  stadiumId?: string | undefined;
1323
1330
  teamId?: string | number | undefined;
@@ -1352,7 +1359,7 @@ export declare const articleSchema: z.ZodObject<{
1352
1359
  imageUrlMedium?: string | null | undefined;
1353
1360
  imageUrlSmall?: string | null | undefined;
1354
1361
  entities?: {
1355
- type: "league" | "stadium" | "game" | "team";
1362
+ type: "league" | "stadium" | "game" | "team" | "rategame";
1356
1363
  league?: string | undefined;
1357
1364
  stadiumId?: string | undefined;
1358
1365
  teamId?: string | number | undefined;
@@ -1385,7 +1392,7 @@ export declare const createArticleSchema: z.ZodObject<{
1385
1392
  body: z.ZodString;
1386
1393
  imageUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
1387
1394
  entities: z.ZodOptional<z.ZodArray<z.ZodObject<{
1388
- type: z.ZodEnum<["team", "league", "stadium", "game"]>;
1395
+ type: z.ZodEnum<["team", "league", "stadium", "game", "rategame"]>;
1389
1396
  teamId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1390
1397
  league: z.ZodOptional<z.ZodString>;
1391
1398
  stadiumId: z.ZodOptional<z.ZodString>;
@@ -1406,7 +1413,7 @@ export declare const createArticleSchema: z.ZodObject<{
1406
1413
  }>>>;
1407
1414
  gameEntity: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
1408
1415
  }, "strip", z.ZodTypeAny, {
1409
- type: "league" | "stadium" | "game" | "team";
1416
+ type: "league" | "stadium" | "game" | "team" | "rategame";
1410
1417
  league?: string | undefined;
1411
1418
  stadiumId?: string | undefined;
1412
1419
  teamId?: string | number | undefined;
@@ -1419,7 +1426,7 @@ export declare const createArticleSchema: z.ZodObject<{
1419
1426
  } | null | undefined;
1420
1427
  gameEntity?: any;
1421
1428
  }, {
1422
- type: "league" | "stadium" | "game" | "team";
1429
+ type: "league" | "stadium" | "game" | "team" | "rategame";
1423
1430
  league?: string | undefined;
1424
1431
  stadiumId?: string | undefined;
1425
1432
  teamId?: string | number | undefined;
@@ -2625,7 +2632,7 @@ export declare const createArticleSchema: z.ZodObject<{
2625
2632
  id?: string | undefined;
2626
2633
  imageUrl?: string | null | undefined;
2627
2634
  entities?: {
2628
- type: "league" | "stadium" | "game" | "team";
2635
+ type: "league" | "stadium" | "game" | "team" | "rategame";
2629
2636
  league?: string | undefined;
2630
2637
  stadiumId?: string | undefined;
2631
2638
  teamId?: string | number | undefined;
@@ -2651,7 +2658,7 @@ export declare const createArticleSchema: z.ZodObject<{
2651
2658
  id?: string | undefined;
2652
2659
  imageUrl?: string | null | undefined;
2653
2660
  entities?: {
2654
- type: "league" | "stadium" | "game" | "team";
2661
+ type: "league" | "stadium" | "game" | "team" | "rategame";
2655
2662
  league?: string | undefined;
2656
2663
  stadiumId?: string | undefined;
2657
2664
  teamId?: string | number | undefined;
@@ -2673,7 +2680,7 @@ export declare const updateArticleSchema: z.ZodObject<{
2673
2680
  body: z.ZodOptional<z.ZodString>;
2674
2681
  imageUrl: z.ZodNullable<z.ZodOptional<z.ZodString>>;
2675
2682
  entities: z.ZodOptional<z.ZodArray<z.ZodObject<{
2676
- type: z.ZodEnum<["team", "league", "stadium", "game"]>;
2683
+ type: z.ZodEnum<["team", "league", "stadium", "game", "rategame"]>;
2677
2684
  teamId: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2678
2685
  league: z.ZodOptional<z.ZodString>;
2679
2686
  stadiumId: z.ZodOptional<z.ZodString>;
@@ -2694,7 +2701,7 @@ export declare const updateArticleSchema: z.ZodObject<{
2694
2701
  }>>>;
2695
2702
  gameEntity: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
2696
2703
  }, "strip", z.ZodTypeAny, {
2697
- type: "league" | "stadium" | "game" | "team";
2704
+ type: "league" | "stadium" | "game" | "team" | "rategame";
2698
2705
  league?: string | undefined;
2699
2706
  stadiumId?: string | undefined;
2700
2707
  teamId?: string | number | undefined;
@@ -2707,7 +2714,7 @@ export declare const updateArticleSchema: z.ZodObject<{
2707
2714
  } | null | undefined;
2708
2715
  gameEntity?: any;
2709
2716
  }, {
2710
- type: "league" | "stadium" | "game" | "team";
2717
+ type: "league" | "stadium" | "game" | "team" | "rategame";
2711
2718
  league?: string | undefined;
2712
2719
  stadiumId?: string | undefined;
2713
2720
  teamId?: string | number | undefined;
@@ -2725,7 +2732,7 @@ export declare const updateArticleSchema: z.ZodObject<{
2725
2732
  title?: string | undefined;
2726
2733
  imageUrl?: string | null | undefined;
2727
2734
  entities?: {
2728
- type: "league" | "stadium" | "game" | "team";
2735
+ type: "league" | "stadium" | "game" | "team" | "rategame";
2729
2736
  league?: string | undefined;
2730
2737
  stadiumId?: string | undefined;
2731
2738
  teamId?: string | number | undefined;
@@ -2743,7 +2750,7 @@ export declare const updateArticleSchema: z.ZodObject<{
2743
2750
  title?: string | undefined;
2744
2751
  imageUrl?: string | null | undefined;
2745
2752
  entities?: {
2746
- type: "league" | "stadium" | "game" | "team";
2753
+ type: "league" | "stadium" | "game" | "team" | "rategame";
2747
2754
  league?: string | undefined;
2748
2755
  stadiumId?: string | undefined;
2749
2756
  teamId?: string | number | undefined;
@@ -1,16 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.articleThreadCommentLikeSchema = exports.articleThreadCommentSchema = exports.searchArticleSchema = exports.updateArticleSchema = exports.createArticleSchema = exports.articleSchema = exports.articleEntitySchema = void 0;
3
+ exports.articleThreadCommentLikeSchema = exports.articleThreadCommentSchema = exports.searchArticleSchema = exports.updateArticleSchema = exports.createArticleSchema = exports.articleSchema = exports.articleEntitySchema = exports.articleEntityTypeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const user_1 = require("./user");
6
6
  const trivia_1 = require("./trivia");
7
+ /**
8
+ * Tag types available on an article. Extends the trivia entity types
9
+ * (team/league/stadium/game) with article-only tags. `rategame` marks an
10
+ * article as being about the RateGame app itself; it carries no foreign id and
11
+ * links to the app home (Discover on web, the Games tab on mobile).
12
+ */
13
+ exports.articleEntityTypeSchema = zod_1.z.enum([
14
+ "team",
15
+ "league",
16
+ "stadium",
17
+ "game",
18
+ "rategame",
19
+ ]);
7
20
  /**
8
21
  * A single entity tag on an article. Reuses the trivia entity model so the
9
22
  * existing entity pickers (league/team/stadium/game) can be shared. An article
10
23
  * may be tagged with up to 10 of these.
11
24
  */
12
25
  exports.articleEntitySchema = zod_1.z.object({
13
- type: trivia_1.triviaTypeSchema,
26
+ type: exports.articleEntityTypeSchema,
14
27
  teamId: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(),
15
28
  league: zod_1.z.string().optional(),
16
29
  stadiumId: zod_1.z.string().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rategame-shared",
3
- "version": "1.1.441",
3
+ "version": "1.1.442",
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",