From 65fb86d42f0f4a83d682fb91856206b889499e99 Mon Sep 17 00:00:00 2001 From: Serena Li Date: Thu, 8 Feb 2024 17:13:57 -0500 Subject: [PATCH] regenerate types, remove .vscode folder --- .vscode/settings.json | 6 ------ frontend2/schema.yml | 18 ++++++++++++++---- frontend2/src/api/_autogen/apis/CompeteApi.ts | 9 +++++++-- frontend2/src/api/_autogen/models/Match.ts | 14 ++++++++++---- .../src/api/_autogen/models/TournamentRound.ts | 9 +++++++++ 5 files changed, 40 insertions(+), 16 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index d2dd3db63..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "eslint.workingDirectories": ["./frontend2"], - "editor.detectIndentation": false, - "editor.tabSize": 2, - "editor.insertSpaces": true -} diff --git a/frontend2/schema.yml b/frontend2/schema.yml index 8c3406ad7..1dd69a7d2 100644 --- a/frontend2/schema.yml +++ b/frontend2/schema.yml @@ -206,7 +206,10 @@ paths: /api/compete/{episode_id}/match/tournament/: get: operationId: compete_match_tournament_list - description: List matches played in a tournament. + description: |- + List matches played in a tournament, or in all tournaments if not specified. + Passing the external_id_private of a tournament allows match lookup for the + tournament, even if it's private. Client uses the external_id_private parameter parameters: - in: path name: episode_id @@ -214,6 +217,11 @@ paths: type: string pattern: ^[^\/.]+$ required: true + - in: query + name: external_id_private + schema: + type: string + description: A private id to filter for. - name: page required: false in: query @@ -2213,8 +2221,8 @@ components: type: string readOnly: true tournament_round: - type: integer - readOnly: true + allOf: + - $ref: '#/components/schemas/TournamentRound' nullable: true participants: type: array @@ -2251,7 +2259,6 @@ components: - participants - replay_url - status - - tournament_round MatchParticipant: type: object properties: @@ -3093,7 +3100,10 @@ components: type: integer release_status: $ref: '#/components/schemas/ReleaseStatusEnum' + display_order: + type: integer required: + - display_order - id - name - tournament diff --git a/frontend2/src/api/_autogen/apis/CompeteApi.ts b/frontend2/src/api/_autogen/apis/CompeteApi.ts index 69d3ab3b7..d8502b2f3 100644 --- a/frontend2/src/api/_autogen/apis/CompeteApi.ts +++ b/frontend2/src/api/_autogen/apis/CompeteApi.ts @@ -94,6 +94,7 @@ export interface CompeteMatchScrimmageListRequest { export interface CompeteMatchTournamentListRequest { episodeId: string; + externalIdPrivate?: string; page?: number; roundId?: number; teamId?: number; @@ -470,7 +471,7 @@ export class CompeteApi extends runtime.BaseAPI { } /** - * List matches played in a tournament. + * List matches played in a tournament, or in all tournaments if not specified. Passing the external_id_private of a tournament allows match lookup for the tournament, even if it\'s private. Client uses the external_id_private parameter */ async competeMatchTournamentListRaw(requestParameters: CompeteMatchTournamentListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters.episodeId === null || requestParameters.episodeId === undefined) { @@ -479,6 +480,10 @@ export class CompeteApi extends runtime.BaseAPI { const queryParameters: any = {}; + if (requestParameters.externalIdPrivate !== undefined) { + queryParameters['external_id_private'] = requestParameters.externalIdPrivate; + } + if (requestParameters.page !== undefined) { queryParameters['page'] = requestParameters.page; } @@ -516,7 +521,7 @@ export class CompeteApi extends runtime.BaseAPI { } /** - * List matches played in a tournament. + * List matches played in a tournament, or in all tournaments if not specified. Passing the external_id_private of a tournament allows match lookup for the tournament, even if it\'s private. Client uses the external_id_private parameter */ async competeMatchTournamentList(requestParameters: CompeteMatchTournamentListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.competeMatchTournamentListRaw(requestParameters, initOverrides); diff --git a/frontend2/src/api/_autogen/models/Match.ts b/frontend2/src/api/_autogen/models/Match.ts index 0e9dcb35b..36d8754db 100644 --- a/frontend2/src/api/_autogen/models/Match.ts +++ b/frontend2/src/api/_autogen/models/Match.ts @@ -25,6 +25,12 @@ import { StatusBccEnumFromJSONTyped, StatusBccEnumToJSON, } from './StatusBccEnum'; +import type { TournamentRound } from './TournamentRound'; +import { + TournamentRoundFromJSON, + TournamentRoundFromJSONTyped, + TournamentRoundToJSON, +} from './TournamentRound'; /** * @@ -52,10 +58,10 @@ export interface Match { readonly episode: string; /** * - * @type {number} + * @type {TournamentRound} * @memberof Match */ - readonly tournament_round: number | null; + tournament_round?: TournamentRound | null; /** * * @type {Array} @@ -102,7 +108,6 @@ export function instanceOfMatch(value: object): boolean { isInstance = isInstance && "id" in value; isInstance = isInstance && "status" in value; isInstance = isInstance && "episode" in value; - isInstance = isInstance && "tournament_round" in value; isInstance = isInstance && "participants" in value; isInstance = isInstance && "maps" in value; isInstance = isInstance && "alternate_order" in value; @@ -126,7 +131,7 @@ export function MatchFromJSONTyped(json: any, ignoreDiscriminator: boolean): Mat 'id': json['id'], 'status': StatusBccEnumFromJSON(json['status']), 'episode': json['episode'], - 'tournament_round': json['tournament_round'], + 'tournament_round': !exists(json, 'tournament_round') ? undefined : TournamentRoundFromJSON(json['tournament_round']), 'participants': (json['participants'] === null ? null : (json['participants'] as Array).map(MatchParticipantFromJSON)), 'maps': json['maps'], 'alternate_order': json['alternate_order'], @@ -145,6 +150,7 @@ export function MatchToJSON(value?: Match | null): any { } return { + 'tournament_round': TournamentRoundToJSON(value.tournament_round), 'participants': (value.participants === null ? null : (value.participants as Array).map(MatchParticipantToJSON)), }; } diff --git a/frontend2/src/api/_autogen/models/TournamentRound.ts b/frontend2/src/api/_autogen/models/TournamentRound.ts index 90ad8d19d..10c0f4800 100644 --- a/frontend2/src/api/_autogen/models/TournamentRound.ts +++ b/frontend2/src/api/_autogen/models/TournamentRound.ts @@ -62,6 +62,12 @@ export interface TournamentRound { * @memberof TournamentRound */ release_status?: ReleaseStatusEnum; + /** + * + * @type {number} + * @memberof TournamentRound + */ + display_order: number; } /** @@ -72,6 +78,7 @@ export function instanceOfTournamentRound(value: object): boolean { isInstance = isInstance && "id" in value; isInstance = isInstance && "tournament" in value; isInstance = isInstance && "name" in value; + isInstance = isInstance && "display_order" in value; return isInstance; } @@ -92,6 +99,7 @@ export function TournamentRoundFromJSONTyped(json: any, ignoreDiscriminator: boo 'name': json['name'], 'maps': !exists(json, 'maps') ? undefined : json['maps'], 'release_status': !exists(json, 'release_status') ? undefined : ReleaseStatusEnumFromJSON(json['release_status']), + 'display_order': json['display_order'], }; } @@ -109,6 +117,7 @@ export function TournamentRoundToJSON(value?: TournamentRound | null): any { 'name': value.name, 'maps': value.maps, 'release_status': ReleaseStatusEnumToJSON(value.release_status), + 'display_order': value.display_order, }; }