xpt-shared-types 1.4.1 → 1.6.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.
@@ -0,0 +1,8 @@
1
+ import type { GameGenre } from "../generated/enums";
2
+ /**
3
+ * Every genre a game can carry, in the order the games page offers them as
4
+ * filter chips. Typed against the generated enum so a schema change that
5
+ * adds or renames a value fails here at compile time rather than leaving a
6
+ * chip that matches nothing.
7
+ */
8
+ export declare const GAME_GENRES: readonly GameGenre[];
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GAME_GENRES = void 0;
4
+ /**
5
+ * Every genre a game can carry, in the order the games page offers them as
6
+ * filter chips. Typed against the generated enum so a schema change that
7
+ * adds or renames a value fails here at compile time rather than leaving a
8
+ * chip that matches nothing.
9
+ */
10
+ exports.GAME_GENRES = [
11
+ "FPS",
12
+ "MOBA",
13
+ "Battle Royale",
14
+ "Fighting (FGC)",
15
+ "Sports",
16
+ "Strategy/RTS",
17
+ "Sim Racing",
18
+ "Card Game",
19
+ "Retro",
20
+ "Other",
21
+ ];
@@ -1,13 +1,21 @@
1
1
  /** `Friendship.status` */
2
2
  export type FriendshipStatus = "pending" | "accepted";
3
+ /** `Game.genre` */
4
+ export type GameGenre = "FPS" | "MOBA" | "Battle Royale" | "Fighting (FGC)" | "Sports" | "Strategy/RTS" | "Sim Racing" | "Card Game" | "Retro" | "Other";
3
5
  /** `GameRequest.customLobbies` */
4
6
  export type GameRequestCustomLobbies = "Yes" | "No" | "Not sure";
5
7
  /** `GameRequest.genre` */
6
8
  export type GameRequestGenre = "FPS" | "MOBA" | "Battle Royale" | "Fighting (FGC)" | "Sports" | "Strategy/RTS" | "Sim Racing" | "Card Game" | "Other";
7
9
  /** `GameRequest.teamPlay` */
8
10
  export type GameRequestTeamPlay = "No (solo)" | "Yes, 2v2" | "Yes, 3v3" | "Yes, 4v4+" | "Don't know";
11
+ /** `Game.visibility` */
12
+ export type GameVisibility = "listed" | "searchOnly" | "archived";
13
+ /** `Match.disputeReason` */
14
+ export type MatchDisputeReason = "scoreMismatch" | "opponentNoShow" | "opponentLaggedOut" | "rulesViolation" | "other";
9
15
  /** `Match.lobbyStatus` */
10
16
  export type MatchLobbyStatus = "waiting" | "ready" | "disputed" | "completed";
17
+ /** `Match.resultType` */
18
+ export type MatchResultType = "reported" | "hostRecorded" | "bye" | "noShowHome" | "noShowAway" | "forfeitHome" | "forfeitAway" | "disputeResolved" | "adminOverride";
11
19
  /** `Match.round` */
12
20
  export type MatchRound = "Round 128" | "Round 64" | "Round 32" | "Round 16" | "Quarter Final" | "Semi-Final" | "Third Round" | "Finals" | "League";
13
21
  /** `Match.streamPlatform` */
@@ -1,5 +1,5 @@
1
1
  import type { BlocksContent, MediaInput, RelationInput } from '../contracts';
2
- import type { FriendshipStatus, GameRequestCustomLobbies, GameRequestGenre, GameRequestTeamPlay, MatchLobbyStatus, MatchRound, MatchStreamPlatform, MatchWinnerSlot, PlatformCode, ReferralStatus, TeamCurrentStatus, TeamInviteStatus, TeamInviteTeamRole, TeamPlayerTeamRole, TournamentCurrentStatus, TournamentParticipantEntryType, TournamentParticipantStatus, TournamentRoleRole, TournamentTeamSize, TournamentType, UserTransactionStripeStatus, UserTransactionType } from './enums';
2
+ import type { FriendshipStatus, GameGenre, GameRequestCustomLobbies, GameRequestGenre, GameRequestTeamPlay, GameVisibility, MatchDisputeReason, MatchLobbyStatus, MatchResultType, MatchRound, MatchStreamPlatform, MatchWinnerSlot, PlatformCode, ReferralStatus, TeamCurrentStatus, TeamInviteStatus, TeamInviteTeamRole, TeamPlayerTeamRole, TournamentCurrentStatus, TournamentParticipantEntryType, TournamentParticipantStatus, TournamentRoleRole, TournamentTeamSize, TournamentType, UserTransactionStripeStatus, UserTransactionType } from './enums';
3
3
  /** Write payload for `about`. */
