diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f121948 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/build +/node_modules +.env \ No newline at end of file diff --git a/command_setup/commands.ts b/command_setup/commands.ts new file mode 100644 index 0000000..6f0aeb0 --- /dev/null +++ b/command_setup/commands.ts @@ -0,0 +1,438 @@ +import { SlashCommandBuilder, SlashCommandSubcommandBuilder } from "@discordjs/builders"; +import { languages, timezones } from "./localization_objects"; + +const commandObjects: CommandObject[] = [ + { + name: 'account', + description: 'Link, unlink, or check the status of your start.gg and Discord account.', + subcommands: [ + { + name: 'link', + description: 'Link your start.gg and Discord accounts. Other users cannot see you use this command.', + options: [ + { + name: 'profile', + description: 'Your start.gg profile URL.', + optionType: 'STRING', + required: true, + } + ] + }, + { + name: 'unlink', + description: 'Unlink your start.gg and Discord accounts. Other users cannot see you use this command.', + }, + { + name: 'status', + description: 'Check if a user\'s start.gg and Discord accounts are linked. Other\'s cannot see you use this command.', + options: [ + { + name: 'user', + description: 'The user you are checking.', + optionType: 'USER', + required: false, + } + ] + }, + // { + // name: 'profile', + // description: 'Check a user\'s profile and recent placements.', + // options: [ + // { + // name: 'user', + // description: 'The user you are checking. If omitted, gets your own profile.', + // optionType: 'USER', + // required: false, + // }, + // { + // name: 'hide', + // description: 'Choose to hide the message from others. By default, this is false.', + // optionType: 'BOOLEAN', + // required: false, + // } + // ] + // } + ] + }, + { + name: 'set', + description: 'Set channel or role for different features.', + subcommands: [ + { + name: 'channel', + description: 'Set channel for announcements, match calling, and match reports', + options: [ + { + name: 'feature', + description: 'The feature you are setting a channel for.', + optionType: 'STRING', + required: true, + choices: [ + { + name: 'announcements', + value: 'announcements' + }, + { + name: 'match calling', + value: 'match_calling' + }, + { + name: 'match reports', + value: 'match_reports' + } + ] + }, + { + name: 'channel', + description: 'The channel you are setting.', + optionType: 'CHANNEL', + required: true, + } + ] + }, + { + name: 'role', + description: 'Set role for announcements.', + options: [ + { + name: 'feature', + description: 'The feature you are setting a role for.', + optionType: 'STRING', + required: true, + choices: [ + { + name: 'announcements', + value: 'announcements' + } + ] + }, + { + name: 'role', + description: 'The role you are setting.', + optionType: 'ROLE', + required: true, + } + ] + }, + { + name: 'language', + description: 'Set the language you would like TournaBot to respond in.', + options: [ + { + name: 'language', + description: 'The language you would like TournaBot to respond in.', + optionType: 'STRING', + required: true, + choices: languages + } + ] + }, + { + name: 'timezone', + description: 'Set the timezone you would like TournaBot to use.', + options: [ + { + name: 'timezone', + description: 'The timezone you would like TournaBot to use.', + optionType: 'STRING', + required: true, + choices: timezones + } + ] + } + ] + }, + { + name: 'tournament', + description: 'Commands related to tournament moderation and automation.', + subcommands: [ + { + name: 'set', + description: 'Set the server\'s active tournament.', + options: [ + { + name: 'url', + description: 'The URL/short URL for the tournament you are setting.', + optionType: 'STRING', + required: true, + } + ] + }, + { + name: 'announce', + description: 'Announce the active start.gg tournament with additional info.', + options: [ + { + name: 'message', + description: 'Shows at the beginning of the announcement. Automatically filled if not provided.', + optionType: 'STRING', + required: false, + } + ] + } + ] + }, + { + name: 'allowlist', + description: 'Add or remove roles with access to TournaBot\'s admin commands.', + subcommands: [ + { + name: 'add', + description: 'Add a role to the allowlist.', + options: [ + { + name: 'role', + description: 'The role you would like to add.', + optionType: 'ROLE', + required: true, + } + ] + }, + { + name: 'remove', + description: 'Remove a role from the allowlist.', + options: [ + { + name: 'role', + description: 'The role you would like to from.', + optionType: 'ROLE', + required: true, + } + ] + } + ] + }, + { + name: 'match', + description: 'Start match pinging and reporting', + subcommands: [ + { + name: 'calling', + description: 'Pings player\'s a minute after check-in begins. Based on the server\'s active tournament.', + options: [ + { + name: 'action', + description: 'Choose whether to start or stop match calling.', + optionType: 'STRING', + required: true, + choices: [ + { + name: 'start', + value: 'start' + }, + { + name: 'stop', + value: 'stop' + } + ] + } + ] + }, + { + name: 'reporting', + description: 'Alerts when matches complete. Based on the server\'s active tournament.', + options: [ + { + name: 'action', + description: 'Choose whether to start or stop match reporting.', + optionType: 'STRING', + required: true, + choices: [ + { + name: 'start', + value: 'start' + }, + { + name: 'stop', + value: 'stop' + } + ] + } + ] + } + ] + }, + { + name: 'support', + description: 'Creates a support ticket for your match. Requires that your accounts are linked.', + subcommands: [] + }, + { + name: 'help', + description: 'Explains how to use TournaBot\'s features/commands.', + subcommands: [] + }, + // { + // name: 'reminders', + // description: 'Toggle automatic tournament reminders.', + // subcommands: [ + // { + // name: 'toggle', + // description: 'Toggle automatic tournament reminders.', + // options: [ + // { + // name: 'toggle', + // description: 'Whether you want reminders on or off.', + // optionType: 'STRING', + // required: true, + // choices: [ + // { + // name: 'on', + // value: 'true', + // }, + // { + // name: 'off', + // value: 'false', + // } + // ] + // } + // ] + // } + // ] + // }, + // { + // name: 'matchmaking', + // description: 'Create, delete, or refresh a matchmaking queue.', + // subcommands: [ + // { + // name: 'create', + // description: 'Create a matchmaking queue. Generates a queue channel in this category.', + // options: [ + // { + // name: 'name', + // description: 'The name of the queue.', + // optionType: 'STRING', + // required: true, + // }, + // { + // name: 'game', + // description: 'The game that the queue is based on.', + // optionType: 'STRING', + // required: true, + // choices: [ + // { + // name: 'Super Smash Bros. Ultimate', + // value: 'ssbu' + // } + // ] + // } + // ] + // }, + // { + // name: 'delete', + // description: 'Delete one or all queues. To delete one, run command in queue channel.', + // }, + // { + // name: 'refresh', + // description: 'Refresh one or all queues. To refresh one, run command in queue channel.', + // }, + // { + // name: 'test', + // description: 'Refresh one or all queues. To refresh one, run command in queue channel.', + // } + // ] + // } +] + +const assignOption = (c: SlashCommandBuilder | SlashCommandSubcommandBuilder, option: Option) => { + switch (option.optionType) { + case 'STRING': + c.addStringOption((opt) => { + opt.setName(option.name).setDescription(option.description).setRequired(option.required); + if (!option.choices?.length) return opt; + for (const choice of option.choices) { + opt.addChoices({ name: choice.name, value: choice.value as string }); + } + return opt; + }); + break; + case 'INTEGER': + c.addIntegerOption((opt) => { + opt.setName(option.name).setDescription(option.description).setRequired(option.required); + if (!option.choices?.length) return opt; + for (const choice of option.choices) { + opt.addChoices({ name: choice.name, value: choice.value as number }); + } + return opt; + }); + break; + case 'BOOLEAN': + c.addBooleanOption((opt) => { + opt.setName(option.name).setDescription(option.description).setRequired(option.required); + return opt; + }); + break; + case 'USER': + c.addUserOption((opt) => { + opt.setName(option.name).setDescription(option.description).setRequired(option.required); + return opt; + }); + break; + case 'CHANNEL': + c.addChannelOption((opt) => { + opt.setName(option.name).setDescription(option.description).setRequired(option.required); + return opt; + }); + break; + case 'ROLE': + c.addRoleOption((opt) => { + opt.setName(option.name).setDescription(option.description).setRequired(option.required); + return opt; + }); + break; + } + return c; +} + +export const commands = commandObjects.map(commandObject => { + let command = new SlashCommandBuilder() + .setName(commandObject.name) + .setDescription(commandObject.description); + // check and iterate through command options + if (commandObject.options?.length) { + for (const option of commandObject.options) { + command = assignOption(command, option) as SlashCommandBuilder; + } + } + if (!commandObject.subcommands?.length) return command.toJSON(); + for (const subcommand of commandObject.subcommands) { + command.addSubcommand((sc) => { + sc.setName(subcommand.name).setDescription(subcommand.description); + if (!subcommand.options?.length) return sc; + for (const option of subcommand.options) { + sc = assignOption(sc, option) as SlashCommandSubcommandBuilder; + } + return sc; + }); + } + + return command.toJSON(); +}); + +interface CommandObject { + name: string; + description: string; + subcommands?: Subcommand[]; + options?: Option[]; +} + +interface Subcommand { + name: string; + description: string; + options?: Option[]; +} + +interface Option { + name: string; + description: string; + optionType: OptionType; + required: boolean; + choices?: Choice[]; +} + +type OptionType = 'STRING' | 'INTEGER' | 'BOOLEAN' | 'USER' | 'CHANNEL' | 'ROLE'; + +interface Choice { + name: string; + value: string | number; +} diff --git a/command_setup/create_commands_global.ts b/command_setup/create_commands_global.ts new file mode 100644 index 0000000..42afecc --- /dev/null +++ b/command_setup/create_commands_global.ts @@ -0,0 +1,19 @@ +import { REST } from '@discordjs/rest'; +import Discord from 'discord.js'; +import { commands } from "./commands"; +const { Routes } = require('discord-api-types/v9'); +require('dotenv').config(); + +const client = new Discord.Client({ intents: ['GUILDS'] }); +const TOKEN = process.env.DISCORD_BOT_TOKEN; + +client.once('ready', () => { + const rest = new REST({ version: '9' }).setToken(TOKEN); + + rest.put(Routes.applicationCommands(client.user.id), { body: commands }) + .then(() => console.log(`Successfully created ${commands.length} commands globally.`)) + .then(() => process.exit(0)) + .catch(console.error); +}); + +client.login(TOKEN); diff --git a/command_setup/create_commands_guild.ts b/command_setup/create_commands_guild.ts new file mode 100644 index 0000000..f69481e --- /dev/null +++ b/command_setup/create_commands_guild.ts @@ -0,0 +1,19 @@ +import { REST } from '@discordjs/rest'; +import Discord from 'discord.js'; +import { commands } from "./commands"; +const { Routes } = require('discord-api-types/v9'); +require('dotenv').config(); + +const client = new Discord.Client({ intents: ['GUILDS'] }); +const TOKEN = process.env.DEV_DISCORD_BOT_TOKEN; + +client.once('ready', () => { + const rest = new REST({ version: '9' }).setToken(TOKEN); + + rest.put(Routes.applicationGuildCommands(client.user.id, process.env.DEV_GUILD_ID), { body: commands }) + .then(() => console.log(`Successfully created ${commands.length} commands in the development guild.`)) + .then(() => process.exit(0)) + .catch(console.error); +}); + +client.login(TOKEN); diff --git a/command_setup/delete_commands.ts b/command_setup/delete_commands.ts new file mode 100644 index 0000000..f17f848 --- /dev/null +++ b/command_setup/delete_commands.ts @@ -0,0 +1,26 @@ +import Discord from 'discord.js'; +const { REST } = require('@discordjs/rest'); +const { Routes } = require('discord-api-types/v9'); +require('dotenv').config(); + +const client = new Discord.Client({ intents: ['GUILDS'] }); +const TOKEN = process.env.DISCORD_BOT_TOKEN; + +client.once('ready', () => { + const rest = new REST({ version: '9' }).setToken(TOKEN); + + rest.get(Routes.applicationCommands(client.user.id)) + .then((data: any) => { + const promises = []; + for (const command of data) { + const deleteUrl = `${Routes.applicationCommands(client.user.id)}/${command.id}`; + promises.push(rest.delete(deleteUrl)); + } + return Promise.all(promises); + }) + .then(() => console.log('Successfully deleted all commands globally.')) + .then(() => process.exit(0)) + .catch(console.error); +}); + +client.login(TOKEN); diff --git a/command_setup/localization_objects.ts b/command_setup/localization_objects.ts new file mode 100644 index 0000000..9be7b36 --- /dev/null +++ b/command_setup/localization_objects.ts @@ -0,0 +1,119 @@ +export const languages = [ + // { name: 'Afrikaans', value: 'af' }, + // { name: 'Albanian', value: 'sq' }, + // { name: 'Amharic', value: 'am' }, + { name: 'Arabic', value: 'ar' }, + // { name: 'Armenian', value: 'hy' }, + // { name: 'Azerbaijani', value: 'az' }, + // { name: 'Basque', value: 'eu' }, + // { name: 'Belarusian', value: 'be' }, + // { name: 'Bengali', value: 'bn' }, + // { name: 'Bosnian', value: 'bs' }, + // { name: 'Bulgarian', value: 'bg' }, + // { name: 'Catalan', value: 'ca' }, + // { name: 'Cebuano', value: 'ceb' }, + { name: 'Chinese (Simplified)', value: 'zh' }, + { name: 'Chinese (Traditional)', value: 'zh-TW' }, + // { name: 'Corsican', value: 'co' }, + // { name: 'Croatian', value: 'hr' }, + // { name: 'Czech', value: 'cs' }, + // { name: 'Danish', value: 'da' }, + // { name: 'Dutch', value: 'nl' }, + { name: 'English', value: 'en' }, + // { name: 'Esperanto', value: 'eo' }, + // { name: 'Estonian', value: 'et' }, + // { name: 'Finnish', value: 'fi' }, + { name: 'French', value: 'fr' }, + // { name: 'Frisian', value: 'fy' }, + // { name: 'Galician', value: 'gl' }, + // { name: 'Georgian', value: 'ka' }, + { name: 'German', value: 'de' }, + // { name: 'Greek', value: 'el' }, + // { name: 'Gujarati', value: 'gu' }, + // { name: 'Haitian Creole', value: 'ht' }, + // { name: 'Hausa', value: 'ha' }, + // { name: 'Hawaiian', value: 'haw' }, + // { name: 'Hebrew', value: 'he' }, + { name: 'Hindi', value: 'hi' }, + // { name: 'Hmong', value: 'hmn' }, + // { name: 'Hungarian', value: 'hu' }, + // { name: 'Icelandic', value: 'is' }, + // { name: 'Igbo', value: 'ig' }, + // { name: 'Indonesian', value: 'id' }, + // { name: 'Irish', value: 'ga' }, + { name: 'Italian', value: 'it' }, + { name: 'Japanese', value: 'ja' }, + // { name: 'Javanese', value: 'jv' }, + // { name: 'Kannada', value: 'kn' }, + // { name: 'Kazakh', value: 'kk' }, + // { name: 'Khmer', value: 'km' }, + // { name: 'Kinyarwanda', value: 'rw' }, + // { name: 'Korean', value: 'ko' }, + // { name: 'Kurdish', value: 'ku' }, + // { name: 'Kyrgyz', value: 'ky' }, + // { name: 'Lao', value: 'lo' }, + // { name: 'Latvian', value: 'lv' }, + // { name: 'Lithuanian', value: 'lt' }, + // { name: 'Luxembourgish', value: 'lb' }, + // { name: 'Macedonian', value: 'mk' }, + // { name: 'Malagasy', value: 'mg' }, + // { name: 'Malay', value: 'ms' }, + // { name: 'Malayalam', value: 'ml' }, + // { name: 'Maltese', value: 'mt' }, + // { name: 'Maori', value: 'mi' }, + // { name: 'Marathi', value: 'mr' }, + // { name: 'Mongolian', value: 'mn' }, + // { name: 'Myanmar (Burmese)', value: 'my' }, + // { name: 'Nepali', value: 'ne' }, + // { name: 'Norwegian', value: 'no' }, + // { name: 'Nyanja (Chichewa)', value: 'ny' }, + // { name: 'Odia (Oriya)', value: 'or' }, + // { name: 'Pashto', value: 'ps' }, + // { name: 'Persian', value: 'fa' }, + // { name: 'Polish', value: 'pl' }, + { name: 'Portugese', value: 'pt' }, + // { name: 'Punjabi', value: 'pa' }, + // { name: 'Romanian', value: 'ro' }, + { name: 'Russian', value: 'ru' }, + // { name: 'Samoan', value: 'sm' }, + // { name: 'Serbian', value: 'sr' }, + // { name: 'Sesotho', value: 'st' }, + // { name: 'Shona', value: 'sn' }, + // { name: 'Sindhi', value: 'sd' }, + // { name: 'Sinhala (Sinhalese)', value: 'si' }, + // { name: 'Slovak', value: 'sk' }, + // { name: 'Slovenian', value: 'sl' }, + // { name: 'Somali', value: 'so' }, + { name: 'Spanish', value: 'es' }, + // { name: 'Sundanese', value: 'su' }, + // { name: 'Swahili', value: 'sw' }, + // { name: 'Swedish', value: 'sv' }, + // { name: 'Tagalog (Filipino)', value: 'tl' }, + // { name: 'Tajik', value: 'tg' }, + // { name: 'Tamil', value: 'ta' }, + // { name: 'Tatar', value: 'tt' }, + // { name: 'Telugu', value: 'te' }, + // { name: 'Thai', value: 'th' }, + // { name: 'Turkish', value: 'tr' }, + // { name: 'Turkmen', value: 'tk' }, + // { name: 'Ukrainian', value: 'uk' }, + // { name: 'Urdu', value: 'ur' }, + // { name: 'Uyghur', value: 'ug' }, + // { name: 'Uzbek', value: 'uz' }, + // { name: 'Vietnamese', value: 'vi' }, + // { name: 'Welsh', value: 'cy' }, + // { name: 'Xhosa', value: 'xh' }, + // { name: 'Yiddish', value: 'yi' }, + // { name: 'Yoruba', value: 'yo' }, + // { name: 'Zulu', value: 'zu' }, +]; + +export const timezones = [ + { name: 'PST/PDT (Los Angeles, California, USA)', value: 'America/Los_Angeles' }, + { name: 'MST (Phoenix, Arizona, USA)', value: 'America/Phoenix' }, + { name: 'MST/MDT (Denver, Colorado, USA)', value: 'America/Denver' }, + { name: 'CST (Regina, Saskatchewan, Canada)', value: 'America/Regina' }, + { name: 'CST/CDT (Chicago, Illinois, USA)', value: 'America/Chicago' }, + { name: 'EST/EDT (New York, New York, USA)', value: 'America/New_York' }, + { name: 'HST (Honolulu, Hawaii, USA)', value: 'Pacific/Honolulu' } +]; diff --git a/database/database.ts b/database/database.ts new file mode 100644 index 0000000..a2ac12d --- /dev/null +++ b/database/database.ts @@ -0,0 +1,4 @@ +import mongoose from 'mongoose'; +require('dotenv').config(); + +export const database = mongoose.connect(process.env.MONGODB_AUTH_URL); diff --git a/database/models/accounts.ts b/database/models/accounts.ts new file mode 100644 index 0000000..ebae556 --- /dev/null +++ b/database/models/accounts.ts @@ -0,0 +1,28 @@ +import { Schema, model } from 'mongoose'; + +const fileName = require('path').basename(__filename); +const collectionName = fileName.substring(0, fileName.length - 3); + +const accountSchema = new Schema({ + discordTag: String, + discordId: String, + slug: String, + playerId: Number, + remind: Boolean, + authorizations: Array +}); + +export interface AccountData { + discordTag: string; + discordId: string; + slug: string; + playerId: number; + remind: boolean; + authorizations: { + externalId: string | null; + externalUsername: string; + type: string; + }[] +} + +export const Accounts = model(collectionName, accountSchema); diff --git a/database/models/guilds.ts b/database/models/guilds.ts new file mode 100644 index 0000000..c3e8ffe --- /dev/null +++ b/database/models/guilds.ts @@ -0,0 +1,17 @@ +import { Schema, model } from 'mongoose'; +import { TournaBotGuildData } from '../../src/types/guild'; + +const fileName = require('path').basename(__filename); +const collectionName = fileName.substring(0, fileName.length - 3); + +const schema = new Schema({ + guildId: String, + locale: String, + timezone: String, + activeTournament: String, + channels: Array, + roles: Array, + allowlist: Array +}); + +export const Guilds = model(collectionName, schema); diff --git a/database/models/matches.ts b/database/models/matches.ts new file mode 100644 index 0000000..e69de29 diff --git a/database/models/players.ts b/database/models/players.ts new file mode 100644 index 0000000..a13eee8 --- /dev/null +++ b/database/models/players.ts @@ -0,0 +1,15 @@ +import { Schema, model } from 'mongoose'; +import { MatchmakingPlayerData } from '../../src/types/matchmaking/player'; + +const fileName = require('path').basename(__filename); +const collectionName = fileName.substring(0, fileName.length - 3); + +const schema = new Schema({ + discordId: String, + queueId: String, + points: Number, + wins: Number, + losses: Number +}); + +export const Players = model(collectionName, schema); diff --git a/database/models/queues.ts b/database/models/queues.ts new file mode 100644 index 0000000..d0dfc98 --- /dev/null +++ b/database/models/queues.ts @@ -0,0 +1,15 @@ +import { Schema, model } from 'mongoose'; +import { MatchmakingQueueData } from '../../src/types/matchmaking/queue'; + +const fileName = require('path').basename(__filename); +const collectionName = fileName.substring(0, fileName.length - 3); + +const schema = new Schema({ + channelId: String, + guildId: String, + name: String, + game: String, + playersInQueue: Array +}); + +export const Queues = model(collectionName, schema); diff --git a/database/models/tickets.ts b/database/models/tickets.ts new file mode 100644 index 0000000..82fea94 --- /dev/null +++ b/database/models/tickets.ts @@ -0,0 +1,18 @@ +import { Schema, model } from 'mongoose'; +import { SupportTicketData } from '../../src/types/support'; + +const fileName = require('path').basename(__filename); +const collectionName = fileName.substring(0, fileName.length - 3); + +const schema = new Schema({ + resolved: Boolean, + id: String, + guildId: String, + discordId: String, + channelId: String, + setId: String, + phase: String, + issue: Object +}); + +export const Support = model(collectionName, schema); diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 0000000..09d7512 --- /dev/null +++ b/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": ["src", "database", "command_setup"], + "ext": "ts", + "exec": "tsc && node build/src/main.js" +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..445caa9 --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "name": "tournabot-refactored", + "version": "1.0.0", + "description": "Streamline start.gg tournaments and improve user quality-of-life.", + "main": "build/src/main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc && node build/command_setup/create_commands_guild.js && node build/src/nlp/train_model.js", + "train": "tsc && node build/src/nlp/train_model.js", + "deploy": "tsc && node build/command_setup/create_commands_global.js && node build/src/nlp/train_model.js", + "delete": "tsc ** node build/command_setup/delete_commands.js" + }, + "author": "Ayaan Govil", + "license": "GPL-3.0", + "dependencies": { + "@discordjs/builders": "^0.13.0", + "@discordjs/rest": "^0.4.1", + "discord-api-types": "^0.33.0", + "discord.js": "^13.7.0", + "dotenv": "^16.0.1", + "fast-average-color-node": "^2.2.0", + "mongoose": "^6.3.3", + "node-fetch": "^2.6.7", + "node-nlp": "^4.24.0", + "node-schedule": "^2.1.0", + "redis": "^4.1.0", + "short-unique-id": "^4.4.4", + "typescript": "^4.6.4" + }, + "devDependencies": { + "@genql/cli": "^2.10.0", + "@genql/runtime": "^2.10.0", + "@typescript-eslint/eslint-plugin": "^5.25.0", + "@typescript-eslint/parser": "^5.25.0", + "eslint": "^8.15.0", + "nodemon": "^2.0.16" + }, + "postinstall": "rm ./node_modules/mongoose/index.d.ts" +} \ No newline at end of file diff --git a/src/commands/account.ts b/src/commands/account.ts new file mode 100644 index 0000000..49b73c2 --- /dev/null +++ b/src/commands/account.ts @@ -0,0 +1,93 @@ +import { CommandInteraction, MessageComponentInteraction } from "discord.js"; +import { Accounts } from "../../database/models/accounts"; +import { Messenger } from "../messaging"; +import { StartggAPI } from "../startgg/api"; +import { User } from "../startgg/genql"; +import { GuildManager } from "../types/guild"; + + + +// add double check during linking that verifies account authenticity (if discord is linked on startgg) + + + +export default { + name: 'account', + adminRequired: false, + canRunInDMs: true, + defer: true, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + if (interaction.inGuild()) { + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + } + + const subCommandName = interaction.options.getSubcommand(); + switch (subCommandName) { + case 'link': + const profileURL = interaction.options.getString('profile'); + if (!profileURL.startsWith('https://www.start.gg/user/')) return callBackMessage(); + const slug = profileURL.replace('https://www.start.gg/user/', ''); + + const data = await StartggAPI.getUser(slug); + const user = data.user as User; + if (!user) return callBackMessage(); + + const updateQuery = { + discordId: interaction.user.id, + } + + const update = { + discordTag: interaction.user.tag, + discordId: interaction.user.id, + slug: slug, + playerId: user.player.id, + remind: true, + authorizations: user.authorizations + } + + const updateOptions = { + new: true, + upsert: true + } + + const updateResponse = await Accounts.findOneAndUpdate(updateQuery, update, updateOptions); + console.log(`Linked ${updateResponse.discordTag}`); + + return m.editReply('**Success!** Your start.gg and Discord accounts are now linked. Check out `/results` for a custom embed of your placements!'); + + async function callBackMessage() { + await m.editReply('**Invalid URL.** Please provide a valid start.gg profile URL.\nExample: https://start.gg/user/96687337'); + } + + case 'unlink': + const conditions = { + discordId: interaction.user.id + } + + const deleteResponse = await Accounts.findOneAndDelete(conditions); + + if (deleteResponse) return m.editReply('**All done.** Your start.gg and Discord accounts are now unlinked.'); + else return m.editReply('**Your start.gg and Discord accounts are not currently linked.** You can use `/account link` to link your accounts.'); + + case 'status': + const userArg = interaction.options.getUser('user'); + const userId = userArg ? userArg.id : interaction.user.id; + const mention = userId === interaction.user.id ? 'Your' : `<@${userId}>'s`; + + const findQuery = { + discordId: userId + } + + const findResponse = await Accounts.findOne(findQuery); + if (findResponse) return m.editReply(`**${mention} start.gg and Discord accounts are linked!** :white_check_mark:`); + else return m.editReply(`**${mention} start.gg and Discord accounts are not currently linked.** :x:`); + case 'profile': + // write this + break; + } + }, + messageComponentExecute: async (interaction: MessageComponentInteraction, args: string[]) => { + + } +} diff --git a/src/commands/allowlist.ts b/src/commands/allowlist.ts new file mode 100644 index 0000000..f26617d --- /dev/null +++ b/src/commands/allowlist.ts @@ -0,0 +1,39 @@ +import { CommandInteraction, MessageComponentInteraction } from "discord.js"; +import { Messenger } from "../messaging"; +import { GuildManager } from "../types/guild"; + +export default { + name: 'allowlist', + adminRequired: true, + canRunInDMs: false, + defer: true, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + + const role = interaction.options.getRole('role'); + let reply: string; + + const subCommand = interaction.options.getSubcommand(); + switch (subCommand) { + case 'add': + if (guild.allowlist.includes(role.id)) return m.editReply('**This role is already added.**'); + guild.allowlist.push(role.id); + reply = `**Success!** Added <@&${role.id}> to the allowlist.`; + break; + + case 'remove': + if (!guild.allowlist.includes(role.id)) return m.editReply('**This role is not currently added.**'); + guild.allowlist.splice(guild.allowlist.indexOf(role.id), 1); + reply = `**All done.** Removed <@&${role.id}> from the allowlist.`; + break; + } + + const response = await guild.updateAll(); + if (!response) return m.editReply(`**An error occured.** Please try again. Reach out to \`F0ne#1933\` if the problem persists.`); + else return m.editReply(reply); + }, + messageComponentExecute: async (interaction: MessageComponentInteraction, args: string[]) => { + + } +} diff --git a/src/commands/help.ts b/src/commands/help.ts new file mode 100644 index 0000000..0675302 --- /dev/null +++ b/src/commands/help.ts @@ -0,0 +1,35 @@ +import { CommandInteraction, DMChannel, GuildMember, MessageComponentInteraction, SelectMenuInteraction } from "discord.js"; +import { Messenger } from "../messaging"; +import { HelpStructure } from "../types/help"; + +export default { + name: 'help', + adminRequired: false, + canRunInDMs: true, + defer: true, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + interaction.editReply({ embeds: [HelpStructure.getEmbed('user', 0)], components: HelpStructure.getComponents('user', 0) }) + .catch(err => console.error('Interaction editReply error in help.ts')); + }, + messageComponentExecute: async (interaction: MessageComponentInteraction | SelectMenuInteraction, args: string[], m: Messenger) => { + if (args.length === 1) args.push('0'); + if (!args[2]) args[2] = ''; + + const options: [string, number, string] = [args[0], parseInt(args[1]), args[2]]; + + const interactionValues = (interaction as SelectMenuInteraction).values; + if (interactionValues) { + const featureSelection = interactionValues[0].split('_'); + if (featureSelection[0] === 'otherType') { + options[0] = featureSelection[1]; + options[1] = 0; + } else { + options[1] = parseInt(featureSelection[1]); + options[2] = featureSelection[0]; + } + } + + interaction.update({ embeds: [HelpStructure.getEmbed(...options)], components: HelpStructure.getComponents(...options) }) + .catch(err => console.error('Interaction update error in help.ts')); + } +} diff --git a/src/commands/match.ts b/src/commands/match.ts new file mode 100644 index 0000000..4333e8a --- /dev/null +++ b/src/commands/match.ts @@ -0,0 +1,55 @@ +import { CommandInteraction, DMChannel, GuildMember, MessageComponentInteraction, SelectMenuInteraction } from "discord.js"; +import { Messenger } from "../messaging"; +import { GuildManager } from "../types/guild"; +import { MatchCallingThread, MatchReportingThread } from "../types/match"; + +export const matchCallingThreads = new Map(); +export const matchReportingThreads = new Map(); + +// add event choosing layer + +export default { + name: 'match', + adminRequired: true, + canRunInDMs: false, + defer: false, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + + if (!guild.activeTournament.length) return m.reply('**There is no active tournament set.** You can use `/tournament set` to set the active tournament.', true); + + const subCommandName = interaction.options.getSubcommand(); + const action = interaction.options.getString('action'); + if (subCommandName === 'calling') { + const activeThread = matchCallingThreads.get(interaction.guildId); + if (action === 'start') { + if (activeThread) return m.reply('**Match calling is currently active.** You can use `/match calling stop` to stop it.', true); + else m.reply('**Match calling has started!** You can use `/match calling stop` to stop it at any time.', true); + const channel = await guild.getDiscordChannel('match_calling', interaction.guild); + const thread = new MatchCallingThread(guild.activeTournament, m, channel); + thread.start(); + } else if (action === 'stop') { + if (!activeThread) return m.reply('**Match calling is not currently active.** You can use `/match calling start` to start it.', true); + else m.reply('**Stopped match calling!**', true); + activeThread.stop(); + } + } else if (subCommandName === 'reporting') { + const activeThread = matchReportingThreads.get(interaction.guildId); + if (action === 'start') { + if (activeThread) return m.reply('**Match reporting is currently active.** You can use `/match reporting stop` to stop it.', true); + else m.reply('**Match reporting has started!** You can use `/match reporting stop` to stop it at any time.', true); + const channel = await guild.getDiscordChannel('match_reports', interaction.guild); + const thread = new MatchReportingThread(guild.activeTournament, m, channel); + thread.start(); + } else if (action === 'stop') { + if (!activeThread) return m.reply('**Match reporting is not currently active.** You can use `/match reporting start` to start it.', true); + else m.reply('**Stopped match reporting!**', true); + activeThread.stop(); + } + } + }, + messageComponentExecute: async (interaction: MessageComponentInteraction | SelectMenuInteraction, args: string[], m: Messenger) => { + + } +} diff --git a/src/commands/matchmaking.ts b/src/commands/matchmaking.ts new file mode 100644 index 0000000..4952c2a --- /dev/null +++ b/src/commands/matchmaking.ts @@ -0,0 +1,117 @@ +import { CommandInteraction, DMChannel, GuildMember, MessageComponentInteraction, SelectMenuInteraction, TextChannel, ThreadManager } from "discord.js"; +import { Messenger } from "../messaging"; +import { GuildManager } from "../types/guild"; +import { GameShorthand } from "../types/matchmaking/match"; +import { MatchmakingQueue, MatchmakingQueueData, QueueManager } from "../types/matchmaking/queue"; + + +// ADD DELETE GAME THROUGH ADMIN PANEL + + +export default { + name: 'matchmaking', + adminRequired: true, + canRunInDMs: false, + defer: true, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + const queue = await QueueManager.get(interaction.guildId, interaction.channelId); + + const subCommandName = interaction.options.getSubcommand(); + switch (subCommandName) { + case 'create': + const name = interaction.options.getString('name'); + const gameShorthand = interaction.options.getString('game') as GameShorthand; + + const newQueue = await QueueManager.create( + { + guildId: interaction.guildId, + channelId: interaction.channelId, + name: name, + game: gameShorthand, + } as MatchmakingQueueData + ); + //new MatchmakingQueue(interaction.guildId, name, gameShorthand); + //await newQueue.buildQueueChannel(interaction.guild, guild, interaction.channel as TextChannel); + //guild.queues.push(newQueue); + + await m.editReply(`**Success!** Created ${name}.`).catch(err => err); + break; + + case 'delete': + if (queue?.channelId === interaction.channelId) { + // delete single queue + await QueueManager.remove(interaction.guildId, interaction.channelId); + } else { + // delete all queues + await QueueManager.removeAll(interaction.guildId); + await m.editReply('**Success!** All queues have been deleted.').catch(err => err); + } + break; + + case 'refresh': + if (queue?.channelId === interaction.channelId) { + // refresh single queue + await QueueManager.refresh(queue); + await m.editReply(`**Success!** ${queue.name} has been refreshed.`).catch(err => err);; + } else { + // refresh all queues + await QueueManager.refreshAll(interaction.guildId); + await m.editReply('**Success!** All queues have been refreshed.').catch(err => err);; + } + break; + } + }, + messageComponentExecute: async (interaction: MessageComponentInteraction | SelectMenuInteraction, args: string[], m: Messenger) => { + // await interaction.deferReply({ ephemeral: true }); + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + const queue = await QueueManager.get(interaction.guildId, interaction.channelId); + + + // need to rework everything below + + + // switch (args[0]) { + // case 'queue': + // await interaction.deferReply({ ephemeral: true }); + // const matchExists = queue.matches.find(m => m.playerIds.includes(interaction.user.id)); + // if (matchExists) return m.editReply('You are currently in a match. If this is a mistake, please ask an admin to refresh the queue.'); + + // const isPlayerAdded = await queue.addPlayerToQueue(interaction.user.id); + // if (isPlayerAdded) { + // await queue.buildQueuePanel(interaction.channel as TextChannel); + // await m.editReply('**Success!** You have been added to the queue.'); + // } else return m.editReply('You are already in the queue.'); + // break; + + // case 'unqueue': + // await interaction.deferReply({ ephemeral: true }); + // const isPlayerRemoved = await queue.removePlayerFromQueue(interaction.user.id); + // if (isPlayerRemoved) { + // await queue.buildQueuePanel(interaction.channel as TextChannel); + // await m.editReply('**Success!** You have been removed from the queue.'); + // } else return m.editReply('You are not in the queue.'); + // break; + + // default: + // // todo: + // // - replace everything with translations + // // - complete play and report phase + // await interaction.deferUpdate(); + + // let match; + // for (const queue of guild.queues) { + // match = queue.matches.find(m => m.playerIds.includes(interaction.user.id)); + // if (match) break; + // } + + // if (interaction.componentType === 'SELECT_MENU') args = args.concat((interaction as SelectMenuInteraction).values); + // return match.updateMatchPanel(args, interaction as MessageComponentInteraction); + // } + + + // queue.checkToStartMatch(interaction.channel as TextChannel); + } +} diff --git a/src/commands/reminders.ts b/src/commands/reminders.ts new file mode 100644 index 0000000..32e01cd --- /dev/null +++ b/src/commands/reminders.ts @@ -0,0 +1,32 @@ +import { CommandInteraction, DMChannel, GuildMember, MessageComponentInteraction, SelectMenuInteraction } from "discord.js"; +import { Accounts } from "../../database/models/accounts"; +import { Messenger } from "../messaging"; +import { GuildManager } from "../types/guild"; + +export default { + name: 'reminders', + adminRequired: false, + canRunInDMs: true, + defer: true, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + if (interaction.inGuild()) { + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + } + + const subCommandName = interaction.options.getSubcommand(); + switch (subCommandName) { + case 'toggle': + const findResponse = await Accounts.findOne({ discordId: interaction.user.id }); + if (!findResponse) return m.editReply('**Your start.gg and Discord accounts must be linked to use this command.** You can use `/account link` to link your accounts.'); + + const toggle = (interaction.options.getString('toggle') === 'true'); + const updateResponse = await Accounts.findOneAndUpdate({ discordId: interaction.user.id }, { remind: toggle }, { new: true }); + + return m.editReply(`**Success!** Your automatic tournament reminders have been toggled \`${toggle ? 'on' : 'off'}\`!`); + } + }, + messageComponentExecute: async (interaction: MessageComponentInteraction | SelectMenuInteraction, args: string[], m: Messenger) => { + + } +} diff --git a/src/commands/set.ts b/src/commands/set.ts new file mode 100644 index 0000000..1bc71dd --- /dev/null +++ b/src/commands/set.ts @@ -0,0 +1,64 @@ +import { CommandInteraction, DMChannel, GuildMember, MessageComponentInteraction } from "discord.js"; +import { languages, timezones } from "../../command_setup/localization_objects"; +import { Messenger } from "../messaging"; +import { GuildManager } from "../types/guild"; +const fetch = require('node-fetch'); + +export default { + name: 'set', + adminRequired: true, + canRunInDMs: false, + defer: true, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + const type = interaction.options.getString('feature') || 'active'; + let typeName = type.replace('_', ' '); + + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + + let guildObjectString: string; + + const subCommandName = interaction.options.getSubcommand(); + switch (subCommandName) { + case 'channel': + const channel = interaction.options.getChannel('channel'); + if (channel.type !== 'GUILD_TEXT') return m.editReply('**Invalid channel.** Must be a text channel.'); + + guild.setChannel(type, channel.id); + guildObjectString = `<#${channel.id}>`; + break; + + case 'role': + const role = interaction.options.getRole('role'); + if (role.id === interaction.guildId) { + guild.removeRole(type); + guildObjectString = `@everyone`; + } else { + guild.setRole(type, role.id); + guildObjectString = `<@&${role.id}>`; + } + break; + + case 'language': + const locale = interaction.options.getString('language'); + guild.locale = locale; + typeName = 'server\'s'; + guildObjectString = `\`${languages.find(l => l.value === locale).name}\``; + break; + + case 'timezone': + const timezone = interaction.options.getString('timezone'); + guild.timezone = timezone; + typeName = 'server\'s'; + guildObjectString = `\`${timezones.find(t => t.value === timezone).name}\``; + break; + } + + const response = await guild.updateAll(); + if (!response) return m.editReply(`**An error occured setting your ${typeName} ${subCommandName}.** Please try again. Reach out to \`F0ne#1933\` if the problem persists.`); + else return m.editReply(`**Success!** The ${typeName} ${subCommandName} is now set to ${guildObjectString}.`); + }, + messageComponentExecute: async (interaction: MessageComponentInteraction, args: string[]) => { + + } +} diff --git a/src/commands/support.ts b/src/commands/support.ts new file mode 100644 index 0000000..1aa917b --- /dev/null +++ b/src/commands/support.ts @@ -0,0 +1,176 @@ +import { CommandInteraction, Message, MessageActionRow, MessageComponentInteraction, MessageSelectMenu, SelectMenuInteraction, TextChannel } from "discord.js"; +import { Accounts } from "../../database/models/accounts"; +import { client } from "../main"; +import { Messenger } from "../messaging"; +import nlp from "../nlp/load_model"; +import { GuildManager, TournaBotGuild } from "../types/guild"; +import { issues, SupportManager } from "../types/support"; + + + +// TODO: +// - cancel ticket as user +// - disable select menus after using them + + + +export default { + name: 'support', + adminRequired: false, + canRunInDMs: false, + defer: true, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + if (!guild.activeTournament.length) return m.editReply('**There is no active tournament set.** Please ask an admin to set an active tournament before using this command.'); + + const account = await Accounts.findOne({ discordId: interaction.user.id }); + if (!account) return m.editReply('**Your start.gg and Discord accounts must be linked to use this command.** You can use `/account link` to link your accounts.'); + + const supportCategory = await SupportManager.buildSupportCategory(guild, interaction.guild); + const supportDashboard = await SupportManager.buildSupportDashboard(guild, interaction.guild, supportCategory); + + const ticketChannel = await SupportManager.create(interaction.guild, interaction.user.id, supportCategory); + if (ticketChannel) await m.editReply(`**I can help you out!** A ticket has just been opened for you at <#${ticketChannel.id}>.`); + else return m.editReply('**You already have a ticket open.** Please resolve your current ticket before creating a new one.'); + + const ticket = await SupportManager.getByChannelId(interaction.guildId, ticketChannel.id); + ticket.phase = 'question'; + + const actionRow = new MessageActionRow().addComponents( + new MessageSelectMenu() + .setCustomId('support') + .setPlaceholder(await m.translate('Reply below or select your issue...')) + .addOptions(issues.map(issue => { + return { + label: issue.name, + description: issue.description, + value: issue.type + } + })), + ); + + await ticketChannel.send({ content: await m.translate(`**<@${interaction.user.id}>, what is your issue?**`), components: [actionRow] }); + + const collector = ticketChannel.createMessageCollector({ filter: m => m.author.id === interaction.user.id }); + setTimeout(async () => { + if (collector.ended) return; + collector.stop(); + ticketChannel.send(await m.translate('**Message collection has automatically stopped after 5 minutes.** Please use the select menu above if you have not requested an admin yet.')).catch(err => err); + }, 300000); // 5 minutes + collector.on('collect', async (message) => { + const content = await new Messenger('en').translate(message.content, true); + const response = await nlp.process('en', content); + const intent = response.intent.split('.'); + switch (intent[0]) { + case 'issue': + ticket.phase = `affirmation_${intent[0]}_${intent[1]}`; + await message.reply(response.answer); + break; + case 'affirmation': + const phase = ticket.getPhaseArray(); + if (phase.length !== 3) break; + if (intent[1] === 'yes') { + collector.stop(); + ticket.phase = `addressing_${phase[2]}`; + if (phase[2] === 'admin') { + message = await message.reply('**Got it.** Calling an admin...'); + const issue = issues.find(i => i.type === phase[2]); + ticket.issue = { + name: issue.name, + type: issue.type + } + await ticket.requestAdmin(m, supportDashboard, await ticket.getRequestEmbed(m)); + return issue.execute(message, guild, m); + } + const supportSets = await ticket.getSupportSets(guild.activeTournament, account.playerId); + await ticket.sendSetSelectMessage(m, message, supportSets); + await ticket.updateAll(); + } else { + ticket.phase = 'question'; + await message.reply(await m.translate(`**<@${interaction.user.id}>, what is your issue?**`)); + } + break; + case 'admin': + ticket.phase = 'affirmation_call_admin'; + await message.reply(await m.translate('**Do you want me to call an admin?**')); + break; + default: + ticket.phase = 'affirmation_call_admin'; + await message.reply(await m.translate('**Sorry, I don\'t understand.** Would you like me to call an admin?')); + } + }); + }, + messageComponentExecute: async (interaction: MessageComponentInteraction | SelectMenuInteraction, args: string[], m: Messenger) => { + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + + // add check to make sure the person doing interactions is either the person for the ticket or an admin + + if (args[0] === 'resolve') { + // NEED TO HANDLE CASE WHERE CHANNEL WAS DELETED + const ticket = await SupportManager.getByChannelId(interaction.guildId, args[1]); + await ticket.resolve(m, interaction); + return SupportManager.removeCache(ticket.guildId, ticket.channelId, ticket.discordId) + } + + if (args[0] === 'delete') { + const ticketChannel = await client.channels.fetch(args[1]).catch(err => null); + if (ticketChannel) await ticketChannel.delete(); + return interaction.update({ components: [] }); + } + + const supportCategory = await SupportManager.buildSupportCategory(guild, interaction.guild); + const supportDashboard = await SupportManager.buildSupportDashboard(guild, interaction.guild, supportCategory); + + const ticket = await SupportManager.getByChannelId(interaction.guildId, interaction.channelId); + const phase = ticket.getPhaseArray(); + + if (args[0] === 'set') { + // MAYBE ADD BEING ABLE TO CHANGE THE SET FOR THE TICKET + if (phase[0] === 'waiting') return; + const setId = args[1] === 'none' ? null : parseInt((interaction as SelectMenuInteraction).values[0]); + ticket.setId = setId; + ticket.phase = 'waiting_on_admin'; + const message = await interaction.reply({ content: await m.translate('**Got it.** Informing an admin...'), fetchReply: true }); + const issue = issues.find(i => i.type === phase[1]); + ticket.issue = { + name: issue.name, + type: issue.type + } + await ticket.requestAdmin(m, supportDashboard, await ticket.getRequestEmbed(m, await ticket.getSupportSet())); + return issue.execute(message as Message, guild, m); + } + + if (phase[0] === 'addressing') return; + const issueName = (interaction as SelectMenuInteraction).values[0]; + ticket.phase = `addressing_${issueName}`; + if (issueName === 'admin') { + const message = await interaction.reply({ content: '**Got it.** Calling an admin...', fetchReply: true }); + const issue = issues.find(i => i.type === issueName); + ticket.issue = { + name: issue.name, + type: issue.type + } + await ticket.requestAdmin(m, supportDashboard, await ticket.getRequestEmbed(m)); + return issue.execute(message as Message, guild, m); + } + + const account = await Accounts.findOne({ discordId: interaction.user.id }); + if (!account) return m.reply('**Your start.gg and Discord accounts must be linked to use this feature.** You can use `/account link` to link your accounts.', true); + const supportSets = await ticket.getSupportSets(guild.activeTournament, account.playerId); + await ticket.sendSetSelectMessage(m, interaction as SelectMenuInteraction, supportSets); + await ticket.updateAll(); + } +} + +const supportThread = async (guild: TournaBotGuild, userId: string, ticketChannel: TextChannel) => { + const m = new Messenger(guild.locale); + + + + // need to rework below + + + +} diff --git a/src/commands/template.ts b/src/commands/template.ts new file mode 100644 index 0000000..a8170a0 --- /dev/null +++ b/src/commands/template.ts @@ -0,0 +1,18 @@ +import { CommandInteraction, DMChannel, GuildMember, MessageComponentInteraction, SelectMenuInteraction } from "discord.js"; +import { Messenger } from "../messaging"; + +export default { + name: '', + adminRequired: false, + canRunInDMs: false, + defer: true, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + const subCommandName = interaction.options.getSubcommand(); + switch (subCommandName) { + + } + }, + messageComponentExecute: async (interaction: MessageComponentInteraction | SelectMenuInteraction, args: string[], m: Messenger) => { + + } +} diff --git a/src/commands/tournament.ts b/src/commands/tournament.ts new file mode 100644 index 0000000..a393b34 --- /dev/null +++ b/src/commands/tournament.ts @@ -0,0 +1,126 @@ +import { ColorResolvable, CommandInteraction, GuildMember, MessageComponentInteraction, MessageEmbed, TextChannel } from "discord.js"; +import { getAverageColor } from "fast-average-color-node"; +import { getFullDate, Messenger } from "../messaging"; +import { StartggAPI } from "../startgg/api"; +import { Tournament } from "../startgg/genql"; +import { GuildManager, TournaBotGuild } from "../types/guild"; +require('dotenv').config(); + +export default { + name: 'tournament', + adminRequired: true, + canRunInDMs: false, + defer: true, + commandExecute: async (interaction: CommandInteraction, m: Messenger) => { + const guild = await GuildManager.get(interaction.guildId); + m.setLocale(guild.locale); + if (!(interaction.member as GuildMember).permissions.has('ADMINISTRATOR')) return m.editReply('**You do not have the permissions to run this command.**'); + + const subCommandName = interaction.options.getSubcommand(); + switch (subCommandName) { + case 'set': + let url = interaction.options.getString('url'); + // activeTournament = activeTournament.replace('https://start.gg/', ''); + if (url.startsWith('start.gg/') || url.startsWith('smash.gg/')) url = 'https://' + url; + + const fetchResponse = await fetch(url).catch((err: any) => console.error(`${interaction.user.username} provided invalid URL: ${url}`)); + if (!fetchResponse) return m.editReply('**There was an error fetching the tournament.** Please try again. Reach out to `F0ne#1933` if the problem persists.'); + + url = fetchResponse.url; + if (!url.startsWith('https://www.start.gg/tournament/')) return m.editReply('**Invalid URL.** Must be a start.gg tournament URL (non-admin).'); + + const slug = url.replace('https://www.start.gg/tournament/', '').split('/')[0]; + guild.activeTournament = slug; + + + // add step here that does a small query to check if the tournament exists + + + const response = await guild.updateAll(); + if (!response) return m.editReply(`**An error occured setting your active tournament.** Please try again. Reach out to \`F0ne#1933\` if the problem persists.`); + else return m.editReply(`**Success!** The active tournament is now set to [https://start.gg/tournament/${slug}](https://start.gg/tournament/${slug}).`); // replace with tournament name + + case 'announce': + return announce(guild, interaction); + } + }, + messageComponentExecute: async (interaction: MessageComponentInteraction, args: string[]) => { + + } +} + +const announce = async (guild: TournaBotGuild, interaction: CommandInteraction) => { + const m = new Messenger(guild.locale, interaction); + + if (!guild.activeTournament.length) return m.editReply('**There is no active tournament set.** You can set an active tournament using \`/set tournament\`.'); + const channel = await guild.getDiscordChannel('announcements'); + if (!channel) return m.editReply('**There is no announcement channel set.** You can set the announcement channel using `/set channel`.'); + + const data = await StartggAPI.getTournament(guild.activeTournament); + if (!data) return m.editReply('**There was an issue contacting start.gg, please try again.** Reach out to `F0ne#1933` if the problem persist.'); + + const tournament: Tournament = data.tournament; + + const images = ['', '']; + for (const image of tournament.images) { + if (image.height === image.width) images[0] = image.url; + else images[1] = image.url; + } + + const color = await getAverageColor(images[0]).catch(err => console.error('No Thumbnail', err)); + const hex = color ? color.hex : `#${process.env.EMBED_COLOR}`; + + const fields = await Promise.all(tournament.events.map(async (event, index) => { + const fullDate = getFullDate(new Date(event.startAt * 1000), guild.timezone); + + let checkInString = ''; + if (event.checkInEnabled) { + const openTime = new Date((event.startAt - event.checkInBuffer - event.checkInDuration) * 1000).toLocaleTimeString('en-US', { + hour12: true, + hour: '2-digit', + minute: '2-digit', + timeZoneName: 'short', + timeZone: guild.timezone + }); + const closeTime = new Date((event.startAt - event.checkInBuffer) * 1000).toLocaleTimeString('en-US', { + hour12: true, + hour: '2-digit', + minute: '2-digit', + timeZoneName: 'short', + timeZone: guild.timezone + }); + checkInString = `Check-in opens at \`${openTime}\` and closes at \`${closeTime}\`.`; + } + + return { + name: event.name, + value: await m.translate(`Starts on \`${fullDate}\`. ${checkInString}`), + inline: true + }; + })); + + fields.splice(0, 0, { + name: await m.translate('Tournament Info'), + value: await m.translate(`Registration closes on \`${getFullDate(new Date(tournament.registrationClosesAt * 1000), guild.timezone)}\`.\n\n__**Events:**__`), + inline: false + }); + + const embed = new MessageEmbed() + .setTitle(tournament.name) + .setURL(`https://start.gg/tournament/${guild.activeTournament}`) + // need to add startAt for tournament + .setDescription(await m.translate(`${tournament.isOnline ? 'Online' : 'In-Person'} Tournament`)) + .addFields(fields) + .setColor(hex as ColorResolvable) + .setThumbnail(images[0]) + .setImage(images[1]) + // .setFooter('TournaBot', client.user.avatarURL({ format: 'png' })) + .setTimestamp(); + + const messageArg = interaction.options.getString('message'); + const roleId = guild.getRole('announcements')?.id; + const announceMessage = messageArg?.length ? messageArg : `${roleId ? `<@&${roleId}>` : '@everyone'}, ${await m.translate(`the registration for **${tournament.name}** is open!`)}`; + await (channel as TextChannel).send({ content: announceMessage, embeds: [embed] }); + + return m.editReply(`**Success!** Announced **${tournament.name}** in <#${channel.id}>.`); +} diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..8b3f1ca --- /dev/null +++ b/src/main.ts @@ -0,0 +1,76 @@ +import Discord, { GuildMember } from 'discord.js'; +import fs from 'fs'; +import { createClient } from 'redis'; +import { database } from '../database/database'; +import { Messenger } from './messaging'; +import { Command, TournaBotClient } from './types/client'; +import { GuildManager } from './types/guild'; +require('dotenv').config(); + + +export const client = new TournaBotClient({ intents: ['GUILDS', 'GUILD_MEMBERS', 'GUILD_MESSAGES', 'GUILD_WEBHOOKS', 'GUILD_EMOJIS_AND_STICKERS', 'GUILD_PRESENCES', 'GUILD_MESSAGE_REACTIONS', 'DIRECT_MESSAGES', 'DIRECT_MESSAGE_REACTIONS'] }); +export const guilds: any = null; +export const cache = createClient(); + +let ready = false; + +client.commands = new Discord.Collection(); +const commandFiles = fs.readdirSync(__dirname + '/commands').filter(file => file.endsWith('.js')); +for (const file of commandFiles) { + const command = require(`./commands/${file}`); + client.commands.set(command.default.name, command.default); +} + +client.once('ready', async () => { + await database + .then(() => console.log('Connected to MongoDB!')) + .catch(err => console.error('MongoDB Connection', err)); + + await cache.connect() + .then(() => console.log('Connected to Redis!')) + .catch(err => console.error('Redis Connection', err)); + + // await guilds.syncAll().then(() => ready = true).catch(err => console.error(err)); + client.user.setActivity('for /help', { type: 'WATCHING' }); + console.log(`# of users: ${client.guilds.cache.reduce((a, g) => a + g.memberCount, 0)}`); + + // Loop for tracking and setting tournament reminders + // Comment this function out for development unrelated to it + // client.startReminderLoop(); + + ready = true; +}); + +client.on('interactionCreate', async interaction => { + if (!ready) return; + if (interaction.isCommand()) { + const command = client.commands.get(interaction.commandName); + const m = new Messenger('en', interaction); + + if (command.defer) await interaction.deferReply({ ephemeral: true }); + if (!command.canRunInDMs && !interaction.inGuild()) return m.editReply('**This command cannot be used in DMs.**'); + if (command.adminRequired && !(await hasPerms(interaction.member as GuildMember))) return m.editReply('**You do not have the permissions to run that command.**'); + + // console.log(interaction.member) + + command.commandExecute(interaction, m); + } else if (interaction.isMessageComponent()) { + const args = interaction.customId.split('_'); + const command = client.commands.get(args.shift()); + const m = new Messenger('en', interaction); + command.messageComponentExecute(interaction, args, m); + } +}); + +const hasPerms = async (member: GuildMember): Promise => { + if (!member) return true; + if (member.permissions.has('ADMINISTRATOR')) return true; + // const guild = await guilds.getGuild(member.guild.id); + // for (const roleId of guild.allowlist) { + // if (member.roles.cache.find(r => r.id === roleId)) return true; + // } + return false; +} + +const TOKEN = process.env.DEV_MODE ? process.env.DEV_DISCORD_BOT_TOKEN : process.env.DISCORD_BOT_TOKEN; +client.login(TOKEN); diff --git a/src/messaging.ts b/src/messaging.ts new file mode 100644 index 0000000..04c383d --- /dev/null +++ b/src/messaging.ts @@ -0,0 +1,120 @@ +import { ColorResolvable, CommandInteraction, MessageActionRow, MessageButton, MessageComponentInteraction, MessageEmbed, TextChannel } from "discord.js"; +import ShortUniqueId from "short-unique-id"; +import { client } from "./main"; +import { Indexable } from "./types/global"; +import fetch from 'node-fetch'; +require('dotenv').config(); + +export class Messenger { + private locale: string; + private interaction: CommandInteraction | MessageComponentInteraction; + + constructor(locale: string, interaction: CommandInteraction | MessageComponentInteraction = null) { + this.setLocale(locale); + this.setInteraction(interaction); + } + + async setLocale(locale: string) { + this.locale = locale; + } + + async setInteraction(interaction: CommandInteraction | MessageComponentInteraction) { + this.interaction = interaction; + } + + async editReply(content: string) { + content = await this.translate(content); + await this.interaction.editReply({ embeds: [this.getEmbed(content)] }) + .catch(err => console.error('Messenger Edit Reply Interaction Null', err)); + } + + async reply(content: string, ephemeral: boolean) { + content = await this.translate(content); + await this.interaction.reply({ embeds: [this.getEmbed(content)], ephemeral: ephemeral }) + .catch(err => console.error('Messenger Reply Interaction Null', err)); + } + + async sendMessage(channel: TextChannel, content: string) { + content = await this.translate(content); + await channel.send({ embeds: [this.getEmbed(content)] }) + .catch(err => console.error('Messenger Send Message', err)); + } + + getEmbed(content: string) { + return new MessageEmbed() + .setDescription(content) + .setColor(`#${process.env.EMBED_COLOR}`); + } + + async translate(message: string, forceTranslate: boolean = false) { + if (this.locale === 'en' && !forceTranslate) return message; + else return await fetch(`https://api.mymemory.translated.net/get?q=${this.fixedEncodeURIComponent(message)}&langpair=en|${this.locale}&de=${new ShortUniqueId({ length: 4 })()}@gmail.com`) + .then((r: any) => r.json()) + .then((data: any) => { + const translation: string = data?.responseData?.translatedText; + let translatedMessage: string = translation === null ? message : translation !== translation.toUpperCase() ? translation : message; + + const encodedValues = [ + { + encoded: '>', + decoded: '>' + }, + { + encoded: '<# ', + decoded: '<#' + }, + { + encoded: '<', + decoded: '<' + }, + { + encoded: ' ', + decoded: '\n' + }, + { + encoded: ''', + decoded: '\'' + } + ] + + for (const encodedValue of encodedValues) { + translatedMessage = replaceAll(translatedMessage, encodedValue.encoded, encodedValue.decoded); + } + + return translatedMessage; + }).catch(err => ''); + } + + private fixedEncodeURIComponent(str: string) { + return encodeURIComponent(str).replace(/[!'()*]/g, (c) => { + return '%' + c.charCodeAt(0).toString(16); + }); + } +} + +export const capitalize = (str: string) => { + const strSplit = str.split('-'); + let tempStr = ''; + + for (const word of strSplit) { + tempStr += word.charAt(0).toUpperCase() + word.slice(1) + ' '; + } + + return tempStr.substring(0, tempStr.length - 1);; +} + +export const replaceAll = (str: string, find: string, replace: string) => { + return str.replace(new RegExp(find, 'g'), replace); +} + +export const getFullDate = (date: Date, timezone: string) => { + return date.toLocaleDateString('en-US', { + weekday: 'long', + month: 'long', + day: 'numeric', + hour: 'numeric', + minute: 'numeric', + timeZoneName: 'short', + timeZone: timezone + }); +} diff --git a/src/nlp/corpus-en.json b/src/nlp/corpus-en.json new file mode 100644 index 0000000..4ee8148 --- /dev/null +++ b/src/nlp/corpus-en.json @@ -0,0 +1,74 @@ +{ + "locale": "en", + "data": [ + { + "intent": "issue.absent", + "utterances": [ + "my opponent isn't here", + "person isn't here", + "person is not here", + "my opponent hasn't shown up", + "they haven't checked in", + "they missed check-in", + "where is my opponent" + ], + "answers": [ + "**I see that you are having an issue with your opponent being absent.** Is that correct?" + ] + }, + { + "intent": "issue.bracket", + "utterances": [ + "theres an issue with the bracket", + "the bracket is messed up", + "im seeded wrong", + "they are seeded wrong", + "theres a conflict", + "theres a bracket conflict", + "something is wrong with the bracket", + "the set is reported wrong", + "someone reported the set incorrectly", + "the score for my set is wrong", + "i won the last match", + "i won the last match even though its reported as loss" + ], + "answers": [ + "**I see that you are having an issue with the bracket.** Is that correct?" + ] + }, + { + "intent": "affirmation.no", + "utterances": [ + "no", + "no thank you", + "im good", + "no im fine" + ], + "answers": [] + }, + { + "intent": "affirmation.yes", + "utterances": [ + "yes", + "yes please", + "yes i would like to", + "please do", + "of course", + "sure" + ], + "answers": [] + }, + { + "intent": "admin", + "utterances": [ + "can you get an admin", + "i want an admin", + "can you get a mod", + "i need a mod", + "can a mod help me", + "can an admin help me" + ], + "answers": [] + } + ] +} \ No newline at end of file diff --git a/src/nlp/load_model.ts b/src/nlp/load_model.ts new file mode 100644 index 0000000..601eef7 --- /dev/null +++ b/src/nlp/load_model.ts @@ -0,0 +1,7 @@ +const { NlpManager } = require('node-nlp'); +import * as corpus from './corpus-en.json'; + +const nlp = new NlpManager({ languages: [corpus.locale] }); +nlp.load(); + +export = nlp; diff --git a/src/nlp/train_model.ts b/src/nlp/train_model.ts new file mode 100644 index 0000000..5039860 --- /dev/null +++ b/src/nlp/train_model.ts @@ -0,0 +1,16 @@ +const { NlpManager } = require('node-nlp'); +import * as corpus from './corpus-en.json'; + +const nlp = new NlpManager({ languages: [corpus.locale] }); + +// Adds the utterances and intents for the NLP +for (const collection of corpus.data) { + for (const utterance of collection.utterances) { + nlp.addDocument(corpus.locale, utterance, collection.intent); + } + for (const answer of collection.answers) { + nlp.addAnswer(corpus.locale, collection.intent, answer); + } +} + +nlp.train().then(() => nlp.save()).then(() => console.log('Done training!')); diff --git a/src/startgg/api.ts b/src/startgg/api.ts new file mode 100644 index 0000000..e778511 --- /dev/null +++ b/src/startgg/api.ts @@ -0,0 +1,348 @@ +import { createClient, QueryRequest } from './genql'; +require('dotenv').config(); + +const client = createClient({ + url: process.env.STARTGG_API_URL, + headers: { + authorization: `Bearer ${process.env.STARTGG_TOKEN}` + } +}); + +export namespace StartggAPI { + export const getUser = async (slug: string) => { + const request: QueryRequest = { + user: [ + { + slug: slug + }, + { + id: true, + player: { + id: true, + gamerTag: true + }, + authorizations: [ + { + types: ['TWITTER', 'TWITCH', 'XBOX', 'MIXER'] + }, + { + externalId: true, + externalUsername: true, + type: true + } + ] + } + ] + } + return await query(request); + } + + export const getUserUpcomingTournaments = async (slug: string) => { + const request: QueryRequest = { + user: [ + { + slug: slug + }, + { + tournaments: [ + { + query: { + filter: { + upcoming: true, + past: false, + tournamentView: 'competing' + } + } + }, + { + nodes: { + name: true, + url: true, + numAttendees: true, + startAt: true, + isOnline: true, + images: { + height: true, + width: true, + url: true, + }, + events: { + name: true, + numEntrants: true, + checkInEnabled: true, + checkInBuffer: true, + checkInDuration: true + }, + streams: { + streamName: true, + streamSource: true + } + } + } + ] + } + ] + } + return await query(request); + } + export const getTournament = async (slug: string) => { + const request: QueryRequest = { + tournament: [ + { + slug: slug + }, + { + name: true, + registrationClosesAt: true, + isOnline: true, + state: true, + images: { + height: true, + width: true, + url: true + }, + events: { + id: true, + name: true, + startAt: true, + checkInEnabled: true, + checkInBuffer: true, + checkInDuration: true + }, + streams: { + id: true, + isOnline: true, + streamSource: true, + streamGame: true, + streamName: true + } + } + ] + } + return await query(request); + } + + export const getMatchCallingSets = async (slug: string) => { + const request: QueryRequest = { + tournament: [ + { + slug: slug + }, + { + startAt: true, + endAt: true, + events: { + name: true, + slug: true, + sets: [ + { + sortType: 'RECENT', + filters: { + state: [6] + } + }, + { + nodes: { + id: true, + totalGames: true, + fullRoundText: true, + event: { + name: true + }, + slots: { + entrant: { + id: true, + name: true, + initialSeedNum: true, + participants: { + user: { + slug: true, + authorizations: [ + { + types: ['DISCORD'] + }, + { + externalId: true, + } + ] + } + } + } + } + } + } + ] + } + } + ] + } + return await query(request); + } + + export const getMatchReportingSets = async (slug: string) => { + const request: QueryRequest = { + tournament: [ + { + slug: slug + }, + { + startAt: true, + endAt: true, + events: { + name: true, + slug: true, + sets: [ + { + sortType: 'CALL_ORDER', + filters: { + state: [3] + } + }, + { + nodes: { + id: true, + totalGames: true, + fullRoundText: true, + winnerId: true, + event: { + name: true + }, + games: { + winnerId: true, + selections: { + selectionValue: true, + entrant: { + id: true + } + } + }, + slots: { + entrant: { + id: true, + name: true, + initialSeedNum: true, + participants: { + user: { + slug: true, + authorizations: [ + { + types: ['DISCORD'] + }, + { + externalId: true, + } + ] + } + } + } + } + } + } + ] + } + } + ] + } + return await query(request); + } + + export const getSupportSets = async (tournamentSlug: string, playerId: string) => { + const request: QueryRequest = { + tournament: [ + { + slug: tournamentSlug + }, + { + events: { + name: true, + slug: true, + sets: [ + { + sortType: 'RECENT', + filters: { + playerIds: [playerId] + } + }, + { + nodes: { + id: true, + fullRoundText: true, + slots: { + entrant: { + name: true, + initialSeedNum: true, + participants: { + user: { + slug: true, + authorizations: [ + { + types: ['DISCORD'] + }, + { + externalId: true, + } + ] + } + } + } + } + } + } + ] + } + } + ] + } + return await query(request); + } + + export const getSupportSet = async (setId: number) => { + const request: QueryRequest = { + set: [ + { + id: setId.toString() + }, + { + id: true, + event: { + slug: true, + name: true + }, + fullRoundText: true, + slots: { + entrant: { + name: true, + initialSeedNum: true, + participants: { + user: { + slug: true, + authorizations: [ + { + types: ['DISCORD'] + }, + { + externalId: true, + } + ] + } + } + } + } + } + ] + } + return await query(request); + } + + const exampleQuery = async () => { + const request: QueryRequest = { + + } + return await query(request); + } + + const query = async (request: QueryRequest) => { + return await client.query(request) + .catch(err => console.error('Start.gg API Query', err)) || null; + } +} diff --git a/src/startgg/character_codes.json b/src/startgg/character_codes.json new file mode 100644 index 0000000..a2e93eb --- /dev/null +++ b/src/startgg/character_codes.json @@ -0,0 +1,89 @@ +{ + "1271": "tbbayo", + "1272": "tbbowserjr", + "1273": "tbbowser", + "1274": "tbfalcon", + "1275": "tbcloud", + "1276": "tbcorrin", + "1277": "tbdaisy", + "1278": "tbdarkpit", + "1279": "tbdiddy", + "1280": "tbkong", + "1282": "tbdrmario", + "1283": "tbduckhunt", + "1285": "tbfalco", + "1286": "tbfox", + "1287": "tbganon", + "1289": "tbgreninja", + "1290": "tbicies", + "1291": "tbike", + "1292": "tbinkling", + "1293": "tbpuff", + "1294": "tbdedede", + "1295": "tbkirby", + "1296": "tblink", + "1297": "tbmac", + "1298": "tblucario", + "1299": "tblucas", + "1300": "tblucina", + "1301": "tbluigi", + "1302": "tbmario", + "1304": "tbmarth", + "1305": "tbmega", + "1307": "tbmeta", + "1310": "tbmewtwo", + "1311": "tbbrawler", + "1313": "tbness", + "1314": "tbolimar", + "1315": "tbpacman", + "1316": "tbpalu", + "1317": "tbpeach", + "1318": "tbpichu", + "1319": "tbpika", + "1320": "tbpit", + "1321": "tbpkmnt", + "1322": "tbridley", + "1323": "tbrob", + "1324": "tbrobin", + "1325": "tbrosa", + "1326": "tbroy", + "1327": "tbryu", + "1328": "tbsamus", + "1329": "tbsheik", + "1330": "tbshulk", + "1331": "tbsnake", + "1332": "tbsonic", + "1333": "tbtink", + "1334": "tbvillager", + "1335": "tbwario", + "1336": "tbwiifit", + "1337": "tbwolf", + "1338": "tbyoshi", + "1339": "tbyink", + "1340": "tbzelda", + "1341": "tbzerosuit", + "1405": "tbgandw", + "1406": "tbincin", + "1407": "tbkrool", + "1408": "tbdsamus", + "1409": "tbchrom", + "1410": "tbken", + "1411": "tbsimon", + "1412": "tbrichter", + "1413": "tbisabelle", + "1414": "tbsword", + "1415": "tbgunner", + "1441": "tbplant", + "1453": "tbjoker", + "1526": "tbhero", + "1530": "tbbanjo", + "1532": "tbterry", + "1539": "tbbyleth", + "1746": "tbrandom", + "1747": "tbminmin", + "1766": "tbsteve", + "1777": "tbseph", + "1795": "tbpythra", + "1846": "tbkazuya", + "1897": "tbsora" +} \ No newline at end of file diff --git a/src/startgg/genql/guards.cjs.js b/src/startgg/genql/guards.cjs.js new file mode 100644 index 0000000..876892e --- /dev/null +++ b/src/startgg/genql/guards.cjs.js @@ -0,0 +1,550 @@ + +var Query_possibleTypes = ['Query'] +module.exports.isQuery = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isQuery"') + return Query_possibleTypes.includes(obj.__typename) +} + + + +var User_possibleTypes = ['User'] +module.exports.isUser = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isUser"') + return User_possibleTypes.includes(obj.__typename) +} + + + +var ProfileAuthorization_possibleTypes = ['ProfileAuthorization'] +module.exports.isProfileAuthorization = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isProfileAuthorization"') + return ProfileAuthorization_possibleTypes.includes(obj.__typename) +} + + + +var Stream_possibleTypes = ['Stream'] +module.exports.isStream = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStream"') + return Stream_possibleTypes.includes(obj.__typename) +} + + + +var EventConnection_possibleTypes = ['EventConnection'] +module.exports.isEventConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isEventConnection"') + return EventConnection_possibleTypes.includes(obj.__typename) +} + + + +var PageInfo_possibleTypes = ['PageInfo'] +module.exports.isPageInfo = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isPageInfo"') + return PageInfo_possibleTypes.includes(obj.__typename) +} + + + +var Event_possibleTypes = ['Event'] +module.exports.isEvent = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isEvent"') + return Event_possibleTypes.includes(obj.__typename) +} + + + +var EntrantConnection_possibleTypes = ['EntrantConnection'] +module.exports.isEntrantConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isEntrantConnection"') + return EntrantConnection_possibleTypes.includes(obj.__typename) +} + + + +var Entrant_possibleTypes = ['Entrant'] +module.exports.isEntrant = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isEntrant"') + return Entrant_possibleTypes.includes(obj.__typename) +} + + + +var SetConnection_possibleTypes = ['SetConnection'] +module.exports.isSetConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isSetConnection"') + return SetConnection_possibleTypes.includes(obj.__typename) +} + + + +var Set_possibleTypes = ['Set'] +module.exports.isSet = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isSet"') + return Set_possibleTypes.includes(obj.__typename) +} + + + +var Game_possibleTypes = ['Game'] +module.exports.isGame = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isGame"') + return Game_possibleTypes.includes(obj.__typename) +} + + + +var Image_possibleTypes = ['Image'] +module.exports.isImage = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isImage"') + return Image_possibleTypes.includes(obj.__typename) +} + + + +var GameSelection_possibleTypes = ['GameSelection'] +module.exports.isGameSelection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isGameSelection"') + return GameSelection_possibleTypes.includes(obj.__typename) +} + + + +var Participant_possibleTypes = ['Participant'] +module.exports.isParticipant = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isParticipant"') + return Participant_possibleTypes.includes(obj.__typename) +} + + + +var ContactInfo_possibleTypes = ['ContactInfo'] +module.exports.isContactInfo = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isContactInfo"') + return ContactInfo_possibleTypes.includes(obj.__typename) +} + + + +var Player_possibleTypes = ['Player'] +module.exports.isPlayer = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isPlayer"') + return Player_possibleTypes.includes(obj.__typename) +} + + + +var PlayerRank_possibleTypes = ['PlayerRank'] +module.exports.isPlayerRank = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isPlayerRank"') + return PlayerRank_possibleTypes.includes(obj.__typename) +} + + + +var Stage_possibleTypes = ['Stage'] +module.exports.isStage = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStage"') + return Stage_possibleTypes.includes(obj.__typename) +} + + + +var PhaseGroup_possibleTypes = ['PhaseGroup'] +module.exports.isPhaseGroup = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isPhaseGroup"') + return PhaseGroup_possibleTypes.includes(obj.__typename) +} + + + +var SeedConnection_possibleTypes = ['SeedConnection'] +module.exports.isSeedConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isSeedConnection"') + return SeedConnection_possibleTypes.includes(obj.__typename) +} + + + +var Seed_possibleTypes = ['Seed'] +module.exports.isSeed = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isSeed"') + return Seed_possibleTypes.includes(obj.__typename) +} + + + +var Phase_possibleTypes = ['Phase'] +module.exports.isPhase = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isPhase"') + return Phase_possibleTypes.includes(obj.__typename) +} + + + +var PhaseGroupConnection_possibleTypes = ['PhaseGroupConnection'] +module.exports.isPhaseGroupConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isPhaseGroupConnection"') + return PhaseGroupConnection_possibleTypes.includes(obj.__typename) +} + + + +var Wave_possibleTypes = ['Wave'] +module.exports.isWave = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isWave"') + return Wave_possibleTypes.includes(obj.__typename) +} + + + +var Progression_possibleTypes = ['Progression'] +module.exports.isProgression = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isProgression"') + return Progression_possibleTypes.includes(obj.__typename) +} + + + +var Standing_possibleTypes = ['Standing'] +module.exports.isStanding = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStanding"') + return Standing_possibleTypes.includes(obj.__typename) +} + + + +var StandingContainer_possibleTypes = ['Tournament','Event','PhaseGroup','Set'] +module.exports.isStandingContainer = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStandingContainer"') + return StandingContainer_possibleTypes.includes(obj.__typename) +} + + + +var Tournament_possibleTypes = ['Tournament'] +module.exports.isTournament = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isTournament"') + return Tournament_possibleTypes.includes(obj.__typename) +} + + + +var TournamentLinks_possibleTypes = ['TournamentLinks'] +module.exports.isTournamentLinks = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isTournamentLinks"') + return TournamentLinks_possibleTypes.includes(obj.__typename) +} + + + +var ParticipantConnection_possibleTypes = ['ParticipantConnection'] +module.exports.isParticipantConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isParticipantConnection"') + return ParticipantConnection_possibleTypes.includes(obj.__typename) +} + + + +var StationsConnection_possibleTypes = ['StationsConnection'] +module.exports.isStationsConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStationsConnection"') + return StationsConnection_possibleTypes.includes(obj.__typename) +} + + + +var Stations_possibleTypes = ['Stations'] +module.exports.isStations = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStations"') + return Stations_possibleTypes.includes(obj.__typename) +} + + + +var StreamQueue_possibleTypes = ['StreamQueue'] +module.exports.isStreamQueue = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStreamQueue"') + return StreamQueue_possibleTypes.includes(obj.__typename) +} + + + +var Streams_possibleTypes = ['Streams'] +module.exports.isStreams = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStreams"') + return Streams_possibleTypes.includes(obj.__typename) +} + + + +var TeamConnection_possibleTypes = ['TeamConnection'] +module.exports.isTeamConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isTeamConnection"') + return TeamConnection_possibleTypes.includes(obj.__typename) +} + + + +var Team_possibleTypes = ['EventTeam','GlobalTeam'] +module.exports.isTeam = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isTeam"') + return Team_possibleTypes.includes(obj.__typename) +} + + + +var TeamMember_possibleTypes = ['TeamMember'] +module.exports.isTeamMember = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isTeamMember"') + return TeamMember_possibleTypes.includes(obj.__typename) +} + + + +var StandingStats_possibleTypes = ['StandingStats'] +module.exports.isStandingStats = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStandingStats"') + return StandingStats_possibleTypes.includes(obj.__typename) +} + + + +var Score_possibleTypes = ['Score'] +module.exports.isScore = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isScore"') + return Score_possibleTypes.includes(obj.__typename) +} + + + +var Round_possibleTypes = ['Round'] +module.exports.isRound = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isRound"') + return Round_possibleTypes.includes(obj.__typename) +} + + + +var StandingConnection_possibleTypes = ['StandingConnection'] +module.exports.isStandingConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isStandingConnection"') + return StandingConnection_possibleTypes.includes(obj.__typename) +} + + + +var SetSlot_possibleTypes = ['SetSlot'] +module.exports.isSetSlot = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isSetSlot"') + return SetSlot_possibleTypes.includes(obj.__typename) +} + + + +var League_possibleTypes = ['League'] +module.exports.isLeague = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isLeague"') + return League_possibleTypes.includes(obj.__typename) +} + + + +var EventOwnerConnection_possibleTypes = ['EventOwnerConnection'] +module.exports.isEventOwnerConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isEventOwnerConnection"') + return EventOwnerConnection_possibleTypes.includes(obj.__typename) +} + + + +var EventOwner_possibleTypes = ['EventOwner'] +module.exports.isEventOwner = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isEventOwner"') + return EventOwner_possibleTypes.includes(obj.__typename) +} + + + +var EventTier_possibleTypes = ['EventTier'] +module.exports.isEventTier = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isEventTier"') + return EventTier_possibleTypes.includes(obj.__typename) +} + + + +var Videogame_possibleTypes = ['Videogame'] +module.exports.isVideogame = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isVideogame"') + return Videogame_possibleTypes.includes(obj.__typename) +} + + + +var Character_possibleTypes = ['Character'] +module.exports.isCharacter = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isCharacter"') + return Character_possibleTypes.includes(obj.__typename) +} + + + +var TeamRosterSize_possibleTypes = ['TeamRosterSize'] +module.exports.isTeamRosterSize = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isTeamRosterSize"') + return TeamRosterSize_possibleTypes.includes(obj.__typename) +} + + + +var LeagueConnection_possibleTypes = ['LeagueConnection'] +module.exports.isLeagueConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isLeagueConnection"') + return LeagueConnection_possibleTypes.includes(obj.__typename) +} + + + +var Address_possibleTypes = ['Address'] +module.exports.isAddress = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isAddress"') + return Address_possibleTypes.includes(obj.__typename) +} + + + +var TournamentConnection_possibleTypes = ['TournamentConnection'] +module.exports.isTournamentConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isTournamentConnection"') + return TournamentConnection_possibleTypes.includes(obj.__typename) +} + + + +var Shop_possibleTypes = ['Shop'] +module.exports.isShop = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isShop"') + return Shop_possibleTypes.includes(obj.__typename) +} + + + +var ShopLevelConnection_possibleTypes = ['ShopLevelConnection'] +module.exports.isShopLevelConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isShopLevelConnection"') + return ShopLevelConnection_possibleTypes.includes(obj.__typename) +} + + + +var ShopLevel_possibleTypes = ['ShopLevel'] +module.exports.isShopLevel = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isShopLevel"') + return ShopLevel_possibleTypes.includes(obj.__typename) +} + + + +var ShopOrderMessageConnection_possibleTypes = ['ShopOrderMessageConnection'] +module.exports.isShopOrderMessageConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isShopOrderMessageConnection"') + return ShopOrderMessageConnection_possibleTypes.includes(obj.__typename) +} + + + +var ShopOrderMessage_possibleTypes = ['ShopOrderMessage'] +module.exports.isShopOrderMessage = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isShopOrderMessage"') + return ShopOrderMessage_possibleTypes.includes(obj.__typename) +} + + + +var VideogameConnection_possibleTypes = ['VideogameConnection'] +module.exports.isVideogameConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isVideogameConnection"') + return VideogameConnection_possibleTypes.includes(obj.__typename) +} + + + +var Mutation_possibleTypes = ['Mutation'] +module.exports.isMutation = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isMutation"') + return Mutation_possibleTypes.includes(obj.__typename) +} + + + +var ActionSet_possibleTypes = ['TeamActionSet'] +module.exports.isActionSet = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isActionSet"') + return ActionSet_possibleTypes.includes(obj.__typename) +} + + + +var BracketConfig_possibleTypes = ['RaceBracketConfig'] +module.exports.isBracketConfig = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isBracketConfig"') + return BracketConfig_possibleTypes.includes(obj.__typename) +} + + + +var EventTeam_possibleTypes = ['EventTeam'] +module.exports.isEventTeam = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isEventTeam"') + return EventTeam_possibleTypes.includes(obj.__typename) +} + + + +var GlobalTeam_possibleTypes = ['GlobalTeam'] +module.exports.isGlobalTeam = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isGlobalTeam"') + return GlobalTeam_possibleTypes.includes(obj.__typename) +} + + + +var EventTeamConnection_possibleTypes = ['EventTeamConnection'] +module.exports.isEventTeamConnection = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isEventTeamConnection"') + return EventTeamConnection_possibleTypes.includes(obj.__typename) +} + + + +var MatchConfig_possibleTypes = ['RaceMatchConfig'] +module.exports.isMatchConfig = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isMatchConfig"') + return MatchConfig_possibleTypes.includes(obj.__typename) +} + + + +var RaceBracketConfig_possibleTypes = ['RaceBracketConfig'] +module.exports.isRaceBracketConfig = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isRaceBracketConfig"') + return RaceBracketConfig_possibleTypes.includes(obj.__typename) +} + + + +var RaceMatchConfig_possibleTypes = ['RaceMatchConfig'] +module.exports.isRaceMatchConfig = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isRaceMatchConfig"') + return RaceMatchConfig_possibleTypes.includes(obj.__typename) +} + + + +var TeamActionSet_possibleTypes = ['TeamActionSet'] +module.exports.isTeamActionSet = function(obj) { + if (!obj || !obj.__typename) throw new Error('__typename is missing in "isTeamActionSet"') + return TeamActionSet_possibleTypes.includes(obj.__typename) +} diff --git a/src/startgg/genql/index.d.ts b/src/startgg/genql/index.d.ts new file mode 100644 index 0000000..13dc0be --- /dev/null +++ b/src/startgg/genql/index.d.ts @@ -0,0 +1,168 @@ +import { + FieldsSelection, + GraphqlOperation, + ClientOptions, + Observable, +} from '@genql/runtime' +import { SubscriptionClient } from 'subscriptions-transport-ws' +export * from './schema' +import { + QueryRequest, + QueryPromiseChain, + Query, + MutationRequest, + MutationPromiseChain, + Mutation, +} from './schema' +export declare const createClient: (options?: ClientOptions) => Client +export declare const everything: { __scalar: boolean } +export declare const version: string + +export interface Client { + wsClient?: SubscriptionClient + + query( + request: R & { __name?: string }, + ): Promise> + + mutation( + request: R & { __name?: string }, + ): Promise> + + chain: { + query: QueryPromiseChain + + mutation: MutationPromiseChain + } +} + +export type QueryResult = FieldsSelection< + Query, + fields +> + +export declare const generateQueryOp: ( + fields: QueryRequest & { __name?: string }, +) => GraphqlOperation +export type MutationResult = FieldsSelection< + Mutation, + fields +> + +export declare const generateMutationOp: ( + fields: MutationRequest & { __name?: string }, +) => GraphqlOperation + +export declare const enumSocialConnectionType: { + readonly TWITTER: 'TWITTER' + readonly TWITCH: 'TWITCH' + readonly DISCORD: 'DISCORD' + readonly MIXER: 'MIXER' + readonly XBOX: 'XBOX' +} + +export declare const enumStreamType: { + readonly TWITCH: 'TWITCH' + readonly MIXER: 'MIXER' +} + +export declare const enumAuthorizationType: { + readonly TWITTER: 'TWITTER' + readonly TWITCH: 'TWITCH' + readonly STEAM: 'STEAM' + readonly DISCORD: 'DISCORD' + readonly XBOX: 'XBOX' + readonly MIXER: 'MIXER' +} + +export declare const enumSetSortType: { + readonly NONE: 'NONE' + readonly CALL_ORDER: 'CALL_ORDER' + readonly MAGIC: 'MAGIC' + readonly RECENT: 'RECENT' + readonly STANDARD: 'STANDARD' + readonly ROUND: 'ROUND' +} + +export declare const enumGameSelectionType: { + readonly CHARACTER: 'CHARACTER' +} + +export declare const enumBracketType: { + readonly SINGLE_ELIMINATION: 'SINGLE_ELIMINATION' + readonly DOUBLE_ELIMINATION: 'DOUBLE_ELIMINATION' + readonly ROUND_ROBIN: 'ROUND_ROBIN' + readonly SWISS: 'SWISS' + readonly EXHIBITION: 'EXHIBITION' + readonly CUSTOM_SCHEDULE: 'CUSTOM_SCHEDULE' + readonly MATCHMAKING: 'MATCHMAKING' + readonly ELIMINATION_ROUNDS: 'ELIMINATION_ROUNDS' + readonly RACE: 'RACE' + readonly CIRCUIT: 'CIRCUIT' +} + +export declare const enumActivityState: { + readonly CREATED: 'CREATED' + readonly ACTIVE: 'ACTIVE' + readonly COMPLETED: 'COMPLETED' + readonly READY: 'READY' + readonly INVALID: 'INVALID' + readonly CALLED: 'CALLED' + readonly QUEUED: 'QUEUED' +} + +export declare const enumStreamSource: { + readonly TWITCH: 'TWITCH' + readonly HITBOX: 'HITBOX' + readonly STREAMME: 'STREAMME' + readonly MIXER: 'MIXER' +} + +export declare const enumTeamMemberStatus: { + readonly UNKNOWN: 'UNKNOWN' + readonly ACCEPTED: 'ACCEPTED' + readonly INVITED: 'INVITED' + readonly REQUEST: 'REQUEST' + readonly ALUM: 'ALUM' + readonly HIATUS: 'HIATUS' + readonly OPEN_SPOT: 'OPEN_SPOT' +} + +export declare const enumTeamMemberType: { + readonly PLAYER: 'PLAYER' + readonly STAFF: 'STAFF' +} + +export declare const enumTournamentPaginationSort: { + readonly startAt: 'startAt' + readonly endAt: 'endAt' + readonly eventRegistrationClosesAt: 'eventRegistrationClosesAt' + readonly computedUpdatedAt: 'computedUpdatedAt' +} + +export declare const enumComparator: { + readonly GREATER_THAN: 'GREATER_THAN' + readonly GREATER_THAN_OR_EQUAL: 'GREATER_THAN_OR_EQUAL' + readonly EQUAL: 'EQUAL' + readonly LESS_THAN_OR_EQUAL: 'LESS_THAN_OR_EQUAL' + readonly LESS_THAN: 'LESS_THAN' +} + +export declare const enumMatchConfigVerificationMethod: { + readonly TWITCH: 'TWITCH' + readonly STREAM_ME: 'STREAM_ME' + readonly ANY: 'ANY' + readonly MIXER: 'MIXER' + readonly YOUTUBE: 'YOUTUBE' +} + +export declare const enumRaceLimitMode: { + readonly BEST_ALL: 'BEST_ALL' + readonly FIRST_ALL: 'FIRST_ALL' + readonly PLAYTIME: 'PLAYTIME' +} + +export declare const enumRaceType: { + readonly GOALS: 'GOALS' + readonly TIMED: 'TIMED' +} diff --git a/src/startgg/genql/index.js b/src/startgg/genql/index.js new file mode 100644 index 0000000..4e40376 --- /dev/null +++ b/src/startgg/genql/index.js @@ -0,0 +1,158 @@ +const { + linkTypeMap, + createClient: createClientOriginal, + generateGraphqlOperation, + assertSameVersion, +} = require('@genql/runtime') +var typeMap = linkTypeMap(require('./types.cjs.js')) + +var version = '2.10.0' +assertSameVersion(version) + +module.exports.version = version + +module.exports.createClient = function(options) { + options = options || {} + var optionsCopy = { + url: 'https://api.start.gg/gql/alpha', + queryRoot: typeMap.Query, + mutationRoot: typeMap.Mutation, + subscriptionRoot: typeMap.Subscription, + } + for (var name in options) { + optionsCopy[name] = options[name] + } + return createClientOriginal(optionsCopy) +} + +module.exports.enumSocialConnectionType = { + TWITTER: 'TWITTER', + TWITCH: 'TWITCH', + DISCORD: 'DISCORD', + MIXER: 'MIXER', + XBOX: 'XBOX', +} + +module.exports.enumStreamType = { + TWITCH: 'TWITCH', + MIXER: 'MIXER', +} + +module.exports.enumAuthorizationType = { + TWITTER: 'TWITTER', + TWITCH: 'TWITCH', + STEAM: 'STEAM', + DISCORD: 'DISCORD', + XBOX: 'XBOX', + MIXER: 'MIXER', +} + +module.exports.enumSetSortType = { + NONE: 'NONE', + CALL_ORDER: 'CALL_ORDER', + MAGIC: 'MAGIC', + RECENT: 'RECENT', + STANDARD: 'STANDARD', + ROUND: 'ROUND', +} + +module.exports.enumGameSelectionType = { + CHARACTER: 'CHARACTER', +} + +module.exports.enumBracketType = { + SINGLE_ELIMINATION: 'SINGLE_ELIMINATION', + DOUBLE_ELIMINATION: 'DOUBLE_ELIMINATION', + ROUND_ROBIN: 'ROUND_ROBIN', + SWISS: 'SWISS', + EXHIBITION: 'EXHIBITION', + CUSTOM_SCHEDULE: 'CUSTOM_SCHEDULE', + MATCHMAKING: 'MATCHMAKING', + ELIMINATION_ROUNDS: 'ELIMINATION_ROUNDS', + RACE: 'RACE', + CIRCUIT: 'CIRCUIT', +} + +module.exports.enumActivityState = { + CREATED: 'CREATED', + ACTIVE: 'ACTIVE', + COMPLETED: 'COMPLETED', + READY: 'READY', + INVALID: 'INVALID', + CALLED: 'CALLED', + QUEUED: 'QUEUED', +} + +module.exports.enumStreamSource = { + TWITCH: 'TWITCH', + HITBOX: 'HITBOX', + STREAMME: 'STREAMME', + MIXER: 'MIXER', +} + +module.exports.enumTeamMemberStatus = { + UNKNOWN: 'UNKNOWN', + ACCEPTED: 'ACCEPTED', + INVITED: 'INVITED', + REQUEST: 'REQUEST', + ALUM: 'ALUM', + HIATUS: 'HIATUS', + OPEN_SPOT: 'OPEN_SPOT', +} + +module.exports.enumTeamMemberType = { + PLAYER: 'PLAYER', + STAFF: 'STAFF', +} + +module.exports.enumTournamentPaginationSort = { + startAt: 'startAt', + endAt: 'endAt', + eventRegistrationClosesAt: 'eventRegistrationClosesAt', + computedUpdatedAt: 'computedUpdatedAt', +} + +module.exports.enumComparator = { + GREATER_THAN: 'GREATER_THAN', + GREATER_THAN_OR_EQUAL: 'GREATER_THAN_OR_EQUAL', + EQUAL: 'EQUAL', + LESS_THAN_OR_EQUAL: 'LESS_THAN_OR_EQUAL', + LESS_THAN: 'LESS_THAN', +} + +module.exports.enumMatchConfigVerificationMethod = { + TWITCH: 'TWITCH', + STREAM_ME: 'STREAM_ME', + ANY: 'ANY', + MIXER: 'MIXER', + YOUTUBE: 'YOUTUBE', +} + +module.exports.enumRaceLimitMode = { + BEST_ALL: 'BEST_ALL', + FIRST_ALL: 'FIRST_ALL', + PLAYTIME: 'PLAYTIME', +} + +module.exports.enumRaceType = { + GOALS: 'GOALS', + TIMED: 'TIMED', +} + +module.exports.generateQueryOp = function(fields) { + return generateGraphqlOperation('query', typeMap.Query, fields) +} +module.exports.generateMutationOp = function(fields) { + return generateGraphqlOperation('mutation', typeMap.Mutation, fields) +} +module.exports.generateSubscriptionOp = function(fields) { + return generateGraphqlOperation('subscription', typeMap.Subscription, fields) +} +module.exports.everything = { + __scalar: true, +} + +var schemaExports = require('./guards.cjs.js') +for (var k in schemaExports) { + module.exports[k] = schemaExports[k] +} diff --git a/src/startgg/genql/schema.graphql b/src/startgg/genql/schema.graphql new file mode 100644 index 0000000..c16251c --- /dev/null +++ b/src/startgg/genql/schema.graphql @@ -0,0 +1,2141 @@ +""" +Specify a query to be read from gql-public. Will use the configured cacheAge on +the query resolve configuration, or the override value passed through the +directive as publicCache(cacheAge: INT) argument. +""" +directive @publicCache( + """Optional override for the query-level cacheAge value.""" + cacheAge: Int +) on FIELD + +""" +Specify a field to only be included in the response if the user is logged in. +""" +directive @userData on FIELD + +type Query { + """Returns the authenticated user""" + currentUser: User + + """Returns an entrant given its id""" + entrant(id: ID!): Entrant + + """Returns an event given its id or slug""" + event(id: ID, slug: String): Event + + """Returns a league given its id or slug""" + league(id: ID, slug: String): League + + """Returns a participant given its id""" + participant(id: ID!, isAdmin: Boolean): Participant + + """Returns a phase given its id""" + phase(id: ID): Phase + + """Returns a phase group given its id""" + phaseGroup(id: ID): PhaseGroup + + """Returns a player given an id""" + player(id: ID!): Player + + """Returns a phase seed given its id""" + seed(id: ID): Seed + + """Returns a set given its id""" + set(id: ID!): Set + + """A shop entity""" + shop(id: ID, slug: String): Shop + + """Returns an stream given its id""" + stream(id: ID!): Streams + + """Returns all the stream queues for a given tournament""" + streamQueue(tournamentId: ID!, includePlayerStreams: Boolean): [StreamQueue] + + """Returns a team given its id""" + team(id: ID, slug: String, inviteCode: String): Team + + """Returns a tournament given its id or slug""" + tournament(id: ID, slug: String): Tournament + + """Paginated, filterable list of tournaments""" + tournaments(query: TournamentQuery!): TournamentConnection + + """Returns a user given a user slug of the form user/abc123, or id""" + user(id: ID, slug: String): User + + """Returns a videogame given its id""" + videogame(id: ID, slug: String): Videogame + + """Returns paginated list of videogames matching the search criteria.""" + videogames(query: VideogameQuery!): VideogameConnection +} + +"""A user""" +type User { + id: ID + + """Authorizations to external services (i.e. Twitch, Twitter)""" + authorizations(types: [SocialConnectionType]): [ProfileAuthorization] + bio: String + + """Public facing user birthday that respects user publishing settings""" + birthday: String + + """ + Uniquely identifying token for user. Same as the hashed part of the slug + """ + discriminator: String + + """Events this user has competed in""" + events(query: UserEventsPaginationQuery): EventConnection + genderPronoun: String + images(type: String): [Image] + + """Leagues this user has competed in""" + leagues(query: UserLeaguesPaginationQuery): LeagueConnection + + """Public location info for this user""" + location: Address + + """Public facing user name that respects user publishing settings""" + name: String + + """player for user""" + player: Player + slug: String + + """Tournaments this user is organizing or competing in""" + tournaments(query: UserTournamentsPaginationQuery): TournamentConnection +} + +""" +Represents the name of the third-party social service (e.g Twitter) for OAuth +""" +enum SocialConnectionType { + """""" + TWITTER + + """""" + TWITCH + + """""" + DISCORD + + """""" + MIXER + + """""" + XBOX +} + +"""An OAuth ProfileAuthorization object""" +type ProfileAuthorization { + id: ID + + """The id given by the external service""" + externalId: String + + """ + The username given by the external service (including discriminator if discord) + """ + externalUsername: String + stream: Stream + + """ + The name of the external service providing this auth i.e. "twitch" + """ + type: AuthorizationType + url: String +} + +"""A Stream object""" +type Stream { + id: ID + + """Whether the stream is currently live. May be slightly delayed.""" + isOnline: Boolean + + """The name of the stream""" + name: String + + """ + The name of the external service providing this auth i.e. "twitch" + """ + type: StreamType +} + +"""Represents the type of stream service""" +enum StreamType { + """""" + TWITCH + + """""" + MIXER +} + +"""Represents the name of the third-party service (e.g Twitter) for OAuth""" +enum AuthorizationType { + """""" + TWITTER + + """""" + TWITCH + + """""" + STEAM + + """""" + DISCORD + + """""" + XBOX + + """""" + MIXER +} + +input UserEventsPaginationQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: UserEventsPaginationFilter +} + +input UserEventsPaginationFilter { + videogameId: [ID] + eventType: Int + minEntrantCount: Int + maxEntrantCount: Int + location: LocationFilterType + search: PaginationSearchType +} + +input LocationFilterType { + countryCode: String + state: String + city: String +} + +input PaginationSearchType { + fieldsToSearch: [String] + searchString: String +} + +type EventConnection { + pageInfo: PageInfo + nodes: [Event] +} + +type PageInfo { + total: Int + totalPages: Int + page: Int + perPage: Int + sortBy: String + filter: JSON +} + +""" +The `JSON` scalar type represents JSON values as specified by + [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +""" +scalar JSON + +"""An event in a tournament""" +type Event { + id: ID + + """How long before the event start will the check-in end (in seconds)""" + checkInBuffer: Int + + """How long the event check-in will last (in seconds)""" + checkInDuration: Int + + """Whether check-in is enabled for this event""" + checkInEnabled: Boolean + + """ + Rough categorization of event tier, denoting relative importance in the competitive scene + """ + competitionTier: Int + + """When the event was created (unix timestamp)""" + createdAt: Timestamp + + """Last date attendees are able to create teams for team events""" + deckSubmissionDeadline: Timestamp + + """Maximum number of participants each Entrant can have""" + entrantSizeMax: Int @deprecated(reason: "Migrate to teamRosterSize") + + """Minimum number of participants each Entrant can have""" + entrantSizeMin: Int @deprecated(reason: "Migrate to teamRosterSize") + + """The entrants that belong to an event, paginated by filter criteria""" + entrants(query: EventEntrantPageQuery): EntrantConnection + + """Whether the event has decks""" + hasDecks: Boolean + + """Are player tasks enabled for this event""" + hasTasks: Boolean + images(type: String): [Image] + + """Whether the event is an online event or not""" + isOnline: Boolean + league: League + + """Markdown field for match rules/instructions""" + matchRulesMarkdown: String + + """Title of event set by organizer""" + name: String + + """Gets the number of entrants in this event""" + numEntrants: Int + + """The phase groups that belong to an event.""" + phaseGroups: [PhaseGroup] + + """The phases that belong to an event.""" + phases( + """Filter phases by state. If not specified will default to all phases""" + state: ActivityState + + """Optionally only return results for this phase""" + phaseId: ID + ): [Phase] + + """TO settings for prizing""" + prizingInfo: JSON + publishing: JSON + + """Markdown field for event rules/instructions""" + rulesMarkdown: String + + """Id of the event ruleset""" + rulesetId: Int + + """Settings pulled from the event ruleset, if one exists""" + rulesetSettings: JSON @deprecated(reason: "Use ruleset") + + """Paginated sets for this Event""" + sets( + page: Int + perPage: Int + + """How to sort these sets""" + sortType: SetSortType + + """Supported filter options to filter down set results.""" + filters: SetFilters + ): SetConnection + slug: String + + """Paginated list of standings""" + standings(query: StandingPaginationQuery!): StandingConnection + + """When does this event start?""" + startAt: Timestamp + + """The state of the Event.""" + state: ActivityState + + """Paginated stations on this event""" + stations(query: StationFilter): StationsConnection + + """Last date attendees are able to create teams for team events""" + teamManagementDeadline: Timestamp + + """ + If this is a teams event, returns whether or not teams can set custom names + """ + teamNameAllowed: Boolean + + """Team roster size requirements""" + teamRosterSize: TeamRosterSize + tournament: Tournament + + """ + The type of the event, whether an entrant will have one participant or multiple + """ + type: Int + + """When the event was last modified (unix timestamp)""" + updatedAt: Timestamp + + """Whether the event uses the new EventSeeds for seeding""" + useEventSeeds: Boolean + videogame: Videogame + + """The waves being used by the event""" + waves( + """Waves filtered by phaseId, returns all if not set.""" + phaseId: ID + ): [Wave] +} + +""" +Represents a Unix Timestamp. Supports up to 53 bit int values, + as that is JavaScript's internal memory allocation for integer values. +""" +scalar Timestamp + +input EventEntrantPageQuery { + page: Int + perPage: Int + sortBy: String + filter: EventEntrantPageQueryFilter +} + +input EventEntrantPageQueryFilter { + name: String +} + +type EntrantConnection { + pageInfo: PageInfo + nodes: [Entrant] +} + +"""An entrant in an event""" +type Entrant { + id: ID + event: Event + + """Entrant's seed number in the first phase of the event.""" + initialSeedNum: Int + isDisqualified: Boolean + + """ + The entrant name as it appears in bracket: gamerTag of the participant or team name + """ + name: String + + """Paginated sets for this entrant""" + paginatedSets( + page: Int + perPage: Int + + """How to sort these sets""" + sortType: SetSortType + + """Supported filter options to filter down set results.""" + filters: SetFilters + ): SetConnection + participants: [Participant] + seeds: [Seed] + skill: Int + + """ + Standing for this entrant given an event. All entrants queried must be in the same event (for now). + """ + standing: Standing + stream: Streams @deprecated(reason: "DEPRECATED. Use streams instead, which supports multiple stream types and teams.") + streams: [Streams] + + """Team linked to this entrant, if one exists""" + team: Team +} + +"""Different sort type configurations used when displaying multiple sets""" +enum SetSortType { + """Sets will not be sorted.""" + NONE + + """ + Sets are sorted in the suggested order that they be called to be played. The order of completed sets is reversed. + """ + CALL_ORDER + + """ + Sets are sorted by relevancy dependent on the state and progress of the event. + """ + MAGIC + + """Sets are sorted in the order that they were started.""" + RECENT + + """Deprecated. This is equivalent to CALL_ORDER""" + STANDARD + + """Sets sorted by round and identifier""" + ROUND +} + +input SetFilters { + """Only return Sets for these Entrants""" + entrantIds: [ID] + + """ + Only return Sets for this Entrant size. For example, to fetch 1v1 Sets only, filter by an entrantSize of 1 + """ + entrantSize: [Int] + + """Only return Sets that have an attached VOD""" + hasVod: Boolean + + """ + Do not return empty Sets. For example, set this to true to filter out sets that are waiting for progressions. + """ + hideEmpty: Boolean + + """Return sets that contain a bye""" + showByes: Boolean + + """ + Only return Sets that are in an Online event. If omitted, Sets for both online and offline Events are returned + """ + isEventOnline: Boolean + + """Only return Sets in certain geographical areas.""" + location: SetFilterLocation + + """Only return Sets for these Participants""" + participantIds: [ID] + + """Only return Sets in these PhaseGroups""" + phaseGroupIds: [ID] + + """Only return Sets in these Phases""" + phaseIds: [ID] + + """Only return Sets in these Events""" + eventIds: [ID] + + """Only return Sets in these Tournaments""" + tournamentIds: [ID] + + """Only return Sets for these Players""" + playerIds: [ID] + + """Only return Sets for these Rounds""" + roundNumber: Int + + """Only returns Sets that are in these states""" + state: [Int] + + """Only return Sets that are assigned to these Station IDs""" + stationIds: [ID] + + """Only return Sets that are assigned to these Station numbers""" + stationNumbers: [Int] + + """Only return sets created or updated since this timestamp""" + updatedAfter: Timestamp +} + +"""Filter Sets by geographical constraints.""" +input SetFilterLocation { + """Only return Sets in this state. Only applicable to US states""" + state: String + + """ + Only return Sets in this country. Expects a valid two-letter country code + """ + country: String + distanceFrom: SetFilterLocationDistanceFrom +} + +""" +Only return Sets that are a certain distance away from a specified point +""" +input SetFilterLocationDistanceFrom { + """Point at which to perform distance calculation""" + point: SetFilterLocationDistanceFromPoint + + """Distance from the point to include results in""" + radius: String +} + +input SetFilterLocationDistanceFromPoint { + lat: Float + lon: Float +} + +type SetConnection { + pageInfo: PageInfo + nodes: [Set] +} + +"""A set""" +type Set { + id: ID + + """The time this set was marked as completed""" + completedAt: Timestamp + + """The time this set was created""" + createdAt: Timestamp + displayScore(mainEntrantId: ID): String + + """Event that this set belongs to.""" + event: Event + + """Full round text of this set.""" + fullRoundText: String + game(orderNum: Int!): Game + games: [Game] + + """Whether this set contains a placeholder entrant""" + hasPlaceholder: Boolean + + """ + The letters that describe a unique identifier within the pool. Eg. F, AT + """ + identifier: String + images(type: String): [Image] + lPlacement: Int + + """Phase group that this Set belongs to.""" + phaseGroup: PhaseGroup + + """The round number of the set. Negative numbers are losers bracket""" + round: Int + + """ + Indicates whether the set is in best of or total games mode. This instructs + which field is used to figure out how many games are in this set. + """ + setGamesType: Int + + """ + A possible spot in a set. Use this to get all entrants in a set. Use this for all bracket types (FFA, elimination, etc) + """ + slots(includeByes: Boolean = false): [SetSlot] + + """ + The start time of the Set. If there is no startAt time on the Set, will pull it from phaseGroup rounds configuration. + """ + startAt: Timestamp + startedAt: Timestamp + state: Int + + """Tournament event station for a set""" + station: Stations + + """Tournament event stream for a set""" + stream: Streams + + """ + If setGamesType is in total games mode, this defined the number of games in the set. + """ + totalGames: Int + + """Url of a VOD for this set""" + vodUrl: String + wPlacement: Int + winnerId: Int +} + +"""A game represents a single game within a set.""" +type Game { + id: ID + images(type: String): [Image] + orderNum: Int + + """Selections for this game such as character, etc.""" + selections: [GameSelection] + + """The stage that this game was played on (if applicable)""" + stage: Stage + state: Int + winnerId: Int +} + +"""An image""" +type Image { + id: ID + height: Float + ratio: Float + type: String + url: String + width: Float +} + +"""A selection for this game. i.e. character/stage selection, etc""" +type GameSelection { + id: ID + + """The entrant who this selection is for""" + entrant: Entrant + orderNum: Int + + """ + The participant who this selection is for. This is only populated if there are + selections for multiple participants of a single entrant + """ + participant: Participant + selectionType: GameSelectionType + selectionValue: Int +} + +"""A participant of a tournament; either a spectator or competitor""" +type Participant { + id: ID + + """If this participant was checked-in by admin""" + checkedIn: Boolean + + """The time this participant was checked-in by admin""" + checkedInAt: Timestamp + + """Info for connected accounts to external services.""" + connectedAccounts: JSON + + """ + Contact Info selected during registration. Falls back to User.location and/or + User.name if necessary. These fields are for admin use only and do not respect + user privacy settings. DO NOT display this information publicly. + """ + contactInfo: ContactInfo + + """ + Email of the user, only available to admins within 18 months of tournament + """ + email: String + entrants: [Entrant] + + """The events this participant registered for.""" + events: [Event] + + """The tag that was used in registration e.g. Mang0""" + gamerTag: String + images(type: String): [Image] + player: Player + + """The prefix that was used in registration e.g. C9""" + prefix: String + + """Admin only field for required social connections""" + requiredConnections: [ProfileAuthorization] + + """The user this participant is associated to.""" + user: User + + """If this participant is verified as actually being in the tournament""" + verified: Boolean +} + +"""Name, address, etc""" +type ContactInfo { + id: ID + + """Participant City Name""" + city: String + + """Participant Country Name""" + country: String + + """Participant Country (region) id""" + countryId: Int + name: String + + """First Name""" + nameFirst: String + + """Last Name""" + nameLast: String + + """Participant State Name""" + state: String + + """Participant State (region) id""" + stateId: Int + + """Zip or Postal Code""" + zipcode: String +} + +"""A player""" +type Player { + id: ID + gamerTag: String + prefix: String + + """Most recent active & published rankings""" + rankings(limit: Int, videogameId: ID): [PlayerRank] + + """Recent sets for this player.""" + recentSets( + """Use this to get H2H history between two players""" + opponentId: ID + ): [Set] @deprecated(reason: "Use the sets field instead.") + + """Set history for this player.""" + sets( + page: Int + perPage: Int + + """Supported filter options to filter down set results.""" + filters: SetFilters + ): SetConnection + user: User +} + +"""A player's ranks""" +type PlayerRank { + id: ID + + """The player's placement on the ranking""" + rank: Int + title: String +} + +"""The type of selection i.e. is it for a character or something else""" +enum GameSelectionType { + """Character selection""" + CHARACTER +} + +"""Video Stage""" +type Stage { + id: ID + + """Stage name""" + name: String +} + +"""A group within a phase""" +type PhaseGroup { + id: ID + + """The bracket type of this group's phase.""" + bracketType: BracketType + + """Unique identifier for this group within the context of its phase""" + displayIdentifier: String + + """ + For the given phase group, this is the start time of the first round that occurs in the group. + """ + firstRoundTime: Timestamp + numRounds: Int + paginatedSeeds(query: SeedPaginationQuery!, eventId: ID): SeedConnection @deprecated(reason: "Please use 'seeds', which is now paginated") + + """Paginated sets on this phaseGroup""" + paginatedSets( + page: Int + perPage: Int + + """How to sort these sets""" + sortType: SetSortType + + """Supported filter options to filter down set results.""" + filters: SetFilters + ): SetConnection @deprecated(reason: "Please use 'sets', which is now paginated") + + """The phase associated with this phase group""" + phase: Phase + + """The progressions out of this phase group""" + progressionsOut: [Progression] + rounds: [Round] + seedMap: JSON + + """Paginated seeds for this phase group""" + seeds(query: SeedPaginationQuery!, eventId: ID): SeedConnection + + """Paginated sets on this phaseGroup""" + sets( + page: Int + perPage: Int + + """How to sort these sets""" + sortType: SetSortType + + """Supported filter options to filter down set results.""" + filters: SetFilters + ): SetConnection + + """Paginated list of standings""" + standings(query: StandingGroupStandingPageFilter): StandingConnection + + """ + Unix time the group is scheduled to start. This info could also be on the wave instead. + """ + startAt: Timestamp + state: Int + tiebreakOrder: JSON + wave: Wave +} + +"""The type of Bracket format that a Phase is configured with.""" +enum BracketType { + """""" + SINGLE_ELIMINATION + + """""" + DOUBLE_ELIMINATION + + """""" + ROUND_ROBIN + + """""" + SWISS + + """""" + EXHIBITION + + """""" + CUSTOM_SCHEDULE + + """""" + MATCHMAKING + + """""" + ELIMINATION_ROUNDS + + """""" + RACE + + """""" + CIRCUIT +} + +input SeedPaginationQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: SeedPageFilter +} + +input SeedPageFilter { + id: ID + entrantName: String + checkInState: [Int] + phaseGroupId: [ID] + eventCheckInGroupId: ID + phaseId: [ID] + eventId: ID + search: PaginationSearchType +} + +type SeedConnection { + pageInfo: PageInfo + nodes: [Seed] +} + +"""A seed for an entrant""" +type Seed { + id: ID + + """Map of Participant ID to checked in boolean""" + checkedInParticipants: JSON + entrant: Entrant + groupSeedNum: Int + isBye: Boolean + phase: Phase + phaseGroup: PhaseGroup + placeholderName: String + placement: Int + + """The player(s) associated with this seed's entrant""" + players: [Player] + progressionSeedId: Int + + """Source progression information""" + progressionSource: Progression + seedNum: Int + + """ + Entrant's win/loss record for this standing. Scores do not include byes. + """ + setRecordWithoutByes(phaseGroupId: ID!): JSON + standings( + """ + The container of the standing groups to get standings for. If null, will return all standings. + """ + containerType: String + ): [Standing] +} + +"""A phase in an event""" +type Phase { + id: ID + + """The bracket type of this phase.""" + bracketType: BracketType + + """The Event that this phase belongs to""" + event: Event + + """Number of phase groups in this phase""" + groupCount: Int + + """Is the phase an exhibition or not.""" + isExhibition: Boolean + + """Name of phase e.g. Round 1 Pools""" + name: String + + """The number of seeds this phase contains.""" + numSeeds: Int + paginatedSeeds(query: SeedPaginationQuery!, eventId: ID): SeedConnection @deprecated(reason: "Please use 'seeds' instead") + + """Phase groups under this phase, paginated""" + phaseGroups(query: PhaseGroupPageQuery): PhaseGroupConnection + + """The relative order of this phase within an event""" + phaseOrder: Int + + """Paginated seeds for this phase""" + seeds(query: SeedPaginationQuery!, eventId: ID): SeedConnection + + """Paginated sets for this Phase""" + sets( + page: Int + perPage: Int + + """How to sort these sets""" + sortType: SetSortType + + """Supported filter options to filter down set results.""" + filters: SetFilters + ): SetConnection + + """State of the phase""" + state: ActivityState + waves: [Wave] +} + +input PhaseGroupPageQuery { + page: Int + perPage: Int + sortBy: String + entrantIds: [ID] + filter: PhaseGroupPageQueryFilter +} + +input PhaseGroupPageQueryFilter { + id: [ID] + waveId: ID +} + +type PhaseGroupConnection { + pageInfo: PageInfo + nodes: [PhaseGroup] +} + +"""Represents the state of an activity""" +enum ActivityState { + """Activity is created""" + CREATED + + """Activity is active or in progress""" + ACTIVE + + """Activity is done""" + COMPLETED + + """Activity is ready to be started""" + READY + + """Activity is invalid""" + INVALID + + """Activity, like a set, has been called to start""" + CALLED + + """Activity is queued to run""" + QUEUED +} + +"""A wave in a tournament""" +type Wave { + id: ID + + """The Wave Identifier""" + identifier: String + + """Unix time the wave is scheduled to start.""" + startAt: Timestamp +} + +""" +A connection between a placement in an origin phase group to a destination seed. +""" +type Progression { + id: ID + originOrder: Int + originPhase: Phase + originPhaseGroup: PhaseGroup + originPlacement: Int +} + +"""A standing indicates the placement of something within a container.""" +type Standing { + id: ID + + """ + The containing entity that contextualizes this standing. Event standings, for + example, represent an entrant's standing in the entire event vs. Set standings + which is an entrant's standing in only a single set within an event. + """ + container: StandingContainer + + """ + If the entity this standing is assigned to can be resolved into an entrant, this will provide the entrant. + """ + entrant: Entrant + isFinal: Boolean + + """ + Metadata that goes along with this standing. Can take on different forms based on standing group type and settings. + """ + metadata: JSON + placement: Int + + """The player(s) tied to this standing's entity""" + player: Player + standing: Int @deprecated(reason: "The \"placement\" field is identical and will eventually replace \"standing\"") + stats: StandingStats + totalPoints: Float +} + +"""The containing entity that this standing is for""" +union StandingContainer = Tournament | Event | PhaseGroup | Set + +"""A tournament""" +type Tournament { + id: ID + addrState: String + + """Admin-only view of admins for this tournament""" + admins( + """Which roles to show""" + roles: [String] + ): [User] + city: String + countryCode: String + + """When the tournament was created (unix timestamp)""" + createdAt: Timestamp + currency: String + + """When the tournament ends""" + endAt: Timestamp + + """When does event registration close""" + eventRegistrationClosesAt: Timestamp + events(limit: Int, filter: EventFilter): [Event] + + """True if tournament has at least one offline event""" + hasOfflineEvents: Boolean + hasOnlineEvents: Boolean + hashtag: String + images(type: String): [Image] + + """True if tournament has at least one online event""" + isOnline: Boolean + + """Is tournament registration open""" + isRegistrationOpen: Boolean + lat: Float + links: TournamentLinks + lng: Float + mapsPlaceId: String + + """The tournament name""" + name: String + + """Number of attendees including spectators, if public""" + numAttendees: Int + + """The user who created the tournament""" + owner: User + + """Paginated, queryable list of participants""" + participants(query: ParticipantPaginationQuery!, isAdmin: Boolean): ParticipantConnection + postalCode: String + primaryContact: String + primaryContactType: String + + """Publishing settings for this tournament""" + publishing: JSON + + """When does registration for the tournament end""" + registrationClosesAt: Timestamp + rules: String + + """The short slug used to form the url""" + shortSlug: String + + """The slug used to form the url""" + slug: String + + """When the tournament Starts""" + startAt: Timestamp + + """ + State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED + """ + state: Int + stations(page: Int, perPage: Int): StationsConnection + streamQueue: [StreamQueue] + streams: [Streams] + + """When is the team creation deadline""" + teamCreationClosesAt: Timestamp + + """Paginated, queryable list of teams""" + teams(query: TeamPaginationQuery!): TeamConnection + + """The timezone of the tournament""" + timezone: String + + """The type of tournament from TournamentType""" + tournamentType: Int + + """When the tournament was last modified (unix timestamp)""" + updatedAt: Timestamp + + """Build Tournament URL""" + url( + """Tournament tab to add to URL""" + tab: String + + """ + Generate a relative URL. Defaults to true. Setting to false will generate an absolute URL + """ + relative: Boolean = true + ): String + venueAddress: String + venueName: String + + """List of all waves in this tournament""" + waves: [Wave] +} + +input EventFilter { + videogameId: [ID] + type: [Int] + published: Boolean +} + +type TournamentLinks { + facebook: String + discord: String +} + +input ParticipantPaginationQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: ParticipantPageFilter +} + +input ParticipantPageFilter { + id: ID + ids: [ID] + eventIds: [ID] + search: PaginationSearchType + gamerTag: String + unpaid: Boolean + incompleteTeam: Boolean + missingDeck: Boolean + checkedIn: Boolean + notCheckedIn: Boolean +} + +type ParticipantConnection { + pageInfo: PageInfo + nodes: [Participant] +} + +type StationsConnection { + pageInfo: PageInfo + nodes: [Stations] +} + +"""Stations, such as a stream setup, at an event""" +type Stations { + id: ID + canAutoAssign: Boolean + clusterNumber: String + clusterPrefix: Int + enabled: Boolean + identifier: Int + numSetups: Int + number: Int + prefix: String + queue: JSON + queueDepth: Int + state: Int + updatedAt: Timestamp +} + +"""A Stream queue object""" +type StreamQueue { + id: String + + """The sets on the stream""" + sets: [Set] + + """The stream on the queue""" + stream: Streams +} + +"""Tournament Stream""" +type Streams { + id: ID + enabled: Boolean + followerCount: Int + isOnline: Boolean + numSetups: Int + parentStreamId: Int + streamGame: String + streamId: String + streamLogo: String + streamName: String + streamSource: StreamSource + streamStatus: String + streamType: Int + streamTypeId: Int +} + +"""Represents the source of a stream""" +enum StreamSource { + """Stream is on twitch.tv channel""" + TWITCH + + """Stream is on smashcast.tv channel""" + HITBOX + + """Stream is on a stream.me channel""" + STREAMME + + """Stream is on a mixer.com channel""" + MIXER +} + +input TeamPaginationQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: TeamPaginationFilter +} + +input TeamPaginationFilter { + globalTeamId: ID + eventState: ActivityState + eventId: ID + eventIds: [ID] + minEntrantCount: Int + maxEntrantCount: Int + search: PaginationSearchType + type: Int + tournamentId: ID + memberStatus: [TeamMemberStatus] + videogameId: [ID] + isLeague: Boolean + upcoming: Boolean + past: Boolean + rosterComplete: Boolean + rosterIncomplete: Boolean +} + +"""Membership status of a team member""" +enum TeamMemberStatus { + """""" + UNKNOWN + + """""" + ACCEPTED + + """""" + INVITED + + """""" + REQUEST + + """""" + ALUM + + """""" + HIATUS + + """""" + OPEN_SPOT +} + +type TeamConnection { + pageInfo: PageInfo + nodes: [Team] +} + +"""A team, either at the global level or within the context of an event""" +interface Team { + id: ID + + """ + Uniquely identifying token for team. Same as the hashed part of the slug + """ + discriminator: String + entrant: Entrant @deprecated(reason: "Use the entrant field off the EventTeam type") + event: Event @deprecated(reason: "Use the event field off the EventTeam type") + images(type: String): [Image] + members(status: [TeamMemberStatus]): [TeamMember] + name: String +} + +"""A member of a team""" +type TeamMember { + id: ID + isAlternate: Boolean + isCaptain: Boolean + + """The type of the team member""" + memberType: TeamMemberType + participant: Participant + player: Player + + """The status of the team member""" + status: TeamMemberStatus +} + +"""Membership type of a team member""" +enum TeamMemberType { + """""" + PLAYER + + """""" + STAFF +} + +""" +Any stats related to this standing. This type is experimental and very likely to change in the future. +""" +type StandingStats { + score: Score +} + +""" +The score that led to this standing being awarded. The meaning of this field can +vary by standing type and is not used for some standing types. +""" +type Score { + """ + The name of this score. e.g. "Kills" or "Stocks" + """ + label: String + + """The raw score value""" + value: Float + + """ + Like value, but formatted for race format events. Formatted according to the race config for the front end to use. + """ + displayValue: String +} + +"""A round within a phase group""" +type Round { + id: ID + + """ + If applicable, bestOf is the number of games + one must win a majority out of to win a set in this round + """ + bestOf: Int + + """Indicates this round's order in the phase group""" + number: Int + + """The time that this round is scheduled to start at""" + startAt: Timestamp +} + +input StandingGroupStandingPageFilter { + page: Int + perPage: Int + sortBy: String +} + +type StandingConnection { + pageInfo: PageInfo + nodes: [Standing] +} + +""" +A slot in a set where a seed currently or will eventually exist in order to participate in the set. +""" +type SetSlot { + id: ID + entrant: Entrant + + """Pairs with prereqType, is the ID of the prereq.""" + prereqId: String + + """ + Given a set prereq type, defines the placement required in the origin set to end up in this slot. + """ + prereqPlacement: Int + + """Describes where the entity in this slot comes from.""" + prereqType: String + seed: Seed + + """The index of the slot. Unique per set.""" + slotIndex: Int + + """ + The standing within this set for the seed currently assigned to this slot. + """ + standing: Standing +} + +"""A league""" +type League { + id: ID + addrState: String + city: String + countryCode: String + + """When the tournament was created (unix timestamp)""" + createdAt: Timestamp + currency: String + + """When the tournament ends""" + endAt: Timestamp + entrantCount: Int + eventOwners(query: EventOwnersQuery): EventOwnerConnection + + """When does event registration close""" + eventRegistrationClosesAt: Timestamp + + """Paginated list of events in a league""" + events(query: LeagueEventsQuery): EventConnection + + """Hacked "progression" into this final event""" + finalEventId: Int @deprecated(reason: "No longer used") + + """True if tournament has at least one offline event""" + hasOfflineEvents: Boolean + hasOnlineEvents: Boolean + hashtag: String + images(type: String): [Image] + + """True if tournament has at least one online event""" + isOnline: Boolean + lat: Float + links: TournamentLinks + lng: Float + mapsPlaceId: String + + """The tournament name""" + name: String + + """Top X number of people in the standings who progress to final event""" + numProgressingToFinalEvent: Int @deprecated(reason: "No longer used") + numUniquePlayers: Int + postalCode: String + primaryContact: String + primaryContactType: String + + """Publishing settings for this tournament""" + publishing: JSON + + """When does registration for the tournament end""" + registrationClosesAt: Timestamp + rules: String + + """The short slug used to form the url""" + shortSlug: String + + """Whether standings for this league should be visible""" + showStandings: Boolean + slug: String + + """Paginated list of standings""" + standings(query: StandingGroupStandingPageFilter): StandingConnection + + """When the tournament Starts""" + startAt: Timestamp + + """ + State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED + """ + state: Int + + """When is the team creation deadline""" + teamCreationClosesAt: Timestamp + tiers: [EventTier] + + """The timezone of the tournament""" + timezone: String + + """The type of tournament from TournamentType""" + tournamentType: Int + + """When the tournament was last modified (unix timestamp)""" + updatedAt: Timestamp + + """Build Tournament URL""" + url( + """Tournament tab to add to URL""" + tab: String + + """ + Generate a relative URL. Defaults to true. Setting to false will generate an absolute URL + """ + relative: Boolean = true + ): String + venueAddress: String + venueName: String + videogames: [Videogame] +} + +input EventOwnersQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String +} + +type EventOwnerConnection { + pageInfo: PageInfo + nodes: [EventOwner] +} + +"""Name and Gamertag of the owner of an event in a league""" +type EventOwner { + eventId: ID + email: String + gamerTag: String + fullName: String +} + +input LeagueEventsQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: LeagueEventsFilter +} + +input LeagueEventsFilter { + search: PaginationSearchType + pointMappingGroupIds: [ID] + tierIds: [ID] + userId: ID + upcoming: Boolean + leagueEntrantId: ID +} + +"""Used for league application tiers""" +type EventTier { + id: ID + + """Name of this tier""" + name: String +} + +"""A videogame""" +type Videogame { + id: ID + + """All characters for this videogame""" + characters: [Character] + displayName: String + images(type: String): [Image] + name: String + slug: String +} + +"""A character in a videogame""" +type Character { + id: ID + images(type: String): [Image] + + """Name of Character""" + name: String +} + +input StandingPaginationQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: StandingPageFilter +} + +input StandingPageFilter { + id: ID + ids: [ID] + search: PaginationSearchType +} + +input StationFilter { + page: Int + perPage: Int +} + +"""Team roster size requirements""" +type TeamRosterSize { + maxAlternates: Int + maxPlayers: Int + minAlternates: Int + minPlayers: Int +} + +input UserLeaguesPaginationQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: UserLeaguesPaginationFilter +} + +input UserLeaguesPaginationFilter { + videogameId: [ID] + upcoming: Boolean + past: Boolean + search: PaginationSearchType +} + +type LeagueConnection { + pageInfo: PageInfo + nodes: [League] +} + +"""A user's address""" +type Address { + id: ID + city: String + country: String + countryId: Int + state: String + stateId: Int +} + +input UserTournamentsPaginationQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: UserTournamentsPaginationFilter +} + +input UserTournamentsPaginationFilter { + past: Boolean + upcoming: Boolean + search: PaginationSearchType + videogameId: [ID] + tournamentView: String + excludeId: [ID] +} + +type TournamentConnection { + pageInfo: PageInfo + nodes: [Tournament] +} + +"""A shop""" +type Shop { + id: ID + levels(query: ShopLevelsQuery): ShopLevelConnection + messages(query: ShopOrderMessagesQuery): ShopOrderMessageConnection + name: String + slug: String + url: String +} + +input ShopLevelsQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String +} + +type ShopLevelConnection { + pageInfo: PageInfo + nodes: [ShopLevel] +} + +"""A shop level""" +type ShopLevel { + id: ID + currAmount: Float + description: String + goalAmount: Float + images(type: String): [Image] + name: String +} + +input ShopOrderMessagesQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String +} + +type ShopOrderMessageConnection { + pageInfo: PageInfo + nodes: [ShopOrderMessage] +} + +"""The message and player info for a shop order""" +type ShopOrderMessage { + id: ID + + """The player's gamertag. Returns null if anonymous message type""" + gamertag: String + + """The order message""" + message: String + + """The player's name. Returns null unless name & tag display is selected""" + name: String + + """The player who left the comment""" + player: Player + + """The total order amount""" + total: Float +} + +input TournamentQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: TournamentPageFilter + sort: TournamentPaginationSort +} + +input TournamentPageFilter { + id: ID + ids: [ID] + + """ID of the user that owns this tournament.""" + ownerId: ID + + """ + If true, filter to only tournaments the currently authed user is an admin of + """ + isCurrentUserAdmin: Boolean + countryCode: String + addrState: String + location: TournamentLocationFilter + afterDate: Timestamp + beforeDate: Timestamp + computedUpdatedAt: Timestamp + name: String + venueName: String + isFeatured: Boolean + isLeague: Boolean + hasBannerImages: Boolean + activeShops: Boolean + regOpen: Boolean + past: Boolean + published: Boolean + publiclySearchable: Boolean + staffPicks: Boolean + hasOnlineEvents: Boolean + topGames: TopGameFilter + upcoming: Boolean + videogameIds: [ID] + sortByScore: Boolean +} + +input TournamentLocationFilter { + """Latitude, Longitude""" + distanceFrom: String + + """e.g. 50mi""" + distance: String +} + +input TopGameFilter { + """ + Array of which # top game you want to filter on.e.g. [2, 3] will filter on the 2nd and 3rd top games + """ + gameNums: [Int] +} + +enum TournamentPaginationSort { + """""" + startAt + + """""" + endAt + + """""" + eventRegistrationClosesAt + + """""" + computedUpdatedAt +} + +input VideogameQuery { + page: Int = 1 + + """How many nodes to return for the page. Maximum value of 500""" + perPage: Int = 25 + sortBy: String + filter: VideogamePageFilter +} + +input VideogamePageFilter { + id: [ID] + name: String + forUser: ID +} + +type VideogameConnection { + pageInfo: PageInfo + nodes: [Videogame] +} + +type Mutation { + """Delete a phase by id""" + deletePhase(phaseId: ID!): Boolean + + """Delete a station by id""" + deleteStation(stationId: ID!): Boolean + + """Delete a wave by id""" + deleteWave(waveId: ID!): Boolean + + """ + Automatically attempt to resolve all schedule conflicts. Returns a list of changed seeds + """ + resolveScheduleConflicts(tournamentId: ID!, options: ResolveConflictsOptions): [Seed] + + """Swap two seed ids in a phase""" + swapSeeds(phaseId: ID!, seed1Id: ID!, seed2Id: ID!): [Seed] + + """Update set of phase groups in a phase""" + updatePhaseGroups(groupConfigs: [PhaseGroupUpdateInput]!): [PhaseGroup] + + """Update the seeding for a phase""" + updatePhaseSeeding(phaseId: ID!, seedMapping: [UpdatePhaseSeedInfo]!, options: UpdatePhaseSeedingOptions): Phase + + """Create or update a Phase""" + upsertPhase(phaseId: ID, eventId: ID, payload: PhaseUpsertInput!): Phase + + """Add or update a station by id""" + upsertStation(stationId: ID, tournamentId: ID, fields: StationUpsertInput!): Stations + + """Add or update a wave by id""" + upsertWave(waveId: ID, tournamentId: ID, fields: WaveUpsertInput!): Wave +} + +input ResolveConflictsOptions { + lockedSeeds: [ResolveConflictsLockedSeedConfig] +} + +input ResolveConflictsLockedSeedConfig { + eventId: ID! + numSeeds: Int! +} + +input PhaseGroupUpdateInput { + phaseGroupId: ID! + stationId: ID + waveId: ID +} + +input UpdatePhaseSeedInfo { + seedId: ID! + seedNum: ID! + phaseGroupId: ID +} + +input UpdatePhaseSeedingOptions { + """ + Validate that seedMapping exactly accounts for all entrants in the phase + """ + strictMode: Boolean +} + +input PhaseUpsertInput { + """ + The name of the Phase. For example, "Top 8" or "Pools" + """ + name: String + + """ + The number of pools to configure for the Phase. Only applies to brackets that support pools + """ + groupCount: Int + bracketType: BracketType +} + +input StationUpsertInput { + number: Int! + clusterId: ID +} + +input WaveUpsertInput { + identifier: String! + startAt: Timestamp! + endAt: Timestamp! +} + +"""A set of actions available for an entity to take""" +interface ActionSet { + id: ID +} + +"""Bracket-specific configuration""" +interface BracketConfig { + id: ID + bracketType: BracketType +} + +"""Comparison operator""" +enum Comparator { + """""" + GREATER_THAN + + """""" + GREATER_THAN_OR_EQUAL + + """""" + EQUAL + + """""" + LESS_THAN_OR_EQUAL + + """""" + LESS_THAN +} + +"""An event-level Team, in the context of some competition""" +type EventTeam implements Team { + id: ID + + """ + Uniquely identifying token for team. Same as the hashed part of the slug + """ + discriminator: String + entrant: Entrant @deprecated(reason: "Use the entrant field off the EventTeam type") + event: Event @deprecated(reason: "Use the event field off the EventTeam type") + globalTeam: GlobalTeam + images(type: String): [Image] + members(status: [TeamMemberStatus]): [TeamMember] + name: String +} + +"""Global Team""" +type GlobalTeam implements Team { + id: ID + + """ + Uniquely identifying token for team. Same as the hashed part of the slug + """ + discriminator: String + entrant: Entrant @deprecated(reason: "Use the entrant field off the EventTeam type") + event: Event @deprecated(reason: "Use the event field off the EventTeam type") + eventTeams(query: TeamPaginationQuery): EventTeamConnection + images(type: String): [Image] + + """Leagues-level teams for leagues this team is competing in""" + leagueTeams(query: TeamPaginationQuery): EventTeamConnection + members(status: [TeamMemberStatus]): [TeamMember] + name: String +} + +type EventTeamConnection { + pageInfo: PageInfo + nodes: [EventTeam] +} + +"""Match-level configuration""" +interface MatchConfig { + id: ID + bracketType: BracketType +} + +""" +Different options available for verifying player-reported match results +""" +enum MatchConfigVerificationMethod { + """""" + TWITCH + + """""" + STREAM_ME + + """""" + ANY + + """""" + MIXER + + """""" + YOUTUBE +} + +"""Race specific bracket configuration""" +type RaceBracketConfig implements BracketConfig { + automaticEndTime: Timestamp + id: ID + automaticStartTime: Timestamp + bracketType: BracketType + goalTargetComparator: Comparator + goalTargetValue: String + limitMode: RaceLimitMode + limitValue: Int + raceType: RaceType +} + +"""Enforces limits on the amount of allowable Race submissions""" +enum RaceLimitMode { + """""" + BEST_ALL + + """""" + FIRST_ALL + + """""" + PLAYTIME +} + +"""Race type""" +enum RaceType { + """""" + GOALS + + """""" + TIMED +} + +"""Race specific match configuration""" +type RaceMatchConfig implements MatchConfig { + id: ID + bracketType: BracketType + + """Can players report results?""" + playerReportingEnabled: Boolean + + """Accepted methods of verification that players can use""" + verificationMethods: [MatchConfigVerificationMethod] + + """Are players required to submit verification of their reported results?""" + verificationRequired: Boolean +} + +"""A set of actions available for a team to take""" +type TeamActionSet implements ActionSet { + id: ID +} diff --git a/src/startgg/genql/schema.ts b/src/startgg/genql/schema.ts new file mode 100644 index 0000000..7345a0c --- /dev/null +++ b/src/startgg/genql/schema.ts @@ -0,0 +1,6123 @@ +import { FieldsSelection, Observable } from '@genql/runtime' + +export type Scalars = { + ID: string, + String: string, + Boolean: boolean, + Int: number, + JSON: any, + Timestamp: any, + Float: number, +} + +export interface Query { + /** Returns the authenticated user */ + currentUser?: User + /** Returns an entrant given its id */ + entrant?: Entrant + /** Returns an event given its id or slug */ + event?: Event + /** Returns a league given its id or slug */ + league?: League + /** Returns a participant given its id */ + participant?: Participant + /** Returns a phase given its id */ + phase?: Phase + /** Returns a phase group given its id */ + phaseGroup?: PhaseGroup + /** Returns a player given an id */ + player?: Player + /** Returns a phase seed given its id */ + seed?: Seed + /** Returns a set given its id */ + set?: Set + /** A shop entity */ + shop?: Shop + /** Returns an stream given its id */ + stream?: Streams + /** Returns all the stream queues for a given tournament */ + streamQueue?: (StreamQueue | undefined)[] + /** Returns a team given its id */ + team?: Team + /** Returns a tournament given its id or slug */ + tournament?: Tournament + /** Paginated, filterable list of tournaments */ + tournaments?: TournamentConnection + /** Returns a user given a user slug of the form user/abc123, or id */ + user?: User + /** Returns a videogame given its id */ + videogame?: Videogame + /** Returns paginated list of videogames matching the search criteria. */ + videogames?: VideogameConnection + __typename: 'Query' +} + + +/** A user */ +export interface User { + id?: Scalars['ID'] + /** Authorizations to external services (i.e. Twitch, Twitter) */ + authorizations?: (ProfileAuthorization | undefined)[] + bio?: Scalars['String'] + /** Public facing user birthday that respects user publishing settings */ + birthday?: Scalars['String'] + /** Uniquely identifying token for user. Same as the hashed part of the slug */ + discriminator?: Scalars['String'] + /** Events this user has competed in */ + events?: EventConnection + genderPronoun?: Scalars['String'] + images?: (Image | undefined)[] + /** Leagues this user has competed in */ + leagues?: LeagueConnection + /** Public location info for this user */ + location?: Address + /** Public facing user name that respects user publishing settings */ + name?: Scalars['String'] + /** player for user */ + player?: Player + slug?: Scalars['String'] + /** Tournaments this user is organizing or competing in */ + tournaments?: TournamentConnection + __typename: 'User' +} + + +/** Represents the name of the third-party social service (e.g Twitter) for OAuth */ +export type SocialConnectionType = 'TWITTER' | 'TWITCH' | 'DISCORD' | 'MIXER' | 'XBOX' + + +/** An OAuth ProfileAuthorization object */ +export interface ProfileAuthorization { + id?: Scalars['ID'] + /** The id given by the external service */ + externalId?: Scalars['String'] + /** The username given by the external service (including discriminator if discord) */ + externalUsername?: Scalars['String'] + stream?: Stream + /** The name of the external service providing this auth i.e. "twitch" */ + type?: AuthorizationType + url?: Scalars['String'] + __typename: 'ProfileAuthorization' +} + + +/** A Stream object */ +export interface Stream { + id?: Scalars['ID'] + /** Whether the stream is currently live. May be slightly delayed. */ + isOnline?: Scalars['Boolean'] + /** The name of the stream */ + name?: Scalars['String'] + /** The name of the external service providing this auth i.e. "twitch" */ + type?: StreamType + __typename: 'Stream' +} + + +/** Represents the type of stream service */ +export type StreamType = 'TWITCH' | 'MIXER' + + +/** Represents the name of the third-party service (e.g Twitter) for OAuth */ +export type AuthorizationType = 'TWITTER' | 'TWITCH' | 'STEAM' | 'DISCORD' | 'XBOX' | 'MIXER' + +export interface EventConnection { + pageInfo?: PageInfo + nodes?: (Event | undefined)[] + __typename: 'EventConnection' +} + +export interface PageInfo { + total?: Scalars['Int'] + totalPages?: Scalars['Int'] + page?: Scalars['Int'] + perPage?: Scalars['Int'] + sortBy?: Scalars['String'] + filter?: Scalars['JSON'] + __typename: 'PageInfo' +} + + +/** An event in a tournament */ +export interface Event { + id?: Scalars['ID'] + /** How long before the event start will the check-in end (in seconds) */ + checkInBuffer?: Scalars['Int'] + /** How long the event check-in will last (in seconds) */ + checkInDuration?: Scalars['Int'] + /** Whether check-in is enabled for this event */ + checkInEnabled?: Scalars['Boolean'] + /** Rough categorization of event tier, denoting relative importance in the competitive scene */ + competitionTier?: Scalars['Int'] + /** When the event was created (unix timestamp) */ + createdAt?: Scalars['Timestamp'] + /** Last date attendees are able to create teams for team events */ + deckSubmissionDeadline?: Scalars['Timestamp'] + /** + * @deprecated Migrate to teamRosterSize + * Maximum number of participants each Entrant can have + */ + entrantSizeMax?: Scalars['Int'] + /** + * @deprecated Migrate to teamRosterSize + * Minimum number of participants each Entrant can have + */ + entrantSizeMin?: Scalars['Int'] + /** The entrants that belong to an event, paginated by filter criteria */ + entrants?: EntrantConnection + /** Whether the event has decks */ + hasDecks?: Scalars['Boolean'] + /** Are player tasks enabled for this event */ + hasTasks?: Scalars['Boolean'] + images?: (Image | undefined)[] + /** Whether the event is an online event or not */ + isOnline?: Scalars['Boolean'] + league?: League + /** Markdown field for match rules/instructions */ + matchRulesMarkdown?: Scalars['String'] + /** Title of event set by organizer */ + name?: Scalars['String'] + /** Gets the number of entrants in this event */ + numEntrants?: Scalars['Int'] + /** The phase groups that belong to an event. */ + phaseGroups?: (PhaseGroup | undefined)[] + /** The phases that belong to an event. */ + phases?: (Phase | undefined)[] + /** TO settings for prizing */ + prizingInfo?: Scalars['JSON'] + publishing?: Scalars['JSON'] + /** Markdown field for event rules/instructions */ + rulesMarkdown?: Scalars['String'] + /** Id of the event ruleset */ + rulesetId?: Scalars['Int'] + /** + * @deprecated Use ruleset + * Settings pulled from the event ruleset, if one exists + */ + rulesetSettings?: Scalars['JSON'] + /** Paginated sets for this Event */ + sets?: SetConnection + slug?: Scalars['String'] + /** Paginated list of standings */ + standings?: StandingConnection + /** When does this event start? */ + startAt?: Scalars['Timestamp'] + /** The state of the Event. */ + state?: ActivityState + /** Paginated stations on this event */ + stations?: StationsConnection + /** Last date attendees are able to create teams for team events */ + teamManagementDeadline?: Scalars['Timestamp'] + /** If this is a teams event, returns whether or not teams can set custom names */ + teamNameAllowed?: Scalars['Boolean'] + /** Team roster size requirements */ + teamRosterSize?: TeamRosterSize + tournament?: Tournament + /** The type of the event, whether an entrant will have one participant or multiple */ + type?: Scalars['Int'] + /** When the event was last modified (unix timestamp) */ + updatedAt?: Scalars['Timestamp'] + /** Whether the event uses the new EventSeeds for seeding */ + useEventSeeds?: Scalars['Boolean'] + videogame?: Videogame + /** The waves being used by the event */ + waves?: (Wave | undefined)[] + __typename: 'Event' +} + +export interface EntrantConnection { + pageInfo?: PageInfo + nodes?: (Entrant | undefined)[] + __typename: 'EntrantConnection' +} + + +/** An entrant in an event */ +export interface Entrant { + id?: Scalars['ID'] + event?: Event + /** Entrant's seed number in the first phase of the event. */ + initialSeedNum?: Scalars['Int'] + isDisqualified?: Scalars['Boolean'] + /** The entrant name as it appears in bracket: gamerTag of the participant or team name */ + name?: Scalars['String'] + /** Paginated sets for this entrant */ + paginatedSets?: SetConnection + participants?: (Participant | undefined)[] + seeds?: (Seed | undefined)[] + skill?: Scalars['Int'] + /** Standing for this entrant given an event. All entrants queried must be in the same event (for now). */ + standing?: Standing + /** @deprecated DEPRECATED. Use streams instead, which supports multiple stream types and teams. */ + stream?: Streams + streams?: (Streams | undefined)[] + /** Team linked to this entrant, if one exists */ + team?: Team + __typename: 'Entrant' +} + + +/** Different sort type configurations used when displaying multiple sets */ +export type SetSortType = 'NONE' | 'CALL_ORDER' | 'MAGIC' | 'RECENT' | 'STANDARD' | 'ROUND' + +export interface SetConnection { + pageInfo?: PageInfo + nodes?: (Set | undefined)[] + __typename: 'SetConnection' +} + + +/** A set */ +export interface Set { + id?: Scalars['ID'] + /** The time this set was marked as completed */ + completedAt?: Scalars['Timestamp'] + /** The time this set was created */ + createdAt?: Scalars['Timestamp'] + displayScore?: Scalars['String'] + /** Event that this set belongs to. */ + event?: Event + /** Full round text of this set. */ + fullRoundText?: Scalars['String'] + game?: Game + games?: (Game | undefined)[] + /** Whether this set contains a placeholder entrant */ + hasPlaceholder?: Scalars['Boolean'] + /** The letters that describe a unique identifier within the pool. Eg. F, AT */ + identifier?: Scalars['String'] + images?: (Image | undefined)[] + lPlacement?: Scalars['Int'] + /** Phase group that this Set belongs to. */ + phaseGroup?: PhaseGroup + /** The round number of the set. Negative numbers are losers bracket */ + round?: Scalars['Int'] + /** + * Indicates whether the set is in best of or total games mode. This instructs + * which field is used to figure out how many games are in this set. + */ + setGamesType?: Scalars['Int'] + /** A possible spot in a set. Use this to get all entrants in a set. Use this for all bracket types (FFA, elimination, etc) */ + slots?: (SetSlot | undefined)[] + /** The start time of the Set. If there is no startAt time on the Set, will pull it from phaseGroup rounds configuration. */ + startAt?: Scalars['Timestamp'] + startedAt?: Scalars['Timestamp'] + state?: Scalars['Int'] + /** Tournament event station for a set */ + station?: Stations + /** Tournament event stream for a set */ + stream?: Streams + /** If setGamesType is in total games mode, this defined the number of games in the set. */ + totalGames?: Scalars['Int'] + /** Url of a VOD for this set */ + vodUrl?: Scalars['String'] + wPlacement?: Scalars['Int'] + winnerId?: Scalars['Int'] + __typename: 'Set' +} + + +/** A game represents a single game within a set. */ +export interface Game { + id?: Scalars['ID'] + images?: (Image | undefined)[] + orderNum?: Scalars['Int'] + /** Selections for this game such as character, etc. */ + selections?: (GameSelection | undefined)[] + /** The stage that this game was played on (if applicable) */ + stage?: Stage + state?: Scalars['Int'] + winnerId?: Scalars['Int'] + __typename: 'Game' +} + + +/** An image */ +export interface Image { + id?: Scalars['ID'] + height?: Scalars['Float'] + ratio?: Scalars['Float'] + type?: Scalars['String'] + url?: Scalars['String'] + width?: Scalars['Float'] + __typename: 'Image' +} + + +/** A selection for this game. i.e. character/stage selection, etc */ +export interface GameSelection { + id?: Scalars['ID'] + /** The entrant who this selection is for */ + entrant?: Entrant + orderNum?: Scalars['Int'] + /** + * The participant who this selection is for. This is only populated if there are + * selections for multiple participants of a single entrant + */ + participant?: Participant + selectionType?: GameSelectionType + selectionValue?: Scalars['Int'] + __typename: 'GameSelection' +} + + +/** A participant of a tournament; either a spectator or competitor */ +export interface Participant { + id?: Scalars['ID'] + /** If this participant was checked-in by admin */ + checkedIn?: Scalars['Boolean'] + /** The time this participant was checked-in by admin */ + checkedInAt?: Scalars['Timestamp'] + /** Info for connected accounts to external services. */ + connectedAccounts?: Scalars['JSON'] + /** + * Contact Info selected during registration. Falls back to User.location and/or + * User.name if necessary. These fields are for admin use only and do not respect + * user privacy settings. DO NOT display this information publicly. + */ + contactInfo?: ContactInfo + /** Email of the user, only available to admins within 18 months of tournament */ + email?: Scalars['String'] + entrants?: (Entrant | undefined)[] + /** The events this participant registered for. */ + events?: (Event | undefined)[] + /** The tag that was used in registration e.g. Mang0 */ + gamerTag?: Scalars['String'] + images?: (Image | undefined)[] + player?: Player + /** The prefix that was used in registration e.g. C9 */ + prefix?: Scalars['String'] + /** Admin only field for required social connections */ + requiredConnections?: (ProfileAuthorization | undefined)[] + /** The user this participant is associated to. */ + user?: User + /** If this participant is verified as actually being in the tournament */ + verified?: Scalars['Boolean'] + __typename: 'Participant' +} + + +/** Name, address, etc */ +export interface ContactInfo { + id?: Scalars['ID'] + /** Participant City Name */ + city?: Scalars['String'] + /** Participant Country Name */ + country?: Scalars['String'] + /** Participant Country (region) id */ + countryId?: Scalars['Int'] + name?: Scalars['String'] + /** First Name */ + nameFirst?: Scalars['String'] + /** Last Name */ + nameLast?: Scalars['String'] + /** Participant State Name */ + state?: Scalars['String'] + /** Participant State (region) id */ + stateId?: Scalars['Int'] + /** Zip or Postal Code */ + zipcode?: Scalars['String'] + __typename: 'ContactInfo' +} + + +/** A player */ +export interface Player { + id?: Scalars['ID'] + gamerTag?: Scalars['String'] + prefix?: Scalars['String'] + /** Most recent active & published rankings */ + rankings?: (PlayerRank | undefined)[] + /** + * @deprecated Use the sets field instead. + * Recent sets for this player. + */ + recentSets?: (Set | undefined)[] + /** Set history for this player. */ + sets?: SetConnection + user?: User + __typename: 'Player' +} + + +/** A player's ranks */ +export interface PlayerRank { + id?: Scalars['ID'] + /** The player's placement on the ranking */ + rank?: Scalars['Int'] + title?: Scalars['String'] + __typename: 'PlayerRank' +} + + +/** The type of selection i.e. is it for a character or something else */ +export type GameSelectionType = 'CHARACTER' + + +/** Video Stage */ +export interface Stage { + id?: Scalars['ID'] + /** Stage name */ + name?: Scalars['String'] + __typename: 'Stage' +} + + +/** A group within a phase */ +export interface PhaseGroup { + id?: Scalars['ID'] + /** The bracket type of this group's phase. */ + bracketType?: BracketType + /** Unique identifier for this group within the context of its phase */ + displayIdentifier?: Scalars['String'] + /** For the given phase group, this is the start time of the first round that occurs in the group. */ + firstRoundTime?: Scalars['Timestamp'] + numRounds?: Scalars['Int'] + /** @deprecated Please use 'seeds', which is now paginated */ + paginatedSeeds?: SeedConnection + /** + * @deprecated Please use 'sets', which is now paginated + * Paginated sets on this phaseGroup + */ + paginatedSets?: SetConnection + /** The phase associated with this phase group */ + phase?: Phase + /** The progressions out of this phase group */ + progressionsOut?: (Progression | undefined)[] + rounds?: (Round | undefined)[] + seedMap?: Scalars['JSON'] + /** Paginated seeds for this phase group */ + seeds?: SeedConnection + /** Paginated sets on this phaseGroup */ + sets?: SetConnection + /** Paginated list of standings */ + standings?: StandingConnection + /** Unix time the group is scheduled to start. This info could also be on the wave instead. */ + startAt?: Scalars['Timestamp'] + state?: Scalars['Int'] + tiebreakOrder?: Scalars['JSON'] + wave?: Wave + __typename: 'PhaseGroup' +} + + +/** The type of Bracket format that a Phase is configured with. */ +export type BracketType = 'SINGLE_ELIMINATION' | 'DOUBLE_ELIMINATION' | 'ROUND_ROBIN' | 'SWISS' | 'EXHIBITION' | 'CUSTOM_SCHEDULE' | 'MATCHMAKING' | 'ELIMINATION_ROUNDS' | 'RACE' | 'CIRCUIT' + +export interface SeedConnection { + pageInfo?: PageInfo + nodes?: (Seed | undefined)[] + __typename: 'SeedConnection' +} + + +/** A seed for an entrant */ +export interface Seed { + id?: Scalars['ID'] + /** Map of Participant ID to checked in boolean */ + checkedInParticipants?: Scalars['JSON'] + entrant?: Entrant + groupSeedNum?: Scalars['Int'] + isBye?: Scalars['Boolean'] + phase?: Phase + phaseGroup?: PhaseGroup + placeholderName?: Scalars['String'] + placement?: Scalars['Int'] + /** The player(s) associated with this seed's entrant */ + players?: (Player | undefined)[] + progressionSeedId?: Scalars['Int'] + /** Source progression information */ + progressionSource?: Progression + seedNum?: Scalars['Int'] + /** Entrant's win/loss record for this standing. Scores do not include byes. */ + setRecordWithoutByes?: Scalars['JSON'] + standings?: (Standing | undefined)[] + __typename: 'Seed' +} + + +/** A phase in an event */ +export interface Phase { + id?: Scalars['ID'] + /** The bracket type of this phase. */ + bracketType?: BracketType + /** The Event that this phase belongs to */ + event?: Event + /** Number of phase groups in this phase */ + groupCount?: Scalars['Int'] + /** Is the phase an exhibition or not. */ + isExhibition?: Scalars['Boolean'] + /** Name of phase e.g. Round 1 Pools */ + name?: Scalars['String'] + /** The number of seeds this phase contains. */ + numSeeds?: Scalars['Int'] + /** @deprecated Please use 'seeds' instead */ + paginatedSeeds?: SeedConnection + /** Phase groups under this phase, paginated */ + phaseGroups?: PhaseGroupConnection + /** The relative order of this phase within an event */ + phaseOrder?: Scalars['Int'] + /** Paginated seeds for this phase */ + seeds?: SeedConnection + /** Paginated sets for this Phase */ + sets?: SetConnection + /** State of the phase */ + state?: ActivityState + waves?: (Wave | undefined)[] + __typename: 'Phase' +} + +export interface PhaseGroupConnection { + pageInfo?: PageInfo + nodes?: (PhaseGroup | undefined)[] + __typename: 'PhaseGroupConnection' +} + + +/** Represents the state of an activity */ +export type ActivityState = 'CREATED' | 'ACTIVE' | 'COMPLETED' | 'READY' | 'INVALID' | 'CALLED' | 'QUEUED' + + +/** A wave in a tournament */ +export interface Wave { + id?: Scalars['ID'] + /** The Wave Identifier */ + identifier?: Scalars['String'] + /** Unix time the wave is scheduled to start. */ + startAt?: Scalars['Timestamp'] + __typename: 'Wave' +} + + +/** A connection between a placement in an origin phase group to a destination seed. */ +export interface Progression { + id?: Scalars['ID'] + originOrder?: Scalars['Int'] + originPhase?: Phase + originPhaseGroup?: PhaseGroup + originPlacement?: Scalars['Int'] + __typename: 'Progression' +} + + +/** A standing indicates the placement of something within a container. */ +export interface Standing { + id?: Scalars['ID'] + /** + * The containing entity that contextualizes this standing. Event standings, for + * example, represent an entrant's standing in the entire event vs. Set standings + * which is an entrant's standing in only a single set within an event. + */ + container?: StandingContainer + /** If the entity this standing is assigned to can be resolved into an entrant, this will provide the entrant. */ + entrant?: Entrant + isFinal?: Scalars['Boolean'] + /** Metadata that goes along with this standing. Can take on different forms based on standing group type and settings. */ + metadata?: Scalars['JSON'] + placement?: Scalars['Int'] + /** The player(s) tied to this standing's entity */ + player?: Player + /** @deprecated The "placement" field is identical and will eventually replace "standing" */ + standing?: Scalars['Int'] + stats?: StandingStats + totalPoints?: Scalars['Float'] + __typename: 'Standing' +} + + +/** The containing entity that this standing is for */ +export type StandingContainer = (Tournament | Event | PhaseGroup | Set) & { __isUnion?: true } + + +/** A tournament */ +export interface Tournament { + id?: Scalars['ID'] + addrState?: Scalars['String'] + /** Admin-only view of admins for this tournament */ + admins?: (User | undefined)[] + city?: Scalars['String'] + countryCode?: Scalars['String'] + /** When the tournament was created (unix timestamp) */ + createdAt?: Scalars['Timestamp'] + currency?: Scalars['String'] + /** When the tournament ends */ + endAt?: Scalars['Timestamp'] + /** When does event registration close */ + eventRegistrationClosesAt?: Scalars['Timestamp'] + events?: (Event | undefined)[] + /** True if tournament has at least one offline event */ + hasOfflineEvents?: Scalars['Boolean'] + hasOnlineEvents?: Scalars['Boolean'] + hashtag?: Scalars['String'] + images?: (Image | undefined)[] + /** True if tournament has at least one online event */ + isOnline?: Scalars['Boolean'] + /** Is tournament registration open */ + isRegistrationOpen?: Scalars['Boolean'] + lat?: Scalars['Float'] + links?: TournamentLinks + lng?: Scalars['Float'] + mapsPlaceId?: Scalars['String'] + /** The tournament name */ + name?: Scalars['String'] + /** Number of attendees including spectators, if public */ + numAttendees?: Scalars['Int'] + /** The user who created the tournament */ + owner?: User + /** Paginated, queryable list of participants */ + participants?: ParticipantConnection + postalCode?: Scalars['String'] + primaryContact?: Scalars['String'] + primaryContactType?: Scalars['String'] + /** Publishing settings for this tournament */ + publishing?: Scalars['JSON'] + /** When does registration for the tournament end */ + registrationClosesAt?: Scalars['Timestamp'] + rules?: Scalars['String'] + /** The short slug used to form the url */ + shortSlug?: Scalars['String'] + /** The slug used to form the url */ + slug?: Scalars['String'] + /** When the tournament Starts */ + startAt?: Scalars['Timestamp'] + /** State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED */ + state?: Scalars['Int'] + stations?: StationsConnection + streamQueue?: (StreamQueue | undefined)[] + streams?: (Streams | undefined)[] + /** When is the team creation deadline */ + teamCreationClosesAt?: Scalars['Timestamp'] + /** Paginated, queryable list of teams */ + teams?: TeamConnection + /** The timezone of the tournament */ + timezone?: Scalars['String'] + /** The type of tournament from TournamentType */ + tournamentType?: Scalars['Int'] + /** When the tournament was last modified (unix timestamp) */ + updatedAt?: Scalars['Timestamp'] + /** Build Tournament URL */ + url?: Scalars['String'] + venueAddress?: Scalars['String'] + venueName?: Scalars['String'] + /** List of all waves in this tournament */ + waves?: (Wave | undefined)[] + __typename: 'Tournament' +} + +export interface TournamentLinks { + facebook?: Scalars['String'] + discord?: Scalars['String'] + __typename: 'TournamentLinks' +} + +export interface ParticipantConnection { + pageInfo?: PageInfo + nodes?: (Participant | undefined)[] + __typename: 'ParticipantConnection' +} + +export interface StationsConnection { + pageInfo?: PageInfo + nodes?: (Stations | undefined)[] + __typename: 'StationsConnection' +} + + +/** Stations, such as a stream setup, at an event */ +export interface Stations { + id?: Scalars['ID'] + canAutoAssign?: Scalars['Boolean'] + clusterNumber?: Scalars['String'] + clusterPrefix?: Scalars['Int'] + enabled?: Scalars['Boolean'] + identifier?: Scalars['Int'] + numSetups?: Scalars['Int'] + number?: Scalars['Int'] + prefix?: Scalars['String'] + queue?: Scalars['JSON'] + queueDepth?: Scalars['Int'] + state?: Scalars['Int'] + updatedAt?: Scalars['Timestamp'] + __typename: 'Stations' +} + + +/** A Stream queue object */ +export interface StreamQueue { + id?: Scalars['String'] + /** The sets on the stream */ + sets?: (Set | undefined)[] + /** The stream on the queue */ + stream?: Streams + __typename: 'StreamQueue' +} + + +/** Tournament Stream */ +export interface Streams { + id?: Scalars['ID'] + enabled?: Scalars['Boolean'] + followerCount?: Scalars['Int'] + isOnline?: Scalars['Boolean'] + numSetups?: Scalars['Int'] + parentStreamId?: Scalars['Int'] + streamGame?: Scalars['String'] + streamId?: Scalars['String'] + streamLogo?: Scalars['String'] + streamName?: Scalars['String'] + streamSource?: StreamSource + streamStatus?: Scalars['String'] + streamType?: Scalars['Int'] + streamTypeId?: Scalars['Int'] + __typename: 'Streams' +} + + +/** Represents the source of a stream */ +export type StreamSource = 'TWITCH' | 'HITBOX' | 'STREAMME' | 'MIXER' + + +/** Membership status of a team member */ +export type TeamMemberStatus = 'UNKNOWN' | 'ACCEPTED' | 'INVITED' | 'REQUEST' | 'ALUM' | 'HIATUS' | 'OPEN_SPOT' + +export interface TeamConnection { + pageInfo?: PageInfo + nodes?: (Team | undefined)[] + __typename: 'TeamConnection' +} + + +/** A team, either at the global level or within the context of an event */ +export type Team = (EventTeam | GlobalTeam) & { __isUnion?: true } + + +/** A member of a team */ +export interface TeamMember { + id?: Scalars['ID'] + isAlternate?: Scalars['Boolean'] + isCaptain?: Scalars['Boolean'] + /** The type of the team member */ + memberType?: TeamMemberType + participant?: Participant + player?: Player + /** The status of the team member */ + status?: TeamMemberStatus + __typename: 'TeamMember' +} + + +/** Membership type of a team member */ +export type TeamMemberType = 'PLAYER' | 'STAFF' + + +/** Any stats related to this standing. This type is experimental and very likely to change in the future. */ +export interface StandingStats { + score?: Score + __typename: 'StandingStats' +} + + +/** + * The score that led to this standing being awarded. The meaning of this field can + * vary by standing type and is not used for some standing types. + */ +export interface Score { + /** The name of this score. e.g. "Kills" or "Stocks" */ + label?: Scalars['String'] + /** The raw score value */ + value?: Scalars['Float'] + /** Like value, but formatted for race format events. Formatted according to the race config for the front end to use. */ + displayValue?: Scalars['String'] + __typename: 'Score' +} + + +/** A round within a phase group */ +export interface Round { + id?: Scalars['ID'] + /** + * If applicable, bestOf is the number of games + * one must win a majority out of to win a set in this round + */ + bestOf?: Scalars['Int'] + /** Indicates this round's order in the phase group */ + number?: Scalars['Int'] + /** The time that this round is scheduled to start at */ + startAt?: Scalars['Timestamp'] + __typename: 'Round' +} + +export interface StandingConnection { + pageInfo?: PageInfo + nodes?: (Standing | undefined)[] + __typename: 'StandingConnection' +} + + +/** A slot in a set where a seed currently or will eventually exist in order to participate in the set. */ +export interface SetSlot { + id?: Scalars['ID'] + entrant?: Entrant + /** Pairs with prereqType, is the ID of the prereq. */ + prereqId?: Scalars['String'] + /** Given a set prereq type, defines the placement required in the origin set to end up in this slot. */ + prereqPlacement?: Scalars['Int'] + /** Describes where the entity in this slot comes from. */ + prereqType?: Scalars['String'] + seed?: Seed + /** The index of the slot. Unique per set. */ + slotIndex?: Scalars['Int'] + /** The standing within this set for the seed currently assigned to this slot. */ + standing?: Standing + __typename: 'SetSlot' +} + + +/** A league */ +export interface League { + id?: Scalars['ID'] + addrState?: Scalars['String'] + city?: Scalars['String'] + countryCode?: Scalars['String'] + /** When the tournament was created (unix timestamp) */ + createdAt?: Scalars['Timestamp'] + currency?: Scalars['String'] + /** When the tournament ends */ + endAt?: Scalars['Timestamp'] + entrantCount?: Scalars['Int'] + eventOwners?: EventOwnerConnection + /** When does event registration close */ + eventRegistrationClosesAt?: Scalars['Timestamp'] + /** Paginated list of events in a league */ + events?: EventConnection + /** + * @deprecated No longer used + * Hacked "progression" into this final event + */ + finalEventId?: Scalars['Int'] + /** True if tournament has at least one offline event */ + hasOfflineEvents?: Scalars['Boolean'] + hasOnlineEvents?: Scalars['Boolean'] + hashtag?: Scalars['String'] + images?: (Image | undefined)[] + /** True if tournament has at least one online event */ + isOnline?: Scalars['Boolean'] + lat?: Scalars['Float'] + links?: TournamentLinks + lng?: Scalars['Float'] + mapsPlaceId?: Scalars['String'] + /** The tournament name */ + name?: Scalars['String'] + /** + * @deprecated No longer used + * Top X number of people in the standings who progress to final event + */ + numProgressingToFinalEvent?: Scalars['Int'] + numUniquePlayers?: Scalars['Int'] + postalCode?: Scalars['String'] + primaryContact?: Scalars['String'] + primaryContactType?: Scalars['String'] + /** Publishing settings for this tournament */ + publishing?: Scalars['JSON'] + /** When does registration for the tournament end */ + registrationClosesAt?: Scalars['Timestamp'] + rules?: Scalars['String'] + /** The short slug used to form the url */ + shortSlug?: Scalars['String'] + /** Whether standings for this league should be visible */ + showStandings?: Scalars['Boolean'] + slug?: Scalars['String'] + /** Paginated list of standings */ + standings?: StandingConnection + /** When the tournament Starts */ + startAt?: Scalars['Timestamp'] + /** State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED */ + state?: Scalars['Int'] + /** When is the team creation deadline */ + teamCreationClosesAt?: Scalars['Timestamp'] + tiers?: (EventTier | undefined)[] + /** The timezone of the tournament */ + timezone?: Scalars['String'] + /** The type of tournament from TournamentType */ + tournamentType?: Scalars['Int'] + /** When the tournament was last modified (unix timestamp) */ + updatedAt?: Scalars['Timestamp'] + /** Build Tournament URL */ + url?: Scalars['String'] + venueAddress?: Scalars['String'] + venueName?: Scalars['String'] + videogames?: (Videogame | undefined)[] + __typename: 'League' +} + +export interface EventOwnerConnection { + pageInfo?: PageInfo + nodes?: (EventOwner | undefined)[] + __typename: 'EventOwnerConnection' +} + + +/** Name and Gamertag of the owner of an event in a league */ +export interface EventOwner { + eventId?: Scalars['ID'] + email?: Scalars['String'] + gamerTag?: Scalars['String'] + fullName?: Scalars['String'] + __typename: 'EventOwner' +} + + +/** Used for league application tiers */ +export interface EventTier { + id?: Scalars['ID'] + /** Name of this tier */ + name?: Scalars['String'] + __typename: 'EventTier' +} + + +/** A videogame */ +export interface Videogame { + id?: Scalars['ID'] + /** All characters for this videogame */ + characters?: (Character | undefined)[] + displayName?: Scalars['String'] + images?: (Image | undefined)[] + name?: Scalars['String'] + slug?: Scalars['String'] + __typename: 'Videogame' +} + + +/** A character in a videogame */ +export interface Character { + id?: Scalars['ID'] + images?: (Image | undefined)[] + /** Name of Character */ + name?: Scalars['String'] + __typename: 'Character' +} + + +/** Team roster size requirements */ +export interface TeamRosterSize { + maxAlternates?: Scalars['Int'] + maxPlayers?: Scalars['Int'] + minAlternates?: Scalars['Int'] + minPlayers?: Scalars['Int'] + __typename: 'TeamRosterSize' +} + +export interface LeagueConnection { + pageInfo?: PageInfo + nodes?: (League | undefined)[] + __typename: 'LeagueConnection' +} + + +/** A user's address */ +export interface Address { + id?: Scalars['ID'] + city?: Scalars['String'] + country?: Scalars['String'] + countryId?: Scalars['Int'] + state?: Scalars['String'] + stateId?: Scalars['Int'] + __typename: 'Address' +} + +export interface TournamentConnection { + pageInfo?: PageInfo + nodes?: (Tournament | undefined)[] + __typename: 'TournamentConnection' +} + + +/** A shop */ +export interface Shop { + id?: Scalars['ID'] + levels?: ShopLevelConnection + messages?: ShopOrderMessageConnection + name?: Scalars['String'] + slug?: Scalars['String'] + url?: Scalars['String'] + __typename: 'Shop' +} + +export interface ShopLevelConnection { + pageInfo?: PageInfo + nodes?: (ShopLevel | undefined)[] + __typename: 'ShopLevelConnection' +} + + +/** A shop level */ +export interface ShopLevel { + id?: Scalars['ID'] + currAmount?: Scalars['Float'] + description?: Scalars['String'] + goalAmount?: Scalars['Float'] + images?: (Image | undefined)[] + name?: Scalars['String'] + __typename: 'ShopLevel' +} + +export interface ShopOrderMessageConnection { + pageInfo?: PageInfo + nodes?: (ShopOrderMessage | undefined)[] + __typename: 'ShopOrderMessageConnection' +} + + +/** The message and player info for a shop order */ +export interface ShopOrderMessage { + id?: Scalars['ID'] + /** The player's gamertag. Returns null if anonymous message type */ + gamertag?: Scalars['String'] + /** The order message */ + message?: Scalars['String'] + /** The player's name. Returns null unless name & tag display is selected */ + name?: Scalars['String'] + /** The player who left the comment */ + player?: Player + /** The total order amount */ + total?: Scalars['Float'] + __typename: 'ShopOrderMessage' +} + +export type TournamentPaginationSort = 'startAt' | 'endAt' | 'eventRegistrationClosesAt' | 'computedUpdatedAt' + +export interface VideogameConnection { + pageInfo?: PageInfo + nodes?: (Videogame | undefined)[] + __typename: 'VideogameConnection' +} + +export interface Mutation { + /** Delete a phase by id */ + deletePhase?: Scalars['Boolean'] + /** Delete a station by id */ + deleteStation?: Scalars['Boolean'] + /** Delete a wave by id */ + deleteWave?: Scalars['Boolean'] + /** Automatically attempt to resolve all schedule conflicts. Returns a list of changed seeds */ + resolveScheduleConflicts?: (Seed | undefined)[] + /** Swap two seed ids in a phase */ + swapSeeds?: (Seed | undefined)[] + /** Update set of phase groups in a phase */ + updatePhaseGroups?: (PhaseGroup | undefined)[] + /** Update the seeding for a phase */ + updatePhaseSeeding?: Phase + /** Create or update a Phase */ + upsertPhase?: Phase + /** Add or update a station by id */ + upsertStation?: Stations + /** Add or update a wave by id */ + upsertWave?: Wave + __typename: 'Mutation' +} + + +/** A set of actions available for an entity to take */ +export type ActionSet = (TeamActionSet) & { __isUnion?: true } + + +/** Bracket-specific configuration */ +export type BracketConfig = (RaceBracketConfig) & { __isUnion?: true } + + +/** Comparison operator */ +export type Comparator = 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'EQUAL' | 'LESS_THAN_OR_EQUAL' | 'LESS_THAN' + + +/** An event-level Team, in the context of some competition */ +export interface EventTeam { + id?: Scalars['ID'] + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator?: Scalars['String'] + /** @deprecated Use the entrant field off the EventTeam type */ + entrant?: Entrant + /** @deprecated Use the event field off the EventTeam type */ + event?: Event + globalTeam?: GlobalTeam + images?: (Image | undefined)[] + members?: (TeamMember | undefined)[] + name?: Scalars['String'] + __typename: 'EventTeam' +} + + +/** Global Team */ +export interface GlobalTeam { + id?: Scalars['ID'] + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator?: Scalars['String'] + /** @deprecated Use the entrant field off the EventTeam type */ + entrant?: Entrant + /** @deprecated Use the event field off the EventTeam type */ + event?: Event + eventTeams?: EventTeamConnection + images?: (Image | undefined)[] + /** Leagues-level teams for leagues this team is competing in */ + leagueTeams?: EventTeamConnection + members?: (TeamMember | undefined)[] + name?: Scalars['String'] + __typename: 'GlobalTeam' +} + +export interface EventTeamConnection { + pageInfo?: PageInfo + nodes?: (EventTeam | undefined)[] + __typename: 'EventTeamConnection' +} + + +/** Match-level configuration */ +export type MatchConfig = (RaceMatchConfig) & { __isUnion?: true } + + +/** Different options available for verifying player-reported match results */ +export type MatchConfigVerificationMethod = 'TWITCH' | 'STREAM_ME' | 'ANY' | 'MIXER' | 'YOUTUBE' + + +/** Race specific bracket configuration */ +export interface RaceBracketConfig { + automaticEndTime?: Scalars['Timestamp'] + id?: Scalars['ID'] + automaticStartTime?: Scalars['Timestamp'] + bracketType?: BracketType + goalTargetComparator?: Comparator + goalTargetValue?: Scalars['String'] + limitMode?: RaceLimitMode + limitValue?: Scalars['Int'] + raceType?: RaceType + __typename: 'RaceBracketConfig' +} + + +/** Enforces limits on the amount of allowable Race submissions */ +export type RaceLimitMode = 'BEST_ALL' | 'FIRST_ALL' | 'PLAYTIME' + + +/** Race type */ +export type RaceType = 'GOALS' | 'TIMED' + + +/** Race specific match configuration */ +export interface RaceMatchConfig { + id?: Scalars['ID'] + bracketType?: BracketType + /** Can players report results? */ + playerReportingEnabled?: Scalars['Boolean'] + /** Accepted methods of verification that players can use */ + verificationMethods?: (MatchConfigVerificationMethod | undefined)[] + /** Are players required to submit verification of their reported results? */ + verificationRequired?: Scalars['Boolean'] + __typename: 'RaceMatchConfig' +} + + +/** A set of actions available for a team to take */ +export interface TeamActionSet { + id?: Scalars['ID'] + __typename: 'TeamActionSet' +} + +export interface QueryRequest { + /** Returns the authenticated user */ + currentUser?: UserRequest + /** Returns an entrant given its id */ + entrant?: [{ id: Scalars['ID'] }, EntrantRequest] + /** Returns an event given its id or slug */ + event?: [{ id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }, EventRequest] | EventRequest + /** Returns a league given its id or slug */ + league?: [{ id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }, LeagueRequest] | LeagueRequest + /** Returns a participant given its id */ + participant?: [{ id: Scalars['ID'], isAdmin?: (Scalars['Boolean'] | null) }, ParticipantRequest] + /** Returns a phase given its id */ + phase?: [{ id?: (Scalars['ID'] | null) }, PhaseRequest] | PhaseRequest + /** Returns a phase group given its id */ + phaseGroup?: [{ id?: (Scalars['ID'] | null) }, PhaseGroupRequest] | PhaseGroupRequest + /** Returns a player given an id */ + player?: [{ id: Scalars['ID'] }, PlayerRequest] + /** Returns a phase seed given its id */ + seed?: [{ id?: (Scalars['ID'] | null) }, SeedRequest] | SeedRequest + /** Returns a set given its id */ + set?: [{ id: Scalars['ID'] }, SetRequest] + /** A shop entity */ + shop?: [{ id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }, ShopRequest] | ShopRequest + /** Returns an stream given its id */ + stream?: [{ id: Scalars['ID'] }, StreamsRequest] + /** Returns all the stream queues for a given tournament */ + streamQueue?: [{ tournamentId: Scalars['ID'], includePlayerStreams?: (Scalars['Boolean'] | null) }, StreamQueueRequest] + /** Returns a team given its id */ + team?: [{ id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null), inviteCode?: (Scalars['String'] | null) }, TeamRequest] | TeamRequest + /** Returns a tournament given its id or slug */ + tournament?: [{ id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }, TournamentRequest] | TournamentRequest + /** Paginated, filterable list of tournaments */ + tournaments?: [{ query: TournamentQuery }, TournamentConnectionRequest] + /** Returns a user given a user slug of the form user/abc123, or id */ + user?: [{ id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }, UserRequest] | UserRequest + /** Returns a videogame given its id */ + videogame?: [{ id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }, VideogameRequest] | VideogameRequest + /** Returns paginated list of videogames matching the search criteria. */ + videogames?: [{ query: VideogameQuery }, VideogameConnectionRequest] + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A user */ +export interface UserRequest { + id?: boolean | number + /** Authorizations to external services (i.e. Twitch, Twitter) */ + authorizations?: [{ types?: ((SocialConnectionType | null)[] | null) }, ProfileAuthorizationRequest] | ProfileAuthorizationRequest + bio?: boolean | number + /** Public facing user birthday that respects user publishing settings */ + birthday?: boolean | number + /** Uniquely identifying token for user. Same as the hashed part of the slug */ + discriminator?: boolean | number + /** Events this user has competed in */ + events?: [{ query?: (UserEventsPaginationQuery | null) }, EventConnectionRequest] | EventConnectionRequest + genderPronoun?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + /** Leagues this user has competed in */ + leagues?: [{ query?: (UserLeaguesPaginationQuery | null) }, LeagueConnectionRequest] | LeagueConnectionRequest + /** Public location info for this user */ + location?: AddressRequest + /** Public facing user name that respects user publishing settings */ + name?: boolean | number + /** player for user */ + player?: PlayerRequest + slug?: boolean | number + /** Tournaments this user is organizing or competing in */ + tournaments?: [{ query?: (UserTournamentsPaginationQuery | null) }, TournamentConnectionRequest] | TournamentConnectionRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** An OAuth ProfileAuthorization object */ +export interface ProfileAuthorizationRequest { + id?: boolean | number + /** The id given by the external service */ + externalId?: boolean | number + /** The username given by the external service (including discriminator if discord) */ + externalUsername?: boolean | number + stream?: StreamRequest + /** The name of the external service providing this auth i.e. "twitch" */ + type?: boolean | number + url?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A Stream object */ +export interface StreamRequest { + id?: boolean | number + /** Whether the stream is currently live. May be slightly delayed. */ + isOnline?: boolean | number + /** The name of the stream */ + name?: boolean | number + /** The name of the external service providing this auth i.e. "twitch" */ + type?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface UserEventsPaginationQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (UserEventsPaginationFilter | null) +} + +export interface UserEventsPaginationFilter { videogameId?: ((Scalars['ID'] | null)[] | null), eventType?: (Scalars['Int'] | null), minEntrantCount?: (Scalars['Int'] | null), maxEntrantCount?: (Scalars['Int'] | null), location?: (LocationFilterType | null), search?: (PaginationSearchType | null) } + +export interface LocationFilterType { countryCode?: (Scalars['String'] | null), state?: (Scalars['String'] | null), city?: (Scalars['String'] | null) } + +export interface PaginationSearchType { fieldsToSearch?: ((Scalars['String'] | null)[] | null), searchString?: (Scalars['String'] | null) } + +export interface EventConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: EventRequest + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface PageInfoRequest { + total?: boolean | number + totalPages?: boolean | number + page?: boolean | number + perPage?: boolean | number + sortBy?: boolean | number + filter?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** An event in a tournament */ +export interface EventRequest { + id?: boolean | number + /** How long before the event start will the check-in end (in seconds) */ + checkInBuffer?: boolean | number + /** How long the event check-in will last (in seconds) */ + checkInDuration?: boolean | number + /** Whether check-in is enabled for this event */ + checkInEnabled?: boolean | number + /** Rough categorization of event tier, denoting relative importance in the competitive scene */ + competitionTier?: boolean | number + /** When the event was created (unix timestamp) */ + createdAt?: boolean | number + /** Last date attendees are able to create teams for team events */ + deckSubmissionDeadline?: boolean | number + /** + * @deprecated Migrate to teamRosterSize + * Maximum number of participants each Entrant can have + */ + entrantSizeMax?: boolean | number + /** + * @deprecated Migrate to teamRosterSize + * Minimum number of participants each Entrant can have + */ + entrantSizeMin?: boolean | number + /** The entrants that belong to an event, paginated by filter criteria */ + entrants?: [{ query?: (EventEntrantPageQuery | null) }, EntrantConnectionRequest] | EntrantConnectionRequest + /** Whether the event has decks */ + hasDecks?: boolean | number + /** Are player tasks enabled for this event */ + hasTasks?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + /** Whether the event is an online event or not */ + isOnline?: boolean | number + league?: LeagueRequest + /** Markdown field for match rules/instructions */ + matchRulesMarkdown?: boolean | number + /** Title of event set by organizer */ + name?: boolean | number + /** Gets the number of entrants in this event */ + numEntrants?: boolean | number + /** The phase groups that belong to an event. */ + phaseGroups?: PhaseGroupRequest + /** The phases that belong to an event. */ + phases?: [{ + /** Filter phases by state. If not specified will default to all phases */ + state?: (ActivityState | null), + /** Optionally only return results for this phase */ + phaseId?: (Scalars['ID'] | null) + }, PhaseRequest] | PhaseRequest + /** TO settings for prizing */ + prizingInfo?: boolean | number + publishing?: boolean | number + /** Markdown field for event rules/instructions */ + rulesMarkdown?: boolean | number + /** Id of the event ruleset */ + rulesetId?: boolean | number + /** + * @deprecated Use ruleset + * Settings pulled from the event ruleset, if one exists + */ + rulesetSettings?: boolean | number + /** Paginated sets for this Event */ + sets?: [{ + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }, SetConnectionRequest] | SetConnectionRequest + slug?: boolean | number + /** Paginated list of standings */ + standings?: [{ query: StandingPaginationQuery }, StandingConnectionRequest] + /** When does this event start? */ + startAt?: boolean | number + /** The state of the Event. */ + state?: boolean | number + /** Paginated stations on this event */ + stations?: [{ query?: (StationFilter | null) }, StationsConnectionRequest] | StationsConnectionRequest + /** Last date attendees are able to create teams for team events */ + teamManagementDeadline?: boolean | number + /** If this is a teams event, returns whether or not teams can set custom names */ + teamNameAllowed?: boolean | number + /** Team roster size requirements */ + teamRosterSize?: TeamRosterSizeRequest + tournament?: TournamentRequest + /** The type of the event, whether an entrant will have one participant or multiple */ + type?: boolean | number + /** When the event was last modified (unix timestamp) */ + updatedAt?: boolean | number + /** Whether the event uses the new EventSeeds for seeding */ + useEventSeeds?: boolean | number + videogame?: VideogameRequest + /** The waves being used by the event */ + waves?: [{ + /** Waves filtered by phaseId, returns all if not set. */ + phaseId?: (Scalars['ID'] | null) + }, WaveRequest] | WaveRequest + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface EventEntrantPageQuery { page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (EventEntrantPageQueryFilter | null) } + +export interface EventEntrantPageQueryFilter { name?: (Scalars['String'] | null) } + +export interface EntrantConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: EntrantRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** An entrant in an event */ +export interface EntrantRequest { + id?: boolean | number + event?: EventRequest + /** Entrant's seed number in the first phase of the event. */ + initialSeedNum?: boolean | number + isDisqualified?: boolean | number + /** The entrant name as it appears in bracket: gamerTag of the participant or team name */ + name?: boolean | number + /** Paginated sets for this entrant */ + paginatedSets?: [{ + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }, SetConnectionRequest] | SetConnectionRequest + participants?: ParticipantRequest + seeds?: SeedRequest + skill?: boolean | number + /** Standing for this entrant given an event. All entrants queried must be in the same event (for now). */ + standing?: StandingRequest + /** @deprecated DEPRECATED. Use streams instead, which supports multiple stream types and teams. */ + stream?: StreamsRequest + streams?: StreamsRequest + /** Team linked to this entrant, if one exists */ + team?: TeamRequest + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface SetFilters { + /** Only return Sets for these Entrants */ + entrantIds?: ((Scalars['ID'] | null)[] | null), + /** Only return Sets for this Entrant size. For example, to fetch 1v1 Sets only, filter by an entrantSize of 1 */ + entrantSize?: ((Scalars['Int'] | null)[] | null), + /** Only return Sets that have an attached VOD */ + hasVod?: (Scalars['Boolean'] | null), + /** Do not return empty Sets. For example, set this to true to filter out sets that are waiting for progressions. */ + hideEmpty?: (Scalars['Boolean'] | null), + /** Return sets that contain a bye */ + showByes?: (Scalars['Boolean'] | null), + /** Only return Sets that are in an Online event. If omitted, Sets for both online and offline Events are returned */ + isEventOnline?: (Scalars['Boolean'] | null), + /** Only return Sets in certain geographical areas. */ + location?: (SetFilterLocation | null), + /** Only return Sets for these Participants */ + participantIds?: ((Scalars['ID'] | null)[] | null), + /** Only return Sets in these PhaseGroups */ + phaseGroupIds?: ((Scalars['ID'] | null)[] | null), + /** Only return Sets in these Phases */ + phaseIds?: ((Scalars['ID'] | null)[] | null), + /** Only return Sets in these Events */ + eventIds?: ((Scalars['ID'] | null)[] | null), + /** Only return Sets in these Tournaments */ + tournamentIds?: ((Scalars['ID'] | null)[] | null), + /** Only return Sets for these Players */ + playerIds?: ((Scalars['ID'] | null)[] | null), + /** Only return Sets for these Rounds */ + roundNumber?: (Scalars['Int'] | null), + /** Only returns Sets that are in these states */ + state?: ((Scalars['Int'] | null)[] | null), + /** Only return Sets that are assigned to these Station IDs */ + stationIds?: ((Scalars['ID'] | null)[] | null), + /** Only return Sets that are assigned to these Station numbers */ + stationNumbers?: ((Scalars['Int'] | null)[] | null), + /** Only return sets created or updated since this timestamp */ + updatedAfter?: (Scalars['Timestamp'] | null) +} + + +/** Filter Sets by geographical constraints. */ +export interface SetFilterLocation { + /** Only return Sets in this state. Only applicable to US states */ + state?: (Scalars['String'] | null), + /** Only return Sets in this country. Expects a valid two-letter country code */ + country?: (Scalars['String'] | null), distanceFrom?: (SetFilterLocationDistanceFrom | null) +} + + +/** Only return Sets that are a certain distance away from a specified point */ +export interface SetFilterLocationDistanceFrom { + /** Point at which to perform distance calculation */ + point?: (SetFilterLocationDistanceFromPoint | null), + /** Distance from the point to include results in */ + radius?: (Scalars['String'] | null) +} + +export interface SetFilterLocationDistanceFromPoint { lat?: (Scalars['Float'] | null), lon?: (Scalars['Float'] | null) } + +export interface SetConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: SetRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A set */ +export interface SetRequest { + id?: boolean | number + /** The time this set was marked as completed */ + completedAt?: boolean | number + /** The time this set was created */ + createdAt?: boolean | number + displayScore?: [{ mainEntrantId?: (Scalars['ID'] | null) }] | boolean | number + /** Event that this set belongs to. */ + event?: EventRequest + /** Full round text of this set. */ + fullRoundText?: boolean | number + game?: [{ orderNum: Scalars['Int'] }, GameRequest] + games?: GameRequest + /** Whether this set contains a placeholder entrant */ + hasPlaceholder?: boolean | number + /** The letters that describe a unique identifier within the pool. Eg. F, AT */ + identifier?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + lPlacement?: boolean | number + /** Phase group that this Set belongs to. */ + phaseGroup?: PhaseGroupRequest + /** The round number of the set. Negative numbers are losers bracket */ + round?: boolean | number + /** + * Indicates whether the set is in best of or total games mode. This instructs + * which field is used to figure out how many games are in this set. + */ + setGamesType?: boolean | number + /** A possible spot in a set. Use this to get all entrants in a set. Use this for all bracket types (FFA, elimination, etc) */ + slots?: [{ includeByes?: (Scalars['Boolean'] | null) }, SetSlotRequest] | SetSlotRequest + /** The start time of the Set. If there is no startAt time on the Set, will pull it from phaseGroup rounds configuration. */ + startAt?: boolean | number + startedAt?: boolean | number + state?: boolean | number + /** Tournament event station for a set */ + station?: StationsRequest + /** Tournament event stream for a set */ + stream?: StreamsRequest + /** If setGamesType is in total games mode, this defined the number of games in the set. */ + totalGames?: boolean | number + /** Url of a VOD for this set */ + vodUrl?: boolean | number + wPlacement?: boolean | number + winnerId?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A game represents a single game within a set. */ +export interface GameRequest { + id?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + orderNum?: boolean | number + /** Selections for this game such as character, etc. */ + selections?: GameSelectionRequest + /** The stage that this game was played on (if applicable) */ + stage?: StageRequest + state?: boolean | number + winnerId?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** An image */ +export interface ImageRequest { + id?: boolean | number + height?: boolean | number + ratio?: boolean | number + type?: boolean | number + url?: boolean | number + width?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A selection for this game. i.e. character/stage selection, etc */ +export interface GameSelectionRequest { + id?: boolean | number + /** The entrant who this selection is for */ + entrant?: EntrantRequest + orderNum?: boolean | number + /** + * The participant who this selection is for. This is only populated if there are + * selections for multiple participants of a single entrant + */ + participant?: ParticipantRequest + selectionType?: boolean | number + selectionValue?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A participant of a tournament; either a spectator or competitor */ +export interface ParticipantRequest { + id?: boolean | number + /** If this participant was checked-in by admin */ + checkedIn?: boolean | number + /** The time this participant was checked-in by admin */ + checkedInAt?: boolean | number + /** Info for connected accounts to external services. */ + connectedAccounts?: boolean | number + /** + * Contact Info selected during registration. Falls back to User.location and/or + * User.name if necessary. These fields are for admin use only and do not respect + * user privacy settings. DO NOT display this information publicly. + */ + contactInfo?: ContactInfoRequest + /** Email of the user, only available to admins within 18 months of tournament */ + email?: boolean | number + entrants?: EntrantRequest + /** The events this participant registered for. */ + events?: EventRequest + /** The tag that was used in registration e.g. Mang0 */ + gamerTag?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + player?: PlayerRequest + /** The prefix that was used in registration e.g. C9 */ + prefix?: boolean | number + /** Admin only field for required social connections */ + requiredConnections?: ProfileAuthorizationRequest + /** The user this participant is associated to. */ + user?: UserRequest + /** If this participant is verified as actually being in the tournament */ + verified?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Name, address, etc */ +export interface ContactInfoRequest { + id?: boolean | number + /** Participant City Name */ + city?: boolean | number + /** Participant Country Name */ + country?: boolean | number + /** Participant Country (region) id */ + countryId?: boolean | number + name?: boolean | number + /** First Name */ + nameFirst?: boolean | number + /** Last Name */ + nameLast?: boolean | number + /** Participant State Name */ + state?: boolean | number + /** Participant State (region) id */ + stateId?: boolean | number + /** Zip or Postal Code */ + zipcode?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A player */ +export interface PlayerRequest { + id?: boolean | number + gamerTag?: boolean | number + prefix?: boolean | number + /** Most recent active & published rankings */ + rankings?: [{ limit?: (Scalars['Int'] | null), videogameId?: (Scalars['ID'] | null) }, PlayerRankRequest] | PlayerRankRequest + /** + * @deprecated Use the sets field instead. + * Recent sets for this player. + */ + recentSets?: [{ + /** Use this to get H2H history between two players */ + opponentId?: (Scalars['ID'] | null) + }, SetRequest] | SetRequest + /** Set history for this player. */ + sets?: [{ + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }, SetConnectionRequest] | SetConnectionRequest + user?: UserRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A player's ranks */ +export interface PlayerRankRequest { + id?: boolean | number + /** The player's placement on the ranking */ + rank?: boolean | number + title?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Video Stage */ +export interface StageRequest { + id?: boolean | number + /** Stage name */ + name?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A group within a phase */ +export interface PhaseGroupRequest { + id?: boolean | number + /** The bracket type of this group's phase. */ + bracketType?: boolean | number + /** Unique identifier for this group within the context of its phase */ + displayIdentifier?: boolean | number + /** For the given phase group, this is the start time of the first round that occurs in the group. */ + firstRoundTime?: boolean | number + numRounds?: boolean | number + /** @deprecated Please use 'seeds', which is now paginated */ + paginatedSeeds?: [{ query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }, SeedConnectionRequest] + /** + * @deprecated Please use 'sets', which is now paginated + * Paginated sets on this phaseGroup + */ + paginatedSets?: [{ + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }, SetConnectionRequest] | SetConnectionRequest + /** The phase associated with this phase group */ + phase?: PhaseRequest + /** The progressions out of this phase group */ + progressionsOut?: ProgressionRequest + rounds?: RoundRequest + seedMap?: boolean | number + /** Paginated seeds for this phase group */ + seeds?: [{ query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }, SeedConnectionRequest] + /** Paginated sets on this phaseGroup */ + sets?: [{ + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }, SetConnectionRequest] | SetConnectionRequest + /** Paginated list of standings */ + standings?: [{ query?: (StandingGroupStandingPageFilter | null) }, StandingConnectionRequest] | StandingConnectionRequest + /** Unix time the group is scheduled to start. This info could also be on the wave instead. */ + startAt?: boolean | number + state?: boolean | number + tiebreakOrder?: boolean | number + wave?: WaveRequest + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface SeedPaginationQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (SeedPageFilter | null) +} + +export interface SeedPageFilter { id?: (Scalars['ID'] | null), entrantName?: (Scalars['String'] | null), checkInState?: ((Scalars['Int'] | null)[] | null), phaseGroupId?: ((Scalars['ID'] | null)[] | null), eventCheckInGroupId?: (Scalars['ID'] | null), phaseId?: ((Scalars['ID'] | null)[] | null), eventId?: (Scalars['ID'] | null), search?: (PaginationSearchType | null) } + +export interface SeedConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: SeedRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A seed for an entrant */ +export interface SeedRequest { + id?: boolean | number + /** Map of Participant ID to checked in boolean */ + checkedInParticipants?: boolean | number + entrant?: EntrantRequest + groupSeedNum?: boolean | number + isBye?: boolean | number + phase?: PhaseRequest + phaseGroup?: PhaseGroupRequest + placeholderName?: boolean | number + placement?: boolean | number + /** The player(s) associated with this seed's entrant */ + players?: PlayerRequest + progressionSeedId?: boolean | number + /** Source progression information */ + progressionSource?: ProgressionRequest + seedNum?: boolean | number + /** Entrant's win/loss record for this standing. Scores do not include byes. */ + setRecordWithoutByes?: [{ phaseGroupId: Scalars['ID'] }] + standings?: [{ + /** The container of the standing groups to get standings for. If null, will return all standings. */ + containerType?: (Scalars['String'] | null) + }, StandingRequest] | StandingRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A phase in an event */ +export interface PhaseRequest { + id?: boolean | number + /** The bracket type of this phase. */ + bracketType?: boolean | number + /** The Event that this phase belongs to */ + event?: EventRequest + /** Number of phase groups in this phase */ + groupCount?: boolean | number + /** Is the phase an exhibition or not. */ + isExhibition?: boolean | number + /** Name of phase e.g. Round 1 Pools */ + name?: boolean | number + /** The number of seeds this phase contains. */ + numSeeds?: boolean | number + /** @deprecated Please use 'seeds' instead */ + paginatedSeeds?: [{ query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }, SeedConnectionRequest] + /** Phase groups under this phase, paginated */ + phaseGroups?: [{ query?: (PhaseGroupPageQuery | null) }, PhaseGroupConnectionRequest] | PhaseGroupConnectionRequest + /** The relative order of this phase within an event */ + phaseOrder?: boolean | number + /** Paginated seeds for this phase */ + seeds?: [{ query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }, SeedConnectionRequest] + /** Paginated sets for this Phase */ + sets?: [{ + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }, SetConnectionRequest] | SetConnectionRequest + /** State of the phase */ + state?: boolean | number + waves?: WaveRequest + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface PhaseGroupPageQuery { page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), entrantIds?: ((Scalars['ID'] | null)[] | null), filter?: (PhaseGroupPageQueryFilter | null) } + +export interface PhaseGroupPageQueryFilter { id?: ((Scalars['ID'] | null)[] | null), waveId?: (Scalars['ID'] | null) } + +export interface PhaseGroupConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: PhaseGroupRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A wave in a tournament */ +export interface WaveRequest { + id?: boolean | number + /** The Wave Identifier */ + identifier?: boolean | number + /** Unix time the wave is scheduled to start. */ + startAt?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A connection between a placement in an origin phase group to a destination seed. */ +export interface ProgressionRequest { + id?: boolean | number + originOrder?: boolean | number + originPhase?: PhaseRequest + originPhaseGroup?: PhaseGroupRequest + originPlacement?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A standing indicates the placement of something within a container. */ +export interface StandingRequest { + id?: boolean | number + /** + * The containing entity that contextualizes this standing. Event standings, for + * example, represent an entrant's standing in the entire event vs. Set standings + * which is an entrant's standing in only a single set within an event. + */ + container?: StandingContainerRequest + /** If the entity this standing is assigned to can be resolved into an entrant, this will provide the entrant. */ + entrant?: EntrantRequest + isFinal?: boolean | number + /** Metadata that goes along with this standing. Can take on different forms based on standing group type and settings. */ + metadata?: boolean | number + placement?: boolean | number + /** The player(s) tied to this standing's entity */ + player?: PlayerRequest + /** @deprecated The "placement" field is identical and will eventually replace "standing" */ + standing?: boolean | number + stats?: StandingStatsRequest + totalPoints?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** The containing entity that this standing is for */ +export interface StandingContainerRequest { + on_Tournament?: TournamentRequest, + on_Event?: EventRequest, + on_PhaseGroup?: PhaseGroupRequest, + on_Set?: SetRequest, + __typename?: boolean | number +} + + +/** A tournament */ +export interface TournamentRequest { + id?: boolean | number + addrState?: boolean | number + /** Admin-only view of admins for this tournament */ + admins?: [{ + /** Which roles to show */ + roles?: ((Scalars['String'] | null)[] | null) + }, UserRequest] | UserRequest + city?: boolean | number + countryCode?: boolean | number + /** When the tournament was created (unix timestamp) */ + createdAt?: boolean | number + currency?: boolean | number + /** When the tournament ends */ + endAt?: boolean | number + /** When does event registration close */ + eventRegistrationClosesAt?: boolean | number + events?: [{ limit?: (Scalars['Int'] | null), filter?: (EventFilter | null) }, EventRequest] | EventRequest + /** True if tournament has at least one offline event */ + hasOfflineEvents?: boolean | number + hasOnlineEvents?: boolean | number + hashtag?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + /** True if tournament has at least one online event */ + isOnline?: boolean | number + /** Is tournament registration open */ + isRegistrationOpen?: boolean | number + lat?: boolean | number + links?: TournamentLinksRequest + lng?: boolean | number + mapsPlaceId?: boolean | number + /** The tournament name */ + name?: boolean | number + /** Number of attendees including spectators, if public */ + numAttendees?: boolean | number + /** The user who created the tournament */ + owner?: UserRequest + /** Paginated, queryable list of participants */ + participants?: [{ query: ParticipantPaginationQuery, isAdmin?: (Scalars['Boolean'] | null) }, ParticipantConnectionRequest] + postalCode?: boolean | number + primaryContact?: boolean | number + primaryContactType?: boolean | number + /** Publishing settings for this tournament */ + publishing?: boolean | number + /** When does registration for the tournament end */ + registrationClosesAt?: boolean | number + rules?: boolean | number + /** The short slug used to form the url */ + shortSlug?: boolean | number + /** The slug used to form the url */ + slug?: boolean | number + /** When the tournament Starts */ + startAt?: boolean | number + /** State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED */ + state?: boolean | number + stations?: [{ page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null) }, StationsConnectionRequest] | StationsConnectionRequest + streamQueue?: StreamQueueRequest + streams?: StreamsRequest + /** When is the team creation deadline */ + teamCreationClosesAt?: boolean | number + /** Paginated, queryable list of teams */ + teams?: [{ query: TeamPaginationQuery }, TeamConnectionRequest] + /** The timezone of the tournament */ + timezone?: boolean | number + /** The type of tournament from TournamentType */ + tournamentType?: boolean | number + /** When the tournament was last modified (unix timestamp) */ + updatedAt?: boolean | number + /** Build Tournament URL */ + url?: [{ + /** Tournament tab to add to URL */ + tab?: (Scalars['String'] | null), + /** Generate a relative URL. Defaults to true. Setting to false will generate an absolute URL */ + relative?: (Scalars['Boolean'] | null) + }] | boolean | number + venueAddress?: boolean | number + venueName?: boolean | number + /** List of all waves in this tournament */ + waves?: WaveRequest + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface EventFilter { videogameId?: ((Scalars['ID'] | null)[] | null), type?: ((Scalars['Int'] | null)[] | null), published?: (Scalars['Boolean'] | null) } + +export interface TournamentLinksRequest { + facebook?: boolean | number + discord?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface ParticipantPaginationQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (ParticipantPageFilter | null) +} + +export interface ParticipantPageFilter { id?: (Scalars['ID'] | null), ids?: ((Scalars['ID'] | null)[] | null), eventIds?: ((Scalars['ID'] | null)[] | null), search?: (PaginationSearchType | null), gamerTag?: (Scalars['String'] | null), unpaid?: (Scalars['Boolean'] | null), incompleteTeam?: (Scalars['Boolean'] | null), missingDeck?: (Scalars['Boolean'] | null), checkedIn?: (Scalars['Boolean'] | null), notCheckedIn?: (Scalars['Boolean'] | null) } + +export interface ParticipantConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: ParticipantRequest + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface StationsConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: StationsRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Stations, such as a stream setup, at an event */ +export interface StationsRequest { + id?: boolean | number + canAutoAssign?: boolean | number + clusterNumber?: boolean | number + clusterPrefix?: boolean | number + enabled?: boolean | number + identifier?: boolean | number + numSetups?: boolean | number + number?: boolean | number + prefix?: boolean | number + queue?: boolean | number + queueDepth?: boolean | number + state?: boolean | number + updatedAt?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A Stream queue object */ +export interface StreamQueueRequest { + id?: boolean | number + /** The sets on the stream */ + sets?: SetRequest + /** The stream on the queue */ + stream?: StreamsRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Tournament Stream */ +export interface StreamsRequest { + id?: boolean | number + enabled?: boolean | number + followerCount?: boolean | number + isOnline?: boolean | number + numSetups?: boolean | number + parentStreamId?: boolean | number + streamGame?: boolean | number + streamId?: boolean | number + streamLogo?: boolean | number + streamName?: boolean | number + streamSource?: boolean | number + streamStatus?: boolean | number + streamType?: boolean | number + streamTypeId?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface TeamPaginationQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (TeamPaginationFilter | null) +} + +export interface TeamPaginationFilter { globalTeamId?: (Scalars['ID'] | null), eventState?: (ActivityState | null), eventId?: (Scalars['ID'] | null), eventIds?: ((Scalars['ID'] | null)[] | null), minEntrantCount?: (Scalars['Int'] | null), maxEntrantCount?: (Scalars['Int'] | null), search?: (PaginationSearchType | null), type?: (Scalars['Int'] | null), tournamentId?: (Scalars['ID'] | null), memberStatus?: ((TeamMemberStatus | null)[] | null), videogameId?: ((Scalars['ID'] | null)[] | null), isLeague?: (Scalars['Boolean'] | null), upcoming?: (Scalars['Boolean'] | null), past?: (Scalars['Boolean'] | null), rosterComplete?: (Scalars['Boolean'] | null), rosterIncomplete?: (Scalars['Boolean'] | null) } + +export interface TeamConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: TeamRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A team, either at the global level or within the context of an event */ +export interface TeamRequest { + id?: boolean | number + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator?: boolean | number + /** @deprecated Use the entrant field off the EventTeam type */ + entrant?: EntrantRequest + /** @deprecated Use the event field off the EventTeam type */ + event?: EventRequest + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + members?: [{ status?: ((TeamMemberStatus | null)[] | null) }, TeamMemberRequest] | TeamMemberRequest + name?: boolean | number + on_EventTeam?: EventTeamRequest + on_GlobalTeam?: GlobalTeamRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A member of a team */ +export interface TeamMemberRequest { + id?: boolean | number + isAlternate?: boolean | number + isCaptain?: boolean | number + /** The type of the team member */ + memberType?: boolean | number + participant?: ParticipantRequest + player?: PlayerRequest + /** The status of the team member */ + status?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Any stats related to this standing. This type is experimental and very likely to change in the future. */ +export interface StandingStatsRequest { + score?: ScoreRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** + * The score that led to this standing being awarded. The meaning of this field can + * vary by standing type and is not used for some standing types. + */ +export interface ScoreRequest { + /** The name of this score. e.g. "Kills" or "Stocks" */ + label?: boolean | number + /** The raw score value */ + value?: boolean | number + /** Like value, but formatted for race format events. Formatted according to the race config for the front end to use. */ + displayValue?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A round within a phase group */ +export interface RoundRequest { + id?: boolean | number + /** + * If applicable, bestOf is the number of games + * one must win a majority out of to win a set in this round + */ + bestOf?: boolean | number + /** Indicates this round's order in the phase group */ + number?: boolean | number + /** The time that this round is scheduled to start at */ + startAt?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface StandingGroupStandingPageFilter { page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null) } + +export interface StandingConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: StandingRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A slot in a set where a seed currently or will eventually exist in order to participate in the set. */ +export interface SetSlotRequest { + id?: boolean | number + entrant?: EntrantRequest + /** Pairs with prereqType, is the ID of the prereq. */ + prereqId?: boolean | number + /** Given a set prereq type, defines the placement required in the origin set to end up in this slot. */ + prereqPlacement?: boolean | number + /** Describes where the entity in this slot comes from. */ + prereqType?: boolean | number + seed?: SeedRequest + /** The index of the slot. Unique per set. */ + slotIndex?: boolean | number + /** The standing within this set for the seed currently assigned to this slot. */ + standing?: StandingRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A league */ +export interface LeagueRequest { + id?: boolean | number + addrState?: boolean | number + city?: boolean | number + countryCode?: boolean | number + /** When the tournament was created (unix timestamp) */ + createdAt?: boolean | number + currency?: boolean | number + /** When the tournament ends */ + endAt?: boolean | number + entrantCount?: boolean | number + eventOwners?: [{ query?: (EventOwnersQuery | null) }, EventOwnerConnectionRequest] | EventOwnerConnectionRequest + /** When does event registration close */ + eventRegistrationClosesAt?: boolean | number + /** Paginated list of events in a league */ + events?: [{ query?: (LeagueEventsQuery | null) }, EventConnectionRequest] | EventConnectionRequest + /** + * @deprecated No longer used + * Hacked "progression" into this final event + */ + finalEventId?: boolean | number + /** True if tournament has at least one offline event */ + hasOfflineEvents?: boolean | number + hasOnlineEvents?: boolean | number + hashtag?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + /** True if tournament has at least one online event */ + isOnline?: boolean | number + lat?: boolean | number + links?: TournamentLinksRequest + lng?: boolean | number + mapsPlaceId?: boolean | number + /** The tournament name */ + name?: boolean | number + /** + * @deprecated No longer used + * Top X number of people in the standings who progress to final event + */ + numProgressingToFinalEvent?: boolean | number + numUniquePlayers?: boolean | number + postalCode?: boolean | number + primaryContact?: boolean | number + primaryContactType?: boolean | number + /** Publishing settings for this tournament */ + publishing?: boolean | number + /** When does registration for the tournament end */ + registrationClosesAt?: boolean | number + rules?: boolean | number + /** The short slug used to form the url */ + shortSlug?: boolean | number + /** Whether standings for this league should be visible */ + showStandings?: boolean | number + slug?: boolean | number + /** Paginated list of standings */ + standings?: [{ query?: (StandingGroupStandingPageFilter | null) }, StandingConnectionRequest] | StandingConnectionRequest + /** When the tournament Starts */ + startAt?: boolean | number + /** State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED */ + state?: boolean | number + /** When is the team creation deadline */ + teamCreationClosesAt?: boolean | number + tiers?: EventTierRequest + /** The timezone of the tournament */ + timezone?: boolean | number + /** The type of tournament from TournamentType */ + tournamentType?: boolean | number + /** When the tournament was last modified (unix timestamp) */ + updatedAt?: boolean | number + /** Build Tournament URL */ + url?: [{ + /** Tournament tab to add to URL */ + tab?: (Scalars['String'] | null), + /** Generate a relative URL. Defaults to true. Setting to false will generate an absolute URL */ + relative?: (Scalars['Boolean'] | null) + }] | boolean | number + venueAddress?: boolean | number + venueName?: boolean | number + videogames?: VideogameRequest + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface EventOwnersQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null) +} + +export interface EventOwnerConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: EventOwnerRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Name and Gamertag of the owner of an event in a league */ +export interface EventOwnerRequest { + eventId?: boolean | number + email?: boolean | number + gamerTag?: boolean | number + fullName?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface LeagueEventsQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (LeagueEventsFilter | null) +} + +export interface LeagueEventsFilter { search?: (PaginationSearchType | null), pointMappingGroupIds?: ((Scalars['ID'] | null)[] | null), tierIds?: ((Scalars['ID'] | null)[] | null), userId?: (Scalars['ID'] | null), upcoming?: (Scalars['Boolean'] | null), leagueEntrantId?: (Scalars['ID'] | null) } + + +/** Used for league application tiers */ +export interface EventTierRequest { + id?: boolean | number + /** Name of this tier */ + name?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A videogame */ +export interface VideogameRequest { + id?: boolean | number + /** All characters for this videogame */ + characters?: CharacterRequest + displayName?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + name?: boolean | number + slug?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A character in a videogame */ +export interface CharacterRequest { + id?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + /** Name of Character */ + name?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface StandingPaginationQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (StandingPageFilter | null) +} + +export interface StandingPageFilter { id?: (Scalars['ID'] | null), ids?: ((Scalars['ID'] | null)[] | null), search?: (PaginationSearchType | null) } + +export interface StationFilter { page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null) } + + +/** Team roster size requirements */ +export interface TeamRosterSizeRequest { + maxAlternates?: boolean | number + maxPlayers?: boolean | number + minAlternates?: boolean | number + minPlayers?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface UserLeaguesPaginationQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (UserLeaguesPaginationFilter | null) +} + +export interface UserLeaguesPaginationFilter { videogameId?: ((Scalars['ID'] | null)[] | null), upcoming?: (Scalars['Boolean'] | null), past?: (Scalars['Boolean'] | null), search?: (PaginationSearchType | null) } + +export interface LeagueConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: LeagueRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A user's address */ +export interface AddressRequest { + id?: boolean | number + city?: boolean | number + country?: boolean | number + countryId?: boolean | number + state?: boolean | number + stateId?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface UserTournamentsPaginationQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (UserTournamentsPaginationFilter | null) +} + +export interface UserTournamentsPaginationFilter { past?: (Scalars['Boolean'] | null), upcoming?: (Scalars['Boolean'] | null), search?: (PaginationSearchType | null), videogameId?: ((Scalars['ID'] | null)[] | null), tournamentView?: (Scalars['String'] | null), excludeId?: ((Scalars['ID'] | null)[] | null) } + +export interface TournamentConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: TournamentRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A shop */ +export interface ShopRequest { + id?: boolean | number + levels?: [{ query?: (ShopLevelsQuery | null) }, ShopLevelConnectionRequest] | ShopLevelConnectionRequest + messages?: [{ query?: (ShopOrderMessagesQuery | null) }, ShopOrderMessageConnectionRequest] | ShopOrderMessageConnectionRequest + name?: boolean | number + slug?: boolean | number + url?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface ShopLevelsQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null) +} + +export interface ShopLevelConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: ShopLevelRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A shop level */ +export interface ShopLevelRequest { + id?: boolean | number + currAmount?: boolean | number + description?: boolean | number + goalAmount?: boolean | number + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + name?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface ShopOrderMessagesQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null) +} + +export interface ShopOrderMessageConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: ShopOrderMessageRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** The message and player info for a shop order */ +export interface ShopOrderMessageRequest { + id?: boolean | number + /** The player's gamertag. Returns null if anonymous message type */ + gamertag?: boolean | number + /** The order message */ + message?: boolean | number + /** The player's name. Returns null unless name & tag display is selected */ + name?: boolean | number + /** The player who left the comment */ + player?: PlayerRequest + /** The total order amount */ + total?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface TournamentQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (TournamentPageFilter | null), sort?: (TournamentPaginationSort | null) +} + +export interface TournamentPageFilter { + id?: (Scalars['ID'] | null), ids?: ((Scalars['ID'] | null)[] | null), + /** ID of the user that owns this tournament. */ + ownerId?: (Scalars['ID'] | null), + /** If true, filter to only tournaments the currently authed user is an admin of */ + isCurrentUserAdmin?: (Scalars['Boolean'] | null), countryCode?: (Scalars['String'] | null), addrState?: (Scalars['String'] | null), location?: (TournamentLocationFilter | null), afterDate?: (Scalars['Timestamp'] | null), beforeDate?: (Scalars['Timestamp'] | null), computedUpdatedAt?: (Scalars['Timestamp'] | null), name?: (Scalars['String'] | null), venueName?: (Scalars['String'] | null), isFeatured?: (Scalars['Boolean'] | null), isLeague?: (Scalars['Boolean'] | null), hasBannerImages?: (Scalars['Boolean'] | null), activeShops?: (Scalars['Boolean'] | null), regOpen?: (Scalars['Boolean'] | null), past?: (Scalars['Boolean'] | null), published?: (Scalars['Boolean'] | null), publiclySearchable?: (Scalars['Boolean'] | null), staffPicks?: (Scalars['Boolean'] | null), hasOnlineEvents?: (Scalars['Boolean'] | null), topGames?: (TopGameFilter | null), upcoming?: (Scalars['Boolean'] | null), videogameIds?: ((Scalars['ID'] | null)[] | null), sortByScore?: (Scalars['Boolean'] | null) +} + +export interface TournamentLocationFilter { + /** Latitude, Longitude */ + distanceFrom?: (Scalars['String'] | null), + /** e.g. 50mi */ + distance?: (Scalars['String'] | null) +} + +export interface TopGameFilter { + /** Array of which # top game you want to filter on.e.g. [2, 3] will filter on the 2nd and 3rd top games */ + gameNums?: ((Scalars['Int'] | null)[] | null) +} + +export interface VideogameQuery { + page?: (Scalars['Int'] | null), + /** How many nodes to return for the page. Maximum value of 500 */ + perPage?: (Scalars['Int'] | null), sortBy?: (Scalars['String'] | null), filter?: (VideogamePageFilter | null) +} + +export interface VideogamePageFilter { id?: ((Scalars['ID'] | null)[] | null), name?: (Scalars['String'] | null), forUser?: (Scalars['ID'] | null) } + +export interface VideogameConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: VideogameRequest + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface MutationRequest { + /** Delete a phase by id */ + deletePhase?: [{ phaseId: Scalars['ID'] }] + /** Delete a station by id */ + deleteStation?: [{ stationId: Scalars['ID'] }] + /** Delete a wave by id */ + deleteWave?: [{ waveId: Scalars['ID'] }] + /** Automatically attempt to resolve all schedule conflicts. Returns a list of changed seeds */ + resolveScheduleConflicts?: [{ tournamentId: Scalars['ID'], options?: (ResolveConflictsOptions | null) }, SeedRequest] + /** Swap two seed ids in a phase */ + swapSeeds?: [{ phaseId: Scalars['ID'], seed1Id: Scalars['ID'], seed2Id: Scalars['ID'] }, SeedRequest] + /** Update set of phase groups in a phase */ + updatePhaseGroups?: [{ groupConfigs: (PhaseGroupUpdateInput | null)[] }, PhaseGroupRequest] + /** Update the seeding for a phase */ + updatePhaseSeeding?: [{ phaseId: Scalars['ID'], seedMapping: (UpdatePhaseSeedInfo | null)[], options?: (UpdatePhaseSeedingOptions | null) }, PhaseRequest] + /** Create or update a Phase */ + upsertPhase?: [{ phaseId?: (Scalars['ID'] | null), eventId?: (Scalars['ID'] | null), payload: PhaseUpsertInput }, PhaseRequest] + /** Add or update a station by id */ + upsertStation?: [{ stationId?: (Scalars['ID'] | null), tournamentId?: (Scalars['ID'] | null), fields: StationUpsertInput }, StationsRequest] + /** Add or update a wave by id */ + upsertWave?: [{ waveId?: (Scalars['ID'] | null), tournamentId?: (Scalars['ID'] | null), fields: WaveUpsertInput }, WaveRequest] + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface ResolveConflictsOptions { lockedSeeds?: ((ResolveConflictsLockedSeedConfig | null)[] | null) } + +export interface ResolveConflictsLockedSeedConfig { eventId: Scalars['ID'], numSeeds: Scalars['Int'] } + +export interface PhaseGroupUpdateInput { phaseGroupId: Scalars['ID'], stationId?: (Scalars['ID'] | null), waveId?: (Scalars['ID'] | null) } + +export interface UpdatePhaseSeedInfo { seedId: Scalars['ID'], seedNum: Scalars['ID'], phaseGroupId?: (Scalars['ID'] | null) } + +export interface UpdatePhaseSeedingOptions { + /** Validate that seedMapping exactly accounts for all entrants in the phase */ + strictMode?: (Scalars['Boolean'] | null) +} + +export interface PhaseUpsertInput { + /** The name of the Phase. For example, "Top 8" or "Pools" */ + name?: (Scalars['String'] | null), + /** The number of pools to configure for the Phase. Only applies to brackets that support pools */ + groupCount?: (Scalars['Int'] | null), bracketType?: (BracketType | null) +} + +export interface StationUpsertInput { number: Scalars['Int'], clusterId?: (Scalars['ID'] | null) } + +export interface WaveUpsertInput { identifier: Scalars['String'], startAt: Scalars['Timestamp'], endAt: Scalars['Timestamp'] } + + +/** A set of actions available for an entity to take */ +export interface ActionSetRequest { + id?: boolean | number + on_TeamActionSet?: TeamActionSetRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Bracket-specific configuration */ +export interface BracketConfigRequest { + id?: boolean | number + bracketType?: boolean | number + on_RaceBracketConfig?: RaceBracketConfigRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** An event-level Team, in the context of some competition */ +export interface EventTeamRequest { + id?: boolean | number + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator?: boolean | number + /** @deprecated Use the entrant field off the EventTeam type */ + entrant?: EntrantRequest + /** @deprecated Use the event field off the EventTeam type */ + event?: EventRequest + globalTeam?: GlobalTeamRequest + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + members?: [{ status?: ((TeamMemberStatus | null)[] | null) }, TeamMemberRequest] | TeamMemberRequest + name?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Global Team */ +export interface GlobalTeamRequest { + id?: boolean | number + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator?: boolean | number + /** @deprecated Use the entrant field off the EventTeam type */ + entrant?: EntrantRequest + /** @deprecated Use the event field off the EventTeam type */ + event?: EventRequest + eventTeams?: [{ query?: (TeamPaginationQuery | null) }, EventTeamConnectionRequest] | EventTeamConnectionRequest + images?: [{ type?: (Scalars['String'] | null) }, ImageRequest] | ImageRequest + /** Leagues-level teams for leagues this team is competing in */ + leagueTeams?: [{ query?: (TeamPaginationQuery | null) }, EventTeamConnectionRequest] | EventTeamConnectionRequest + members?: [{ status?: ((TeamMemberStatus | null)[] | null) }, TeamMemberRequest] | TeamMemberRequest + name?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + +export interface EventTeamConnectionRequest { + pageInfo?: PageInfoRequest + nodes?: EventTeamRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Match-level configuration */ +export interface MatchConfigRequest { + id?: boolean | number + bracketType?: boolean | number + on_RaceMatchConfig?: RaceMatchConfigRequest + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Race specific bracket configuration */ +export interface RaceBracketConfigRequest { + automaticEndTime?: boolean | number + id?: boolean | number + automaticStartTime?: boolean | number + bracketType?: boolean | number + goalTargetComparator?: boolean | number + goalTargetValue?: boolean | number + limitMode?: boolean | number + limitValue?: boolean | number + raceType?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** Race specific match configuration */ +export interface RaceMatchConfigRequest { + id?: boolean | number + bracketType?: boolean | number + /** Can players report results? */ + playerReportingEnabled?: boolean | number + /** Accepted methods of verification that players can use */ + verificationMethods?: boolean | number + /** Are players required to submit verification of their reported results? */ + verificationRequired?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +/** A set of actions available for a team to take */ +export interface TeamActionSetRequest { + id?: boolean | number + __typename?: boolean | number + __scalar?: boolean | number +} + + +const Query_possibleTypes: string[] = ['Query'] +export const isQuery = (obj?: { __typename?: any } | null): obj is Query => { + if (!obj?.__typename) throw new Error('__typename is missing in "isQuery"') + return Query_possibleTypes.includes(obj.__typename) +} + + + +const User_possibleTypes: string[] = ['User'] +export const isUser = (obj?: { __typename?: any } | null): obj is User => { + if (!obj?.__typename) throw new Error('__typename is missing in "isUser"') + return User_possibleTypes.includes(obj.__typename) +} + + + +const ProfileAuthorization_possibleTypes: string[] = ['ProfileAuthorization'] +export const isProfileAuthorization = (obj?: { __typename?: any } | null): obj is ProfileAuthorization => { + if (!obj?.__typename) throw new Error('__typename is missing in "isProfileAuthorization"') + return ProfileAuthorization_possibleTypes.includes(obj.__typename) +} + + + +const Stream_possibleTypes: string[] = ['Stream'] +export const isStream = (obj?: { __typename?: any } | null): obj is Stream => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStream"') + return Stream_possibleTypes.includes(obj.__typename) +} + + + +const EventConnection_possibleTypes: string[] = ['EventConnection'] +export const isEventConnection = (obj?: { __typename?: any } | null): obj is EventConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isEventConnection"') + return EventConnection_possibleTypes.includes(obj.__typename) +} + + + +const PageInfo_possibleTypes: string[] = ['PageInfo'] +export const isPageInfo = (obj?: { __typename?: any } | null): obj is PageInfo => { + if (!obj?.__typename) throw new Error('__typename is missing in "isPageInfo"') + return PageInfo_possibleTypes.includes(obj.__typename) +} + + + +const Event_possibleTypes: string[] = ['Event'] +export const isEvent = (obj?: { __typename?: any } | null): obj is Event => { + if (!obj?.__typename) throw new Error('__typename is missing in "isEvent"') + return Event_possibleTypes.includes(obj.__typename) +} + + + +const EntrantConnection_possibleTypes: string[] = ['EntrantConnection'] +export const isEntrantConnection = (obj?: { __typename?: any } | null): obj is EntrantConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isEntrantConnection"') + return EntrantConnection_possibleTypes.includes(obj.__typename) +} + + + +const Entrant_possibleTypes: string[] = ['Entrant'] +export const isEntrant = (obj?: { __typename?: any } | null): obj is Entrant => { + if (!obj?.__typename) throw new Error('__typename is missing in "isEntrant"') + return Entrant_possibleTypes.includes(obj.__typename) +} + + + +const SetConnection_possibleTypes: string[] = ['SetConnection'] +export const isSetConnection = (obj?: { __typename?: any } | null): obj is SetConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isSetConnection"') + return SetConnection_possibleTypes.includes(obj.__typename) +} + + + +const Set_possibleTypes: string[] = ['Set'] +export const isSet = (obj?: { __typename?: any } | null): obj is Set => { + if (!obj?.__typename) throw new Error('__typename is missing in "isSet"') + return Set_possibleTypes.includes(obj.__typename) +} + + + +const Game_possibleTypes: string[] = ['Game'] +export const isGame = (obj?: { __typename?: any } | null): obj is Game => { + if (!obj?.__typename) throw new Error('__typename is missing in "isGame"') + return Game_possibleTypes.includes(obj.__typename) +} + + + +const Image_possibleTypes: string[] = ['Image'] +export const isImage = (obj?: { __typename?: any } | null): obj is Image => { + if (!obj?.__typename) throw new Error('__typename is missing in "isImage"') + return Image_possibleTypes.includes(obj.__typename) +} + + + +const GameSelection_possibleTypes: string[] = ['GameSelection'] +export const isGameSelection = (obj?: { __typename?: any } | null): obj is GameSelection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isGameSelection"') + return GameSelection_possibleTypes.includes(obj.__typename) +} + + + +const Participant_possibleTypes: string[] = ['Participant'] +export const isParticipant = (obj?: { __typename?: any } | null): obj is Participant => { + if (!obj?.__typename) throw new Error('__typename is missing in "isParticipant"') + return Participant_possibleTypes.includes(obj.__typename) +} + + + +const ContactInfo_possibleTypes: string[] = ['ContactInfo'] +export const isContactInfo = (obj?: { __typename?: any } | null): obj is ContactInfo => { + if (!obj?.__typename) throw new Error('__typename is missing in "isContactInfo"') + return ContactInfo_possibleTypes.includes(obj.__typename) +} + + + +const Player_possibleTypes: string[] = ['Player'] +export const isPlayer = (obj?: { __typename?: any } | null): obj is Player => { + if (!obj?.__typename) throw new Error('__typename is missing in "isPlayer"') + return Player_possibleTypes.includes(obj.__typename) +} + + + +const PlayerRank_possibleTypes: string[] = ['PlayerRank'] +export const isPlayerRank = (obj?: { __typename?: any } | null): obj is PlayerRank => { + if (!obj?.__typename) throw new Error('__typename is missing in "isPlayerRank"') + return PlayerRank_possibleTypes.includes(obj.__typename) +} + + + +const Stage_possibleTypes: string[] = ['Stage'] +export const isStage = (obj?: { __typename?: any } | null): obj is Stage => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStage"') + return Stage_possibleTypes.includes(obj.__typename) +} + + + +const PhaseGroup_possibleTypes: string[] = ['PhaseGroup'] +export const isPhaseGroup = (obj?: { __typename?: any } | null): obj is PhaseGroup => { + if (!obj?.__typename) throw new Error('__typename is missing in "isPhaseGroup"') + return PhaseGroup_possibleTypes.includes(obj.__typename) +} + + + +const SeedConnection_possibleTypes: string[] = ['SeedConnection'] +export const isSeedConnection = (obj?: { __typename?: any } | null): obj is SeedConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isSeedConnection"') + return SeedConnection_possibleTypes.includes(obj.__typename) +} + + + +const Seed_possibleTypes: string[] = ['Seed'] +export const isSeed = (obj?: { __typename?: any } | null): obj is Seed => { + if (!obj?.__typename) throw new Error('__typename is missing in "isSeed"') + return Seed_possibleTypes.includes(obj.__typename) +} + + + +const Phase_possibleTypes: string[] = ['Phase'] +export const isPhase = (obj?: { __typename?: any } | null): obj is Phase => { + if (!obj?.__typename) throw new Error('__typename is missing in "isPhase"') + return Phase_possibleTypes.includes(obj.__typename) +} + + + +const PhaseGroupConnection_possibleTypes: string[] = ['PhaseGroupConnection'] +export const isPhaseGroupConnection = (obj?: { __typename?: any } | null): obj is PhaseGroupConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isPhaseGroupConnection"') + return PhaseGroupConnection_possibleTypes.includes(obj.__typename) +} + + + +const Wave_possibleTypes: string[] = ['Wave'] +export const isWave = (obj?: { __typename?: any } | null): obj is Wave => { + if (!obj?.__typename) throw new Error('__typename is missing in "isWave"') + return Wave_possibleTypes.includes(obj.__typename) +} + + + +const Progression_possibleTypes: string[] = ['Progression'] +export const isProgression = (obj?: { __typename?: any } | null): obj is Progression => { + if (!obj?.__typename) throw new Error('__typename is missing in "isProgression"') + return Progression_possibleTypes.includes(obj.__typename) +} + + + +const Standing_possibleTypes: string[] = ['Standing'] +export const isStanding = (obj?: { __typename?: any } | null): obj is Standing => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStanding"') + return Standing_possibleTypes.includes(obj.__typename) +} + + + +const StandingContainer_possibleTypes: string[] = ['Tournament', 'Event', 'PhaseGroup', 'Set'] +export const isStandingContainer = (obj?: { __typename?: any } | null): obj is StandingContainer => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStandingContainer"') + return StandingContainer_possibleTypes.includes(obj.__typename) +} + + + +const Tournament_possibleTypes: string[] = ['Tournament'] +export const isTournament = (obj?: { __typename?: any } | null): obj is Tournament => { + if (!obj?.__typename) throw new Error('__typename is missing in "isTournament"') + return Tournament_possibleTypes.includes(obj.__typename) +} + + + +const TournamentLinks_possibleTypes: string[] = ['TournamentLinks'] +export const isTournamentLinks = (obj?: { __typename?: any } | null): obj is TournamentLinks => { + if (!obj?.__typename) throw new Error('__typename is missing in "isTournamentLinks"') + return TournamentLinks_possibleTypes.includes(obj.__typename) +} + + + +const ParticipantConnection_possibleTypes: string[] = ['ParticipantConnection'] +export const isParticipantConnection = (obj?: { __typename?: any } | null): obj is ParticipantConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isParticipantConnection"') + return ParticipantConnection_possibleTypes.includes(obj.__typename) +} + + + +const StationsConnection_possibleTypes: string[] = ['StationsConnection'] +export const isStationsConnection = (obj?: { __typename?: any } | null): obj is StationsConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStationsConnection"') + return StationsConnection_possibleTypes.includes(obj.__typename) +} + + + +const Stations_possibleTypes: string[] = ['Stations'] +export const isStations = (obj?: { __typename?: any } | null): obj is Stations => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStations"') + return Stations_possibleTypes.includes(obj.__typename) +} + + + +const StreamQueue_possibleTypes: string[] = ['StreamQueue'] +export const isStreamQueue = (obj?: { __typename?: any } | null): obj is StreamQueue => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStreamQueue"') + return StreamQueue_possibleTypes.includes(obj.__typename) +} + + + +const Streams_possibleTypes: string[] = ['Streams'] +export const isStreams = (obj?: { __typename?: any } | null): obj is Streams => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStreams"') + return Streams_possibleTypes.includes(obj.__typename) +} + + + +const TeamConnection_possibleTypes: string[] = ['TeamConnection'] +export const isTeamConnection = (obj?: { __typename?: any } | null): obj is TeamConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isTeamConnection"') + return TeamConnection_possibleTypes.includes(obj.__typename) +} + + + +const Team_possibleTypes: string[] = ['EventTeam', 'GlobalTeam'] +export const isTeam = (obj?: { __typename?: any } | null): obj is Team => { + if (!obj?.__typename) throw new Error('__typename is missing in "isTeam"') + return Team_possibleTypes.includes(obj.__typename) +} + + + +const TeamMember_possibleTypes: string[] = ['TeamMember'] +export const isTeamMember = (obj?: { __typename?: any } | null): obj is TeamMember => { + if (!obj?.__typename) throw new Error('__typename is missing in "isTeamMember"') + return TeamMember_possibleTypes.includes(obj.__typename) +} + + + +const StandingStats_possibleTypes: string[] = ['StandingStats'] +export const isStandingStats = (obj?: { __typename?: any } | null): obj is StandingStats => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStandingStats"') + return StandingStats_possibleTypes.includes(obj.__typename) +} + + + +const Score_possibleTypes: string[] = ['Score'] +export const isScore = (obj?: { __typename?: any } | null): obj is Score => { + if (!obj?.__typename) throw new Error('__typename is missing in "isScore"') + return Score_possibleTypes.includes(obj.__typename) +} + + + +const Round_possibleTypes: string[] = ['Round'] +export const isRound = (obj?: { __typename?: any } | null): obj is Round => { + if (!obj?.__typename) throw new Error('__typename is missing in "isRound"') + return Round_possibleTypes.includes(obj.__typename) +} + + + +const StandingConnection_possibleTypes: string[] = ['StandingConnection'] +export const isStandingConnection = (obj?: { __typename?: any } | null): obj is StandingConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isStandingConnection"') + return StandingConnection_possibleTypes.includes(obj.__typename) +} + + + +const SetSlot_possibleTypes: string[] = ['SetSlot'] +export const isSetSlot = (obj?: { __typename?: any } | null): obj is SetSlot => { + if (!obj?.__typename) throw new Error('__typename is missing in "isSetSlot"') + return SetSlot_possibleTypes.includes(obj.__typename) +} + + + +const League_possibleTypes: string[] = ['League'] +export const isLeague = (obj?: { __typename?: any } | null): obj is League => { + if (!obj?.__typename) throw new Error('__typename is missing in "isLeague"') + return League_possibleTypes.includes(obj.__typename) +} + + + +const EventOwnerConnection_possibleTypes: string[] = ['EventOwnerConnection'] +export const isEventOwnerConnection = (obj?: { __typename?: any } | null): obj is EventOwnerConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isEventOwnerConnection"') + return EventOwnerConnection_possibleTypes.includes(obj.__typename) +} + + + +const EventOwner_possibleTypes: string[] = ['EventOwner'] +export const isEventOwner = (obj?: { __typename?: any } | null): obj is EventOwner => { + if (!obj?.__typename) throw new Error('__typename is missing in "isEventOwner"') + return EventOwner_possibleTypes.includes(obj.__typename) +} + + + +const EventTier_possibleTypes: string[] = ['EventTier'] +export const isEventTier = (obj?: { __typename?: any } | null): obj is EventTier => { + if (!obj?.__typename) throw new Error('__typename is missing in "isEventTier"') + return EventTier_possibleTypes.includes(obj.__typename) +} + + + +const Videogame_possibleTypes: string[] = ['Videogame'] +export const isVideogame = (obj?: { __typename?: any } | null): obj is Videogame => { + if (!obj?.__typename) throw new Error('__typename is missing in "isVideogame"') + return Videogame_possibleTypes.includes(obj.__typename) +} + + + +const Character_possibleTypes: string[] = ['Character'] +export const isCharacter = (obj?: { __typename?: any } | null): obj is Character => { + if (!obj?.__typename) throw new Error('__typename is missing in "isCharacter"') + return Character_possibleTypes.includes(obj.__typename) +} + + + +const TeamRosterSize_possibleTypes: string[] = ['TeamRosterSize'] +export const isTeamRosterSize = (obj?: { __typename?: any } | null): obj is TeamRosterSize => { + if (!obj?.__typename) throw new Error('__typename is missing in "isTeamRosterSize"') + return TeamRosterSize_possibleTypes.includes(obj.__typename) +} + + + +const LeagueConnection_possibleTypes: string[] = ['LeagueConnection'] +export const isLeagueConnection = (obj?: { __typename?: any } | null): obj is LeagueConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isLeagueConnection"') + return LeagueConnection_possibleTypes.includes(obj.__typename) +} + + + +const Address_possibleTypes: string[] = ['Address'] +export const isAddress = (obj?: { __typename?: any } | null): obj is Address => { + if (!obj?.__typename) throw new Error('__typename is missing in "isAddress"') + return Address_possibleTypes.includes(obj.__typename) +} + + + +const TournamentConnection_possibleTypes: string[] = ['TournamentConnection'] +export const isTournamentConnection = (obj?: { __typename?: any } | null): obj is TournamentConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isTournamentConnection"') + return TournamentConnection_possibleTypes.includes(obj.__typename) +} + + + +const Shop_possibleTypes: string[] = ['Shop'] +export const isShop = (obj?: { __typename?: any } | null): obj is Shop => { + if (!obj?.__typename) throw new Error('__typename is missing in "isShop"') + return Shop_possibleTypes.includes(obj.__typename) +} + + + +const ShopLevelConnection_possibleTypes: string[] = ['ShopLevelConnection'] +export const isShopLevelConnection = (obj?: { __typename?: any } | null): obj is ShopLevelConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isShopLevelConnection"') + return ShopLevelConnection_possibleTypes.includes(obj.__typename) +} + + + +const ShopLevel_possibleTypes: string[] = ['ShopLevel'] +export const isShopLevel = (obj?: { __typename?: any } | null): obj is ShopLevel => { + if (!obj?.__typename) throw new Error('__typename is missing in "isShopLevel"') + return ShopLevel_possibleTypes.includes(obj.__typename) +} + + + +const ShopOrderMessageConnection_possibleTypes: string[] = ['ShopOrderMessageConnection'] +export const isShopOrderMessageConnection = (obj?: { __typename?: any } | null): obj is ShopOrderMessageConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isShopOrderMessageConnection"') + return ShopOrderMessageConnection_possibleTypes.includes(obj.__typename) +} + + + +const ShopOrderMessage_possibleTypes: string[] = ['ShopOrderMessage'] +export const isShopOrderMessage = (obj?: { __typename?: any } | null): obj is ShopOrderMessage => { + if (!obj?.__typename) throw new Error('__typename is missing in "isShopOrderMessage"') + return ShopOrderMessage_possibleTypes.includes(obj.__typename) +} + + + +const VideogameConnection_possibleTypes: string[] = ['VideogameConnection'] +export const isVideogameConnection = (obj?: { __typename?: any } | null): obj is VideogameConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isVideogameConnection"') + return VideogameConnection_possibleTypes.includes(obj.__typename) +} + + + +const Mutation_possibleTypes: string[] = ['Mutation'] +export const isMutation = (obj?: { __typename?: any } | null): obj is Mutation => { + if (!obj?.__typename) throw new Error('__typename is missing in "isMutation"') + return Mutation_possibleTypes.includes(obj.__typename) +} + + + +const ActionSet_possibleTypes: string[] = ['TeamActionSet'] +export const isActionSet = (obj?: { __typename?: any } | null): obj is ActionSet => { + if (!obj?.__typename) throw new Error('__typename is missing in "isActionSet"') + return ActionSet_possibleTypes.includes(obj.__typename) +} + + + +const BracketConfig_possibleTypes: string[] = ['RaceBracketConfig'] +export const isBracketConfig = (obj?: { __typename?: any } | null): obj is BracketConfig => { + if (!obj?.__typename) throw new Error('__typename is missing in "isBracketConfig"') + return BracketConfig_possibleTypes.includes(obj.__typename) +} + + + +const EventTeam_possibleTypes: string[] = ['EventTeam'] +export const isEventTeam = (obj?: { __typename?: any } | null): obj is EventTeam => { + if (!obj?.__typename) throw new Error('__typename is missing in "isEventTeam"') + return EventTeam_possibleTypes.includes(obj.__typename) +} + + + +const GlobalTeam_possibleTypes: string[] = ['GlobalTeam'] +export const isGlobalTeam = (obj?: { __typename?: any } | null): obj is GlobalTeam => { + if (!obj?.__typename) throw new Error('__typename is missing in "isGlobalTeam"') + return GlobalTeam_possibleTypes.includes(obj.__typename) +} + + + +const EventTeamConnection_possibleTypes: string[] = ['EventTeamConnection'] +export const isEventTeamConnection = (obj?: { __typename?: any } | null): obj is EventTeamConnection => { + if (!obj?.__typename) throw new Error('__typename is missing in "isEventTeamConnection"') + return EventTeamConnection_possibleTypes.includes(obj.__typename) +} + + + +const MatchConfig_possibleTypes: string[] = ['RaceMatchConfig'] +export const isMatchConfig = (obj?: { __typename?: any } | null): obj is MatchConfig => { + if (!obj?.__typename) throw new Error('__typename is missing in "isMatchConfig"') + return MatchConfig_possibleTypes.includes(obj.__typename) +} + + + +const RaceBracketConfig_possibleTypes: string[] = ['RaceBracketConfig'] +export const isRaceBracketConfig = (obj?: { __typename?: any } | null): obj is RaceBracketConfig => { + if (!obj?.__typename) throw new Error('__typename is missing in "isRaceBracketConfig"') + return RaceBracketConfig_possibleTypes.includes(obj.__typename) +} + + + +const RaceMatchConfig_possibleTypes: string[] = ['RaceMatchConfig'] +export const isRaceMatchConfig = (obj?: { __typename?: any } | null): obj is RaceMatchConfig => { + if (!obj?.__typename) throw new Error('__typename is missing in "isRaceMatchConfig"') + return RaceMatchConfig_possibleTypes.includes(obj.__typename) +} + + + +const TeamActionSet_possibleTypes: string[] = ['TeamActionSet'] +export const isTeamActionSet = (obj?: { __typename?: any } | null): obj is TeamActionSet => { + if (!obj?.__typename) throw new Error('__typename is missing in "isTeamActionSet"') + return TeamActionSet_possibleTypes.includes(obj.__typename) +} + + +export interface QueryPromiseChain { + + /** Returns the authenticated user */ + currentUser: (UserPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns an entrant given its id */ + entrant: ((args: { id: Scalars['ID'] }) => EntrantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns an event given its id or slug */ + event: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => EventPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (EventPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a league given its id or slug */ + league: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => LeaguePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (LeaguePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a participant given its id */ + participant: ((args: { id: Scalars['ID'], isAdmin?: (Scalars['Boolean'] | null) }) => ParticipantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a phase given its id */ + phase: ((args?: { id?: (Scalars['ID'] | null) }) => PhasePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (PhasePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a phase group given its id */ + phaseGroup: ((args?: { id?: (Scalars['ID'] | null) }) => PhaseGroupPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (PhaseGroupPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a player given an id */ + player: ((args: { id: Scalars['ID'] }) => PlayerPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a phase seed given its id */ + seed: ((args?: { id?: (Scalars['ID'] | null) }) => SeedPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (SeedPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a set given its id */ + set: ((args: { id: Scalars['ID'] }) => SetPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** A shop entity */ + shop: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => ShopPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (ShopPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns an stream given its id */ + stream: ((args: { id: Scalars['ID'] }) => StreamsPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns all the stream queues for a given tournament */ + streamQueue: ((args: { tournamentId: Scalars['ID'], includePlayerStreams?: (Scalars['Boolean'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Returns a team given its id */ + team: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null), inviteCode?: (Scalars['String'] | null) }) => TeamPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (TeamPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a tournament given its id or slug */ + tournament: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => TournamentPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (TournamentPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Paginated, filterable list of tournaments */ + tournaments: ((args: { query: TournamentQuery }) => TournamentConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a user given a user slug of the form user/abc123, or id */ + user: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => UserPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (UserPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns a videogame given its id */ + videogame: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => VideogamePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (VideogamePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Returns paginated list of videogames matching the search criteria. */ + videogames: ((args: { query: VideogameQuery }) => VideogameConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) +} + +export interface QueryObservableChain { + + /** Returns the authenticated user */ + currentUser: (UserObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns an entrant given its id */ + entrant: ((args: { id: Scalars['ID'] }) => EntrantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns an event given its id or slug */ + event: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => EventObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (EventObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a league given its id or slug */ + league: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => LeagueObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (LeagueObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a participant given its id */ + participant: ((args: { id: Scalars['ID'], isAdmin?: (Scalars['Boolean'] | null) }) => ParticipantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a phase given its id */ + phase: ((args?: { id?: (Scalars['ID'] | null) }) => PhaseObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (PhaseObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a phase group given its id */ + phaseGroup: ((args?: { id?: (Scalars['ID'] | null) }) => PhaseGroupObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (PhaseGroupObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a player given an id */ + player: ((args: { id: Scalars['ID'] }) => PlayerObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a phase seed given its id */ + seed: ((args?: { id?: (Scalars['ID'] | null) }) => SeedObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (SeedObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a set given its id */ + set: ((args: { id: Scalars['ID'] }) => SetObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** A shop entity */ + shop: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => ShopObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (ShopObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns an stream given its id */ + stream: ((args: { id: Scalars['ID'] }) => StreamsObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns all the stream queues for a given tournament */ + streamQueue: ((args: { tournamentId: Scalars['ID'], includePlayerStreams?: (Scalars['Boolean'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Returns a team given its id */ + team: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null), inviteCode?: (Scalars['String'] | null) }) => TeamObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (TeamObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a tournament given its id or slug */ + tournament: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => TournamentObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (TournamentObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Paginated, filterable list of tournaments */ + tournaments: ((args: { query: TournamentQuery }) => TournamentConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a user given a user slug of the form user/abc123, or id */ + user: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => UserObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (UserObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns a videogame given its id */ + videogame: ((args?: { id?: (Scalars['ID'] | null), slug?: (Scalars['String'] | null) }) => VideogameObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (VideogameObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Returns paginated list of videogames matching the search criteria. */ + videogames: ((args: { query: VideogameQuery }) => VideogameConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) +} + + +/** A user */ +export interface UserPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** Authorizations to external services (i.e. Twitch, Twitter) */ + authorizations: ((args?: { types?: ((SocialConnectionType | null)[] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + bio: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Public facing user birthday that respects user publishing settings */ + birthday: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Uniquely identifying token for user. Same as the hashed part of the slug */ + discriminator: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Events this user has competed in */ + events: ((args?: { query?: (UserEventsPaginationQuery | null) }) => EventConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (EventConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + genderPronoun: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Leagues this user has competed in */ + leagues: ((args?: { query?: (UserLeaguesPaginationQuery | null) }) => LeagueConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (LeagueConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Public location info for this user */ + location: (AddressPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Public facing user name that respects user publishing settings */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** player for user */ + player: (PlayerPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Tournaments this user is organizing or competing in */ + tournaments: ((args?: { query?: (UserTournamentsPaginationQuery | null) }) => TournamentConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (TournamentConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) +} + + +/** A user */ +export interface UserObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** Authorizations to external services (i.e. Twitch, Twitter) */ + authorizations: ((args?: { types?: ((SocialConnectionType | null)[] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + bio: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Public facing user birthday that respects user publishing settings */ + birthday: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Uniquely identifying token for user. Same as the hashed part of the slug */ + discriminator: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Events this user has competed in */ + events: ((args?: { query?: (UserEventsPaginationQuery | null) }) => EventConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (EventConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + genderPronoun: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Leagues this user has competed in */ + leagues: ((args?: { query?: (UserLeaguesPaginationQuery | null) }) => LeagueConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (LeagueConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Public location info for this user */ + location: (AddressObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Public facing user name that respects user publishing settings */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** player for user */ + player: (PlayerObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Tournaments this user is organizing or competing in */ + tournaments: ((args?: { query?: (UserTournamentsPaginationQuery | null) }) => TournamentConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (TournamentConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) +} + + +/** An OAuth ProfileAuthorization object */ +export interface ProfileAuthorizationPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** The id given by the external service */ + externalId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The username given by the external service (including discriminator if discord) */ + externalUsername: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + stream: (StreamPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The name of the external service providing this auth i.e. "twitch" */ + type: ({ get: (request?: boolean | number, defaultValue?: (AuthorizationType | undefined)) => Promise<(AuthorizationType | undefined)> }), + url: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** An OAuth ProfileAuthorization object */ +export interface ProfileAuthorizationObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** The id given by the external service */ + externalId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The username given by the external service (including discriminator if discord) */ + externalUsername: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + stream: (StreamObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The name of the external service providing this auth i.e. "twitch" */ + type: ({ get: (request?: boolean | number, defaultValue?: (AuthorizationType | undefined)) => Observable<(AuthorizationType | undefined)> }), + url: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** A Stream object */ +export interface StreamPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** Whether the stream is currently live. May be slightly delayed. */ + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** The name of the stream */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The name of the external service providing this auth i.e. "twitch" */ + type: ({ get: (request?: boolean | number, defaultValue?: (StreamType | undefined)) => Promise<(StreamType | undefined)> }) +} + + +/** A Stream object */ +export interface StreamObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** Whether the stream is currently live. May be slightly delayed. */ + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** The name of the stream */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The name of the external service providing this auth i.e. "twitch" */ + type: ({ get: (request?: boolean | number, defaultValue?: (StreamType | undefined)) => Observable<(StreamType | undefined)> }) +} + +export interface EventConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface EventConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface PageInfoPromiseChain { + total: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + totalPages: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + page: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + perPage: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + sortBy: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + filter: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }) +} + +export interface PageInfoObservableChain { + total: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + totalPages: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + page: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + perPage: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + sortBy: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + filter: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }) +} + + +/** An event in a tournament */ +export interface EventPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** How long before the event start will the check-in end (in seconds) */ + checkInBuffer: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** How long the event check-in will last (in seconds) */ + checkInDuration: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Whether check-in is enabled for this event */ + checkInEnabled: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Rough categorization of event tier, denoting relative importance in the competitive scene */ + competitionTier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** When the event was created (unix timestamp) */ + createdAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** Last date attendees are able to create teams for team events */ + deckSubmissionDeadline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** + * @deprecated Migrate to teamRosterSize + * Maximum number of participants each Entrant can have + */ + entrantSizeMax: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** + * @deprecated Migrate to teamRosterSize + * Minimum number of participants each Entrant can have + */ + entrantSizeMin: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** The entrants that belong to an event, paginated by filter criteria */ + entrants: ((args?: { query?: (EventEntrantPageQuery | null) }) => EntrantConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (EntrantConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Whether the event has decks */ + hasDecks: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Are player tasks enabled for this event */ + hasTasks: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Whether the event is an online event or not */ + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + league: (LeaguePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Markdown field for match rules/instructions */ + matchRulesMarkdown: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Title of event set by organizer */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Gets the number of entrants in this event */ + numEntrants: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** The phase groups that belong to an event. */ + phaseGroups: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** The phases that belong to an event. */ + phases: ((args?: { + /** Filter phases by state. If not specified will default to all phases */ + state?: (ActivityState | null), + /** Optionally only return results for this phase */ + phaseId?: (Scalars['ID'] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** TO settings for prizing */ + prizingInfo: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + publishing: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + + /** Markdown field for event rules/instructions */ + rulesMarkdown: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Id of the event ruleset */ + rulesetId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** + * @deprecated Use ruleset + * Settings pulled from the event ruleset, if one exists + */ + rulesetSettings: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + + /** Paginated sets for this Event */ + sets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Paginated list of standings */ + standings: ((args: { query: StandingPaginationQuery }) => StandingConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** When does this event start? */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** The state of the Event. */ + state: ({ get: (request?: boolean | number, defaultValue?: (ActivityState | undefined)) => Promise<(ActivityState | undefined)> }), + + /** Paginated stations on this event */ + stations: ((args?: { query?: (StationFilter | null) }) => StationsConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (StationsConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Last date attendees are able to create teams for team events */ + teamManagementDeadline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** If this is a teams event, returns whether or not teams can set custom names */ + teamNameAllowed: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Team roster size requirements */ + teamRosterSize: (TeamRosterSizePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + tournament: (TournamentPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The type of the event, whether an entrant will have one participant or multiple */ + type: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** When the event was last modified (unix timestamp) */ + updatedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** Whether the event uses the new EventSeeds for seeding */ + useEventSeeds: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + videogame: (VideogamePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The waves being used by the event */ + waves: ((args?: { + /** Waves filtered by phaseId, returns all if not set. */ + phaseId?: (Scalars['ID'] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** An event in a tournament */ +export interface EventObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** How long before the event start will the check-in end (in seconds) */ + checkInBuffer: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** How long the event check-in will last (in seconds) */ + checkInDuration: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Whether check-in is enabled for this event */ + checkInEnabled: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Rough categorization of event tier, denoting relative importance in the competitive scene */ + competitionTier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** When the event was created (unix timestamp) */ + createdAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** Last date attendees are able to create teams for team events */ + deckSubmissionDeadline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** + * @deprecated Migrate to teamRosterSize + * Maximum number of participants each Entrant can have + */ + entrantSizeMax: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** + * @deprecated Migrate to teamRosterSize + * Minimum number of participants each Entrant can have + */ + entrantSizeMin: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** The entrants that belong to an event, paginated by filter criteria */ + entrants: ((args?: { query?: (EventEntrantPageQuery | null) }) => EntrantConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (EntrantConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Whether the event has decks */ + hasDecks: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Are player tasks enabled for this event */ + hasTasks: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Whether the event is an online event or not */ + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + league: (LeagueObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Markdown field for match rules/instructions */ + matchRulesMarkdown: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Title of event set by organizer */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Gets the number of entrants in this event */ + numEntrants: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** The phase groups that belong to an event. */ + phaseGroups: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** The phases that belong to an event. */ + phases: ((args?: { + /** Filter phases by state. If not specified will default to all phases */ + state?: (ActivityState | null), + /** Optionally only return results for this phase */ + phaseId?: (Scalars['ID'] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** TO settings for prizing */ + prizingInfo: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + publishing: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + + /** Markdown field for event rules/instructions */ + rulesMarkdown: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Id of the event ruleset */ + rulesetId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** + * @deprecated Use ruleset + * Settings pulled from the event ruleset, if one exists + */ + rulesetSettings: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + + /** Paginated sets for this Event */ + sets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Paginated list of standings */ + standings: ((args: { query: StandingPaginationQuery }) => StandingConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** When does this event start? */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** The state of the Event. */ + state: ({ get: (request?: boolean | number, defaultValue?: (ActivityState | undefined)) => Observable<(ActivityState | undefined)> }), + + /** Paginated stations on this event */ + stations: ((args?: { query?: (StationFilter | null) }) => StationsConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (StationsConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Last date attendees are able to create teams for team events */ + teamManagementDeadline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** If this is a teams event, returns whether or not teams can set custom names */ + teamNameAllowed: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Team roster size requirements */ + teamRosterSize: (TeamRosterSizeObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + tournament: (TournamentObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The type of the event, whether an entrant will have one participant or multiple */ + type: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** When the event was last modified (unix timestamp) */ + updatedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** Whether the event uses the new EventSeeds for seeding */ + useEventSeeds: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + videogame: (VideogameObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The waves being used by the event */ + waves: ((args?: { + /** Waves filtered by phaseId, returns all if not set. */ + phaseId?: (Scalars['ID'] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface EntrantConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface EntrantConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** An entrant in an event */ +export interface EntrantPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + event: (EventPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Entrant's seed number in the first phase of the event. */ + initialSeedNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + isDisqualified: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** The entrant name as it appears in bracket: gamerTag of the participant or team name */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Paginated sets for this entrant */ + paginatedSets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + participants: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + seeds: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + skill: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Standing for this entrant given an event. All entrants queried must be in the same event (for now). */ + standing: (StandingPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** @deprecated DEPRECATED. Use streams instead, which supports multiple stream types and teams. */ + stream: (StreamsPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + streams: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Team linked to this entrant, if one exists */ + team: (TeamPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) +} + + +/** An entrant in an event */ +export interface EntrantObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + event: (EventObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Entrant's seed number in the first phase of the event. */ + initialSeedNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + isDisqualified: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** The entrant name as it appears in bracket: gamerTag of the participant or team name */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Paginated sets for this entrant */ + paginatedSets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + participants: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + seeds: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + skill: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Standing for this entrant given an event. All entrants queried must be in the same event (for now). */ + standing: (StandingObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** @deprecated DEPRECATED. Use streams instead, which supports multiple stream types and teams. */ + stream: (StreamsObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + streams: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Team linked to this entrant, if one exists */ + team: (TeamObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) +} + +export interface SetConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface SetConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A set */ +export interface SetPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** The time this set was marked as completed */ + completedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** The time this set was created */ + createdAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + displayScore: ((args?: { mainEntrantId?: (Scalars['ID'] | null) }) => { get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) & ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Event that this set belongs to. */ + event: (EventPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Full round text of this set. */ + fullRoundText: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + game: ((args: { orderNum: Scalars['Int'] }) => GamePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + games: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Whether this set contains a placeholder entrant */ + hasPlaceholder: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** The letters that describe a unique identifier within the pool. Eg. F, AT */ + identifier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + lPlacement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Phase group that this Set belongs to. */ + phaseGroup: (PhaseGroupPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The round number of the set. Negative numbers are losers bracket */ + round: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** + * Indicates whether the set is in best of or total games mode. This instructs + * which field is used to figure out how many games are in this set. + */ + setGamesType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** A possible spot in a set. Use this to get all entrants in a set. Use this for all bracket types (FFA, elimination, etc) */ + slots: ((args?: { includeByes?: (Scalars['Boolean'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** The start time of the Set. If there is no startAt time on the Set, will pull it from phaseGroup rounds configuration. */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + startedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Tournament event station for a set */ + station: (StationsPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Tournament event stream for a set */ + stream: (StreamsPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** If setGamesType is in total games mode, this defined the number of games in the set. */ + totalGames: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Url of a VOD for this set */ + vodUrl: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + wPlacement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + winnerId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }) +} + + +/** A set */ +export interface SetObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** The time this set was marked as completed */ + completedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** The time this set was created */ + createdAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + displayScore: ((args?: { mainEntrantId?: (Scalars['ID'] | null) }) => { get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) & ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Event that this set belongs to. */ + event: (EventObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Full round text of this set. */ + fullRoundText: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + game: ((args: { orderNum: Scalars['Int'] }) => GameObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + games: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Whether this set contains a placeholder entrant */ + hasPlaceholder: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** The letters that describe a unique identifier within the pool. Eg. F, AT */ + identifier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + lPlacement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Phase group that this Set belongs to. */ + phaseGroup: (PhaseGroupObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The round number of the set. Negative numbers are losers bracket */ + round: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** + * Indicates whether the set is in best of or total games mode. This instructs + * which field is used to figure out how many games are in this set. + */ + setGamesType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** A possible spot in a set. Use this to get all entrants in a set. Use this for all bracket types (FFA, elimination, etc) */ + slots: ((args?: { includeByes?: (Scalars['Boolean'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** The start time of the Set. If there is no startAt time on the Set, will pull it from phaseGroup rounds configuration. */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + startedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Tournament event station for a set */ + station: (StationsObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Tournament event stream for a set */ + stream: (StreamsObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** If setGamesType is in total games mode, this defined the number of games in the set. */ + totalGames: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Url of a VOD for this set */ + vodUrl: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + wPlacement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + winnerId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }) +} + + +/** A game represents a single game within a set. */ +export interface GamePromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + orderNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Selections for this game such as character, etc. */ + selections: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** The stage that this game was played on (if applicable) */ + stage: (StagePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + winnerId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }) +} + + +/** A game represents a single game within a set. */ +export interface GameObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + orderNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Selections for this game such as character, etc. */ + selections: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** The stage that this game was played on (if applicable) */ + stage: (StageObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + winnerId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }) +} + + +/** An image */ +export interface ImagePromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + height: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }), + ratio: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }), + type: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + url: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + width: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }) +} + + +/** An image */ +export interface ImageObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + height: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }), + ratio: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }), + type: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + url: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + width: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }) +} + + +/** A selection for this game. i.e. character/stage selection, etc */ +export interface GameSelectionPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** The entrant who this selection is for */ + entrant: (EntrantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + orderNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** + * The participant who this selection is for. This is only populated if there are + * selections for multiple participants of a single entrant + */ + participant: (ParticipantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + selectionType: ({ get: (request?: boolean | number, defaultValue?: (GameSelectionType | undefined)) => Promise<(GameSelectionType | undefined)> }), + selectionValue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }) +} + + +/** A selection for this game. i.e. character/stage selection, etc */ +export interface GameSelectionObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** The entrant who this selection is for */ + entrant: (EntrantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + orderNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** + * The participant who this selection is for. This is only populated if there are + * selections for multiple participants of a single entrant + */ + participant: (ParticipantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + selectionType: ({ get: (request?: boolean | number, defaultValue?: (GameSelectionType | undefined)) => Observable<(GameSelectionType | undefined)> }), + selectionValue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }) +} + + +/** A participant of a tournament; either a spectator or competitor */ +export interface ParticipantPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** If this participant was checked-in by admin */ + checkedIn: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** The time this participant was checked-in by admin */ + checkedInAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** Info for connected accounts to external services. */ + connectedAccounts: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + + /** + * Contact Info selected during registration. Falls back to User.location and/or + * User.name if necessary. These fields are for admin use only and do not respect + * user privacy settings. DO NOT display this information publicly. + */ + contactInfo: (ContactInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Email of the user, only available to admins within 18 months of tournament */ + email: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + entrants: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** The events this participant registered for. */ + events: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** The tag that was used in registration e.g. Mang0 */ + gamerTag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + player: (PlayerPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The prefix that was used in registration e.g. C9 */ + prefix: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Admin only field for required social connections */ + requiredConnections: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** The user this participant is associated to. */ + user: (UserPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** If this participant is verified as actually being in the tournament */ + verified: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }) +} + + +/** A participant of a tournament; either a spectator or competitor */ +export interface ParticipantObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** If this participant was checked-in by admin */ + checkedIn: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** The time this participant was checked-in by admin */ + checkedInAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** Info for connected accounts to external services. */ + connectedAccounts: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + + /** + * Contact Info selected during registration. Falls back to User.location and/or + * User.name if necessary. These fields are for admin use only and do not respect + * user privacy settings. DO NOT display this information publicly. + */ + contactInfo: (ContactInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Email of the user, only available to admins within 18 months of tournament */ + email: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + entrants: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** The events this participant registered for. */ + events: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** The tag that was used in registration e.g. Mang0 */ + gamerTag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + player: (PlayerObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The prefix that was used in registration e.g. C9 */ + prefix: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Admin only field for required social connections */ + requiredConnections: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** The user this participant is associated to. */ + user: (UserObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** If this participant is verified as actually being in the tournament */ + verified: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }) +} + + +/** Name, address, etc */ +export interface ContactInfoPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** Participant City Name */ + city: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Participant Country Name */ + country: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Participant Country (region) id */ + countryId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** First Name */ + nameFirst: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Last Name */ + nameLast: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Participant State Name */ + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Participant State (region) id */ + stateId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Zip or Postal Code */ + zipcode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** Name, address, etc */ +export interface ContactInfoObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** Participant City Name */ + city: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Participant Country Name */ + country: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Participant Country (region) id */ + countryId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** First Name */ + nameFirst: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Last Name */ + nameLast: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Participant State Name */ + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Participant State (region) id */ + stateId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Zip or Postal Code */ + zipcode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** A player */ +export interface PlayerPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + gamerTag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + prefix: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Most recent active & published rankings */ + rankings: ((args?: { limit?: (Scalars['Int'] | null), videogameId?: (Scalars['ID'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** + * @deprecated Use the sets field instead. + * Recent sets for this player. + */ + recentSets: ((args?: { + /** Use this to get H2H history between two players */ + opponentId?: (Scalars['ID'] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Set history for this player. */ + sets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + user: (UserPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) +} + + +/** A player */ +export interface PlayerObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + gamerTag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + prefix: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Most recent active & published rankings */ + rankings: ((args?: { limit?: (Scalars['Int'] | null), videogameId?: (Scalars['ID'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** + * @deprecated Use the sets field instead. + * Recent sets for this player. + */ + recentSets: ((args?: { + /** Use this to get H2H history between two players */ + opponentId?: (Scalars['ID'] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Set history for this player. */ + sets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + user: (UserObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) +} + + +/** A player's ranks */ +export interface PlayerRankPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** The player's placement on the ranking */ + rank: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + title: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** A player's ranks */ +export interface PlayerRankObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** The player's placement on the ranking */ + rank: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + title: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** Video Stage */ +export interface StagePromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** Stage name */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** Video Stage */ +export interface StageObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** Stage name */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** A group within a phase */ +export interface PhaseGroupPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** The bracket type of this group's phase. */ + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Promise<(BracketType | undefined)> }), + + /** Unique identifier for this group within the context of its phase */ + displayIdentifier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** For the given phase group, this is the start time of the first round that occurs in the group. */ + firstRoundTime: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + numRounds: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** @deprecated Please use 'seeds', which is now paginated */ + paginatedSeeds: ((args: { query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }) => SeedConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** + * @deprecated Please use 'sets', which is now paginated + * Paginated sets on this phaseGroup + */ + paginatedSets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The phase associated with this phase group */ + phase: (PhasePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The progressions out of this phase group */ + progressionsOut: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + rounds: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + seedMap: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + + /** Paginated seeds for this phase group */ + seeds: ((args: { query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }) => SeedConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Paginated sets on this phaseGroup */ + sets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Paginated list of standings */ + standings: ((args?: { query?: (StandingGroupStandingPageFilter | null) }) => StandingConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (StandingConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Unix time the group is scheduled to start. This info could also be on the wave instead. */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + tiebreakOrder: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + wave: (WavePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) +} + + +/** A group within a phase */ +export interface PhaseGroupObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** The bracket type of this group's phase. */ + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Observable<(BracketType | undefined)> }), + + /** Unique identifier for this group within the context of its phase */ + displayIdentifier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** For the given phase group, this is the start time of the first round that occurs in the group. */ + firstRoundTime: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + numRounds: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** @deprecated Please use 'seeds', which is now paginated */ + paginatedSeeds: ((args: { query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }) => SeedConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** + * @deprecated Please use 'sets', which is now paginated + * Paginated sets on this phaseGroup + */ + paginatedSets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The phase associated with this phase group */ + phase: (PhaseObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The progressions out of this phase group */ + progressionsOut: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + rounds: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + seedMap: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + + /** Paginated seeds for this phase group */ + seeds: ((args: { query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }) => SeedConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Paginated sets on this phaseGroup */ + sets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Paginated list of standings */ + standings: ((args?: { query?: (StandingGroupStandingPageFilter | null) }) => StandingConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (StandingConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Unix time the group is scheduled to start. This info could also be on the wave instead. */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + tiebreakOrder: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + wave: (WaveObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) +} + +export interface SeedConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface SeedConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A seed for an entrant */ +export interface SeedPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** Map of Participant ID to checked in boolean */ + checkedInParticipants: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + entrant: (EntrantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + groupSeedNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + isBye: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + phase: (PhasePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + phaseGroup: (PhaseGroupPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + placeholderName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + placement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** The player(s) associated with this seed's entrant */ + players: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + progressionSeedId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Source progression information */ + progressionSource: (ProgressionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + seedNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Entrant's win/loss record for this standing. Scores do not include byes. */ + setRecordWithoutByes: ((args: { phaseGroupId: Scalars['ID'] }) => { get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + standings: ((args?: { + /** The container of the standing groups to get standings for. If null, will return all standings. */ + containerType?: (Scalars['String'] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A seed for an entrant */ +export interface SeedObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** Map of Participant ID to checked in boolean */ + checkedInParticipants: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + entrant: (EntrantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + groupSeedNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + isBye: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + phase: (PhaseObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + phaseGroup: (PhaseGroupObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + placeholderName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + placement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** The player(s) associated with this seed's entrant */ + players: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + progressionSeedId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Source progression information */ + progressionSource: (ProgressionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + seedNum: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Entrant's win/loss record for this standing. Scores do not include byes. */ + setRecordWithoutByes: ((args: { phaseGroupId: Scalars['ID'] }) => { get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + standings: ((args?: { + /** The container of the standing groups to get standings for. If null, will return all standings. */ + containerType?: (Scalars['String'] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A phase in an event */ +export interface PhasePromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** The bracket type of this phase. */ + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Promise<(BracketType | undefined)> }), + + /** The Event that this phase belongs to */ + event: (EventPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Number of phase groups in this phase */ + groupCount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Is the phase an exhibition or not. */ + isExhibition: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Name of phase e.g. Round 1 Pools */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The number of seeds this phase contains. */ + numSeeds: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** @deprecated Please use 'seeds' instead */ + paginatedSeeds: ((args: { query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }) => SeedConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Phase groups under this phase, paginated */ + phaseGroups: ((args?: { query?: (PhaseGroupPageQuery | null) }) => PhaseGroupConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (PhaseGroupConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The relative order of this phase within an event */ + phaseOrder: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Paginated seeds for this phase */ + seeds: ((args: { query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }) => SeedConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Paginated sets for this Phase */ + sets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (SetConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** State of the phase */ + state: ({ get: (request?: boolean | number, defaultValue?: (ActivityState | undefined)) => Promise<(ActivityState | undefined)> }), + waves: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A phase in an event */ +export interface PhaseObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** The bracket type of this phase. */ + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Observable<(BracketType | undefined)> }), + + /** The Event that this phase belongs to */ + event: (EventObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Number of phase groups in this phase */ + groupCount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Is the phase an exhibition or not. */ + isExhibition: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Name of phase e.g. Round 1 Pools */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The number of seeds this phase contains. */ + numSeeds: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** @deprecated Please use 'seeds' instead */ + paginatedSeeds: ((args: { query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }) => SeedConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Phase groups under this phase, paginated */ + phaseGroups: ((args?: { query?: (PhaseGroupPageQuery | null) }) => PhaseGroupConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (PhaseGroupConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The relative order of this phase within an event */ + phaseOrder: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Paginated seeds for this phase */ + seeds: ((args: { query: SeedPaginationQuery, eventId?: (Scalars['ID'] | null) }) => SeedConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Paginated sets for this Phase */ + sets: ((args?: { + page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null), + /** How to sort these sets */ + sortType?: (SetSortType | null), + /** Supported filter options to filter down set results. */ + filters?: (SetFilters | null) + }) => SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (SetConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** State of the phase */ + state: ({ get: (request?: boolean | number, defaultValue?: (ActivityState | undefined)) => Observable<(ActivityState | undefined)> }), + waves: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface PhaseGroupConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface PhaseGroupConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A wave in a tournament */ +export interface WavePromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** The Wave Identifier */ + identifier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Unix time the wave is scheduled to start. */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }) +} + + +/** A wave in a tournament */ +export interface WaveObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** The Wave Identifier */ + identifier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Unix time the wave is scheduled to start. */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }) +} + + +/** A connection between a placement in an origin phase group to a destination seed. */ +export interface ProgressionPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + originOrder: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + originPhase: (PhasePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + originPhaseGroup: (PhaseGroupPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + originPlacement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }) +} + + +/** A connection between a placement in an origin phase group to a destination seed. */ +export interface ProgressionObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + originOrder: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + originPhase: (PhaseObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + originPhaseGroup: (PhaseGroupObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + originPlacement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }) +} + + +/** A standing indicates the placement of something within a container. */ +export interface StandingPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** + * The containing entity that contextualizes this standing. Event standings, for + * example, represent an entrant's standing in the entire event vs. Set standings + * which is an entrant's standing in only a single set within an event. + */ + container: ({ get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** If the entity this standing is assigned to can be resolved into an entrant, this will provide the entrant. */ + entrant: (EntrantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + isFinal: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Metadata that goes along with this standing. Can take on different forms based on standing group type and settings. */ + metadata: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + placement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** The player(s) tied to this standing's entity */ + player: (PlayerPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** @deprecated The "placement" field is identical and will eventually replace "standing" */ + standing: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + stats: (StandingStatsPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + totalPoints: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }) +} + + +/** A standing indicates the placement of something within a container. */ +export interface StandingObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** + * The containing entity that contextualizes this standing. Event standings, for + * example, represent an entrant's standing in the entire event vs. Set standings + * which is an entrant's standing in only a single set within an event. + */ + container: ({ get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** If the entity this standing is assigned to can be resolved into an entrant, this will provide the entrant. */ + entrant: (EntrantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + isFinal: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Metadata that goes along with this standing. Can take on different forms based on standing group type and settings. */ + metadata: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + placement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** The player(s) tied to this standing's entity */ + player: (PlayerObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** @deprecated The "placement" field is identical and will eventually replace "standing" */ + standing: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + stats: (StandingStatsObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + totalPoints: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }) +} + + +/** A tournament */ +export interface TournamentPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + addrState: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Admin-only view of admins for this tournament */ + admins: ((args?: { + /** Which roles to show */ + roles?: ((Scalars['String'] | null)[] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + city: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + countryCode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** When the tournament was created (unix timestamp) */ + createdAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + currency: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** When the tournament ends */ + endAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** When does event registration close */ + eventRegistrationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + events: ((args?: { limit?: (Scalars['Int'] | null), filter?: (EventFilter | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** True if tournament has at least one offline event */ + hasOfflineEvents: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + hasOnlineEvents: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + hashtag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** True if tournament has at least one online event */ + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Is tournament registration open */ + isRegistrationOpen: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + lat: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }), + links: (TournamentLinksPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + lng: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }), + mapsPlaceId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The tournament name */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Number of attendees including spectators, if public */ + numAttendees: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** The user who created the tournament */ + owner: (UserPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Paginated, queryable list of participants */ + participants: ((args: { query: ParticipantPaginationQuery, isAdmin?: (Scalars['Boolean'] | null) }) => ParticipantConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + postalCode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + primaryContact: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + primaryContactType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Publishing settings for this tournament */ + publishing: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + + /** When does registration for the tournament end */ + registrationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + rules: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The short slug used to form the url */ + shortSlug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The slug used to form the url */ + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** When the tournament Starts */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED */ + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + stations: ((args?: { page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null) }) => StationsConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (StationsConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + streamQueue: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + streams: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** When is the team creation deadline */ + teamCreationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** Paginated, queryable list of teams */ + teams: ((args: { query: TeamPaginationQuery }) => TeamConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The timezone of the tournament */ + timezone: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The type of tournament from TournamentType */ + tournamentType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** When the tournament was last modified (unix timestamp) */ + updatedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** Build Tournament URL */ + url: ((args?: { + /** Tournament tab to add to URL */ + tab?: (Scalars['String'] | null), + /** Generate a relative URL. Defaults to true. Setting to false will generate an absolute URL */ + relative?: (Scalars['Boolean'] | null) + }) => { get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) & ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + venueAddress: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + venueName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** List of all waves in this tournament */ + waves: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A tournament */ +export interface TournamentObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + addrState: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Admin-only view of admins for this tournament */ + admins: ((args?: { + /** Which roles to show */ + roles?: ((Scalars['String'] | null)[] | null) + }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + city: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + countryCode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** When the tournament was created (unix timestamp) */ + createdAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + currency: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** When the tournament ends */ + endAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** When does event registration close */ + eventRegistrationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + events: ((args?: { limit?: (Scalars['Int'] | null), filter?: (EventFilter | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** True if tournament has at least one offline event */ + hasOfflineEvents: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + hasOnlineEvents: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + hashtag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** True if tournament has at least one online event */ + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Is tournament registration open */ + isRegistrationOpen: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + lat: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }), + links: (TournamentLinksObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + lng: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }), + mapsPlaceId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The tournament name */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Number of attendees including spectators, if public */ + numAttendees: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** The user who created the tournament */ + owner: (UserObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Paginated, queryable list of participants */ + participants: ((args: { query: ParticipantPaginationQuery, isAdmin?: (Scalars['Boolean'] | null) }) => ParticipantConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + postalCode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + primaryContact: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + primaryContactType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Publishing settings for this tournament */ + publishing: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + + /** When does registration for the tournament end */ + registrationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + rules: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The short slug used to form the url */ + shortSlug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The slug used to form the url */ + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** When the tournament Starts */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED */ + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + stations: ((args?: { page?: (Scalars['Int'] | null), perPage?: (Scalars['Int'] | null) }) => StationsConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (StationsConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + streamQueue: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + streams: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** When is the team creation deadline */ + teamCreationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** Paginated, queryable list of teams */ + teams: ((args: { query: TeamPaginationQuery }) => TeamConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The timezone of the tournament */ + timezone: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The type of tournament from TournamentType */ + tournamentType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** When the tournament was last modified (unix timestamp) */ + updatedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** Build Tournament URL */ + url: ((args?: { + /** Tournament tab to add to URL */ + tab?: (Scalars['String'] | null), + /** Generate a relative URL. Defaults to true. Setting to false will generate an absolute URL */ + relative?: (Scalars['Boolean'] | null) + }) => { get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) & ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + venueAddress: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + venueName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** List of all waves in this tournament */ + waves: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface TournamentLinksPromiseChain { + facebook: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + discord: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + +export interface TournamentLinksObservableChain { + facebook: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + discord: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + +export interface ParticipantConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface ParticipantConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface StationsConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface StationsConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** Stations, such as a stream setup, at an event */ +export interface StationsPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + canAutoAssign: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + clusterNumber: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + clusterPrefix: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + enabled: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + identifier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + numSetups: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + number: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + prefix: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + queue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + queueDepth: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + updatedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }) +} + + +/** Stations, such as a stream setup, at an event */ +export interface StationsObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + canAutoAssign: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + clusterNumber: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + clusterPrefix: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + enabled: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + identifier: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + numSetups: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + number: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + prefix: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + queue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + queueDepth: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + updatedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }) +} + + +/** A Stream queue object */ +export interface StreamQueuePromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The sets on the stream */ + sets: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** The stream on the queue */ + stream: (StreamsPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) +} + + +/** A Stream queue object */ +export interface StreamQueueObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The sets on the stream */ + sets: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** The stream on the queue */ + stream: (StreamsObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) +} + + +/** Tournament Stream */ +export interface StreamsPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + enabled: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + followerCount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + numSetups: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + parentStreamId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + streamGame: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + streamId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + streamLogo: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + streamName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + streamSource: ({ get: (request?: boolean | number, defaultValue?: (StreamSource | undefined)) => Promise<(StreamSource | undefined)> }), + streamStatus: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + streamType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + streamTypeId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }) +} + + +/** Tournament Stream */ +export interface StreamsObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + enabled: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + followerCount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + numSetups: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + parentStreamId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + streamGame: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + streamId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + streamLogo: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + streamName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + streamSource: ({ get: (request?: boolean | number, defaultValue?: (StreamSource | undefined)) => Observable<(StreamSource | undefined)> }), + streamStatus: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + streamType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + streamTypeId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }) +} + +export interface TeamConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface TeamConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A team, either at the global level or within the context of an event */ +export interface TeamPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** @deprecated Use the entrant field off the EventTeam type */ + entrant: (EntrantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** @deprecated Use the event field off the EventTeam type */ + event: (EventPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + members: ((args?: { status?: ((TeamMemberStatus | null)[] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** A team, either at the global level or within the context of an event */ +export interface TeamObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** @deprecated Use the entrant field off the EventTeam type */ + entrant: (EntrantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** @deprecated Use the event field off the EventTeam type */ + event: (EventObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + members: ((args?: { status?: ((TeamMemberStatus | null)[] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** A member of a team */ +export interface TeamMemberPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + isAlternate: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + isCaptain: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** The type of the team member */ + memberType: ({ get: (request?: boolean | number, defaultValue?: (TeamMemberType | undefined)) => Promise<(TeamMemberType | undefined)> }), + participant: (ParticipantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + player: (PlayerPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The status of the team member */ + status: ({ get: (request?: boolean | number, defaultValue?: (TeamMemberStatus | undefined)) => Promise<(TeamMemberStatus | undefined)> }) +} + + +/** A member of a team */ +export interface TeamMemberObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + isAlternate: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + isCaptain: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** The type of the team member */ + memberType: ({ get: (request?: boolean | number, defaultValue?: (TeamMemberType | undefined)) => Observable<(TeamMemberType | undefined)> }), + participant: (ParticipantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + player: (PlayerObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The status of the team member */ + status: ({ get: (request?: boolean | number, defaultValue?: (TeamMemberStatus | undefined)) => Observable<(TeamMemberStatus | undefined)> }) +} + + +/** Any stats related to this standing. This type is experimental and very likely to change in the future. */ +export interface StandingStatsPromiseChain { + score: (ScorePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) +} + + +/** Any stats related to this standing. This type is experimental and very likely to change in the future. */ +export interface StandingStatsObservableChain { + score: (ScoreObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) +} + + +/** + * The score that led to this standing being awarded. The meaning of this field can + * vary by standing type and is not used for some standing types. + */ +export interface ScorePromiseChain { + + /** The name of this score. e.g. "Kills" or "Stocks" */ + label: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The raw score value */ + value: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }), + + /** Like value, but formatted for race format events. Formatted according to the race config for the front end to use. */ + displayValue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** + * The score that led to this standing being awarded. The meaning of this field can + * vary by standing type and is not used for some standing types. + */ +export interface ScoreObservableChain { + + /** The name of this score. e.g. "Kills" or "Stocks" */ + label: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The raw score value */ + value: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }), + + /** Like value, but formatted for race format events. Formatted according to the race config for the front end to use. */ + displayValue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** A round within a phase group */ +export interface RoundPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** + * If applicable, bestOf is the number of games + * one must win a majority out of to win a set in this round + */ + bestOf: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Indicates this round's order in the phase group */ + number: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** The time that this round is scheduled to start at */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }) +} + + +/** A round within a phase group */ +export interface RoundObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** + * If applicable, bestOf is the number of games + * one must win a majority out of to win a set in this round + */ + bestOf: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Indicates this round's order in the phase group */ + number: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** The time that this round is scheduled to start at */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }) +} + +export interface StandingConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface StandingConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A slot in a set where a seed currently or will eventually exist in order to participate in the set. */ +export interface SetSlotPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + entrant: (EntrantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Pairs with prereqType, is the ID of the prereq. */ + prereqId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Given a set prereq type, defines the placement required in the origin set to end up in this slot. */ + prereqPlacement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** Describes where the entity in this slot comes from. */ + prereqType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + seed: (SeedPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The index of the slot. Unique per set. */ + slotIndex: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** The standing within this set for the seed currently assigned to this slot. */ + standing: (StandingPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) +} + + +/** A slot in a set where a seed currently or will eventually exist in order to participate in the set. */ +export interface SetSlotObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + entrant: (EntrantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Pairs with prereqType, is the ID of the prereq. */ + prereqId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Given a set prereq type, defines the placement required in the origin set to end up in this slot. */ + prereqPlacement: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** Describes where the entity in this slot comes from. */ + prereqType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + seed: (SeedObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The index of the slot. Unique per set. */ + slotIndex: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** The standing within this set for the seed currently assigned to this slot. */ + standing: (StandingObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) +} + + +/** A league */ +export interface LeaguePromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + addrState: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + city: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + countryCode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** When the tournament was created (unix timestamp) */ + createdAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + currency: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** When the tournament ends */ + endAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + entrantCount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + eventOwners: ((args?: { query?: (EventOwnersQuery | null) }) => EventOwnerConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (EventOwnerConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** When does event registration close */ + eventRegistrationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** Paginated list of events in a league */ + events: ((args?: { query?: (LeagueEventsQuery | null) }) => EventConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (EventConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** + * @deprecated No longer used + * Hacked "progression" into this final event + */ + finalEventId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** True if tournament has at least one offline event */ + hasOfflineEvents: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + hasOnlineEvents: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + hashtag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** True if tournament has at least one online event */ + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + lat: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }), + links: (TournamentLinksPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + lng: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }), + mapsPlaceId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The tournament name */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** + * @deprecated No longer used + * Top X number of people in the standings who progress to final event + */ + numProgressingToFinalEvent: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + numUniquePlayers: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + postalCode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + primaryContact: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + primaryContactType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Publishing settings for this tournament */ + publishing: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Promise<(Scalars['JSON'] | undefined)> }), + + /** When does registration for the tournament end */ + registrationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + rules: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The short slug used to form the url */ + shortSlug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Whether standings for this league should be visible */ + showStandings: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** Paginated list of standings */ + standings: ((args?: { query?: (StandingGroupStandingPageFilter | null) }) => StandingConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (StandingConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** When the tournament Starts */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED */ + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** When is the team creation deadline */ + teamCreationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + tiers: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** The timezone of the tournament */ + timezone: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The type of tournament from TournamentType */ + tournamentType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + + /** When the tournament was last modified (unix timestamp) */ + updatedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + + /** Build Tournament URL */ + url: ((args?: { + /** Tournament tab to add to URL */ + tab?: (Scalars['String'] | null), + /** Generate a relative URL. Defaults to true. Setting to false will generate an absolute URL */ + relative?: (Scalars['Boolean'] | null) + }) => { get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) & ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + venueAddress: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + venueName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + videogames: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A league */ +export interface LeagueObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + addrState: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + city: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + countryCode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** When the tournament was created (unix timestamp) */ + createdAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + currency: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** When the tournament ends */ + endAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + entrantCount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + eventOwners: ((args?: { query?: (EventOwnersQuery | null) }) => EventOwnerConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (EventOwnerConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** When does event registration close */ + eventRegistrationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** Paginated list of events in a league */ + events: ((args?: { query?: (LeagueEventsQuery | null) }) => EventConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (EventConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** + * @deprecated No longer used + * Hacked "progression" into this final event + */ + finalEventId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** True if tournament has at least one offline event */ + hasOfflineEvents: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + hasOnlineEvents: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + hashtag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** True if tournament has at least one online event */ + isOnline: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + lat: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }), + links: (TournamentLinksObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + lng: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }), + mapsPlaceId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The tournament name */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** + * @deprecated No longer used + * Top X number of people in the standings who progress to final event + */ + numProgressingToFinalEvent: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + numUniquePlayers: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + postalCode: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + primaryContact: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + primaryContactType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Publishing settings for this tournament */ + publishing: ({ get: (request?: boolean | number, defaultValue?: (Scalars['JSON'] | undefined)) => Observable<(Scalars['JSON'] | undefined)> }), + + /** When does registration for the tournament end */ + registrationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + rules: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The short slug used to form the url */ + shortSlug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Whether standings for this league should be visible */ + showStandings: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** Paginated list of standings */ + standings: ((args?: { query?: (StandingGroupStandingPageFilter | null) }) => StandingConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (StandingConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** When the tournament Starts */ + startAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** State of the tournament, can be ActivityState::CREATED, ActivityState::ACTIVE, or ActivityState::COMPLETED */ + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** When is the team creation deadline */ + teamCreationClosesAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + tiers: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** The timezone of the tournament */ + timezone: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The type of tournament from TournamentType */ + tournamentType: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + + /** When the tournament was last modified (unix timestamp) */ + updatedAt: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + + /** Build Tournament URL */ + url: ((args?: { + /** Tournament tab to add to URL */ + tab?: (Scalars['String'] | null), + /** Generate a relative URL. Defaults to true. Setting to false will generate an absolute URL */ + relative?: (Scalars['Boolean'] | null) + }) => { get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) & ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + venueAddress: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + venueName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + videogames: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface EventOwnerConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface EventOwnerConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** Name and Gamertag of the owner of an event in a league */ +export interface EventOwnerPromiseChain { + eventId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + email: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + gamerTag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + fullName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** Name and Gamertag of the owner of an event in a league */ +export interface EventOwnerObservableChain { + eventId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + email: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + gamerTag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + fullName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** Used for league application tiers */ +export interface EventTierPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** Name of this tier */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** Used for league application tiers */ +export interface EventTierObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** Name of this tier */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** A videogame */ +export interface VideogamePromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** All characters for this videogame */ + characters: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + displayName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** A videogame */ +export interface VideogameObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** All characters for this videogame */ + characters: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + displayName: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** A character in a videogame */ +export interface CharacterPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Name of Character */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** A character in a videogame */ +export interface CharacterObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Name of Character */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** Team roster size requirements */ +export interface TeamRosterSizePromiseChain { + maxAlternates: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + maxPlayers: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + minAlternates: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + minPlayers: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }) +} + + +/** Team roster size requirements */ +export interface TeamRosterSizeObservableChain { + maxAlternates: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + maxPlayers: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + minAlternates: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + minPlayers: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }) +} + +export interface LeagueConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface LeagueConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A user's address */ +export interface AddressPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + city: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + country: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + countryId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + stateId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }) +} + + +/** A user's address */ +export interface AddressObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + city: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + country: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + countryId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + state: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + stateId: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }) +} + +export interface TournamentConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface TournamentConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A shop */ +export interface ShopPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + levels: ((args?: { query?: (ShopLevelsQuery | null) }) => ShopLevelConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (ShopLevelConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + messages: ((args?: { query?: (ShopOrderMessagesQuery | null) }) => ShopOrderMessageConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (ShopOrderMessageConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + url: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** A shop */ +export interface ShopObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + levels: ((args?: { query?: (ShopLevelsQuery | null) }) => ShopLevelConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (ShopLevelConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + messages: ((args?: { query?: (ShopOrderMessagesQuery | null) }) => ShopOrderMessageConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (ShopOrderMessageConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + slug: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + url: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + +export interface ShopLevelConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface ShopLevelConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** A shop level */ +export interface ShopLevelPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + currAmount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }), + description: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + goalAmount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** A shop level */ +export interface ShopLevelObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + currAmount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }), + description: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + goalAmount: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + +export interface ShopOrderMessageConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface ShopOrderMessageConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** The message and player info for a shop order */ +export interface ShopOrderMessagePromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** The player's gamertag. Returns null if anonymous message type */ + gamertag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The order message */ + message: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The player's name. Returns null unless name & tag display is selected */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** The player who left the comment */ + player: (PlayerPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** The total order amount */ + total: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Promise<(Scalars['Float'] | undefined)> }) +} + + +/** The message and player info for a shop order */ +export interface ShopOrderMessageObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** The player's gamertag. Returns null if anonymous message type */ + gamertag: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The order message */ + message: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The player's name. Returns null unless name & tag display is selected */ + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** The player who left the comment */ + player: (PlayerObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** The total order amount */ + total: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Float'] | undefined)) => Observable<(Scalars['Float'] | undefined)> }) +} + +export interface VideogameConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface VideogameConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface MutationPromiseChain { + + /** Delete a phase by id */ + deletePhase: ((args: { phaseId: Scalars['ID'] }) => { get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Delete a station by id */ + deleteStation: ((args: { stationId: Scalars['ID'] }) => { get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Delete a wave by id */ + deleteWave: ((args: { waveId: Scalars['ID'] }) => { get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Automatically attempt to resolve all schedule conflicts. Returns a list of changed seeds */ + resolveScheduleConflicts: ((args: { tournamentId: Scalars['ID'], options?: (ResolveConflictsOptions | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Swap two seed ids in a phase */ + swapSeeds: ((args: { phaseId: Scalars['ID'], seed1Id: Scalars['ID'], seed2Id: Scalars['ID'] }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Update set of phase groups in a phase */ + updatePhaseGroups: ((args: { groupConfigs: (PhaseGroupUpdateInput | null)[] }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Update the seeding for a phase */ + updatePhaseSeeding: ((args: { phaseId: Scalars['ID'], seedMapping: (UpdatePhaseSeedInfo | null)[], options?: (UpdatePhaseSeedingOptions | null) }) => PhasePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Create or update a Phase */ + upsertPhase: ((args: { phaseId?: (Scalars['ID'] | null), eventId?: (Scalars['ID'] | null), payload: PhaseUpsertInput }) => PhasePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Add or update a station by id */ + upsertStation: ((args: { stationId?: (Scalars['ID'] | null), tournamentId?: (Scalars['ID'] | null), fields: StationUpsertInput }) => StationsPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** Add or update a wave by id */ + upsertWave: ((args: { waveId?: (Scalars['ID'] | null), tournamentId?: (Scalars['ID'] | null), fields: WaveUpsertInput }) => WavePromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) +} + +export interface MutationObservableChain { + + /** Delete a phase by id */ + deletePhase: ((args: { phaseId: Scalars['ID'] }) => { get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Delete a station by id */ + deleteStation: ((args: { stationId: Scalars['ID'] }) => { get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Delete a wave by id */ + deleteWave: ((args: { waveId: Scalars['ID'] }) => { get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Automatically attempt to resolve all schedule conflicts. Returns a list of changed seeds */ + resolveScheduleConflicts: ((args: { tournamentId: Scalars['ID'], options?: (ResolveConflictsOptions | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Swap two seed ids in a phase */ + swapSeeds: ((args: { phaseId: Scalars['ID'], seed1Id: Scalars['ID'], seed2Id: Scalars['ID'] }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Update set of phase groups in a phase */ + updatePhaseGroups: ((args: { groupConfigs: (PhaseGroupUpdateInput | null)[] }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Update the seeding for a phase */ + updatePhaseSeeding: ((args: { phaseId: Scalars['ID'], seedMapping: (UpdatePhaseSeedInfo | null)[], options?: (UpdatePhaseSeedingOptions | null) }) => PhaseObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Create or update a Phase */ + upsertPhase: ((args: { phaseId?: (Scalars['ID'] | null), eventId?: (Scalars['ID'] | null), payload: PhaseUpsertInput }) => PhaseObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Add or update a station by id */ + upsertStation: ((args: { stationId?: (Scalars['ID'] | null), tournamentId?: (Scalars['ID'] | null), fields: StationUpsertInput }) => StationsObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** Add or update a wave by id */ + upsertWave: ((args: { waveId?: (Scalars['ID'] | null), tournamentId?: (Scalars['ID'] | null), fields: WaveUpsertInput }) => WaveObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) +} + + +/** A set of actions available for an entity to take */ +export interface ActionSetPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }) +} + + +/** A set of actions available for an entity to take */ +export interface ActionSetObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }) +} + + +/** Bracket-specific configuration */ +export interface BracketConfigPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Promise<(BracketType | undefined)> }) +} + + +/** Bracket-specific configuration */ +export interface BracketConfigObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Observable<(BracketType | undefined)> }) +} + + +/** An event-level Team, in the context of some competition */ +export interface EventTeamPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** @deprecated Use the entrant field off the EventTeam type */ + entrant: (EntrantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** @deprecated Use the event field off the EventTeam type */ + event: (EventPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + globalTeam: (GlobalTeamPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + members: ((args?: { status?: ((TeamMemberStatus | null)[] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** An event-level Team, in the context of some competition */ +export interface EventTeamObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** @deprecated Use the entrant field off the EventTeam type */ + entrant: (EntrantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** @deprecated Use the event field off the EventTeam type */ + event: (EventObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + globalTeam: (GlobalTeamObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + members: ((args?: { status?: ((TeamMemberStatus | null)[] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + + +/** Global Team */ +export interface GlobalTeamPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + + /** @deprecated Use the entrant field off the EventTeam type */ + entrant: (EntrantPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + + /** @deprecated Use the event field off the EventTeam type */ + event: (EventPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + eventTeams: ((args?: { query?: (TeamPaginationQuery | null) }) => EventTeamConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (EventTeamConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + + /** Leagues-level teams for leagues this team is competing in */ + leagueTeams: ((args?: { query?: (TeamPaginationQuery | null) }) => EventTeamConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }) & (EventTeamConnectionPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + members: ((args?: { status?: ((TeamMemberStatus | null)[] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }) +} + + +/** Global Team */ +export interface GlobalTeamObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + + /** Uniquely identifying token for team. Same as the hashed part of the slug */ + discriminator: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + + /** @deprecated Use the entrant field off the EventTeam type */ + entrant: (EntrantObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + + /** @deprecated Use the event field off the EventTeam type */ + event: (EventObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + eventTeams: ((args?: { query?: (TeamPaginationQuery | null) }) => EventTeamConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (EventTeamConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + images: ((args?: { type?: (Scalars['String'] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + + /** Leagues-level teams for leagues this team is competing in */ + leagueTeams: ((args?: { query?: (TeamPaginationQuery | null) }) => EventTeamConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }) & (EventTeamConnectionObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + members: ((args?: { status?: ((TeamMemberStatus | null)[] | null) }) => { get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) & ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }), + name: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }) +} + +export interface EventTeamConnectionPromiseChain { + pageInfo: (PageInfoPromiseChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Promise<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Promise<((FieldsSelection | undefined)[] | undefined)> }) +} + +export interface EventTeamConnectionObservableChain { + pageInfo: (PageInfoObservableChain & { get: (request: R, defaultValue?: (FieldsSelection | undefined)) => Observable<(FieldsSelection | undefined)> }), + nodes: ({ get: (request: R, defaultValue?: ((FieldsSelection | undefined)[] | undefined)) => Observable<((FieldsSelection | undefined)[] | undefined)> }) +} + + +/** Match-level configuration */ +export interface MatchConfigPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Promise<(BracketType | undefined)> }) +} + + +/** Match-level configuration */ +export interface MatchConfigObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Observable<(BracketType | undefined)> }) +} + + +/** Race specific bracket configuration */ +export interface RaceBracketConfigPromiseChain { + automaticEndTime: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + automaticStartTime: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Promise<(Scalars['Timestamp'] | undefined)> }), + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Promise<(BracketType | undefined)> }), + goalTargetComparator: ({ get: (request?: boolean | number, defaultValue?: (Comparator | undefined)) => Promise<(Comparator | undefined)> }), + goalTargetValue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Promise<(Scalars['String'] | undefined)> }), + limitMode: ({ get: (request?: boolean | number, defaultValue?: (RaceLimitMode | undefined)) => Promise<(RaceLimitMode | undefined)> }), + limitValue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Promise<(Scalars['Int'] | undefined)> }), + raceType: ({ get: (request?: boolean | number, defaultValue?: (RaceType | undefined)) => Promise<(RaceType | undefined)> }) +} + + +/** Race specific bracket configuration */ +export interface RaceBracketConfigObservableChain { + automaticEndTime: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + automaticStartTime: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Timestamp'] | undefined)) => Observable<(Scalars['Timestamp'] | undefined)> }), + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Observable<(BracketType | undefined)> }), + goalTargetComparator: ({ get: (request?: boolean | number, defaultValue?: (Comparator | undefined)) => Observable<(Comparator | undefined)> }), + goalTargetValue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['String'] | undefined)) => Observable<(Scalars['String'] | undefined)> }), + limitMode: ({ get: (request?: boolean | number, defaultValue?: (RaceLimitMode | undefined)) => Observable<(RaceLimitMode | undefined)> }), + limitValue: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Int'] | undefined)) => Observable<(Scalars['Int'] | undefined)> }), + raceType: ({ get: (request?: boolean | number, defaultValue?: (RaceType | undefined)) => Observable<(RaceType | undefined)> }) +} + + +/** Race specific match configuration */ +export interface RaceMatchConfigPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }), + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Promise<(BracketType | undefined)> }), + + /** Can players report results? */ + playerReportingEnabled: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }), + + /** Accepted methods of verification that players can use */ + verificationMethods: ({ get: (request?: boolean | number, defaultValue?: ((MatchConfigVerificationMethod | undefined)[] | undefined)) => Promise<((MatchConfigVerificationMethod | undefined)[] | undefined)> }), + + /** Are players required to submit verification of their reported results? */ + verificationRequired: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Promise<(Scalars['Boolean'] | undefined)> }) +} + + +/** Race specific match configuration */ +export interface RaceMatchConfigObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }), + bracketType: ({ get: (request?: boolean | number, defaultValue?: (BracketType | undefined)) => Observable<(BracketType | undefined)> }), + + /** Can players report results? */ + playerReportingEnabled: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }), + + /** Accepted methods of verification that players can use */ + verificationMethods: ({ get: (request?: boolean | number, defaultValue?: ((MatchConfigVerificationMethod | undefined)[] | undefined)) => Observable<((MatchConfigVerificationMethod | undefined)[] | undefined)> }), + + /** Are players required to submit verification of their reported results? */ + verificationRequired: ({ get: (request?: boolean | number, defaultValue?: (Scalars['Boolean'] | undefined)) => Observable<(Scalars['Boolean'] | undefined)> }) +} + + +/** A set of actions available for a team to take */ +export interface TeamActionSetPromiseChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Promise<(Scalars['ID'] | undefined)> }) +} + + +/** A set of actions available for a team to take */ +export interface TeamActionSetObservableChain { + id: ({ get: (request?: boolean | number, defaultValue?: (Scalars['ID'] | undefined)) => Observable<(Scalars['ID'] | undefined)> }) +} \ No newline at end of file diff --git a/src/startgg/genql/types.cjs.js b/src/startgg/genql/types.cjs.js new file mode 100644 index 0000000..5d33e01 --- /dev/null +++ b/src/startgg/genql/types.cjs.js @@ -0,0 +1,3460 @@ +module.exports = { + "scalars": [ + 2, + 3, + 5, + 7, + 8, + 9, + 11, + 17, + 19, + 24, + 29, + 39, + 42, + 51, + 66, + 69, + 73, + 111, + 126, + 131, + 133, + 134 + ], + "types": { + "Query": { + "currentUser": [ + 1 + ], + "entrant": [ + 23, + { + "id": [ + 2, + "ID!" + ] + } + ], + "event": [ + 18, + { + "id": [ + 2 + ], + "slug": [ + 5 + ] + } + ], + "league": [ + 80, + { + "id": [ + 2 + ], + "slug": [ + 5 + ] + } + ], + "participant": [ + 35, + { + "id": [ + 2, + "ID!" + ], + "isAdmin": [ + 7 + ] + } + ], + "phase": [ + 47, + { + "id": [ + 2 + ] + } + ], + "phaseGroup": [ + 41, + { + "id": [ + 2 + ] + } + ], + "player": [ + 37, + { + "id": [ + 2, + "ID!" + ] + } + ], + "seed": [ + 46, + { + "id": [ + 2 + ] + } + ], + "set": [ + 31, + { + "id": [ + 2, + "ID!" + ] + } + ], + "shop": [ + 100, + { + "id": [ + 2 + ], + "slug": [ + 5 + ] + } + ], + "stream": [ + 65, + { + "id": [ + 2, + "ID!" + ] + } + ], + "streamQueue": [ + 64, + { + "tournamentId": [ + 2, + "ID!" + ], + "includePlayerStreams": [ + 7 + ] + } + ], + "team": [ + 71, + { + "id": [ + 2 + ], + "slug": [ + 5 + ], + "inviteCode": [ + 5 + ] + } + ], + "tournament": [ + 56, + { + "id": [ + 2 + ], + "slug": [ + 5 + ] + } + ], + "tournaments": [ + 99, + { + "query": [ + 107, + "TournamentQuery!" + ] + } + ], + "user": [ + 1, + { + "id": [ + 2 + ], + "slug": [ + 5 + ] + } + ], + "videogame": [ + 87, + { + "id": [ + 2 + ], + "slug": [ + 5 + ] + } + ], + "videogames": [ + 114, + { + "query": [ + 112, + "VideogameQuery!" + ] + } + ], + "__typename": [ + 5 + ] + }, + "User": { + "id": [ + 2 + ], + "authorizations": [ + 4, + { + "types": [ + 3, + "[SocialConnectionType]" + ] + } + ], + "bio": [ + 5 + ], + "birthday": [ + 5 + ], + "discriminator": [ + 5 + ], + "events": [ + 15, + { + "query": [ + 10 + ] + } + ], + "genderPronoun": [ + 5 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "leagues": [ + 95, + { + "query": [ + 93 + ] + } + ], + "location": [ + 96 + ], + "name": [ + 5 + ], + "player": [ + 37 + ], + "slug": [ + 5 + ], + "tournaments": [ + 99, + { + "query": [ + 97 + ] + } + ], + "__typename": [ + 5 + ] + }, + "ID": {}, + "SocialConnectionType": {}, + "ProfileAuthorization": { + "id": [ + 2 + ], + "externalId": [ + 5 + ], + "externalUsername": [ + 5 + ], + "stream": [ + 6 + ], + "type": [ + 9 + ], + "url": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "String": {}, + "Stream": { + "id": [ + 2 + ], + "isOnline": [ + 7 + ], + "name": [ + 5 + ], + "type": [ + 8 + ], + "__typename": [ + 5 + ] + }, + "Boolean": {}, + "StreamType": {}, + "AuthorizationType": {}, + "UserEventsPaginationQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 12 + ], + "__typename": [ + 5 + ] + }, + "Int": {}, + "UserEventsPaginationFilter": { + "videogameId": [ + 2 + ], + "eventType": [ + 11 + ], + "minEntrantCount": [ + 11 + ], + "maxEntrantCount": [ + 11 + ], + "location": [ + 13 + ], + "search": [ + 14 + ], + "__typename": [ + 5 + ] + }, + "LocationFilterType": { + "countryCode": [ + 5 + ], + "state": [ + 5 + ], + "city": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "PaginationSearchType": { + "fieldsToSearch": [ + 5 + ], + "searchString": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "EventConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 18 + ], + "__typename": [ + 5 + ] + }, + "PageInfo": { + "total": [ + 11 + ], + "totalPages": [ + 11 + ], + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 17 + ], + "__typename": [ + 5 + ] + }, + "JSON": {}, + "Event": { + "id": [ + 2 + ], + "checkInBuffer": [ + 11 + ], + "checkInDuration": [ + 11 + ], + "checkInEnabled": [ + 7 + ], + "competitionTier": [ + 11 + ], + "createdAt": [ + 19 + ], + "deckSubmissionDeadline": [ + 19 + ], + "entrantSizeMax": [ + 11 + ], + "entrantSizeMin": [ + 11 + ], + "entrants": [ + 22, + { + "query": [ + 20 + ] + } + ], + "hasDecks": [ + 7 + ], + "hasTasks": [ + 7 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "isOnline": [ + 7 + ], + "league": [ + 80 + ], + "matchRulesMarkdown": [ + 5 + ], + "name": [ + 5 + ], + "numEntrants": [ + 11 + ], + "phaseGroups": [ + 41 + ], + "phases": [ + 47, + { + "state": [ + 51 + ], + "phaseId": [ + 2 + ] + } + ], + "prizingInfo": [ + 17 + ], + "publishing": [ + 17 + ], + "rulesMarkdown": [ + 5 + ], + "rulesetId": [ + 11 + ], + "rulesetSettings": [ + 17 + ], + "sets": [ + 30, + { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortType": [ + 24 + ], + "filters": [ + 25 + ] + } + ], + "slug": [ + 5 + ], + "standings": [ + 78, + { + "query": [ + 89, + "StandingPaginationQuery!" + ] + } + ], + "startAt": [ + 19 + ], + "state": [ + 51 + ], + "stations": [ + 62, + { + "query": [ + 91 + ] + } + ], + "teamManagementDeadline": [ + 19 + ], + "teamNameAllowed": [ + 7 + ], + "teamRosterSize": [ + 92 + ], + "tournament": [ + 56 + ], + "type": [ + 11 + ], + "updatedAt": [ + 19 + ], + "useEventSeeds": [ + 7 + ], + "videogame": [ + 87 + ], + "waves": [ + 52, + { + "phaseId": [ + 2 + ] + } + ], + "__typename": [ + 5 + ] + }, + "Timestamp": {}, + "EventEntrantPageQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 21 + ], + "__typename": [ + 5 + ] + }, + "EventEntrantPageQueryFilter": { + "name": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "EntrantConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 23 + ], + "__typename": [ + 5 + ] + }, + "Entrant": { + "id": [ + 2 + ], + "event": [ + 18 + ], + "initialSeedNum": [ + 11 + ], + "isDisqualified": [ + 7 + ], + "name": [ + 5 + ], + "paginatedSets": [ + 30, + { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortType": [ + 24 + ], + "filters": [ + 25 + ] + } + ], + "participants": [ + 35 + ], + "seeds": [ + 46 + ], + "skill": [ + 11 + ], + "standing": [ + 54 + ], + "stream": [ + 65 + ], + "streams": [ + 65 + ], + "team": [ + 71 + ], + "__typename": [ + 5 + ] + }, + "SetSortType": {}, + "SetFilters": { + "entrantIds": [ + 2 + ], + "entrantSize": [ + 11 + ], + "hasVod": [ + 7 + ], + "hideEmpty": [ + 7 + ], + "showByes": [ + 7 + ], + "isEventOnline": [ + 7 + ], + "location": [ + 26 + ], + "participantIds": [ + 2 + ], + "phaseGroupIds": [ + 2 + ], + "phaseIds": [ + 2 + ], + "eventIds": [ + 2 + ], + "tournamentIds": [ + 2 + ], + "playerIds": [ + 2 + ], + "roundNumber": [ + 11 + ], + "state": [ + 11 + ], + "stationIds": [ + 2 + ], + "stationNumbers": [ + 11 + ], + "updatedAfter": [ + 19 + ], + "__typename": [ + 5 + ] + }, + "SetFilterLocation": { + "state": [ + 5 + ], + "country": [ + 5 + ], + "distanceFrom": [ + 27 + ], + "__typename": [ + 5 + ] + }, + "SetFilterLocationDistanceFrom": { + "point": [ + 28 + ], + "radius": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "SetFilterLocationDistanceFromPoint": { + "lat": [ + 29 + ], + "lon": [ + 29 + ], + "__typename": [ + 5 + ] + }, + "Float": {}, + "SetConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 31 + ], + "__typename": [ + 5 + ] + }, + "Set": { + "id": [ + 2 + ], + "completedAt": [ + 19 + ], + "createdAt": [ + 19 + ], + "displayScore": [ + 5, + { + "mainEntrantId": [ + 2 + ] + } + ], + "event": [ + 18 + ], + "fullRoundText": [ + 5 + ], + "game": [ + 32, + { + "orderNum": [ + 11, + "Int!" + ] + } + ], + "games": [ + 32 + ], + "hasPlaceholder": [ + 7 + ], + "identifier": [ + 5 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "lPlacement": [ + 11 + ], + "phaseGroup": [ + 41 + ], + "round": [ + 11 + ], + "setGamesType": [ + 11 + ], + "slots": [ + 79, + { + "includeByes": [ + 7 + ] + } + ], + "startAt": [ + 19 + ], + "startedAt": [ + 19 + ], + "state": [ + 11 + ], + "station": [ + 63 + ], + "stream": [ + 65 + ], + "totalGames": [ + 11 + ], + "vodUrl": [ + 5 + ], + "wPlacement": [ + 11 + ], + "winnerId": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "Game": { + "id": [ + 2 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "orderNum": [ + 11 + ], + "selections": [ + 34 + ], + "stage": [ + 40 + ], + "state": [ + 11 + ], + "winnerId": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "Image": { + "id": [ + 2 + ], + "height": [ + 29 + ], + "ratio": [ + 29 + ], + "type": [ + 5 + ], + "url": [ + 5 + ], + "width": [ + 29 + ], + "__typename": [ + 5 + ] + }, + "GameSelection": { + "id": [ + 2 + ], + "entrant": [ + 23 + ], + "orderNum": [ + 11 + ], + "participant": [ + 35 + ], + "selectionType": [ + 39 + ], + "selectionValue": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "Participant": { + "id": [ + 2 + ], + "checkedIn": [ + 7 + ], + "checkedInAt": [ + 19 + ], + "connectedAccounts": [ + 17 + ], + "contactInfo": [ + 36 + ], + "email": [ + 5 + ], + "entrants": [ + 23 + ], + "events": [ + 18 + ], + "gamerTag": [ + 5 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "player": [ + 37 + ], + "prefix": [ + 5 + ], + "requiredConnections": [ + 4 + ], + "user": [ + 1 + ], + "verified": [ + 7 + ], + "__typename": [ + 5 + ] + }, + "ContactInfo": { + "id": [ + 2 + ], + "city": [ + 5 + ], + "country": [ + 5 + ], + "countryId": [ + 11 + ], + "name": [ + 5 + ], + "nameFirst": [ + 5 + ], + "nameLast": [ + 5 + ], + "state": [ + 5 + ], + "stateId": [ + 11 + ], + "zipcode": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "Player": { + "id": [ + 2 + ], + "gamerTag": [ + 5 + ], + "prefix": [ + 5 + ], + "rankings": [ + 38, + { + "limit": [ + 11 + ], + "videogameId": [ + 2 + ] + } + ], + "recentSets": [ + 31, + { + "opponentId": [ + 2 + ] + } + ], + "sets": [ + 30, + { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "filters": [ + 25 + ] + } + ], + "user": [ + 1 + ], + "__typename": [ + 5 + ] + }, + "PlayerRank": { + "id": [ + 2 + ], + "rank": [ + 11 + ], + "title": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "GameSelectionType": {}, + "Stage": { + "id": [ + 2 + ], + "name": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "PhaseGroup": { + "id": [ + 2 + ], + "bracketType": [ + 42 + ], + "displayIdentifier": [ + 5 + ], + "firstRoundTime": [ + 19 + ], + "numRounds": [ + 11 + ], + "paginatedSeeds": [ + 45, + { + "query": [ + 43, + "SeedPaginationQuery!" + ], + "eventId": [ + 2 + ] + } + ], + "paginatedSets": [ + 30, + { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortType": [ + 24 + ], + "filters": [ + 25 + ] + } + ], + "phase": [ + 47 + ], + "progressionsOut": [ + 53 + ], + "rounds": [ + 76 + ], + "seedMap": [ + 17 + ], + "seeds": [ + 45, + { + "query": [ + 43, + "SeedPaginationQuery!" + ], + "eventId": [ + 2 + ] + } + ], + "sets": [ + 30, + { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortType": [ + 24 + ], + "filters": [ + 25 + ] + } + ], + "standings": [ + 78, + { + "query": [ + 77 + ] + } + ], + "startAt": [ + 19 + ], + "state": [ + 11 + ], + "tiebreakOrder": [ + 17 + ], + "wave": [ + 52 + ], + "__typename": [ + 5 + ] + }, + "BracketType": {}, + "SeedPaginationQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 44 + ], + "__typename": [ + 5 + ] + }, + "SeedPageFilter": { + "id": [ + 2 + ], + "entrantName": [ + 5 + ], + "checkInState": [ + 11 + ], + "phaseGroupId": [ + 2 + ], + "eventCheckInGroupId": [ + 2 + ], + "phaseId": [ + 2 + ], + "eventId": [ + 2 + ], + "search": [ + 14 + ], + "__typename": [ + 5 + ] + }, + "SeedConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 46 + ], + "__typename": [ + 5 + ] + }, + "Seed": { + "id": [ + 2 + ], + "checkedInParticipants": [ + 17 + ], + "entrant": [ + 23 + ], + "groupSeedNum": [ + 11 + ], + "isBye": [ + 7 + ], + "phase": [ + 47 + ], + "phaseGroup": [ + 41 + ], + "placeholderName": [ + 5 + ], + "placement": [ + 11 + ], + "players": [ + 37 + ], + "progressionSeedId": [ + 11 + ], + "progressionSource": [ + 53 + ], + "seedNum": [ + 11 + ], + "setRecordWithoutByes": [ + 17, + { + "phaseGroupId": [ + 2, + "ID!" + ] + } + ], + "standings": [ + 54, + { + "containerType": [ + 5 + ] + } + ], + "__typename": [ + 5 + ] + }, + "Phase": { + "id": [ + 2 + ], + "bracketType": [ + 42 + ], + "event": [ + 18 + ], + "groupCount": [ + 11 + ], + "isExhibition": [ + 7 + ], + "name": [ + 5 + ], + "numSeeds": [ + 11 + ], + "paginatedSeeds": [ + 45, + { + "query": [ + 43, + "SeedPaginationQuery!" + ], + "eventId": [ + 2 + ] + } + ], + "phaseGroups": [ + 50, + { + "query": [ + 48 + ] + } + ], + "phaseOrder": [ + 11 + ], + "seeds": [ + 45, + { + "query": [ + 43, + "SeedPaginationQuery!" + ], + "eventId": [ + 2 + ] + } + ], + "sets": [ + 30, + { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortType": [ + 24 + ], + "filters": [ + 25 + ] + } + ], + "state": [ + 51 + ], + "waves": [ + 52 + ], + "__typename": [ + 5 + ] + }, + "PhaseGroupPageQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "entrantIds": [ + 2 + ], + "filter": [ + 49 + ], + "__typename": [ + 5 + ] + }, + "PhaseGroupPageQueryFilter": { + "id": [ + 2 + ], + "waveId": [ + 2 + ], + "__typename": [ + 5 + ] + }, + "PhaseGroupConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 41 + ], + "__typename": [ + 5 + ] + }, + "ActivityState": {}, + "Wave": { + "id": [ + 2 + ], + "identifier": [ + 5 + ], + "startAt": [ + 19 + ], + "__typename": [ + 5 + ] + }, + "Progression": { + "id": [ + 2 + ], + "originOrder": [ + 11 + ], + "originPhase": [ + 47 + ], + "originPhaseGroup": [ + 41 + ], + "originPlacement": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "Standing": { + "id": [ + 2 + ], + "container": [ + 55 + ], + "entrant": [ + 23 + ], + "isFinal": [ + 7 + ], + "metadata": [ + 17 + ], + "placement": [ + 11 + ], + "player": [ + 37 + ], + "standing": [ + 11 + ], + "stats": [ + 74 + ], + "totalPoints": [ + 29 + ], + "__typename": [ + 5 + ] + }, + "StandingContainer": { + "on_Tournament": [ + 56 + ], + "on_Event": [ + 18 + ], + "on_PhaseGroup": [ + 41 + ], + "on_Set": [ + 31 + ], + "__typename": [ + 5 + ] + }, + "Tournament": { + "id": [ + 2 + ], + "addrState": [ + 5 + ], + "admins": [ + 1, + { + "roles": [ + 5, + "[String]" + ] + } + ], + "city": [ + 5 + ], + "countryCode": [ + 5 + ], + "createdAt": [ + 19 + ], + "currency": [ + 5 + ], + "endAt": [ + 19 + ], + "eventRegistrationClosesAt": [ + 19 + ], + "events": [ + 18, + { + "limit": [ + 11 + ], + "filter": [ + 57 + ] + } + ], + "hasOfflineEvents": [ + 7 + ], + "hasOnlineEvents": [ + 7 + ], + "hashtag": [ + 5 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "isOnline": [ + 7 + ], + "isRegistrationOpen": [ + 7 + ], + "lat": [ + 29 + ], + "links": [ + 58 + ], + "lng": [ + 29 + ], + "mapsPlaceId": [ + 5 + ], + "name": [ + 5 + ], + "numAttendees": [ + 11 + ], + "owner": [ + 1 + ], + "participants": [ + 61, + { + "query": [ + 59, + "ParticipantPaginationQuery!" + ], + "isAdmin": [ + 7 + ] + } + ], + "postalCode": [ + 5 + ], + "primaryContact": [ + 5 + ], + "primaryContactType": [ + 5 + ], + "publishing": [ + 17 + ], + "registrationClosesAt": [ + 19 + ], + "rules": [ + 5 + ], + "shortSlug": [ + 5 + ], + "slug": [ + 5 + ], + "startAt": [ + 19 + ], + "state": [ + 11 + ], + "stations": [ + 62, + { + "page": [ + 11 + ], + "perPage": [ + 11 + ] + } + ], + "streamQueue": [ + 64 + ], + "streams": [ + 65 + ], + "teamCreationClosesAt": [ + 19 + ], + "teams": [ + 70, + { + "query": [ + 67, + "TeamPaginationQuery!" + ] + } + ], + "timezone": [ + 5 + ], + "tournamentType": [ + 11 + ], + "updatedAt": [ + 19 + ], + "url": [ + 5, + { + "tab": [ + 5 + ], + "relative": [ + 7 + ] + } + ], + "venueAddress": [ + 5 + ], + "venueName": [ + 5 + ], + "waves": [ + 52 + ], + "__typename": [ + 5 + ] + }, + "EventFilter": { + "videogameId": [ + 2 + ], + "type": [ + 11 + ], + "published": [ + 7 + ], + "__typename": [ + 5 + ] + }, + "TournamentLinks": { + "facebook": [ + 5 + ], + "discord": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "ParticipantPaginationQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 60 + ], + "__typename": [ + 5 + ] + }, + "ParticipantPageFilter": { + "id": [ + 2 + ], + "ids": [ + 2 + ], + "eventIds": [ + 2 + ], + "search": [ + 14 + ], + "gamerTag": [ + 5 + ], + "unpaid": [ + 7 + ], + "incompleteTeam": [ + 7 + ], + "missingDeck": [ + 7 + ], + "checkedIn": [ + 7 + ], + "notCheckedIn": [ + 7 + ], + "__typename": [ + 5 + ] + }, + "ParticipantConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 35 + ], + "__typename": [ + 5 + ] + }, + "StationsConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 63 + ], + "__typename": [ + 5 + ] + }, + "Stations": { + "id": [ + 2 + ], + "canAutoAssign": [ + 7 + ], + "clusterNumber": [ + 5 + ], + "clusterPrefix": [ + 11 + ], + "enabled": [ + 7 + ], + "identifier": [ + 11 + ], + "numSetups": [ + 11 + ], + "number": [ + 11 + ], + "prefix": [ + 5 + ], + "queue": [ + 17 + ], + "queueDepth": [ + 11 + ], + "state": [ + 11 + ], + "updatedAt": [ + 19 + ], + "__typename": [ + 5 + ] + }, + "StreamQueue": { + "id": [ + 5 + ], + "sets": [ + 31 + ], + "stream": [ + 65 + ], + "__typename": [ + 5 + ] + }, + "Streams": { + "id": [ + 2 + ], + "enabled": [ + 7 + ], + "followerCount": [ + 11 + ], + "isOnline": [ + 7 + ], + "numSetups": [ + 11 + ], + "parentStreamId": [ + 11 + ], + "streamGame": [ + 5 + ], + "streamId": [ + 5 + ], + "streamLogo": [ + 5 + ], + "streamName": [ + 5 + ], + "streamSource": [ + 66 + ], + "streamStatus": [ + 5 + ], + "streamType": [ + 11 + ], + "streamTypeId": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "StreamSource": {}, + "TeamPaginationQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 68 + ], + "__typename": [ + 5 + ] + }, + "TeamPaginationFilter": { + "globalTeamId": [ + 2 + ], + "eventState": [ + 51 + ], + "eventId": [ + 2 + ], + "eventIds": [ + 2 + ], + "minEntrantCount": [ + 11 + ], + "maxEntrantCount": [ + 11 + ], + "search": [ + 14 + ], + "type": [ + 11 + ], + "tournamentId": [ + 2 + ], + "memberStatus": [ + 69 + ], + "videogameId": [ + 2 + ], + "isLeague": [ + 7 + ], + "upcoming": [ + 7 + ], + "past": [ + 7 + ], + "rosterComplete": [ + 7 + ], + "rosterIncomplete": [ + 7 + ], + "__typename": [ + 5 + ] + }, + "TeamMemberStatus": {}, + "TeamConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 71 + ], + "__typename": [ + 5 + ] + }, + "Team": { + "id": [ + 2 + ], + "discriminator": [ + 5 + ], + "entrant": [ + 23 + ], + "event": [ + 18 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "members": [ + 72, + { + "status": [ + 69, + "[TeamMemberStatus]" + ] + } + ], + "name": [ + 5 + ], + "on_EventTeam": [ + 127 + ], + "on_GlobalTeam": [ + 128 + ], + "__typename": [ + 5 + ] + }, + "TeamMember": { + "id": [ + 2 + ], + "isAlternate": [ + 7 + ], + "isCaptain": [ + 7 + ], + "memberType": [ + 73 + ], + "participant": [ + 35 + ], + "player": [ + 37 + ], + "status": [ + 69 + ], + "__typename": [ + 5 + ] + }, + "TeamMemberType": {}, + "StandingStats": { + "score": [ + 75 + ], + "__typename": [ + 5 + ] + }, + "Score": { + "label": [ + 5 + ], + "value": [ + 29 + ], + "displayValue": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "Round": { + "id": [ + 2 + ], + "bestOf": [ + 11 + ], + "number": [ + 11 + ], + "startAt": [ + 19 + ], + "__typename": [ + 5 + ] + }, + "StandingGroupStandingPageFilter": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "StandingConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 54 + ], + "__typename": [ + 5 + ] + }, + "SetSlot": { + "id": [ + 2 + ], + "entrant": [ + 23 + ], + "prereqId": [ + 5 + ], + "prereqPlacement": [ + 11 + ], + "prereqType": [ + 5 + ], + "seed": [ + 46 + ], + "slotIndex": [ + 11 + ], + "standing": [ + 54 + ], + "__typename": [ + 5 + ] + }, + "League": { + "id": [ + 2 + ], + "addrState": [ + 5 + ], + "city": [ + 5 + ], + "countryCode": [ + 5 + ], + "createdAt": [ + 19 + ], + "currency": [ + 5 + ], + "endAt": [ + 19 + ], + "entrantCount": [ + 11 + ], + "eventOwners": [ + 82, + { + "query": [ + 81 + ] + } + ], + "eventRegistrationClosesAt": [ + 19 + ], + "events": [ + 15, + { + "query": [ + 84 + ] + } + ], + "finalEventId": [ + 11 + ], + "hasOfflineEvents": [ + 7 + ], + "hasOnlineEvents": [ + 7 + ], + "hashtag": [ + 5 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "isOnline": [ + 7 + ], + "lat": [ + 29 + ], + "links": [ + 58 + ], + "lng": [ + 29 + ], + "mapsPlaceId": [ + 5 + ], + "name": [ + 5 + ], + "numProgressingToFinalEvent": [ + 11 + ], + "numUniquePlayers": [ + 11 + ], + "postalCode": [ + 5 + ], + "primaryContact": [ + 5 + ], + "primaryContactType": [ + 5 + ], + "publishing": [ + 17 + ], + "registrationClosesAt": [ + 19 + ], + "rules": [ + 5 + ], + "shortSlug": [ + 5 + ], + "showStandings": [ + 7 + ], + "slug": [ + 5 + ], + "standings": [ + 78, + { + "query": [ + 77 + ] + } + ], + "startAt": [ + 19 + ], + "state": [ + 11 + ], + "teamCreationClosesAt": [ + 19 + ], + "tiers": [ + 86 + ], + "timezone": [ + 5 + ], + "tournamentType": [ + 11 + ], + "updatedAt": [ + 19 + ], + "url": [ + 5, + { + "tab": [ + 5 + ], + "relative": [ + 7 + ] + } + ], + "venueAddress": [ + 5 + ], + "venueName": [ + 5 + ], + "videogames": [ + 87 + ], + "__typename": [ + 5 + ] + }, + "EventOwnersQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "EventOwnerConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 83 + ], + "__typename": [ + 5 + ] + }, + "EventOwner": { + "eventId": [ + 2 + ], + "email": [ + 5 + ], + "gamerTag": [ + 5 + ], + "fullName": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "LeagueEventsQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 85 + ], + "__typename": [ + 5 + ] + }, + "LeagueEventsFilter": { + "search": [ + 14 + ], + "pointMappingGroupIds": [ + 2 + ], + "tierIds": [ + 2 + ], + "userId": [ + 2 + ], + "upcoming": [ + 7 + ], + "leagueEntrantId": [ + 2 + ], + "__typename": [ + 5 + ] + }, + "EventTier": { + "id": [ + 2 + ], + "name": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "Videogame": { + "id": [ + 2 + ], + "characters": [ + 88 + ], + "displayName": [ + 5 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "name": [ + 5 + ], + "slug": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "Character": { + "id": [ + 2 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "name": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "StandingPaginationQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 90 + ], + "__typename": [ + 5 + ] + }, + "StandingPageFilter": { + "id": [ + 2 + ], + "ids": [ + 2 + ], + "search": [ + 14 + ], + "__typename": [ + 5 + ] + }, + "StationFilter": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "TeamRosterSize": { + "maxAlternates": [ + 11 + ], + "maxPlayers": [ + 11 + ], + "minAlternates": [ + 11 + ], + "minPlayers": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "UserLeaguesPaginationQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 94 + ], + "__typename": [ + 5 + ] + }, + "UserLeaguesPaginationFilter": { + "videogameId": [ + 2 + ], + "upcoming": [ + 7 + ], + "past": [ + 7 + ], + "search": [ + 14 + ], + "__typename": [ + 5 + ] + }, + "LeagueConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 80 + ], + "__typename": [ + 5 + ] + }, + "Address": { + "id": [ + 2 + ], + "city": [ + 5 + ], + "country": [ + 5 + ], + "countryId": [ + 11 + ], + "state": [ + 5 + ], + "stateId": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "UserTournamentsPaginationQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 98 + ], + "__typename": [ + 5 + ] + }, + "UserTournamentsPaginationFilter": { + "past": [ + 7 + ], + "upcoming": [ + 7 + ], + "search": [ + 14 + ], + "videogameId": [ + 2 + ], + "tournamentView": [ + 5 + ], + "excludeId": [ + 2 + ], + "__typename": [ + 5 + ] + }, + "TournamentConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 56 + ], + "__typename": [ + 5 + ] + }, + "Shop": { + "id": [ + 2 + ], + "levels": [ + 102, + { + "query": [ + 101 + ] + } + ], + "messages": [ + 105, + { + "query": [ + 104 + ] + } + ], + "name": [ + 5 + ], + "slug": [ + 5 + ], + "url": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "ShopLevelsQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "ShopLevelConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 103 + ], + "__typename": [ + 5 + ] + }, + "ShopLevel": { + "id": [ + 2 + ], + "currAmount": [ + 29 + ], + "description": [ + 5 + ], + "goalAmount": [ + 29 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "name": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "ShopOrderMessagesQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "ShopOrderMessageConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 106 + ], + "__typename": [ + 5 + ] + }, + "ShopOrderMessage": { + "id": [ + 2 + ], + "gamertag": [ + 5 + ], + "message": [ + 5 + ], + "name": [ + 5 + ], + "player": [ + 37 + ], + "total": [ + 29 + ], + "__typename": [ + 5 + ] + }, + "TournamentQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 108 + ], + "sort": [ + 111 + ], + "__typename": [ + 5 + ] + }, + "TournamentPageFilter": { + "id": [ + 2 + ], + "ids": [ + 2 + ], + "ownerId": [ + 2 + ], + "isCurrentUserAdmin": [ + 7 + ], + "countryCode": [ + 5 + ], + "addrState": [ + 5 + ], + "location": [ + 109 + ], + "afterDate": [ + 19 + ], + "beforeDate": [ + 19 + ], + "computedUpdatedAt": [ + 19 + ], + "name": [ + 5 + ], + "venueName": [ + 5 + ], + "isFeatured": [ + 7 + ], + "isLeague": [ + 7 + ], + "hasBannerImages": [ + 7 + ], + "activeShops": [ + 7 + ], + "regOpen": [ + 7 + ], + "past": [ + 7 + ], + "published": [ + 7 + ], + "publiclySearchable": [ + 7 + ], + "staffPicks": [ + 7 + ], + "hasOnlineEvents": [ + 7 + ], + "topGames": [ + 110 + ], + "upcoming": [ + 7 + ], + "videogameIds": [ + 2 + ], + "sortByScore": [ + 7 + ], + "__typename": [ + 5 + ] + }, + "TournamentLocationFilter": { + "distanceFrom": [ + 5 + ], + "distance": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "TopGameFilter": { + "gameNums": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "TournamentPaginationSort": {}, + "VideogameQuery": { + "page": [ + 11 + ], + "perPage": [ + 11 + ], + "sortBy": [ + 5 + ], + "filter": [ + 113 + ], + "__typename": [ + 5 + ] + }, + "VideogamePageFilter": { + "id": [ + 2 + ], + "name": [ + 5 + ], + "forUser": [ + 2 + ], + "__typename": [ + 5 + ] + }, + "VideogameConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 87 + ], + "__typename": [ + 5 + ] + }, + "Mutation": { + "deletePhase": [ + 7, + { + "phaseId": [ + 2, + "ID!" + ] + } + ], + "deleteStation": [ + 7, + { + "stationId": [ + 2, + "ID!" + ] + } + ], + "deleteWave": [ + 7, + { + "waveId": [ + 2, + "ID!" + ] + } + ], + "resolveScheduleConflicts": [ + 46, + { + "tournamentId": [ + 2, + "ID!" + ], + "options": [ + 116 + ] + } + ], + "swapSeeds": [ + 46, + { + "phaseId": [ + 2, + "ID!" + ], + "seed1Id": [ + 2, + "ID!" + ], + "seed2Id": [ + 2, + "ID!" + ] + } + ], + "updatePhaseGroups": [ + 41, + { + "groupConfigs": [ + 118, + "[PhaseGroupUpdateInput]!" + ] + } + ], + "updatePhaseSeeding": [ + 47, + { + "phaseId": [ + 2, + "ID!" + ], + "seedMapping": [ + 119, + "[UpdatePhaseSeedInfo]!" + ], + "options": [ + 120 + ] + } + ], + "upsertPhase": [ + 47, + { + "phaseId": [ + 2 + ], + "eventId": [ + 2 + ], + "payload": [ + 121, + "PhaseUpsertInput!" + ] + } + ], + "upsertStation": [ + 63, + { + "stationId": [ + 2 + ], + "tournamentId": [ + 2 + ], + "fields": [ + 122, + "StationUpsertInput!" + ] + } + ], + "upsertWave": [ + 52, + { + "waveId": [ + 2 + ], + "tournamentId": [ + 2 + ], + "fields": [ + 123, + "WaveUpsertInput!" + ] + } + ], + "__typename": [ + 5 + ] + }, + "ResolveConflictsOptions": { + "lockedSeeds": [ + 117 + ], + "__typename": [ + 5 + ] + }, + "ResolveConflictsLockedSeedConfig": { + "eventId": [ + 2 + ], + "numSeeds": [ + 11 + ], + "__typename": [ + 5 + ] + }, + "PhaseGroupUpdateInput": { + "phaseGroupId": [ + 2 + ], + "stationId": [ + 2 + ], + "waveId": [ + 2 + ], + "__typename": [ + 5 + ] + }, + "UpdatePhaseSeedInfo": { + "seedId": [ + 2 + ], + "seedNum": [ + 2 + ], + "phaseGroupId": [ + 2 + ], + "__typename": [ + 5 + ] + }, + "UpdatePhaseSeedingOptions": { + "strictMode": [ + 7 + ], + "__typename": [ + 5 + ] + }, + "PhaseUpsertInput": { + "name": [ + 5 + ], + "groupCount": [ + 11 + ], + "bracketType": [ + 42 + ], + "__typename": [ + 5 + ] + }, + "StationUpsertInput": { + "number": [ + 11 + ], + "clusterId": [ + 2 + ], + "__typename": [ + 5 + ] + }, + "WaveUpsertInput": { + "identifier": [ + 5 + ], + "startAt": [ + 19 + ], + "endAt": [ + 19 + ], + "__typename": [ + 5 + ] + }, + "ActionSet": { + "id": [ + 2 + ], + "on_TeamActionSet": [ + 136 + ], + "__typename": [ + 5 + ] + }, + "BracketConfig": { + "id": [ + 2 + ], + "bracketType": [ + 42 + ], + "on_RaceBracketConfig": [ + 132 + ], + "__typename": [ + 5 + ] + }, + "Comparator": {}, + "EventTeam": { + "id": [ + 2 + ], + "discriminator": [ + 5 + ], + "entrant": [ + 23 + ], + "event": [ + 18 + ], + "globalTeam": [ + 128 + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "members": [ + 72, + { + "status": [ + 69, + "[TeamMemberStatus]" + ] + } + ], + "name": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "GlobalTeam": { + "id": [ + 2 + ], + "discriminator": [ + 5 + ], + "entrant": [ + 23 + ], + "event": [ + 18 + ], + "eventTeams": [ + 129, + { + "query": [ + 67 + ] + } + ], + "images": [ + 33, + { + "type": [ + 5 + ] + } + ], + "leagueTeams": [ + 129, + { + "query": [ + 67 + ] + } + ], + "members": [ + 72, + { + "status": [ + 69, + "[TeamMemberStatus]" + ] + } + ], + "name": [ + 5 + ], + "__typename": [ + 5 + ] + }, + "EventTeamConnection": { + "pageInfo": [ + 16 + ], + "nodes": [ + 127 + ], + "__typename": [ + 5 + ] + }, + "MatchConfig": { + "id": [ + 2 + ], + "bracketType": [ + 42 + ], + "on_RaceMatchConfig": [ + 135 + ], + "__typename": [ + 5 + ] + }, + "MatchConfigVerificationMethod": {}, + "RaceBracketConfig": { + "automaticEndTime": [ + 19 + ], + "id": [ + 2 + ], + "automaticStartTime": [ + 19 + ], + "bracketType": [ + 42 + ], + "goalTargetComparator": [ + 126 + ], + "goalTargetValue": [ + 5 + ], + "limitMode": [ + 133 + ], + "limitValue": [ + 11 + ], + "raceType": [ + 134 + ], + "__typename": [ + 5 + ] + }, + "RaceLimitMode": {}, + "RaceType": {}, + "RaceMatchConfig": { + "id": [ + 2 + ], + "bracketType": [ + 42 + ], + "playerReportingEnabled": [ + 7 + ], + "verificationMethods": [ + 131 + ], + "verificationRequired": [ + 7 + ], + "__typename": [ + 5 + ] + }, + "TeamActionSet": { + "id": [ + 2 + ], + "__typename": [ + 5 + ] + } + } +} \ No newline at end of file diff --git a/src/types/characters.ts b/src/types/characters.ts new file mode 100644 index 0000000..598085c --- /dev/null +++ b/src/types/characters.ts @@ -0,0 +1,98 @@ +import { client } from "../main"; +import { Indexable } from "./global" + +export namespace Characters { + const characters = { + "1271": "tbbayo", + "1272": "tbbowserjr", + "1273": "tbbowser", + "1274": "tbfalcon", + "1275": "tbcloud", + "1276": "tbcorrin", + "1277": "tbdaisy", + "1278": "tbdarkpit", + "1279": "tbdiddy", + "1280": "tbkong", + "1282": "tbdrmario", + "1283": "tbduckhunt", + "1285": "tbfalco", + "1286": "tbfox", + "1287": "tbganon", + "1289": "tbgreninja", + "1290": "tbicies", + "1291": "tbike", + "1292": "tbinkling", + "1293": "tbpuff", + "1294": "tbdedede", + "1295": "tbkirby", + "1296": "tblink", + "1297": "tbmac", + "1298": "tblucario", + "1299": "tblucas", + "1300": "tblucina", + "1301": "tbluigi", + "1302": "tbmario", + "1304": "tbmarth", + "1305": "tbmega", + "1307": "tbmeta", + "1310": "tbmewtwo", + "1311": "tbbrawler", + "1313": "tbness", + "1314": "tbolimar", + "1315": "tbpacman", + "1316": "tbpalu", + "1317": "tbpeach", + "1318": "tbpichu", + "1319": "tbpika", + "1320": "tbpit", + "1321": "tbpkmnt", + "1322": "tbridley", + "1323": "tbrob", + "1324": "tbrobin", + "1325": "tbrosa", + "1326": "tbroy", + "1327": "tbryu", + "1328": "tbsamus", + "1329": "tbsheik", + "1330": "tbshulk", + "1331": "tbsnake", + "1332": "tbsonic", + "1333": "tbtink", + "1334": "tbvillager", + "1335": "tbwario", + "1336": "tbwiifit", + "1337": "tbwolf", + "1338": "tbyoshi", + "1339": "tbyink", + "1340": "tbzelda", + "1341": "tbzerosuit", + "1405": "tbgandw", + "1406": "tbincin", + "1407": "tbkrool", + "1408": "tbdsamus", + "1409": "tbchrom", + "1410": "tbken", + "1411": "tbsimon", + "1412": "tbrichter", + "1413": "tbisabelle", + "1414": "tbsword", + "1415": "tbgunner", + "1441": "tbplant", + "1453": "tbjoker", + "1526": "tbhero", + "1530": "tbbanjo", + "1532": "tbterry", + "1539": "tbbyleth", + "1746": "tbrandom", + "1747": "tbminmin", + "1766": "tbsteve", + "1777": "tbseph", + "1795": "tbpythra", + "1846": "tbkazuya", + "1897": "tbsora" + } as Indexable + + export const getEmojiFromId = (id: string) => { + return client.emojis.cache.find(e => e.name === characters[id]); + } +} diff --git a/src/types/client.ts b/src/types/client.ts new file mode 100644 index 0000000..7115238 --- /dev/null +++ b/src/types/client.ts @@ -0,0 +1,51 @@ +import { Client, Collection } from "discord.js"; +import { Accounts } from "../../database/models/accounts"; +import { StartggAPI } from "../startgg/api"; +import { Tournament, User } from "../startgg/genql"; + +export class TournaBotClient extends Client { + commands: Collection; + + async startReminderLoop() { + const iterateNext = () => { + count++; + console.log(`Reminder loop iteration ${count}`); + this.setReminders(); + } + + let count = 0; + + iterateNext(); + setInterval(iterateNext, 3600000); + } + + private async setReminders() { + const accounts = await Accounts.find({ remind: true }); + for (const account of accounts) { + const data = await StartggAPI.getUserUpcomingTournaments(account.slug); + if (!data) continue; + const user = data.user as User; + for (const tournament of user.tournaments.nodes) { + const startAt = tournament.startAt * 1000; + const difference = startAt - Date.now(); + if (difference <= 7200000 && difference >= 3600000) setTimeout(() => this.remind(account.discordId, tournament), difference - 3600000); + } + } + } + + async remind(discordId: string, tournament: Tournament) { + + } +} + +export interface Command { + name: String; + description: String; + execute: Function; + show: Boolean; + commandExecute: Function; + messageComponentExecute: Function; + canRunInDMs: boolean; + adminRequired: boolean; + defer: boolean; +} diff --git a/src/types/global.ts b/src/types/global.ts new file mode 100644 index 0000000..27aef2d --- /dev/null +++ b/src/types/global.ts @@ -0,0 +1,11 @@ + +export interface DataEntry { + updateAll(): Promise; + updateCache(): Promise; + updateDatabase(): Promise; +} + +export interface Indexable { + [key: string]: any; +} + diff --git a/src/types/guild.ts b/src/types/guild.ts new file mode 100644 index 0000000..36b765b --- /dev/null +++ b/src/types/guild.ts @@ -0,0 +1,136 @@ +import { Channel, Guild } from "discord.js"; +import { Guilds } from "../../database/models/guilds"; +import { cache, client } from "../main"; +import { DataEntry } from "./global"; + +export namespace GuildManager { + export const get = async (guildId: string) => { + return await getCache(guildId) || await getDatabase(guildId); + } + + const getCache = async (guildId: string) => { + const data = JSON.parse(await cache.get(`guild:${guildId}`) + .catch(err => console.error('Retrieve Cache Guild', err)) || null); + return data ? new TournaBotGuild(data) : null; + } + + const getDatabase = async (guildId: string) => { + const data = await Guilds.findOne({ guildId: guildId }) + .catch(err => console.error('Retrieve Database Guild', err)); + if (data) { + const guild = new TournaBotGuild(data); + await guild.updateCache(); + return guild; + } else return await create({ + guildId: guildId + } as TournaBotGuildData); + } + + export const create = async (data: TournaBotGuildData) => { + const guild = new TournaBotGuild(data); + await guild.updateAll(); + return guild; + } + + export const remove = async (guildId: string) => { + await cache.del(`matchmaking:${guildId}`) + .catch(err => console.error('Delete Cache Guild', err)); + return await Guilds.deleteOne({ guildId: guildId }) + .catch(err => console.error('Delete Database Guild', err)); + } +} + +export interface TournaBotGuildData extends DataEntry { + guildId: string; + locale: string; + timezone: string; + activeTournament: string; + channels: TournaBotDiscordData[]; + roles: TournaBotDiscordData[]; + allowlist: string[]; +} + +export interface TournaBotDiscordData { + type: string; + id: string; +} + +export class TournaBotGuild implements TournaBotGuildData { + guildId: string; + locale: string; + timezone: string; + activeTournament: string; + channels: TournaBotDiscordData[]; + roles: TournaBotDiscordData[]; + allowlist: string[]; + + constructor(data: TournaBotGuildData) { + this.guildId = data.guildId; + this.locale = data.locale || 'en'; + this.timezone = data.timezone || 'America/Los_Angeles'; + this.activeTournament = data.activeTournament || ''; + this.channels = data.channels || []; + this.roles = data.roles || []; + this.allowlist = data.allowlist || []; + } + + getChannel(type: string) { + return this.channels.find(c => c.type === type); + } + + getRole(type: string) { + return this.roles.find(r => r.type === type); + } + + async getDiscordGuild(): Promise { + return client.guilds.cache.get(this.guildId) || await client.guilds.fetch(this.guildId).catch(err => null); + } + + async getDiscordChannel(type: string, discordGuild?: Guild): Promise { + const guild = (discordGuild || await this.getDiscordGuild()); + const channelId = this.getChannel(type)?.id; + if (!channelId) return null; + return guild.channels.cache.get(channelId) || await guild.channels.fetch(channelId).catch(err => null); + } + + setChannel(type: string, channelId: string) { + const channel = this.getChannel(type); + if (channel) channel.id = channelId; + else this.channels.push({ + type: type, + id: channelId + }); + } + + setRole(type: string, roleId: string) { + const role = this.getRole(type); + if (role) role.id = roleId; + else this.roles.push({ + type: type, + id: roleId + }); + } + + removeRole(type: string) { + const role = this.getRole(type); + const index = this.roles.indexOf(role); + if (index !== -1) this.roles.splice(index, 1); + return role; + } + + async updateAll() { + await this.updateCache(); + return await this.updateDatabase(); + } + + async updateCache() { + return await cache.set(`guild:${this.guildId}`, JSON.stringify(this)) + .catch(err => console.error('Set Cache Guild', err)); + } + + async updateDatabase() { + return await Guilds.updateOne({ guildId: this.guildId }, this, { upsert: true }) + .catch(err => console.error('Set Database Guild', err)); + } + +} diff --git a/src/types/help.ts b/src/types/help.ts new file mode 100644 index 0000000..a90505b --- /dev/null +++ b/src/types/help.ts @@ -0,0 +1,238 @@ +import { ButtonInteraction, MessageActionRow, MessageButton, MessageEmbed, MessageSelectMenu } from "discord.js"; +import { client } from "../main"; +import { capitalize } from "../messaging"; +import { Indexable } from "./global"; +require('dotenv').config(); + +export namespace HelpStructure { + const types: TypeStructure = { + user: { + features: { + accounts: { + longDescription: 'TournaBot handles account linking between start.gg and Discord manually. Several commands are account-based, such as \`/support\`.', + shortDescription: 'TournaBot handles account linking manually.', + commands: [ + { + command: 'account link ', + description: 'Links your start.gg and Discord accounts. Enables use of commands such as `/support`. Others cannot see you use this command.', + image: '' + }, + { + command: 'account unlink', + description: 'Unlinks your start.gg and Discord accounts. Others cannot see you use this command.', + image: '' + }, + { + command: 'account status ', + description: 'Checks if a user\'s start.gg and Discord accounts are linked. Omitting the `user` argument will check if your own start.gg and Discord accounts are linked. Others cannot see you use this command.', + image: '' + } + ] + }, + support: { + longDescription: 'A support ticket system driven by artificial intelligence that helps you resolve any issue quickly and efficiently.', + shortDescription: 'Support ticket system driven by artificial intelligence.', + commands: [ + { + command: 'support', + description: 'Creates a support ticket for you to address an issue related to the tournament. You can talk with TournaBot to identify your issue or select your issue from the select menu.', + image: '' + } + ] + } + } + }, + admin: { + features: { + tournament: { + longDescription: 'Set an active tournament and announce it.', + shortDescription: 'Set an active tournament and announce it.', + commands: [ + { + command: 'tournament set ', + description: 'Sets the active tournament for the server. Features such as match reporting/calling and support tickets require this command.', + image: '' + }, + { + command: 'tournament announce ', + description: 'Announces a tournament with tournament and event info. If the `message` argument is omitted, TournaBot will automatically generate a message. You can set the role to ping in the automatic message using `/set role`.', + image: '' + } + ] + }, + support: { + longDescription: 'A support ticket system driven by artificial intelligence that helps you resolve any issue quickly and efficiently.', + shortDescription: 'Support ticket system driven by artificial intelligence.', + commands: [ + { + command: 'support', + description: 'You must set a tournament using `/tournament set` to use this command. Creates a support ticket. Generates a category and dashboard for tickets when initially ran. TournaBot will identify the user\'s issue and set before sending a request for an admin in the dashboard.', + image: '' + } + ] + }, + match: { + longDescription: 'Ping users for their matches as they are called and report match outcomes as they finish.', + shortDescription: 'Ping users for called matches and report match outcomes.', + commands: [ + { + command: 'match calling ', + description: 'You must set a channel and tournament using `/set channel` and `/tournament set` to use this command. Pings users for their matches as they are called. Gives round information and links to the set. Needs a Discord connection via `/account link` or start.gg to work effectively. Match calling can be manually stopped using `stop`, but will automatically stop after 6 hours or when the tournament ends according to the tournament details.', + image: '' + }, + { + command: 'match reporting ', + description: 'You must set a channel and tournament using `/set channel` and `/tournament set` to use this command. Reports match outcomes as they finish. Gives details such as the seeds, games, characters picked, and whether it was an upset or not. Needs a Discord connection via `/account link` or start.gg to work effectively. Match reporting can be manually stopped using `stop`, but will automatically stop after 6 hours or when the tournament ends according to the tournament details.', + image: '' + } + ] + }, + allowlist: { + longDescription: 'Give certain roles access to admin commands.', + shortDescription: 'Give certain roles access to admin commands.', + commands: [ + { + command: 'allowlist add ', + description: 'Adds a role to the allowlist. Allows that role to use admin commands.', + image: '' + }, + { + command: 'allowlist remove ', + description: 'Removes a role from the allowlist.', + image: '' + } + ] + } + } + } + } + + export const getEmbed = (type: string, pageIndex: number, feature: string = '') => { + const embed = new MessageEmbed().setColor(`#${process.env.EMBED_COLOR}`); + const typeObj = (types as Indexable)[type]; + + if (feature.length) { + const featureObj = typeObj.features[feature]; + const embedObj = featureObj.commands[pageIndex]; + const commandFormatted = embedObj.command.length ? `> \`/${embedObj.command}\`\n\n` : ''; + + embed.setAuthor({ name: `${capitalize(type)} Features` }) + .setTitle(capitalize(feature)) + .setDescription(`${commandFormatted}${embedObj.description}`) + .setImage(embedObj.image) + .setFooter({ text: `Page ${pageIndex + 1} of ${typeObj.features[feature].commands.length}` }); + if (embedObj?.thumbnail) embed.setThumbnail(embedObj.thumbnail); + } else { + const numFeatures = Object.keys(typeObj.features).length; + const numFeaturesPerPage = 5; + + embed.setTitle(`${capitalize(type)} Features`) + .setDescription('') + .setFooter({ text: `Page ${pageIndex + 1} of ${Math.floor(numFeatures / numFeaturesPerPage) + 1}` }); + + + let countIndex = 0; + const min = pageIndex * numFeaturesPerPage; + const max = min + numFeaturesPerPage; + for (const feature in typeObj.features) { + if (countIndex >= min && countIndex < max) { + const featureObj = typeObj.features[feature]; + embed.description += `:small_orange_diamond:**${capitalize(feature)}**\n\n${featureObj.longDescription}\n\n`; + } + countIndex++; + } + + const otherType = type === 'user' ? 'admin' : 'user'; + embed.description += `**You can the select menu below to switch to ${otherType} features.**`; + } + + return embed; + } + + export const getComponents = (type: string, pageIndex: number, feature: string = '') => { + const typeObj = (types as Indexable)[type]; + const maxPageIndex = feature.length ? typeObj.features[feature].commands.length - 1 : Math.floor(Object.keys(typeObj.features).length / 5); + + const actionRows: MessageActionRow[] = []; + const actionRow = generateArrowButtons(type, pageIndex, maxPageIndex, feature); + actionRows.push(actionRow); + + if (!feature.length) { + const selectMenu = generateSelectMenu(type); + actionRows.push(new MessageActionRow().addComponents(selectMenu)); + } + + return actionRows; + } + + export const generateArrowButtons = (type: string, pageIndex: number, maxPageIndex: number, feature: string = '') => { + return new MessageActionRow().addComponents( + new MessageButton() + .setCustomId(`help_${type}_${pageIndex - 1}_${feature}`) + .setStyle('PRIMARY') + .setLabel('⬅️') + .setDisabled(pageIndex === 0), + new MessageButton() + .setCustomId(`help_${type}_${pageIndex + 1}_${feature}`) + .setStyle('PRIMARY') + .setLabel('➡️') + .setDisabled(pageIndex + 1 > maxPageIndex), + new MessageButton() + .setCustomId(`help_${type}_0`) + .setStyle('DANGER') + .setLabel('Back') + .setDisabled(feature.length === 0) + ); + } + + export const generateSelectMenu = (type: string) => { + const typeObj = (types as Indexable)[type]; + + const selectMenu = new MessageSelectMenu() + .setCustomId(`help_${type}_select`) + .setPlaceholder('Select a feature...'); + + const otherType = type === 'user' ? 'admin' : 'user'; + selectMenu.addOptions({ + label: `See ${capitalize(otherType)} Features ↗️`, + value: `otherType_${otherType}` + }) + + for (const feature in typeObj.features) { + const featureObj = typeObj.features[feature]; + selectMenu.addOptions({ + label: capitalize(feature), + description: featureObj.shortDescription, + value: `${feature}_0` + }); + } + + return selectMenu; + } +} + +interface TypeStructure { + user: { + features: { + [feature: string]: FeatureStructure; + } + } + admin: { + features: { + [feature: string]: FeatureStructure; + } + } +} + +interface FeatureStructure { + longDescription: string; + shortDescription: string; + commands: CommandStructure[]; +} + +interface CommandStructure { + command: string; + description: string; + image: string; + thumbnail?: string; +} diff --git a/src/types/match.ts b/src/types/match.ts new file mode 100644 index 0000000..c04d96f --- /dev/null +++ b/src/types/match.ts @@ -0,0 +1,252 @@ +import { GuildEmoji, MessageEmbed, TextChannel } from "discord.js"; +import { Accounts } from "../../database/models/accounts"; +import { matchCallingThreads, matchReportingThreads } from "../commands/match"; +import { Messenger } from "../messaging"; +import { StartggAPI } from "../startgg/api"; +import { Set, SetSlot, Tournament } from "../startgg/genql"; +import { Characters } from "./characters"; + +const getEntrants = async (setSlots: SetSlot[]) => { + const entrants: SortedEntrant[] = []; + + for (const slot of setSlots) { + const slotEntrant = slot.entrant; + const entrant: SortedEntrant = { + id: parseInt(slotEntrant.id), + name: slotEntrant.name, + seed: slotEntrant.initialSeedNum, + users: [], + characters: [] + } + for (const participant of slotEntrant.participants) { + const slotUser = participant.user; + if (!slotUser) continue; + const slug = slotUser.slug.replace('user/', ''); + const user: SortedUser = { + slug: slug, + mention: '' + } + if (slotUser.authorizations.length) user.mention = `<@${slotUser.authorizations[0].externalId}>`; + else { + const account = await Accounts.findOne({ slug: slug }); + if (account) user.mention = `<@${account.discordId}>`; + } + entrant.users.push(user); + } + entrants.push(entrant); + } + + return entrants; +} + +interface SortedEntrant { + id: number; + name: string; + seed: number; + users: SortedUser[]; + characters: GuildEmoji[]; +} + +interface SortedUser { + slug: string; + mention: string; +} + + +// self deletion could lead to memory leaks, im not quite sure how the garbage collector handles it + + +export interface MatchThread { + slug: string; + m: Messenger; + channel: TextChannel; + sets: string[]; + automaticStop: NodeJS.Timeout; + loop: NodeJS.Timer; + + start(): void; + stop(): void; + iterate(): Promise; +} + +export class MatchCallingThread implements MatchThread { + slug: string; + m: Messenger; + channel: TextChannel; + sets: string[]; + automaticStop: NodeJS.Timeout; + loop: NodeJS.Timer; + + constructor(slug: string, m: Messenger, channel: TextChannel) { + this.slug = slug; + this.m = m; + this.channel = channel; + this.sets = []; + } + + start() { + // send message to channel here saying that match calling has started for tournament + this.automaticStop = setTimeout(() => { + this.stop(); + this.m.sendMessage(this.channel, 'Match calling has automatically stopped after 6 hours.'); + }, 21600000); + this.loop = setInterval(async () => { await this.iterate(); }, 10000); // 10 second interval + matchCallingThreads.set(this.channel.guildId, this); + this.iterate(); + } + + stop() { + clearTimeout(this.automaticStop); + clearInterval(this.loop); + matchCallingThreads.delete(this.channel.guildId); + } + + async iterate() { + const data = await StartggAPI.getMatchCallingSets(this.slug); + if (!data) return; + + const tournament: Tournament = data.tournament; + + if (tournament.startAt * 1000 > Date.now()) { + this.stop(); + return this.m.sendMessage(this.channel, '**Match calling has automatically stopped because the tournament has not started.** If this is a mistake, check the tournament start time on start.gg.'); + } + + if (tournament.endAt * 1000 < Date.now()) { + this.stop(); + return this.m.sendMessage(this.channel, '**Match calling has automatically stopped because the tournament has ended.** If this is a mistake, check the tournament end time on start.gg.'); + } + + const events = tournament.events; + for (const event of events) { + for (const set of event.sets.nodes) { + if (this.sets.includes(set.id)) continue; + this.sets.push(set.id); + await this.channel.send(await this.generateMatchupMessage(event.slug, set)); + } + } + } + + async generateMatchupMessage(slug: string, set: Set) { + const entrants = await getEntrants(set.slots); + + const embed = new MessageEmbed() + .setAuthor({ name: `${set.event.name} - ${set.fullRoundText} - Best of ${set.totalGames}` }) + .setTitle(`${entrants[0].name} vs. ${entrants[0].name}`) + .setURL(`https://start.gg/${slug}/set/${set.id}`) + .setDescription('Your match has been called! Please check-in on start.gg.') + .setColor(`#${process.env.EMBED_COLOR}`); + + return { content: entrants.map(e => e.users.map(u => u.mention).join('')).join('') || 'No mentions available.', embeds: [embed] } + } +} + +export class MatchReportingThread implements MatchThread { + slug: string; + m: Messenger; + channel: TextChannel; + sets: string[]; + automaticStop: NodeJS.Timeout; + loop: NodeJS.Timer; + + constructor(slug: string, m: Messenger, channel: TextChannel) { + this.slug = slug; + this.m = m; + this.channel = channel; + this.sets = []; + } + + start() { + // send message to channel here saying that match reporting has started for tournament + this.automaticStop = setTimeout(() => { + this.stop(); + this.m.sendMessage(this.channel, 'Match reporting has automatically stopped after 6 hours.'); + }, 21600000); + this.loop = setInterval(async () => { await this.iterate(); }, 10000); // 10 second interval + matchReportingThreads.set(this.channel.guildId, this); + this.iterate(); + } + + stop() { + clearTimeout(this.automaticStop); + clearInterval(this.loop); + matchReportingThreads.delete(this.channel.guildId); + } + + async iterate() { + const data = await StartggAPI.getMatchReportingSets(this.slug); + if (!data) return; + + const tournament: Tournament = data.tournament; + + if (tournament.startAt * 1000 > Date.now()) { + this.stop(); + return this.m.sendMessage(this.channel, '**Match reporting has automatically stopped because the tournament has not started.** If this is a mistake, check the tournament start time on start.gg.'); + } + + if (tournament.endAt * 1000 < Date.now()) { + this.stop(); + return this.m.sendMessage(this.channel, '**Match reporting has automatically stopped because the tournament has ended.** If this is a mistake, check the tournament end time on start.gg.'); + } + + const events = tournament.events; + for (const event of events) { + for (const set of event.sets.nodes) { + if (this.sets.includes(set.id)) continue; + this.sets.push(set.id); + await this.channel.send(await this.generateResultsEmbed(event.slug, set)); + } + } + } + + async generateResultsEmbed(slug: string, set: Set) { + const entrants = await getEntrants(set.slots); + + const winner = entrants.find(e => e.id === set.winnerId); + const loser = entrants.find(e => e.id !== set.winnerId); + + const message = winner.seed > loser.seed ? `🚨 UPSET ALERT 🚨` : set.games?.length ? set.games.length === set.totalGames ? `🏆 Close One! 🏆` : `🏆 Decisive Victory! 🏆` : `🏆 Disqualification... 🏆`; + const score = [0, 0]; + const games = []; + + if (set.games?.length) { + for (const game of set.games) { + if (winner.id === game.winnerId) score[0]++; + else score[1]++; + + if (!game.selections) continue; + + const gameWinner = entrants.find(e => e.id === game.winnerId); + let gameWinnerString = `**${gameWinner.name}**`; + const gameLoser = entrants.find(e => e.id !== game.winnerId); + let gameLoserString = `${gameLoser.name}`; + + for (const selection of game.selections) { + const emoji = Characters.getEmojiFromId(`${selection.selectionValue}`); + if (!emoji) continue; + if (parseInt(selection.entrant.id) === gameWinner.id) gameWinnerString += ` ${emoji}`; + else gameLoserString += ` ${emoji}`; + } + + games.push(`${gameWinnerString} vs. ${gameLoserString}`); + } + } + + const embed = new MessageEmbed() + .setAuthor({ name: `${set.event.name} - ${set.fullRoundText} - Best of ${set.totalGames}` }) + .setTitle(message) + .setURL(`https://start.gg/${slug}/set/${set.id}`) + .setDescription(set.games?.length ? `(${winner.seed}) **${winner.name}** ${winner.users.map(e => e.mention).join('')} wins ${score[0]}-${score[1]} against (${loser.seed}) **${loser.name}** ${loser.users.map(e => e.mention).join('')}!` + : `(${loser.seed}) **${loser.name}** ${loser.users.map(e => e.mention).join('')} has been disqualified, giving (${winner.seed}) **${winner.name}** ${winner.users.map(e => e.mention).join('')} the win!`) + .addFields(games.map((g, i) => { + return { + name: `Game ${i + 1}`, + value: g, + inline: true + } + })) + .setColor(`#${process.env.EMBED_COLOR}`); + + return { embeds: [embed] }; + } +} diff --git a/src/types/matchmaking.ts b/src/types/matchmaking.ts new file mode 100644 index 0000000..0f4cc28 --- /dev/null +++ b/src/types/matchmaking.ts @@ -0,0 +1,481 @@ +import { Guild, MessageActionRow, MessageButton, MessageComponentInteraction, MessageEmbed, MessageSelectMenu, OverwriteResolvable, Snowflake, TextChannel } from "discord.js"; +import ShortUniqueId from "short-unique-id"; +import { client, guilds } from "../main"; +import { Messenger } from "../messaging"; +import { TournaBotDiscordData, TournaBotGuild } from "./guild"; + +const games: MatchmakingGame[] = [ + { + shorthand: 'ssbu', + name: 'Super Smash Bros. Ultimate', + playersPerGame: 2 + } +] + +export interface MatchmakingGame { + shorthand: string; + name: string; + playersPerGame: number; +} + +export class MatchmakingQueue { + id: string; + name: string; + game: MatchmakingGame; + guildId: string; + categoryId: string = '' + channelId: string = ''; + messageId: string = ''; + players: MatchmakingPlayer[] = []; + playersInQueue: string[] = []; + matches: MatchmakingMatch[] = []; + + constructor(guildId: string, name: string, gameShorthand: string) { + this.id = new ShortUniqueId({ length: 8 })(); + this.guildId = guildId; + this.name = name; + this.game = games.find(g => g.shorthand === gameShorthand); + } + + async refresh(clientGuild: Guild, guild: TournaBotGuild) { + for (const match of this.matches) { + await this.deleteMatch(match); + } + this.playersInQueue = []; + await this.buildQueueChannel(clientGuild, guild); + } + + async buildQueueChannel(clientGuild: Guild, guild: TournaBotGuild, interactionChannel?: TextChannel) { + if (interactionChannel) this.categoryId = interactionChannel.parent.id; + let queueChannel: TextChannel = await guild.getDiscordChannel(this.channelId); + if (!(queueChannel instanceof TextChannel)) { + queueChannel = await clientGuild.channels.create(this.name, { + type: 'GUILD_TEXT', + permissionOverwrites: [{ + id: clientGuild.id, + deny: ['MANAGE_CHANNELS', 'SEND_MESSAGES'], + allow: ['VIEW_CHANNEL'] + }], + parent: this.categoryId as Snowflake + }); + this.channelId = queueChannel.id; + this.messageId = ''; + await guilds.updateGuild(guild); + } + await this.buildQueuePanel(queueChannel); + return queueChannel; + } + + async buildQueuePanel(channel: TextChannel) { + const guild = await guilds.getGuild(this.guildId); + const m = new Messenger(guild.locale); + + const embed = new MessageEmbed() + .setTitle(this.name) + .setDescription(`${await m.translate('Game:')} ${this.game.name}`) + .addField(await m.translate('Players Needed To Start Game'), `**${(this.game.playersPerGame - this.playersInQueue.length).toString()}**`) + .setColor(`#${process.env.EMBED_COLOR}`) + .setFooter('TournaBot', client.user.avatarURL({ format: 'png' })); + + const buttons = new MessageActionRow().addComponents( + new MessageButton() + .setCustomId(`matchmaking_queue`) + .setStyle('SUCCESS') + .setLabel(await m.translate('Join Queue')), + new MessageButton() + .setCustomId(`matchmaking_unqueue`) + .setStyle('DANGER') + .setLabel(await m.translate('Leave Queue')) + ); + + let message = await channel.messages.fetch(this.messageId).catch(err => null); + message = message ? await message.edit({ embeds: [embed], components: [buttons] }) : await channel.send({ embeds: [embed], components: [buttons] }); + + this.messageId = message.id; + } + + async addPlayerToQueue(discordId: string) { + const player = await this.getPlayer(discordId); + if (this.playersInQueue.includes(discordId)) return false; + this.playersInQueue.push(discordId); + return true; + } + + async removePlayerFromQueue(discordId: string) { + if (!this.playersInQueue.includes(discordId)) return false; + const index = this.playersInQueue.indexOf(discordId); + this.playersInQueue.splice(index, 1); + return true; + } + + async checkToStartMatch(channel: TextChannel) { + if (this.playersInQueue.length >= this.game.playersPerGame) { + const playerIds = []; + for (let i = 0; i < this.game.playersPerGame; i++) { + playerIds.push(this.playersInQueue.splice(Math.floor(Math.random() * this.playersInQueue.length), 1)[0]); + } + await this.buildQueuePanel(channel); + // add checking if player is in game for queueing back up + const match = new MatchmakingMatch(this.id, this.name, this.game, this.guildId, playerIds, []); + + const guild = await guilds.getGuild(this.guildId); + const clientGuild = await guild.getClientGuild(); + + await match.startMatch(clientGuild); + this.matches.push(match); + guilds.updateGuild(guild); + } + } + + async deleteMatch(match: MatchmakingMatch) { + for (const channel of match.channels) { + const clientChannel = await client.channels.fetch(channel.id).catch(err => null); + if (clientChannel) await clientChannel.delete(); + } + + const index = this.matches.indexOf(match); + if (index !== -1) this.matches.splice(index, 1); + + const guild = await guilds.getGuild(this.guildId); + await guilds.updateGuild(guild); + } + + async getPlayer(discordId: string) { + let player = this.players.find(p => p.discordId === discordId); + if (!player) { + player = new MatchmakingPlayer({ discordId: discordId }); + this.players.push(player); + const guild = await guilds.getGuild(this.guildId); + await guilds.updateGuild(guild); + } + return player; + } + + convertForMongo() { + return { + id: this.id, + name: this.name, + game: this.game, + guildId: this.guildId, + categoryId: this.categoryId, + channelId: this.channelId, + messageId: this.messageId, + players: this.players, + matches: this.matches + } + } +} + +export interface MatchmakingMatchInterface { + queueId: string; + queueName: string; + game: MatchmakingGame; + guildId: string; + playerIds: string[]; + channels: TournaBotDiscordData[]; + checkedIn: boolean; +} + +export class MatchmakingMatch implements MatchmakingMatchInterface { + queueId; + queueName; + game; + guildId; + playerIds; + channels; + checkedIn = false; + + constructor(queueId: string, queueName: string, game: MatchmakingGame, guildId: string, playerIds: string[], channels: TournaBotDiscordData[]) { + this.queueId = queueId; + this.queueName = queueName; + this.game = game; + this.guildId = guildId; + this.playerIds = playerIds; + this.channels = channels; + } + + async startMatch(clientGuild: Guild) { + await this.createChannels(clientGuild); + await this.phases.checkIn(true, clientGuild); + } + + async createChannels(clientGuild: Guild) { + const category = await clientGuild.channels.create(`${this.queueName} Match`, { + type: 'GUILD_CATEGORY', + permissionOverwrites: [{ + id: clientGuild.id, + deny: ['MANAGE_CHANNELS', 'VIEW_CHANNEL', 'SEND_MESSAGES'], + allow: [] + }] + }); + this.setChannel('category', category.id); + + const adminChannel = await clientGuild.channels.create('admin', { + type: 'GUILD_TEXT', + parent: category + }); + this.setChannel('admin', adminChannel.id); + + const gameChannelPerms = this.playerIds.map(id => { + return { + id: id, + deny: ['SEND_MESSAGES'], + allow: ['VIEW_CHANNEL'] + } + }); + gameChannelPerms.push({ + id: clientGuild.id, + deny: ['MANAGE_CHANNELS', 'VIEW_CHANNEL', 'SEND_MESSAGES'], + allow: [] + }); + const gameChannel = await clientGuild.channels.create('match', { + type: 'GUILD_TEXT', + permissionOverwrites: gameChannelPerms as OverwriteResolvable[], + parent: category + }); + this.setChannel('game', gameChannel.id); + + const chatChannelPerms = this.playerIds.map(id => { + return { + id: id, + deny: [], + allow: ['VIEW_CHANNEL', 'SEND_MESSAGES'] + } + }); + chatChannelPerms.push({ + id: clientGuild.id, + deny: ['MANAGE_CHANNELS', 'VIEW_CHANNEL', 'SEND_MESSAGES'], + allow: [] + }); + const chatChannel = await clientGuild.channels.create('chat', { + type: 'GUILD_TEXT', + permissionOverwrites: chatChannelPerms as OverwriteResolvable[], + parent: category + }); + this.setChannel('chat', chatChannel.id); + } + + async updateMatchPanel(phase: string[], interaction: MessageComponentInteraction) { + const guild = await guilds.getGuild(this.guildId); + const clientGuild = await guild.getClientGuild(); + const phaseString = phase.shift(); + switch (phaseString) { + case 'checkin': + return this.phases.checkIn(false, clientGuild, interaction); + // case 'stageselectstart': + // return this.phases.stageSelectionStarter(phase, interaction); + // case 'stageselectcounter': + // return; + } + } + + phases = { + checkIn: async (send: boolean = false, clientGuild: Guild, interaction?: MessageComponentInteraction) => { + const guild = await guilds.getGuild(this.guildId); + const m = new Messenger(guild.locale, interaction); + + const playerId = interaction?.user?.id; + let content = interaction ? interaction.message.embeds[0].fields[0].value : this.playerIds.map(id => `<@${id}>`).join('\n'); + if (content.includes(playerId)) content = content.replace(`<@${playerId}>`, ''); + + if (content.length === 0) { // if all are checked in, move on to next phase + this.checkedIn = true; + switch (this.game.shorthand) { + case 'ssbu': + // return this.phases.stageSelectionStarter([], interaction); + const stages = ['Battlefield', 'Final Destination', 'Smashville', 'Pokemon Stadium 2', 'Town and City']; + return this.phases.playAndReport(stages[Math.floor(Math.random() * stages.length)], interaction); + } + } + + const embed = new MessageEmbed() + .setTitle(await m.translate('Check-in')) + .setDescription(await m.translate('Please check-in with the button below. You have 60 seconds to check-in.')) + .addField(await m.translate('Not Checked-in'), content) + .setColor(`#${process.env.EMBED_COLOR}`) + .setFooter('TournaBot', client.user.avatarURL({ format: 'png' })) + .setTimestamp(); + + const actionRow = new MessageActionRow().addComponents( + new MessageButton() + .setCustomId('matchmaking_checkin') + .setStyle('SUCCESS') + .setLabel(await m.translate('Check-in')) + ); + + const gameChannel = await this.getClientChannel(clientGuild, 'game'); + if (send) { + await gameChannel.send(this.playerIds.map(id => `<@${id}>`).join('')); + gameChannel.send({ embeds: [embed], components: [actionRow] }); + setTimeout(async () => { + if (this.checkedIn) return; + const guild = await guilds.getGuild(this.guildId); + const queue = guild.queues.find((q: { id: string; }) => q.id === this.queueId); + queue.deleteMatch(this); // self reference deletion (could possibly create a memory leak?) + }, 60000); + } else interaction.editReply({ embeds: [embed], components: [actionRow] }); + }, + + // stageSelectionStarter: async (args: string[], interaction: MessageComponentInteraction) => { + // // if (this.game.shorthand === 'ssbu') { // for when support for more than one game is added + // const guild = await guilds.getGuild(this.guildId); + // const m = new Messenger(interaction, guild.locale); + + // const description = interaction.message.embeds[0].description; + // let stages = []; + // let player = this.playerIds[Math.floor(Math.random() * 2)]; + + // if (args.length) { + // const currentPickPlayer = description.substring(description.indexOf('<@') + 2, description.indexOf('>')); + // if (interaction.user.id != currentPickPlayer) return; + + // const menu = interaction.message.components[0].components[0] as MessageSelectMenu; + // for (const stage of menu.options) { + // stages.push(stage.label); + // } + + // const stageIndex = parseInt(args[0]); + // if (stages.length === 2) return this.phases.playAndReport([stages[stageIndex]], interaction); + // stages.splice(stageIndex, 1); + + // if (stages.length != 3) player = this.playerIds[Math.abs(this.playerIds.indexOf(currentPickPlayer) - 1)]; + // else player = currentPickPlayer; + // } else { + // this.firstBan = player; + // stages = ['Battlefield', 'Final Destination', 'Smashville', 'Pokemon Stadium 2', 'Town and City']; + // await guilds.updateGuild(guild); + // } + + // translating stages could be optimized by translating beforehand + + // const embed = new MessageEmbed() + // .setTitle(await m.translate('Stage Selection (Starter)')) + // // need to continue translating + // .setDescription(await m.translate(`*Ruleset from the [2021 SWT Rulebook](https://smashworldtour.com/wp-content/uploads/2021/02/SWT-2021-Rulebook-2020.2.16.pdf)* + + // <@${player}>, it is your turn to **${stages.length === 5 ? 'ban 1 stage' : this.firstBan === player ? 'select a stage' : 'ban 2 stages'}**! + + // • ${stages.join('\n• ')}`)) + // .setFooter('TournaBot', client.user.avatarURL({ format: 'png' })) + // .setTimestamp(); + + + // const actionRow = new MessageActionRow().addComponents( + // new MessageSelectMenu() + // .setCustomId('matchmaking_stageselectstart') + // .setPlaceholder(await m.translate('Pick a stage...')) + // .setOptions(await Promise.all(stages.map(async (stage, index) => { + // return { + // label: await m.translate(stage), + // value: index.toString() + // } + // }))) + // ); + + // interaction.editReply({ embeds: [embed], components: [actionRow] }); + // // } + // }, + + // stageSelectionCounterpick: async (args: string[], interaction: MessageComponentInteraction) => { + // const guild = await guilds.getGuild(this.guildId); + // const m = new Messenger(interaction, guild.locale); + + // // if (this.game.shorthand === 'ssbu') { // for when support for more than one game is added + + // const embed = new MessageEmbed() + // .setTitle(await m.translate('Stage Selection (Counterpick)')) + // .setDescription(await m.translate(`*Ruleset from the [2021 SWT Rulebook](https://smashworldtour.com/wp-content/uploads/2021/02/SWT-2021-Rulebook-2020.2.16.pdf)* + + // `)) + // .setFooter('TournaBot', client.user.avatarURL({ format: 'png' })) + // .setTimestamp(); + + // interaction.editReply({ embeds: [embed], components: [] }); + // // } + // }, + + playAndReport: async (stage: string, interaction: MessageComponentInteraction) => { + const guild = await guilds.getGuild(this.guildId); + const m = new Messenger(guild.locale); + + // if (this.game.shorthand === 'ssbu') { // for when support for more than one game is added + const embed = new MessageEmbed() + .setTitle(await m.translate(`Play and Report`)) + .setDescription(await m.translate(`*Ruleset from the [2021 SWT Rulebook](https://smashworldtour.com/wp-content/uploads/2021/02/SWT-2021-Rulebook-2020.2.16.pdf)* + + Stage: ${stage} + + Game Settings: + • Stock: 3 + • Timer: 7:00 + • Handicap: Off + • Team Attack: On + • Launch Rate: 1.0x + • Items: Off and None + • FS Meter: Off + • Damage Handicap: Off + • Custom Balance: Off + • Spirits: Off + • Pause: Off + • Stage Selection: Loser’s Pick + • Stage Hazards: Off + • Stage Morph: Off + • Underdog Boost: Off + • Score Display: Off + • Show Damage: Yes`)) + .setFooter('TournaBot', client.user.avatarURL({ format: 'png' })) + .setTimestamp(); + + interaction.editReply({ embeds: [embed], components: [] }); + + // todo + // - add best of option + // - add variable for storing winners + + // } + } + } + + setChannel(type: string, channelId: string) { + const channel = this.getChannel(type); + if (channel) channel.id = channelId; + else this.channels.push({ + type: type, + id: channelId + }); + } + + getChannel(type: string) { + return this.channels.find(c => c.type === type); + } + + async getClientChannel(clientGuild: Guild, type: string) { + return await clientGuild.channels.fetch(this.getChannel(type)?.id).catch(err => err); + } +} + +export class MatchmakingPlayer { + discordId: string; + points: number; + wins: number; + losses: number; + + constructor(mongoPlayer: { discordId: string, points?: number, wins?: number, losses?: number }) { + this.discordId = mongoPlayer.discordId; + this.points = mongoPlayer?.points || 1000; + this.wins = mongoPlayer?.wins || 0; + this.losses = mongoPlayer?.losses || 0; + } + + win(playerTwo: MatchmakingPlayer) { + this.wins++; + this.points += playerTwo.points / this.points * 100; + playerTwo.loss(this); + } + + private loss(playerTwo: MatchmakingPlayer) { + this.losses++; + this.points -= this.points / playerTwo.points * 90; + if (this.points < 1000) this.points = 1000; + } +} diff --git a/src/types/matchmaking/match.ts b/src/types/matchmaking/match.ts new file mode 100644 index 0000000..64c8f34 --- /dev/null +++ b/src/types/matchmaking/match.ts @@ -0,0 +1,62 @@ +import { DataEntry } from "../global"; +import { TournaBotDiscordData } from "../guild"; + +export namespace MatchManager { + +} + +export interface MatchmakingMatchData extends DataEntry { + queueId: string; + queueName: string; + guildId: string; + playerIds: string[]; + channels: TournaBotDiscordData[]; + game: GameShorthand; + checkedIn: boolean; +} + +export class MatchmakingMatch implements MatchmakingMatchData { + queueId: string; + queueName: string; + guildId: string; + playerIds: string[]; + channels: TournaBotDiscordData[]; + game: GameShorthand; + checkedIn: boolean; + + constructor(data: MatchmakingMatchData) { + this.queueId = data.queueId; + this.queueName = data.queueName; + this.guildId = data.guildId; + this.playerIds = data.playerIds; + this.channels = data.channels || []; + this.game = data.game; + this.checkedIn = data.checkedIn || false; + } + + updateAll(): Promise { + throw new Error("Method not implemented."); + } + + updateCache(): Promise { + throw new Error("Method not implemented."); + } + + updateDatabase(): Promise { + throw new Error("Method not implemented."); + } +} + +export const games: { [shorthand in GameShorthand]: MatchmakingGame } = { + 'ssbu': { + name: 'Super Smash Bros. Ultimate', + playersPerGame: 2 + } +} + +export type GameShorthand = 'ssbu'; + +interface MatchmakingGame { + name: string; + playersPerGame: number; +} diff --git a/src/types/matchmaking/player.ts b/src/types/matchmaking/player.ts new file mode 100644 index 0000000..345154e --- /dev/null +++ b/src/types/matchmaking/player.ts @@ -0,0 +1,70 @@ +import { Players } from "../../../database/models/players"; +import { DataEntry } from "../global"; + +export namespace PlayerManager { + export const get = async (discordId: string, queueId: string) => { + const data = await Players.findOne({ discordId: discordId, queueId: queueId }) + .catch(err => console.error('Retrieve Database Player', err)); + return data ? new MatchmakingPlayer(data) : null; + } + + export const create = async (data: MatchmakingPlayerData) => { + const player = new MatchmakingPlayer(data); + await player.updateAll(); + return player; + } + + export const remove = async (discordId: string, queueId: string) => { + return await Players.deleteOne({ discordId: discordId, queueId: queueId }) + .catch(err => console.error('Delete Database Player', err)); + } +} + +export interface MatchmakingPlayerData extends DataEntry { + discordId: string; + queueId: string; + points: number; + wins: number; + losses: number; +} + +export class MatchmakingPlayer implements MatchmakingPlayerData { + discordId: string; + queueId: string; + points: number; + wins: number; + losses: number; + + constructor(data: MatchmakingPlayerData) { + this.discordId = data.discordId; + this.queueId = data.queueId; + this.points = data.points; + this.wins = data.wins; + this.losses = data.losses; + } + + win(otherPlayer: MatchmakingPlayer) { + this.wins++; + this.points += otherPlayer.points / this.points * 100; + otherPlayer.loss(this); + } + + private loss(winningPlayer: MatchmakingPlayer) { + this.losses++; + this.points -= this.points / winningPlayer.points * 90; + if (this.points < 1000) this.points = 1000; + } + + async updateAll() { + return await this.updateDatabase(); + } + + async updateCache() { + throw new Error('Cache does not contain players.'); + } + + async updateDatabase() { + return await Players.updateOne({ discordId: this.discordId, queueId: this.queueId }, this, { upsert: true }) + .catch(err => console.error('Update Database Player', err)); + } +} diff --git a/src/types/matchmaking/queue.ts b/src/types/matchmaking/queue.ts new file mode 100644 index 0000000..268a8ff --- /dev/null +++ b/src/types/matchmaking/queue.ts @@ -0,0 +1,90 @@ +import { Queues } from "../../../database/models/queues"; +import { cache } from "../../main"; +import { DataEntry } from "../global"; +import { GameShorthand } from "./match"; + +export namespace QueueManager { + export const get = async (guildId: string, channelId: string) => { + return await getCache(guildId, channelId) || await getDatabase(channelId); + } + + const getCache = async (guildId: string, channelId: string) => { + const data = JSON.parse(await cache.hGet(`queues:${guildId}`, channelId) + .catch(err => console.error('Retrieve Cache Queue', err)) || null); + return data ? new MatchmakingQueue(data) : null; + } + + const getDatabase = async (channelId: string) => { + const data = await Queues.findOne({ channelId: channelId }) + .catch(err => console.error('Retrieve Database Queue', err)); + if (data) { + const queue = new MatchmakingQueue(data); + await queue.updateCache(); + return queue; + } else return null; + } + + export const create = async (data: MatchmakingQueueData) => { + const queue = new MatchmakingQueue(data); + await queue.updateAll(); + return queue; + } + + export const remove = async (guildId: string, channelId: string) => { + await cache.hDel(`queues:${guildId}`, channelId) + .catch(err => console.error('Delete Cache Queue', err)); + return await Queues.deleteOne({ guildId: guildId, channelId: channelId }) + .catch(err => console.error('Delete Database Queue', err)); + } + + export const removeAll = async (guildId: string) => { + // need to implement + } + + export const refresh = async (queue: MatchmakingQueue) => { + // need to implement + } + + export const refreshAll = async (guildId: string) => { + // need to implement + } +} + +export interface MatchmakingQueueData extends DataEntry { + guildId: string; + channelId: string; + name: string; + game: GameShorthand; + playersInQueue: string[]; +} + +export class MatchmakingQueue implements MatchmakingQueueData { + guildId: string; + channelId: string; + name: string; + game: GameShorthand; + playersInQueue: string[]; + + constructor(data: MatchmakingQueueData) { + this.guildId = data.guildId; + this.channelId = data.channelId; + this.name = data.name; + this.game = data.game; + this.playersInQueue = data.playersInQueue || []; + } + + async updateAll() { + await this.updateCache(); + return await this.updateDatabase(); + } + + async updateCache() { + return await cache.hSet(`queues:${this.guildId}`, this.channelId, JSON.stringify(this)) + .catch(err => console.error('Set Cache Queue', err)); + } + + async updateDatabase() { + return await Queues.updateOne({ guildId: this.guildId, channelId: this.channelId }, this, { upsert: true }) + .catch(err => console.error('Set Database Queue', err)); + } +} diff --git a/src/types/support.ts b/src/types/support.ts new file mode 100644 index 0000000..3a00fd1 --- /dev/null +++ b/src/types/support.ts @@ -0,0 +1,380 @@ +import { CategoryChannel, ColorResolvable, Guild, Message, MessageActionRow, MessageButton, MessageComponentInteraction, MessageEmbed, MessageSelectMenu, SelectMenuInteraction, TextChannel } from "discord.js"; +import { getAverageColor } from "fast-average-color-node"; +import ShortUniqueId from "short-unique-id"; +import { AccountData, Accounts } from "../../database/models/accounts"; +import { Support } from "../../database/models/tickets"; +import { cache, client } from "../main"; +import { Messenger } from "../messaging"; +import { StartggAPI } from "../startgg/api"; +import { Event, Set, Tournament } from "../startgg/genql"; +import { DataEntry } from "./global"; +import { TournaBotGuild } from "./guild"; + +export namespace SupportManager { + export const getByDiscordId = async (guildId: string, discordId: string, resolved: boolean = false) => { + const channelId = await cache.hGet(`support:${guildId}`, `discordId:${discordId}`) + .catch(err => console.error('Retrieve Cache Support Channel ID', err)) || null; + return channelId ? await getByChannelId(guildId, channelId) : await getDatabase({ guildId: guildId, discordId: discordId, resolved: resolved } as SupportTicketData); + } + + export const getByChannelId = async (guildId: string, channelId: string) => { + const data = JSON.parse(await cache.hGet(`support:${guildId}`, `channelId:${channelId}`) + .catch(err => console.error('Retrieve Cache Support', err)) || null); + return data ? new SupportTicket(data) : await getDatabase({ guildId: guildId, channelId: channelId } as SupportTicketData); + } + + const getDatabase = async (filter: SupportTicketData) => { + const data = await Support.findOne(filter, {}, { sort: { created_at: -1 } }); + if (data) { + const ticket = new SupportTicket(data); + await ticket.updateCache(); + return ticket; + } else return null; + } + + export const create = async (discordGuild: Guild, discordId: string, supportCategory: CategoryChannel) => { + const potentialTicket = await getByDiscordId(discordGuild.id, discordId); + if (potentialTicket && await discordGuild.channels.fetch(potentialTicket.channelId).catch(async err => { + await remove(discordGuild.id, potentialTicket.channelId, discordId); + return false; + })) return; + const ticketId = new ShortUniqueId({ length: 4 })(); + const ticketChannel = await discordGuild.channels.create(`ticket-${ticketId}`, { + type: 'GUILD_TEXT', + permissionOverwrites: [{ + id: discordGuild.id, + deny: ['MANAGE_CHANNELS', 'VIEW_CHANNEL', 'SEND_MESSAGES'], + allow: [] + }, { + id: discordId, + deny: ['MANAGE_CHANNELS'], + allow: ['VIEW_CHANNEL', 'SEND_MESSAGES'] + }], + parent: supportCategory + }); + const ticket = new SupportTicket({ + id: ticketId, + guildId: discordGuild.id, + channelId: ticketChannel.id, + discordId: discordId, + } as SupportTicketData); + await ticket.updateAll(); + return ticketChannel; + } + + export const remove = async (guildId: string, channelId: string, discordId: string) => { + await cache.hDel(`support:${guildId}`, `discordId:${discordId}`) + .catch(err => console.error('Delete Cache Support Channel ID', err)); + await cache.hDel(`support:${guildId}`, `channelId:${channelId}`) + .catch(err => console.error('Delete Cache Support', err)); + return await Support.deleteOne({ guildId: guildId, channelId: channelId, discordId: discordId }) + .catch(err => console.error('Delete Database Support', err)); + } + + export const removeCache = async (guildId: string, channelId: string, discordId: string) => { + await cache.hDel(`support:${guildId}`, `discordId:${discordId}`) + .catch(err => console.error('Delete Cache Support Channel ID', err)); + return await cache.hDel(`support:${guildId}`, `channelId:${channelId}`) + .catch(err => console.error('Delete Cache Support', err)); + } + + export const buildSupportCategory = async (guild: TournaBotGuild, discordGuild: Guild) => { + let clientSupportCategory: CategoryChannel = await guild.getDiscordChannel('support_category', discordGuild); + if (!(clientSupportCategory instanceof CategoryChannel)) { + clientSupportCategory = await discordGuild.channels.create('Support Tickets', { + type: 'GUILD_CATEGORY', + permissionOverwrites: [{ + id: discordGuild.id, + deny: ['MANAGE_CHANNELS', 'VIEW_CHANNEL', 'SEND_MESSAGES'], + allow: [] + }] + }); + guild.setChannel('support_category', clientSupportCategory.id); + await guild.updateAll(); + } + return clientSupportCategory; + } + + export const buildSupportDashboard = async (guild: TournaBotGuild, discordGuild: Guild, supportCategory: CategoryChannel) => { + let clientSupportDashboard: TextChannel = await guild.getDiscordChannel('support_dashboard', discordGuild); + if (!(clientSupportDashboard instanceof TextChannel)) { + clientSupportDashboard = await discordGuild.channels.create('support-dashboard', { + type: 'GUILD_TEXT', + permissionOverwrites: [{ + id: discordGuild.id, + deny: ['MANAGE_CHANNELS', 'VIEW_CHANNEL', 'SEND_MESSAGES'], + allow: [] + }], + parent: supportCategory + }); + guild.setChannel('support_dashboard', clientSupportDashboard.id); + await guild.updateAll(); + } + return clientSupportDashboard; + } +} + +export interface SupportTicketData extends DataEntry { + resolved: boolean; + id: string; + guildId: string; + channelId: string; + discordId: string; + setId: number; + phase: string; + issue: { + name: string; + type: string; + } +} + +class SupportTicket implements SupportTicketData { + resolved: boolean; + id: string; + guildId: string; + channelId: string; + discordId: string; + setId: number; + phase: string; + issue: { + name: string; + type: string; + } + + constructor(data: SupportTicketData) { + this.resolved = data.resolved || false; + this.id = data.id; + this.guildId = data.guildId; + this.discordId = data.discordId; + this.channelId = data.channelId; + this.setId = data.setId; + this.phase = data.phase || 'none'; + this.issue = data.issue; + } + + getPhaseArray() { + return this.phase.split('_'); + } + + async requestAdmin(m: Messenger, supportDashboard: TextChannel, embed: MessageEmbed) { + const actionRow = new MessageActionRow() + .addComponents( + new MessageButton() + .setURL(`https://discord.com/channels/${this.guildId}/${this.channelId}`) + .setStyle('LINK') + .setLabel(await m.translate('Go To Ticket')), + new MessageButton() + .setCustomId(`support_resolve_${this.channelId}`) + .setStyle('SUCCESS') + .setLabel(await m.translate('Resolve Ticket')) + ); + + await this.updateAll(); + await supportDashboard.send({ embeds: [embed], components: [actionRow] }); + } + + async getRequestEmbed(m: Messenger, set?: SupportSet) { + const user = await client.users.fetch(this.discordId); + const avatar = user.avatarURL({ format: 'png' }); + const color = await getAverageColor(avatar).catch(err => console.error('No Thumbnail', err)); + const hex = color ? color.hex : `#${process.env.EMBED_COLOR}`; + + const embed = new MessageEmbed() + .setTitle(await m.translate(`Request from ${user.username}`)) + .addField(await m.translate('Issue'), this.issue.name, true) + .addField(await m.translate('User'), `<@${user.id}>`, true) + .addField(await m.translate('Ticket'), `<#${this.channelId}>`, true) + .addField(await m.translate('Status'), await m.translate(this.resolved ? '\`RESOLVED\` :white_check_mark:' : '\`NOT RESOLVED\` :x:'), true) + .setColor(hex as ColorResolvable) + .setThumbnail(avatar) + .setTimestamp(); + + if (set) { + const entrantOne = set.entrants[0]; + const entrantTwo = set.entrants[1]; + embed.addField(await m.translate('Matchup'), `**${entrantOne.name}** ${entrantOne.mentions.join('')} vs. **${entrantTwo.name}** ${entrantTwo.mentions.join('')}`, true) + .addField(await m.translate('Set'), `[Set Link](${set.url})`, true) + } + + return embed; + } + + async getSupportSets(tournamentSlug: string, playerId: number) { + const data = await StartggAPI.getSupportSets(tournamentSlug, playerId.toString()); + const supportSets: SupportSet[] = []; + if (!data) return supportSets; + + for (const event of (data.tournament as Tournament).events) { + for (const set of event.sets.nodes) { + supportSets.push(await this.parseSet(set, event)); + } + } + + return supportSets; + } + + async getSupportSet() { + const data = await StartggAPI.getSupportSet(this.setId); + return await this.parseSet(data.set); + } + + async parseSet(set: Set, event?: Event) { + const supportSet: SupportSet = { + id: parseInt(set.id), + url: `https://start.gg/${event?.slug || set.event.slug}/set/${set.id}`, + eventName: event?.name || set.event.name, + roundText: set.fullRoundText, + entrants: [] + } + for (const slot of set.slots) { + const slotEntrant = slot.entrant; + const entrant: SupportEntrant = { + name: slotEntrant.name, + seed: slotEntrant.initialSeedNum, + mentions: [] + } + for (const participant of slotEntrant.participants) { + const slotUser = participant.user; + if (!slotUser) continue; + if (slotUser.authorizations.length) entrant.mentions.push(`<@${slotUser.authorizations[0].externalId}>`); + else { + const account = await Accounts.findOne({ slug: slotUser.slug.replace('user/', '') }); + if (account) entrant.mentions.push(`<@${account.discordId}>`); + } + } + supportSet.entrants.push(entrant); + } + return supportSet; + } + + async sendSetSelectMessage(m: Messenger, response: Message | SelectMenuInteraction, supportSets: SupportSet[]) { + const supportEvents = [[supportSets[0]]]; + supportSets.slice(1).forEach((set, index) => { + if (set.eventName == supportSets[index].eventName) supportEvents[supportEvents.length - 1].push(set); + else supportEvents.push([set]); + }); + + const actionRows: MessageActionRow[] = []; + + for (let i = 0; i < supportEvents.length; i++) { + if (actionRows.length < 4) { + const actionRow = new MessageActionRow() + .addComponents( + new MessageSelectMenu() + .setCustomId(`support_set_${i}`) + .setPlaceholder(supportEvents[i][0].eventName) + .addOptions(supportEvents[i].map(supportSet => { + const entrantOne = supportSet.entrants[0]; + const entrantTwo = supportSet.entrants[1]; + return { + label: `${entrantOne.name} vs. ${entrantTwo.name}`, + description: supportSet.roundText, + value: `${supportSet.id}` + } + })), + ); + actionRows.push(actionRow); + } + } + + const noneButton = new MessageButton() + .setCustomId(`support_set_none`) + .setStyle('SECONDARY') + .setLabel(`None`); + + actionRows.push(new MessageActionRow().addComponents(noneButton)); + + return await response.reply({ content: await m.translate('**Got it.** Please select the set related to your issue below...'), components: actionRows }); + } + + async resolve(m: Messenger, interaction: MessageComponentInteraction | SelectMenuInteraction) { + const actionRow = new MessageActionRow() + .addComponents( + new MessageButton() + .setCustomId(`support_delete_${this.channelId}`) + .setStyle('DANGER') + .setLabel(await m.translate('Delete Ticket Channel')) + ); + + const ticketChannel = await (client.channels.fetch(this.channelId).catch(err => null) as Promise); + if (ticketChannel) { + await ticketChannel.permissionOverwrites.set([{ + id: this.discordId, + deny: ['SEND_MESSAGES'], + allow: [] + }]); + await ticketChannel.send(await m.translate(`**<@${this.discordId}>, this ticket has been resolved by <@${interaction.user.id}>.** Please create another support ticket if the problem persists.`)); + } + + this.phase = 'resolved' + this.resolved = true; + + await interaction.update({ embeds: [await this.getRequestEmbed(m, this.setId ? await this.getSupportSet() : null)], components: [actionRow] }); + await this.updateAll(); + } + + async updateAll() { + await this.updateCache(); + return await this.updateDatabase(); + } + + async updateCache() { + await cache.hSet(`support:${this.guildId}`, `discordId:${this.discordId}`, this.channelId) + .catch(err => console.error('Set Cache Support Channel ID', err)); + return await cache.hSet(`support:${this.guildId}`, `channelId:${this.channelId}`, JSON.stringify(this)) + .catch(err => console.error('Set Cache Support', err)); + } + + async updateDatabase() { + return await Support.updateOne({ guildId: this.guildId, channelId: this.channelId, discordId: this.discordId }, this, { upsert: true }) + .catch(err => console.error('Set Database Support', err)); + } +} + +interface SupportSet { + id: number; + url: string; + eventName: string; + roundText: string; + entrants: SupportEntrant[]; +} + +interface SupportEntrant { + name: string; + seed: number; + mentions: string[]; +} + +export const issues: Issue[] = [ + { + name: 'Opponent Absent', + type: 'absent', + description: 'Your opponent has not shown up for your match.', + async execute(message: Message, guild: TournaBotGuild, m: Messenger) { + await message.reply(await m.translate('**An admin has been requested for this ticket.** They will contact or disqualify the absent player and then resolve this ticket.')); + } + }, + { + name: 'Bracket Issue', + type: 'bracket', + description: 'Bracket has conflicts or incorrect reporting/seeding.', + async execute(message: Message, guild: TournaBotGuild, m: Messenger) { + await message.reply(await m.translate('**An admin has been requested for this ticket.** They will take a look at the bracket and resolve this ticket once the bracket is fixed.')); + } + }, + { + name: 'Unknown', + type: 'admin', + description: 'Just call an admin.', + async execute(message: Message, guild: TournaBotGuild, m: Messenger) { + await message.reply(await m.translate('**An admin has been requested for this ticket.** They will resolve this ticket once they have addressed the issue.')); + } + } +]; + +interface Issue { + name: string; + type: string; + description: string; + execute: (message: Message, guild: TournaBotGuild, m: Messenger) => Promise +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..0fccddd --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,76 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "ESNEXT", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ + // "lib": [], /* Specify library files to be included in the compilation. */ + "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ + // "declaration": true, /* Generates corresponding '.d.ts' file. */ + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + // "outDir": "./", /* Redirect output structure to the directory. */ + // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + /* Strict Type-Checking Options */ + // "strict": true, /* Enable all strict type-checking options. */ + "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": false, /* Enable strict null checks. */ + "strictFunctionTypes": true, /* Enable strict checking of function types. */ + "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": false, /* Enable strict checking of property initialization in classes. */ + "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + // "noImplicitAny": true, + "preserveConstEnums": true, + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ + /* Advanced Options */ + "skipLibCheck": true, /* Skip type checking of declaration files. */ + "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */ + "outDir": "build", + "resolveJsonModule": true + }, + "include": [ + "src/**/*", + "database/**/*", + "command_setup/*" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file