xpt-shared-types 1.3.0 → 1.3.1
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/README.md +6 -6
- package/dist/generated/enums.d.ts +0 -4
- package/dist/generated/inputs.d.ts +5 -17
- package/dist/generated/models.d.ts +5 -17
- package/package.json +1 -1
- package/src/generated/enums.ts +0 -18
- package/src/generated/inputs.ts +4 -20
- package/src/generated/models.ts +4 -20
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ frontend cannot consume.
|
|
|
54
54
|
**Everything except `id` and `documentId` is optional.** Not just relations.
|
|
55
55
|
This codebase uses Strapi's `fields` selection pervasively, so even a
|
|
56
56
|
schema-`required` attribute like `user.email` is absent from most responses.
|
|
57
|
-
The base model is the
|
|
57
|
+
The base model is the _minimum guarantee_, not the full row.
|
|
58
58
|
|
|
59
59
|
**Single values are `?: T | null`.** Strapi sends `null` for an unset value
|
|
60
60
|
rather than omitting the key. Lists come back as `[]`, so they are not nullable.
|
|
@@ -83,7 +83,7 @@ asked for:
|
|
|
83
83
|
```ts
|
|
84
84
|
const tournament = await getTournament(slug); // Populated<Tournament, 'game' | 'prizes'>
|
|
85
85
|
|
|
86
|
-
tournament.game.title;
|
|
86
|
+
tournament.game.title; // ok — the annotation says it was populated
|
|
87
87
|
tournament.region?.name; // still optional — this query did not populate it
|
|
88
88
|
```
|
|
89
89
|
|
|
@@ -95,10 +95,10 @@ silently disables exactly the checking this package exists to provide.
|
|
|
95
95
|
|
|
96
96
|
The two apps are on different Yarn majors, so they link differently:
|
|
97
97
|
|
|
98
|
-
| Repo
|
|
99
|
-
|
|
|
100
|
-
| `xpt-strapi` | 1.22.5 (classic) | `"xpt-shared-types": "link:../xpt-shared-types"`
|
|
101
|
-
| `xpt-client` | 4.1.1 (Berry)
|
|
98
|
+
| Repo | Yarn | Dependency |
|
|
99
|
+
| ------------ | ---------------- | -------------------------------------------------- |
|
|
100
|
+
| `xpt-strapi` | 1.22.5 (classic) | `"xpt-shared-types": "link:../xpt-shared-types"` |
|
|
101
|
+
| `xpt-client` | 4.1.1 (Berry) | `"xpt-shared-types": "portal:../xpt-shared-types"` |
|
|
102
102
|
|
|
103
103
|
`portal:` is Berry-only and fails on Yarn 1. Both symlink to this directory, so
|
|
104
104
|
edits are picked up after `yarn build` with no publish step.
|
|
@@ -14,8 +14,6 @@ export type MatchRound = "Round 128" | "Round 64" | "Round 32" | "Round 16" | "Q
|
|
|
14
14
|
export type MatchStreamPlatform = "twitch" | "youtube" | "kick" | "other";
|
|
15
15
|
/** `Match.winnerSlot` */
|
|
16
16
|
export type MatchWinnerSlot = "home" | "away";
|
|
17
|
-
/** `Prize.rank` */
|
|
18
|
-
export type PrizeRank = "one" | "two" | "three";
|
|
19
17
|
/** `Referral.status` */
|
|
20
18
|
export type ReferralStatus = "pending" | "completed";
|
|
21
19
|
/** `Team.current_status` */
|
|
@@ -34,8 +32,6 @@ export type TournamentParticipantEntryType = "solo" | "team";
|
|
|
34
32
|
export type TournamentParticipantStatus = "registered" | "active" | "eliminated" | "completed";
|
|
35
33
|
/** `TournamentRole.role` */
|
|
36
34
|
export type TournamentRoleRole = "moderator" | "admin";
|
|
37
|
-
/** `TournamentStage.stageName` */
|
|
38
|
-
export type TournamentStageStageName = "Round 128" | "Round 64" | "Round 32" | "Round 16" | "Quarter Final" | "Semi-Final" | "Third Round" | "Finals" | "League";
|
|
39
35
|
/** `Tournament.teamSize` */
|
|
40
36
|
export type TournamentTeamSize = "one" | "two" | "three" | "four" | "five";
|
|
41
37
|
/** `Tournament.type` */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BlocksContent, MediaInput, RelationInput } from '../contracts';
|
|
2
|
-
import type { FriendshipStatus, GameRequestCustomLobbies, GameRequestGenre, GameRequestTeamPlay, MatchLobbyStatus, MatchRound, MatchStreamPlatform, MatchWinnerSlot,
|
|
2
|
+
import type { FriendshipStatus, GameRequestCustomLobbies, GameRequestGenre, GameRequestTeamPlay, MatchLobbyStatus, MatchRound, MatchStreamPlatform, MatchWinnerSlot, 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;
|
|
@@ -171,13 +171,6 @@ export interface PrivacyInput {
|
|
|
171
171
|
content?: BlocksContent;
|
|
172
172
|
title?: string;
|
|
173
173
|
}
|
|
174
|
-
/** Write payload for `prize`. */
|
|
175
|
-
export interface PrizeInput {
|
|
176
|
-
description?: string;
|
|
177
|
-
value?: number;
|
|
178
|
-
tournament?: RelationInput;
|
|
179
|
-
rank?: PrizeRank;
|
|
180
|
-
}
|
|
181
174
|
/** Write payload for `referral`. */
|
|
182
175
|
export interface ReferralInput {
|
|
183
176
|
referrer?: RelationInput;
|
|
@@ -277,18 +270,19 @@ export interface TournamentInput {
|
|
|
277
270
|
game?: RelationInput;
|
|
278
271
|
currentStatus?: TournamentCurrentStatus;
|
|
279
272
|
group?: RelationInput;
|
|
280
|
-
prizes?:
|
|
273
|
+
prizes?: unknown;
|
|
281
274
|
tournament_participants?: RelationInput | RelationInput[];
|
|
282
275
|
tournament_roles?: RelationInput | RelationInput[];
|
|
283
276
|
league_tables?: RelationInput | RelationInput[];
|
|
284
277
|
rules?: string;
|
|
285
278
|
hasThirdPlace?: boolean;
|
|
279
|
+
hasMatchLobby?: boolean;
|
|
286
280
|
isPrivate?: boolean;
|
|
287
281
|
checkInTime?: number;
|
|
288
282
|
region?: RelationInput;
|
|
289
283
|
platform?: RelationInput;
|
|
290
284
|
gameAccount?: RelationInput;
|
|
291
|
-
tournament_stages?:
|
|
285
|
+
tournament_stages?: unknown;
|
|
292
286
|
prizesDistributed?: boolean;
|
|
293
287
|
discordUrl?: string;
|
|
294
288
|
twitterUrl?: string;
|
|
@@ -320,13 +314,6 @@ export interface TournamentRoleInput {
|
|
|
320
314
|
users_permissions_user?: RelationInput;
|
|
321
315
|
tournament?: RelationInput;
|
|
322
316
|
}
|
|
323
|
-
/** Write payload for `tournament-stage`. */
|
|
324
|
-
export interface TournamentStageInput {
|
|
325
|
-
stageName?: TournamentStageStageName;
|
|
326
|
-
bestOf?: number;
|
|
327
|
-
tournament?: RelationInput;
|
|
328
|
-
isThirdPlace?: boolean;
|
|
329
|
-
}
|
|
330
317
|
/** Write payload for `user`. */
|
|
331
318
|
export interface UserInput {
|
|
332
319
|
username?: string;
|
|
@@ -354,6 +341,7 @@ export interface UserInput {
|
|
|
354
341
|
notificationPreferences?: unknown;
|
|
355
342
|
referralCode?: string;
|
|
356
343
|
referralRewardClaimed?: boolean;
|
|
344
|
+
lastSeenAt?: string;
|
|
357
345
|
}
|
|
358
346
|
/** Write payload for `user-game-account`. */
|
|
359
347
|
export interface UserGameAccountInput {
|
|
@@ -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,
|
|
2
|
+
import type { FriendshipStatus, GameRequestCustomLobbies, GameRequestGenre, GameRequestTeamPlay, MatchLobbyStatus, MatchRound, MatchStreamPlatform, MatchWinnerSlot, 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;
|
|
@@ -171,13 +171,6 @@ export interface Privacy extends StrapiDocument {
|
|
|
171
171
|
content?: BlocksContent | null;
|
|
172
172
|
title?: string | null;
|
|
173
173
|
}
|
|
174
|
-
/** `prize` */
|
|
175
|
-
export interface Prize extends StrapiDocument {
|
|
176
|
-
description?: string | null;
|
|
177
|
-
value?: number | null;
|
|
178
|
-
tournament?: Tournament | null;
|
|
179
|
-
rank?: PrizeRank | null;
|
|
180
|
-
}
|
|
181
174
|
/** `referral` */
|
|
182
175
|
export interface Referral extends StrapiDocument {
|
|
183
176
|
referrer?: User | null;
|
|
@@ -277,18 +270,19 @@ export interface Tournament extends StrapiDocument {
|
|
|
277
270
|
game?: Game | null;
|
|
278
271
|
currentStatus?: TournamentCurrentStatus | null;
|
|
279
272
|
group?: Group | null;
|
|
280
|
-
prizes?:
|
|
273
|
+
prizes?: unknown | null;
|
|
281
274
|
tournament_participants?: TournamentParticipant[];
|
|
282
275
|
tournament_roles?: TournamentRole[];
|
|
283
276
|
league_tables?: LeagueTable[];
|
|
284
277
|
rules?: string | null;
|
|
285
278
|
hasThirdPlace?: boolean | null;
|
|
279
|
+
hasMatchLobby?: boolean | null;
|
|
286
280
|
isPrivate?: boolean | null;
|
|
287
281
|
checkInTime?: number | null;
|
|
288
282
|
region?: Region | null;
|
|
289
283
|
platform?: Platform | null;
|
|
290
284
|
gameAccount?: GameAccount | null;
|
|
291
|
-
tournament_stages?:
|
|
285
|
+
tournament_stages?: unknown | null;
|
|
292
286
|
prizesDistributed?: boolean | null;
|
|
293
287
|
discordUrl?: string | null;
|
|
294
288
|
twitterUrl?: string | null;
|
|
@@ -320,13 +314,6 @@ export interface TournamentRole extends StrapiDocument {
|
|
|
320
314
|
users_permissions_user?: User | null;
|
|
321
315
|
tournament?: Tournament | null;
|
|
322
316
|
}
|
|
323
|
-
/** `tournament-stage` */
|
|
324
|
-
export interface TournamentStage extends StrapiDocument {
|
|
325
|
-
stageName?: TournamentStageStageName | null;
|
|
326
|
-
bestOf?: number | null;
|
|
327
|
-
tournament?: Tournament | null;
|
|
328
|
-
isThirdPlace?: boolean | null;
|
|
329
|
-
}
|
|
330
317
|
/** `user` */
|
|
331
318
|
export interface User extends StrapiDocument {
|
|
332
319
|
username?: string | null;
|
|
@@ -354,6 +341,7 @@ export interface User extends StrapiDocument {
|
|
|
354
341
|
notificationPreferences?: unknown | null;
|
|
355
342
|
referralCode?: string | null;
|
|
356
343
|
referralRewardClaimed?: boolean | null;
|
|
344
|
+
lastSeenAt?: string | null;
|
|
357
345
|
}
|
|
358
346
|
/** `user-game-account` */
|
|
359
347
|
export interface UserGameAccount extends StrapiDocument {
|
package/package.json
CHANGED
package/src/generated/enums.ts
CHANGED
|
@@ -64,12 +64,6 @@ export type MatchWinnerSlot =
|
|
|
64
64
|
| "home"
|
|
65
65
|
| "away";
|
|
66
66
|
|
|
67
|
-
/** `Prize.rank` */
|
|
68
|
-
export type PrizeRank =
|
|
69
|
-
| "one"
|
|
70
|
-
| "two"
|
|
71
|
-
| "three";
|
|
72
|
-
|
|
73
67
|
/** `Referral.status` */
|
|
74
68
|
export type ReferralStatus =
|
|
75
69
|
| "pending"
|
|
@@ -129,18 +123,6 @@ export type TournamentRoleRole =
|
|
|
129
123
|
| "moderator"
|
|
130
124
|
| "admin";
|
|
131
125
|
|
|
132
|
-
/** `TournamentStage.stageName` */
|
|
133
|
-
export type TournamentStageStageName =
|
|
134
|
-
| "Round 128"
|
|
135
|
-
| "Round 64"
|
|
136
|
-
| "Round 32"
|
|
137
|
-
| "Round 16"
|
|
138
|
-
| "Quarter Final"
|
|
139
|
-
| "Semi-Final"
|
|
140
|
-
| "Third Round"
|
|
141
|
-
| "Finals"
|
|
142
|
-
| "League";
|
|
143
|
-
|
|
144
126
|
/** `Tournament.teamSize` */
|
|
145
127
|
export type TournamentTeamSize =
|
|
146
128
|
| "one"
|
package/src/generated/inputs.ts
CHANGED
|
@@ -16,7 +16,6 @@ import type {
|
|
|
16
16
|
MatchRound,
|
|
17
17
|
MatchStreamPlatform,
|
|
18
18
|
MatchWinnerSlot,
|
|
19
|
-
PrizeRank,
|
|
20
19
|
ReferralStatus,
|
|
21
20
|
TeamCurrentStatus,
|
|
22
21
|
TeamInviteStatus,
|
|
@@ -26,7 +25,6 @@ import type {
|
|
|
26
25
|
TournamentParticipantEntryType,
|
|
27
26
|
TournamentParticipantStatus,
|
|
28
27
|
TournamentRoleRole,
|
|
29
|
-
TournamentStageStageName,
|
|
30
28
|
TournamentTeamSize,
|
|
31
29
|
TournamentType,
|
|
32
30
|
UserTransactionStripeStatus,
|
|
@@ -225,14 +223,6 @@ export interface PrivacyInput {
|
|
|
225
223
|
title?: string;
|
|
226
224
|
}
|
|
227
225
|
|
|
228
|
-
/** Write payload for `prize`. */
|
|
229
|
-
export interface PrizeInput {
|
|
230
|
-
description?: string;
|
|
231
|
-
value?: number;
|
|
232
|
-
tournament?: RelationInput;
|
|
233
|
-
rank?: PrizeRank;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
226
|
/** Write payload for `referral`. */
|
|
237
227
|
export interface ReferralInput {
|
|
238
228
|
referrer?: RelationInput;
|
|
@@ -341,18 +331,19 @@ export interface TournamentInput {
|
|
|
341
331
|
game?: RelationInput;
|
|
342
332
|
currentStatus?: TournamentCurrentStatus;
|
|
343
333
|
group?: RelationInput;
|
|
344
|
-
prizes?:
|
|
334
|
+
prizes?: unknown;
|
|
345
335
|
tournament_participants?: RelationInput | RelationInput[];
|
|
346
336
|
tournament_roles?: RelationInput | RelationInput[];
|
|
347
337
|
league_tables?: RelationInput | RelationInput[];
|
|
348
338
|
rules?: string;
|
|
349
339
|
hasThirdPlace?: boolean;
|
|
340
|
+
hasMatchLobby?: boolean;
|
|
350
341
|
isPrivate?: boolean;
|
|
351
342
|
checkInTime?: number;
|
|
352
343
|
region?: RelationInput;
|
|
353
344
|
platform?: RelationInput;
|
|
354
345
|
gameAccount?: RelationInput;
|
|
355
|
-
tournament_stages?:
|
|
346
|
+
tournament_stages?: unknown;
|
|
356
347
|
prizesDistributed?: boolean;
|
|
357
348
|
discordUrl?: string;
|
|
358
349
|
twitterUrl?: string;
|
|
@@ -388,14 +379,6 @@ export interface TournamentRoleInput {
|
|
|
388
379
|
tournament?: RelationInput;
|
|
389
380
|
}
|
|
390
381
|
|
|
391
|
-
/** Write payload for `tournament-stage`. */
|
|
392
|
-
export interface TournamentStageInput {
|
|
393
|
-
stageName?: TournamentStageStageName;
|
|
394
|
-
bestOf?: number;
|
|
395
|
-
tournament?: RelationInput;
|
|
396
|
-
isThirdPlace?: boolean;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
382
|
/** Write payload for `user`. */
|
|
400
383
|
export interface UserInput {
|
|
401
384
|
username?: string;
|
|
@@ -423,6 +406,7 @@ export interface UserInput {
|
|
|
423
406
|
notificationPreferences?: unknown;
|
|
424
407
|
referralCode?: string;
|
|
425
408
|
referralRewardClaimed?: boolean;
|
|
409
|
+
lastSeenAt?: string;
|
|
426
410
|
}
|
|
427
411
|
|
|
428
412
|
/** Write payload for `user-game-account`. */
|
package/src/generated/models.ts
CHANGED
|
@@ -17,7 +17,6 @@ import type {
|
|
|
17
17
|
MatchRound,
|
|
18
18
|
MatchStreamPlatform,
|
|
19
19
|
MatchWinnerSlot,
|
|
20
|
-
PrizeRank,
|
|
21
20
|
ReferralStatus,
|
|
22
21
|
TeamCurrentStatus,
|
|
23
22
|
TeamInviteStatus,
|
|
@@ -27,7 +26,6 @@ import type {
|
|
|
27
26
|
TournamentParticipantEntryType,
|
|
28
27
|
TournamentParticipantStatus,
|
|
29
28
|
TournamentRoleRole,
|
|
30
|
-
TournamentStageStageName,
|
|
31
29
|
TournamentTeamSize,
|
|
32
30
|
TournamentType,
|
|
33
31
|
UserTransactionStripeStatus,
|
|
@@ -226,14 +224,6 @@ export interface Privacy extends StrapiDocument {
|
|
|
226
224
|
title?: string | null;
|
|
227
225
|
}
|
|
228
226
|
|
|
229
|
-
/** `prize` */
|
|
230
|
-
export interface Prize extends StrapiDocument {
|
|
231
|
-
description?: string | null;
|
|
232
|
-
value?: number | null;
|
|
233
|
-
tournament?: Tournament | null;
|
|
234
|
-
rank?: PrizeRank | null;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
227
|
/** `referral` */
|
|
238
228
|
export interface Referral extends StrapiDocument {
|
|
239
229
|
referrer?: User | null;
|
|
@@ -342,18 +332,19 @@ export interface Tournament extends StrapiDocument {
|
|
|
342
332
|
game?: Game | null;
|
|
343
333
|
currentStatus?: TournamentCurrentStatus | null;
|
|
344
334
|
group?: Group | null;
|
|
345
|
-
prizes?:
|
|
335
|
+
prizes?: unknown | null;
|
|
346
336
|
tournament_participants?: TournamentParticipant[];
|
|
347
337
|
tournament_roles?: TournamentRole[];
|
|
348
338
|
league_tables?: LeagueTable[];
|
|
349
339
|
rules?: string | null;
|
|
350
340
|
hasThirdPlace?: boolean | null;
|
|
341
|
+
hasMatchLobby?: boolean | null;
|
|
351
342
|
isPrivate?: boolean | null;
|
|
352
343
|
checkInTime?: number | null;
|
|
353
344
|
region?: Region | null;
|
|
354
345
|
platform?: Platform | null;
|
|
355
346
|
gameAccount?: GameAccount | null;
|
|
356
|
-
tournament_stages?:
|
|
347
|
+
tournament_stages?: unknown | null;
|
|
357
348
|
prizesDistributed?: boolean | null;
|
|
358
349
|
discordUrl?: string | null;
|
|
359
350
|
twitterUrl?: string | null;
|
|
@@ -389,14 +380,6 @@ export interface TournamentRole extends StrapiDocument {
|
|
|
389
380
|
tournament?: Tournament | null;
|
|
390
381
|
}
|
|
391
382
|
|
|
392
|
-
/** `tournament-stage` */
|
|
393
|
-
export interface TournamentStage extends StrapiDocument {
|
|
394
|
-
stageName?: TournamentStageStageName | null;
|
|
395
|
-
bestOf?: number | null;
|
|
396
|
-
tournament?: Tournament | null;
|
|
397
|
-
isThirdPlace?: boolean | null;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
383
|
/** `user` */
|
|
401
384
|
export interface User extends StrapiDocument {
|
|
402
385
|
username?: string | null;
|
|
@@ -424,6 +407,7 @@ export interface User extends StrapiDocument {
|
|
|
424
407
|
notificationPreferences?: unknown | null;
|
|
425
408
|
referralCode?: string | null;
|
|
426
409
|
referralRewardClaimed?: boolean | null;
|
|
410
|
+
lastSeenAt?: string | null;
|
|
427
411
|
}
|
|
428
412
|
|
|
429
413
|
/** `user-game-account` */
|