4
4
  export interface AboutInput {
5
5
  heroTitle?: string;
@@ -44,10 +44,12 @@ export interface GameInput {
44
44
  imgThumb?: MediaInput;
45
45
  imgMain?: MediaInput;
46
46
  tournaments?: RelationInput | RelationInput[];
47
- isTrending?: boolean;
48
47
  user_game_stats?: RelationInput | RelationInput[];
49
48
  team_game_stats?: RelationInput | RelationInput[];
50
49
  imgMainPosition?: string;
50
+ visibility?: GameVisibility;
51
+ genre?: GameGenre;
52
+ sortOrder?: number;
51
53
  platforms?: RelationInput | RelationInput[];
52
54
  game_accounts?: RelationInput | RelationInput[];
53
55
  }
@@ -130,6 +132,13 @@ export interface MatchInput {
130
132
  isStreaming?: boolean;
131
133
  streamHandle?: string;
132
134
  streamPlatform?: MatchStreamPlatform;
135
+ startedAt?: string;
136
+ endedAt?: string;
137
+ resultType?: MatchResultType;
138
+ resultNote?: string;
139
+ disputeReason?: MatchDisputeReason;
140
+ disputeNote?: string;
141
+ disputedBy?: RelationInput;
133
142
  }
134
143
  /** Write payload for `match-message`. */
135
144
  export interface MatchMessageInput {
@@ -1,5 +1,5 @@
1
1
  import type { BlocksContent, StrapiDocument, StrapiMedia, UserRole } from '../contracts';
2
- import type { FriendshipStatus, GameRequestCustomLobbies, GameRequestGenre, GameRequestTeamPlay, MatchLobbyStatus, MatchRound, MatchStreamPlatform, MatchWinnerSlot, PlatformCode, ReferralStatus, TeamCurrentStatus, TeamInviteStatus, TeamInviteTeamRole, TeamPlayerTeamRole, TournamentCurrentStatus, TournamentParticipantEntryType, TournamentParticipantStatus, TournamentRoleRole, TournamentTeamSize, TournamentType, UserTransactionStripeStatus, UserTransactionType } from './enums';
2
+ import type { FriendshipStatus, GameGenre, GameRequestCustomLobbies, GameRequestGenre, GameRequestTeamPlay, GameVisibility, MatchDisputeReason, MatchLobbyStatus, MatchResultType, MatchRound, MatchStreamPlatform, MatchWinnerSlot, PlatformCode, ReferralStatus, TeamCurrentStatus, TeamInviteStatus, TeamInviteTeamRole, TeamPlayerTeamRole, TournamentCurrentStatus, TournamentParticipantEntryType, TournamentParticipantStatus, TournamentRoleRole, TournamentTeamSize, TournamentType, UserTransactionStripeStatus, UserTransactionType } from './enums';
3
3
  /** `about` */
4
4
  export interface About extends StrapiDocument {
5
5
  heroTitle?: string | null;
@@ -44,10 +44,12 @@ export interface Game extends StrapiDocument {
44
44
  imgThumb?: StrapiMedia | null;
45
45
  imgMain?: StrapiMedia | null;
46
46
  tournaments?: Tournament[];
47
- isTrending?: boolean | null;
48
47
  user_game_stats?: UserGameStat[];
49
48
  team_game_stats?: TeamGameStat[];
50
49
  imgMainPosition?: string | null;
50
+ visibility?: GameVisibility | null;
51
+ genre?: GameGenre | null;
52
+ sortOrder?: number | null;
51
53
  platforms?: Platform[];
52
54
  game_accounts?: GameAccount[];
53
55
  }
@@ -130,6 +132,13 @@ export interface Match extends StrapiDocument {
130
132
  isStreaming?: boolean | null;
131
133
  streamHandle?: string | null;
132
134
  streamPlatform?: MatchStreamPlatform | null;
135
+ startedAt?: string | null;
136
+ endedAt?: string | null;
137
+ resultType?: MatchResultType | null;
138
+ resultNote?: string | null;
139
+ disputeReason?: MatchDisputeReason | null;
140
+ disputeNote?: string | null;
141
+ disputedBy?: User | null;
133
142
  }
134
143
  /** `match-message` */
135
144
  export interface MatchMessage extends StrapiDocument {
package/dist/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from './manual';
4
4
  export * from './bracket';
5
5
  export * from './gameCatalogue';
6
6
  export * from './data/countriesList';
7
+ export * from './data/gameGenres';
package/dist/index.js CHANGED
@@ -27,3 +27,4 @@ __exportStar(require("./bracket"), exports);
27
27
  __exportStar(require("./gameCatalogue"), exports);
28
28
  // Data
29
29
  __exportStar(require("./data/countriesList"), exports);
30
+ __exportStar(require("./data/gameGenres"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xpt-shared-types",
3
- "version": "1.4.1",
3
+ "version": "1.6.2",
4
4
  "description": "Shared types and data for XPT projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,20 @@
1
+ import type { GameGenre } from "../generated/enums";
2
+
3
+ /**
4
+ * Every genre a game can carry, in the order the games page offers them as
5
+ * filter chips. Typed against the generated enum so a schema change that
6
+ * adds or renames a value fails here at compile time rather than leaving a
7
+ * chip that matches nothing.
8
+ */
9
+ export const GAME_GENRES: readonly GameGenre[] = [
10
+ "FPS",
11
+ "MOBA",
12
+ "Battle Royale",
13
+ "Fighting (FGC)",
14
+ "Sports",
15
+ "Strategy/RTS",
16
+ "Sim Racing",
17
+ "Card Game",
18
+ "Retro",
19
+ "Other",
20
+ ];
@@ -7,6 +7,19 @@ export type FriendshipStatus =
7
7
  | "pending"
8
8
  | "accepted";
9
9
 
10
+ /** `Game.genre` */
11
+ export type GameGenre =
12
+ | "FPS"
13
+ | "MOBA"
14
+ | "Battle Royale"
15
+ | "Fighting (FGC)"
16
+ | "Sports"
17
+ | "Strategy/RTS"
18
+ | "Sim Racing"
19
+ | "Card Game"
20
+ | "Retro"
21
+ | "Other";
22
+
10
23
  /** `GameRequest.customLobbies` */
11
24
  export type GameRequestCustomLobbies =
12
25
  | "Yes"
@@ -33,6 +46,20 @@ export type GameRequestTeamPlay =
33
46
  | "Yes, 4v4+"
34
47
  | "Don't know";
35
48
 
49
+ /** `Game.visibility` */
50
+ export type GameVisibility =
51
+ | "listed"
52
+ | "searchOnly"
53
+ | "archived";
54
+
55
+ /** `Match.disputeReason` */
56
+ export type MatchDisputeReason =
57
+ | "scoreMismatch"
58
+ | "opponentNoShow"
59
+ | "opponentLaggedOut"
60
+ | "rulesViolation"
61
+ | "other";
62
+
36
63
  /** `Match.lobbyStatus` */
37
64
  export type MatchLobbyStatus =
38
65
  | "waiting"
@@ -40,6 +67,18 @@ export type MatchLobbyStatus =
40
67
  | "disputed"
41
68
  | "completed";
42
69
 
70
+ /** `Match.resultType` */
71
+ export type MatchResultType =
72
+ | "reported"
73
+ | "hostRecorded"
74
+ | "bye"
75
+ | "noShowHome"
76
+ | "noShowAway"
77
+ | "forfeitHome"
78
+ | "forfeitAway"
79
+ | "disputeResolved"
80
+ | "adminOverride";
81
+
43
82
  /** `Match.round` */
44
83
  export type MatchRound =
45
84
  | "Round 128"
@@ -9,10 +9,14 @@ import type {
9
9
  } from '../contracts';
10
10
  import type {
11
11
  FriendshipStatus,
12
+ GameGenre,
12
13
  GameRequestCustomLobbies,
13
14
  GameRequestGenre,
14
15
  GameRequestTeamPlay,
16
+ GameVisibility,
17
+ MatchDisputeReason,
15
18
  MatchLobbyStatus,
19
+ MatchResultType,
16
20
  MatchRound,
17
21
  MatchStreamPlatform,
18
22
  MatchWinnerSlot,
@@ -82,10 +86,12 @@ export interface GameInput {
82
86
  imgThumb?: MediaInput;
83
87
  imgMain?: MediaInput;
84
88
  tournaments?: RelationInput | RelationInput[];
85
- isTrending?: boolean;
86
89
  user_game_stats?: RelationInput | RelationInput[];
87
90
  team_game_stats?: RelationInput | RelationInput[];
88
91
  imgMainPosition?: string;
92
+ visibility?: GameVisibility;
93
+ genre?: GameGenre;
94
+ sortOrder?: number;
89
95
  platforms?: RelationInput | RelationInput[];
90
96
  game_accounts?: RelationInput | RelationInput[];
91
97
  }
@@ -174,6 +180,13 @@ export interface MatchInput {
174
180
  isStreaming?: boolean;
175
181
  streamHandle?: string;
176
182
  streamPlatform?: MatchStreamPlatform;
183
+ startedAt?: string;
184
+ endedAt?: string;
185
+ resultType?: MatchResultType;
186
+ resultNote?: string;
187
+ disputeReason?: MatchDisputeReason;
188
+ disputeNote?: string;
189
+ disputedBy?: RelationInput;
177
190
  }
178
191
 
179
192
  /** Write payload for `match-message`. */
@@ -10,10 +10,14 @@ import type {
10
10
  } from '../contracts';
11
11
  import type {
12
12
  FriendshipStatus,
13
+ GameGenre,
13
14
  GameRequestCustomLobbies,
14
15
  GameRequestGenre,
15
16
  GameRequestTeamPlay,
17
+ GameVisibility,
18
+ MatchDisputeReason,
16
19
  MatchLobbyStatus,
20
+ MatchResultType,
17
21
  MatchRound,
18
22
  MatchStreamPlatform,
19
23
  MatchWinnerSlot,
@@ -83,10 +87,12 @@ export interface Game extends StrapiDocument {
83
87
  imgThumb?: StrapiMedia | null;
84
88
  imgMain?: StrapiMedia | null;
85
89
  tournaments?: Tournament[];
86
- isTrending?: boolean | null;
87
90
  user_game_stats?: UserGameStat[];
88
91
  team_game_stats?: TeamGameStat[];
89
92
  imgMainPosition?: string | null;
93
+ visibility?: GameVisibility | null;
94
+ genre?: GameGenre | null;
95
+ sortOrder?: number | null;
90
96
  platforms?: Platform[];
91
97
  game_accounts?: GameAccount[];
92
98
  }
@@ -175,6 +181,13 @@ export interface Match extends StrapiDocument {
175
181
  isStreaming?: boolean | null;
176
182
  streamHandle?: string | null;
177
183
  streamPlatform?: MatchStreamPlatform | null;
184
+ startedAt?: string | null;
185
+ endedAt?: string | null;
186
+ resultType?: MatchResultType | null;
187
+ resultNote?: string | null;
188
+ disputeReason?: MatchDisputeReason | null;
189
+ disputeNote?: string | null;
190
+ disputedBy?: User | null;
178
191
  }
179
192
 
180
193
  /** `match-message` */
package/src/index.ts CHANGED
@@ -16,3 +16,4 @@ export * from './gameCatalogue';
16
16
 
17
17
  // Data
18
18
  export * from './data/countriesList';
19
+ export * from './data/gameGenres';