diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..af94013 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +packages/*/dist +apps/*/dist \ No newline at end of file diff --git a/apps/web/src/components/navbar.jsx b/apps/web/src/components/navbar.jsx index c6a6adb..d4accaf 100644 --- a/apps/web/src/components/navbar.jsx +++ b/apps/web/src/components/navbar.jsx @@ -1,3 +1,4 @@ +/* eslint-disable react/prop-types */ import { Link } from "react-router-dom"; import "../styles/navbar.styles.css"; diff --git a/apps/web/src/pages/app.jsx b/apps/web/src/pages/app.jsx index ed66f12..b4123a2 100644 --- a/apps/web/src/pages/app.jsx +++ b/apps/web/src/pages/app.jsx @@ -1,5 +1,4 @@ import "react-toastify/dist/ReactToastify.css"; -import Navbar from "../components/navbar"; import { useEffect, useState } from "react"; import Machines from "../components/machine"; import Challenge from "../components/challenge"; diff --git a/packages/api/.eslintignore b/packages/api/.eslintignore new file mode 100644 index 0000000..53c37a1 --- /dev/null +++ b/packages/api/.eslintignore @@ -0,0 +1 @@ +dist \ No newline at end of file diff --git a/packages/api/extras/cache.ts b/packages/api/extras/cache.ts index cbae951..58f57ba 100644 --- a/packages/api/extras/cache.ts +++ b/packages/api/extras/cache.ts @@ -1,6 +1,6 @@ -import { Redis } from "@upstash/redis" +import { Redis } from "@upstash/redis"; export const cache_client = new Redis({ url: process.env.UPSTASH_REDIS_REST_URL, token: process.env.UPSTASH_REDIS_REST_TOKEN, -}) \ No newline at end of file +}); \ No newline at end of file diff --git a/packages/api/graphql/types.ts b/packages/api/graphql/types.ts index 8a9c108..5c9e124 100644 --- a/packages/api/graphql/types.ts +++ b/packages/api/graphql/types.ts @@ -4,7 +4,7 @@ export type Exact = { [K in keyof T]: T[K] export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; export type MakeEmpty = { [_ in K]?: never }; -export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +export type Incremental = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: { input: string; output: string; } @@ -17,78 +17,78 @@ export type Scalars = { /** Boolean expression to compare columns of type "Boolean". All fields are combined with logical 'AND'. */ export type Boolean_Comparison_Exp = { - _eq?: InputMaybe; - _gt?: InputMaybe; - _gte?: InputMaybe; - _in?: InputMaybe>; - _is_null?: InputMaybe; - _lt?: InputMaybe; - _lte?: InputMaybe; - _neq?: InputMaybe; - _nin?: InputMaybe>; + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + _in?: InputMaybe>; + _is_null?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + _nin?: InputMaybe>; }; /** Boolean expression to compare columns of type "Int". All fields are combined with logical 'AND'. */ export type Int_Comparison_Exp = { - _eq?: InputMaybe; - _gt?: InputMaybe; - _gte?: InputMaybe; - _in?: InputMaybe>; - _is_null?: InputMaybe; - _lt?: InputMaybe; - _lte?: InputMaybe; - _neq?: InputMaybe; - _nin?: InputMaybe>; + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + _in?: InputMaybe>; + _is_null?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + _nin?: InputMaybe>; }; /** Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. */ export type String_Comparison_Exp = { - _eq?: InputMaybe; - _gt?: InputMaybe; - _gte?: InputMaybe; + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; /** does the column match the given case-insensitive pattern */ - _ilike?: InputMaybe; - _in?: InputMaybe>; + _ilike?: InputMaybe; + _in?: InputMaybe>; /** does the column match the given POSIX regular expression, case insensitive */ - _iregex?: InputMaybe; - _is_null?: InputMaybe; + _iregex?: InputMaybe; + _is_null?: InputMaybe; /** does the column match the given pattern */ - _like?: InputMaybe; - _lt?: InputMaybe; - _lte?: InputMaybe; - _neq?: InputMaybe; + _like?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; /** does the column NOT match the given case-insensitive pattern */ - _nilike?: InputMaybe; - _nin?: InputMaybe>; + _nilike?: InputMaybe; + _nin?: InputMaybe>; /** does the column NOT match the given POSIX regular expression, case insensitive */ - _niregex?: InputMaybe; + _niregex?: InputMaybe; /** does the column NOT match the given pattern */ - _nlike?: InputMaybe; + _nlike?: InputMaybe; /** does the column NOT match the given POSIX regular expression, case sensitive */ - _nregex?: InputMaybe; + _nregex?: InputMaybe; /** does the column NOT match the given SQL regular expression */ - _nsimilar?: InputMaybe; + _nsimilar?: InputMaybe; /** does the column match the given POSIX regular expression, case sensitive */ - _regex?: InputMaybe; + _regex?: InputMaybe; /** does the column match the given SQL regular expression */ - _similar?: InputMaybe; + _similar?: InputMaybe; }; /** Bans issued to users */ export type Bans = { - __typename?: 'bans'; - created_at: Scalars['timestamptz']['output']; - id: Scalars['String']['output']; - ip: Scalars['String']['output']; - updated_at: Scalars['timestamptz']['output']; + __typename?: "bans"; + created_at: Scalars["timestamptz"]["output"]; + id: Scalars["String"]["output"]; + ip: Scalars["String"]["output"]; + updated_at: Scalars["timestamptz"]["output"]; /** An object relationship */ user: Users; - user_id: Scalars['String']['output']; + user_id: Scalars["String"]["output"]; }; /** aggregated selection of "bans" */ export type Bans_Aggregate = { - __typename?: 'bans_aggregate'; + __typename?: "bans_aggregate"; aggregate?: Maybe; nodes: Array; }; @@ -99,15 +99,15 @@ export type Bans_Aggregate_Bool_Exp = { export type Bans_Aggregate_Bool_Exp_Count = { arguments?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; filter?: InputMaybe; predicate: Int_Comparison_Exp; }; /** aggregate fields of "bans" */ export type Bans_Aggregate_Fields = { - __typename?: 'bans_aggregate_fields'; - count: Scalars['Int']['output']; + __typename?: "bans_aggregate_fields"; + count: Scalars["Int"]["output"]; max?: Maybe; min?: Maybe; }; @@ -116,7 +116,7 @@ export type Bans_Aggregate_Fields = { /** aggregate fields of "bans" */ export type Bans_Aggregate_FieldsCountArgs = { columns?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; }; /** order by aggregate values of table "bans" */ @@ -149,27 +149,27 @@ export type Bans_Bool_Exp = { /** unique or primary key constraints on table "bans" */ export enum Bans_Constraint { /** unique or primary key constraint on columns "id" */ - BansPkey = 'bans_pkey' + BansPkey = "bans_pkey" } /** input type for inserting data into table "bans" */ export type Bans_Insert_Input = { - created_at?: InputMaybe; - id?: InputMaybe; - ip?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; user?: InputMaybe; - user_id?: InputMaybe; + user_id?: InputMaybe; }; /** aggregate max on columns */ export type Bans_Max_Fields = { - __typename?: 'bans_max_fields'; - created_at?: Maybe; - id?: Maybe; - ip?: Maybe; - updated_at?: Maybe; - user_id?: Maybe; + __typename?: "bans_max_fields"; + created_at?: Maybe; + id?: Maybe; + ip?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; /** order by max() on columns of table "bans" */ @@ -183,12 +183,12 @@ export type Bans_Max_Order_By = { /** aggregate min on columns */ export type Bans_Min_Fields = { - __typename?: 'bans_min_fields'; - created_at?: Maybe; - id?: Maybe; - ip?: Maybe; - updated_at?: Maybe; - user_id?: Maybe; + __typename?: "bans_min_fields"; + created_at?: Maybe; + id?: Maybe; + ip?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; /** order by min() on columns of table "bans" */ @@ -202,9 +202,9 @@ export type Bans_Min_Order_By = { /** response of any mutation on the table "bans" */ export type Bans_Mutation_Response = { - __typename?: 'bans_mutation_response'; + __typename?: "bans_mutation_response"; /** number of rows affected by the mutation */ - affected_rows: Scalars['Int']['output']; + affected_rows: Scalars["Int"]["output"]; /** data from the rows affected by the mutation */ returning: Array; }; @@ -228,30 +228,30 @@ export type Bans_Order_By = { /** primary key columns input for table: bans */ export type Bans_Pk_Columns_Input = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; /** select columns of table "bans" */ export enum Bans_Select_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Id = 'id', + Id = "id", /** column name */ - Ip = 'ip', + Ip = "ip", /** column name */ - UpdatedAt = 'updated_at', + UpdatedAt = "updated_at", /** column name */ - UserId = 'user_id' + UserId = "user_id" } /** input type for updating data in table "bans" */ export type Bans_Set_Input = { - created_at?: InputMaybe; - id?: InputMaybe; - ip?: InputMaybe; - updated_at?: InputMaybe; - user_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; }; /** Streaming cursor of the table "bans" */ @@ -264,25 +264,25 @@ export type Bans_Stream_Cursor_Input = { /** Initial value of the column from where the streaming should start */ export type Bans_Stream_Cursor_Value_Input = { - created_at?: InputMaybe; - id?: InputMaybe; - ip?: InputMaybe; - updated_at?: InputMaybe; - user_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; }; /** update columns of table "bans" */ export enum Bans_Update_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Id = 'id', + Id = "id", /** column name */ - Ip = 'ip', + Ip = "ip", /** column name */ - UpdatedAt = 'updated_at', + UpdatedAt = "updated_at", /** column name */ - UserId = 'user_id' + UserId = "user_id" } export type Bans_Updates = { @@ -294,34 +294,34 @@ export type Bans_Updates = { /** Challenges Data */ export type Challenges = { - __typename?: 'challenges'; - created_at: Scalars['timestamptz']['output']; - description: Scalars['String']['output']; - flag: Scalars['String']['output']; - id: Scalars['String']['output']; + __typename?: "challenges"; + created_at: Scalars["timestamptz"]["output"]; + description: Scalars["String"]["output"]; + flag: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; /** An object relationship */ machine: Machines; - machine_id: Scalars['String']['output']; - name: Scalars['String']['output']; - point: Scalars['Int']['output']; + machine_id: Scalars["String"]["output"]; + name: Scalars["String"]["output"]; + point: Scalars["Int"]["output"]; /** An array relationship */ scores: Array; /** An aggregate relationship */ scores_aggregate: Scores_Aggregate; - stage: Scalars['Int']['output']; + stage: Scalars["Int"]["output"]; /** An array relationship */ submissions: Array; /** An aggregate relationship */ submissions_aggregate: Submissions_Aggregate; - updated_at: Scalars['timestamptz']['output']; + updated_at: Scalars["timestamptz"]["output"]; }; /** Challenges Data */ export type ChallengesScoresArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -330,8 +330,8 @@ export type ChallengesScoresArgs = { /** Challenges Data */ export type ChallengesScores_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -340,8 +340,8 @@ export type ChallengesScores_AggregateArgs = { /** Challenges Data */ export type ChallengesSubmissionsArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -350,15 +350,15 @@ export type ChallengesSubmissionsArgs = { /** Challenges Data */ export type ChallengesSubmissions_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; /** aggregated selection of "challenges" */ export type Challenges_Aggregate = { - __typename?: 'challenges_aggregate'; + __typename?: "challenges_aggregate"; aggregate?: Maybe; nodes: Array; }; @@ -369,16 +369,16 @@ export type Challenges_Aggregate_Bool_Exp = { export type Challenges_Aggregate_Bool_Exp_Count = { arguments?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; filter?: InputMaybe; predicate: Int_Comparison_Exp; }; /** aggregate fields of "challenges" */ export type Challenges_Aggregate_Fields = { - __typename?: 'challenges_aggregate_fields'; + __typename?: "challenges_aggregate_fields"; avg?: Maybe; - count: Scalars['Int']['output']; + count: Scalars["Int"]["output"]; max?: Maybe; min?: Maybe; stddev?: Maybe; @@ -394,7 +394,7 @@ export type Challenges_Aggregate_Fields = { /** aggregate fields of "challenges" */ export type Challenges_Aggregate_FieldsCountArgs = { columns?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; }; /** order by aggregate values of table "challenges" */ @@ -421,9 +421,9 @@ export type Challenges_Arr_Rel_Insert_Input = { /** aggregate avg on columns */ export type Challenges_Avg_Fields = { - __typename?: 'challenges_avg_fields'; - point?: Maybe; - stage?: Maybe; + __typename?: "challenges_avg_fields"; + point?: Maybe; + stage?: Maybe; }; /** order by avg() on columns of table "challenges" */ @@ -456,47 +456,47 @@ export type Challenges_Bool_Exp = { /** unique or primary key constraints on table "challenges" */ export enum Challenges_Constraint { /** unique or primary key constraint on columns "flag" */ - ChallengesFlagKey = 'challenges_flag_key', + ChallengesFlagKey = "challenges_flag_key", /** unique or primary key constraint on columns "name" */ - ChallengesNameKey = 'challenges_name_key', + ChallengesNameKey = "challenges_name_key", /** unique or primary key constraint on columns "id" */ - ChallengesPkey = 'challenges_pkey' + ChallengesPkey = "challenges_pkey" } /** input type for incrementing numeric columns in table "challenges" */ export type Challenges_Inc_Input = { - point?: InputMaybe; - stage?: InputMaybe; + point?: InputMaybe; + stage?: InputMaybe; }; /** input type for inserting data into table "challenges" */ export type Challenges_Insert_Input = { - created_at?: InputMaybe; - description?: InputMaybe; - flag?: InputMaybe; - id?: InputMaybe; + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; machine?: InputMaybe; - machine_id?: InputMaybe; - name?: InputMaybe; - point?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; scores?: InputMaybe; - stage?: InputMaybe; + stage?: InputMaybe; submissions?: InputMaybe; - updated_at?: InputMaybe; + updated_at?: InputMaybe; }; /** aggregate max on columns */ export type Challenges_Max_Fields = { - __typename?: 'challenges_max_fields'; - created_at?: Maybe; - description?: Maybe; - flag?: Maybe; - id?: Maybe; - machine_id?: Maybe; - name?: Maybe; - point?: Maybe; - stage?: Maybe; - updated_at?: Maybe; + __typename?: "challenges_max_fields"; + created_at?: Maybe; + description?: Maybe; + flag?: Maybe; + id?: Maybe; + machine_id?: Maybe; + name?: Maybe; + point?: Maybe; + stage?: Maybe; + updated_at?: Maybe; }; /** order by max() on columns of table "challenges" */ @@ -514,16 +514,16 @@ export type Challenges_Max_Order_By = { /** aggregate min on columns */ export type Challenges_Min_Fields = { - __typename?: 'challenges_min_fields'; - created_at?: Maybe; - description?: Maybe; - flag?: Maybe; - id?: Maybe; - machine_id?: Maybe; - name?: Maybe; - point?: Maybe; - stage?: Maybe; - updated_at?: Maybe; + __typename?: "challenges_min_fields"; + created_at?: Maybe; + description?: Maybe; + flag?: Maybe; + id?: Maybe; + machine_id?: Maybe; + name?: Maybe; + point?: Maybe; + stage?: Maybe; + updated_at?: Maybe; }; /** order by min() on columns of table "challenges" */ @@ -541,9 +541,9 @@ export type Challenges_Min_Order_By = { /** response of any mutation on the table "challenges" */ export type Challenges_Mutation_Response = { - __typename?: 'challenges_mutation_response'; + __typename?: "challenges_mutation_response"; /** number of rows affected by the mutation */ - affected_rows: Scalars['Int']['output']; + affected_rows: Scalars["Int"]["output"]; /** data from the rows affected by the mutation */ returning: Array; }; @@ -580,49 +580,49 @@ export type Challenges_Order_By = { /** primary key columns input for table: challenges */ export type Challenges_Pk_Columns_Input = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; /** select columns of table "challenges" */ export enum Challenges_Select_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Description = 'description', + Description = "description", /** column name */ - Flag = 'flag', + Flag = "flag", /** column name */ - Id = 'id', + Id = "id", /** column name */ - MachineId = 'machine_id', + MachineId = "machine_id", /** column name */ - Name = 'name', + Name = "name", /** column name */ - Point = 'point', + Point = "point", /** column name */ - Stage = 'stage', + Stage = "stage", /** column name */ - UpdatedAt = 'updated_at' + UpdatedAt = "updated_at" } /** input type for updating data in table "challenges" */ export type Challenges_Set_Input = { - created_at?: InputMaybe; - description?: InputMaybe; - flag?: InputMaybe; - id?: InputMaybe; - machine_id?: InputMaybe; - name?: InputMaybe; - point?: InputMaybe; - stage?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; + stage?: InputMaybe; + updated_at?: InputMaybe; }; /** aggregate stddev on columns */ export type Challenges_Stddev_Fields = { - __typename?: 'challenges_stddev_fields'; - point?: Maybe; - stage?: Maybe; + __typename?: "challenges_stddev_fields"; + point?: Maybe; + stage?: Maybe; }; /** order by stddev() on columns of table "challenges" */ @@ -633,9 +633,9 @@ export type Challenges_Stddev_Order_By = { /** aggregate stddev_pop on columns */ export type Challenges_Stddev_Pop_Fields = { - __typename?: 'challenges_stddev_pop_fields'; - point?: Maybe; - stage?: Maybe; + __typename?: "challenges_stddev_pop_fields"; + point?: Maybe; + stage?: Maybe; }; /** order by stddev_pop() on columns of table "challenges" */ @@ -646,9 +646,9 @@ export type Challenges_Stddev_Pop_Order_By = { /** aggregate stddev_samp on columns */ export type Challenges_Stddev_Samp_Fields = { - __typename?: 'challenges_stddev_samp_fields'; - point?: Maybe; - stage?: Maybe; + __typename?: "challenges_stddev_samp_fields"; + point?: Maybe; + stage?: Maybe; }; /** order by stddev_samp() on columns of table "challenges" */ @@ -667,22 +667,22 @@ export type Challenges_Stream_Cursor_Input = { /** Initial value of the column from where the streaming should start */ export type Challenges_Stream_Cursor_Value_Input = { - created_at?: InputMaybe; - description?: InputMaybe; - flag?: InputMaybe; - id?: InputMaybe; - machine_id?: InputMaybe; - name?: InputMaybe; - point?: InputMaybe; - stage?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; + stage?: InputMaybe; + updated_at?: InputMaybe; }; /** aggregate sum on columns */ export type Challenges_Sum_Fields = { - __typename?: 'challenges_sum_fields'; - point?: Maybe; - stage?: Maybe; + __typename?: "challenges_sum_fields"; + point?: Maybe; + stage?: Maybe; }; /** order by sum() on columns of table "challenges" */ @@ -694,23 +694,23 @@ export type Challenges_Sum_Order_By = { /** update columns of table "challenges" */ export enum Challenges_Update_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Description = 'description', + Description = "description", /** column name */ - Flag = 'flag', + Flag = "flag", /** column name */ - Id = 'id', + Id = "id", /** column name */ - MachineId = 'machine_id', + MachineId = "machine_id", /** column name */ - Name = 'name', + Name = "name", /** column name */ - Point = 'point', + Point = "point", /** column name */ - Stage = 'stage', + Stage = "stage", /** column name */ - UpdatedAt = 'updated_at' + UpdatedAt = "updated_at" } export type Challenges_Updates = { @@ -724,9 +724,9 @@ export type Challenges_Updates = { /** aggregate var_pop on columns */ export type Challenges_Var_Pop_Fields = { - __typename?: 'challenges_var_pop_fields'; - point?: Maybe; - stage?: Maybe; + __typename?: "challenges_var_pop_fields"; + point?: Maybe; + stage?: Maybe; }; /** order by var_pop() on columns of table "challenges" */ @@ -737,9 +737,9 @@ export type Challenges_Var_Pop_Order_By = { /** aggregate var_samp on columns */ export type Challenges_Var_Samp_Fields = { - __typename?: 'challenges_var_samp_fields'; - point?: Maybe; - stage?: Maybe; + __typename?: "challenges_var_samp_fields"; + point?: Maybe; + stage?: Maybe; }; /** order by var_samp() on columns of table "challenges" */ @@ -750,9 +750,9 @@ export type Challenges_Var_Samp_Order_By = { /** aggregate variance on columns */ export type Challenges_Variance_Fields = { - __typename?: 'challenges_variance_fields'; - point?: Maybe; - stage?: Maybe; + __typename?: "challenges_variance_fields"; + point?: Maybe; + stage?: Maybe; }; /** order by variance() on columns of table "challenges" */ @@ -764,35 +764,35 @@ export type Challenges_Variance_Order_By = { /** ordering argument of a cursor */ export enum Cursor_Ordering { /** ascending ordering of the cursor */ - Asc = 'ASC', + Asc = "ASC", /** descending ordering of the cursor */ - Desc = 'DESC' + Desc = "DESC" } /** Machines Data */ export type Machines = { - __typename?: 'machines'; + __typename?: "machines"; /** An array relationship */ challenges: Array; /** An aggregate relationship */ challenges_aggregate: Challenges_Aggregate; - created_at: Scalars['timestamptz']['output']; - created_by: Scalars['String']['output']; - depends_on?: Maybe; - description: Scalars['String']['output']; - id: Scalars['String']['output']; - name: Scalars['String']['output']; - no_of_solves: Scalars['Int']['output']; - tags: Scalars['String']['output']; - updated_at: Scalars['timestamptz']['output']; + created_at: Scalars["timestamptz"]["output"]; + created_by: Scalars["String"]["output"]; + depends_on?: Maybe; + description: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + name: Scalars["String"]["output"]; + no_of_solves: Scalars["Int"]["output"]; + tags: Scalars["String"]["output"]; + updated_at: Scalars["timestamptz"]["output"]; }; /** Machines Data */ export type MachinesChallengesArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -801,24 +801,24 @@ export type MachinesChallengesArgs = { /** Machines Data */ export type MachinesChallenges_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; /** aggregated selection of "machines" */ export type Machines_Aggregate = { - __typename?: 'machines_aggregate'; + __typename?: "machines_aggregate"; aggregate?: Maybe; nodes: Array; }; /** aggregate fields of "machines" */ export type Machines_Aggregate_Fields = { - __typename?: 'machines_aggregate_fields'; + __typename?: "machines_aggregate_fields"; avg?: Maybe; - count: Scalars['Int']['output']; + count: Scalars["Int"]["output"]; max?: Maybe; min?: Maybe; stddev?: Maybe; @@ -834,13 +834,13 @@ export type Machines_Aggregate_Fields = { /** aggregate fields of "machines" */ export type Machines_Aggregate_FieldsCountArgs = { columns?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; }; /** aggregate avg on columns */ export type Machines_Avg_Fields = { - __typename?: 'machines_avg_fields'; - no_of_solves?: Maybe; + __typename?: "machines_avg_fields"; + no_of_solves?: Maybe; }; /** Boolean expression to filter rows from the table "machines". All fields are combined with a logical 'AND'. */ @@ -864,63 +864,63 @@ export type Machines_Bool_Exp = { /** unique or primary key constraints on table "machines" */ export enum Machines_Constraint { /** unique or primary key constraint on columns "name" */ - MachinesNameKey = 'machines_name_key', + MachinesNameKey = "machines_name_key", /** unique or primary key constraint on columns "id" */ - MachinesPkey = 'machines_pkey' + MachinesPkey = "machines_pkey" } /** input type for incrementing numeric columns in table "machines" */ export type Machines_Inc_Input = { - no_of_solves?: InputMaybe; + no_of_solves?: InputMaybe; }; /** input type for inserting data into table "machines" */ export type Machines_Insert_Input = { challenges?: InputMaybe; - created_at?: InputMaybe; - created_by?: InputMaybe; - depends_on?: InputMaybe; - description?: InputMaybe; - id?: InputMaybe; - name?: InputMaybe; - no_of_solves?: InputMaybe; - tags?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + created_by?: InputMaybe; + depends_on?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + no_of_solves?: InputMaybe; + tags?: InputMaybe; + updated_at?: InputMaybe; }; /** aggregate max on columns */ export type Machines_Max_Fields = { - __typename?: 'machines_max_fields'; - created_at?: Maybe; - created_by?: Maybe; - depends_on?: Maybe; - description?: Maybe; - id?: Maybe; - name?: Maybe; - no_of_solves?: Maybe; - tags?: Maybe; - updated_at?: Maybe; + __typename?: "machines_max_fields"; + created_at?: Maybe; + created_by?: Maybe; + depends_on?: Maybe; + description?: Maybe; + id?: Maybe; + name?: Maybe; + no_of_solves?: Maybe; + tags?: Maybe; + updated_at?: Maybe; }; /** aggregate min on columns */ export type Machines_Min_Fields = { - __typename?: 'machines_min_fields'; - created_at?: Maybe; - created_by?: Maybe; - depends_on?: Maybe; - description?: Maybe; - id?: Maybe; - name?: Maybe; - no_of_solves?: Maybe; - tags?: Maybe; - updated_at?: Maybe; + __typename?: "machines_min_fields"; + created_at?: Maybe; + created_by?: Maybe; + depends_on?: Maybe; + description?: Maybe; + id?: Maybe; + name?: Maybe; + no_of_solves?: Maybe; + tags?: Maybe; + updated_at?: Maybe; }; /** response of any mutation on the table "machines" */ export type Machines_Mutation_Response = { - __typename?: 'machines_mutation_response'; + __typename?: "machines_mutation_response"; /** number of rows affected by the mutation */ - affected_rows: Scalars['Int']['output']; + affected_rows: Scalars["Int"]["output"]; /** data from the rows affected by the mutation */ returning: Array; }; @@ -955,60 +955,60 @@ export type Machines_Order_By = { /** primary key columns input for table: machines */ export type Machines_Pk_Columns_Input = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; /** select columns of table "machines" */ export enum Machines_Select_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - CreatedBy = 'created_by', + CreatedBy = "created_by", /** column name */ - DependsOn = 'depends_on', + DependsOn = "depends_on", /** column name */ - Description = 'description', + Description = "description", /** column name */ - Id = 'id', + Id = "id", /** column name */ - Name = 'name', + Name = "name", /** column name */ - NoOfSolves = 'no_of_solves', + NoOfSolves = "no_of_solves", /** column name */ - Tags = 'tags', + Tags = "tags", /** column name */ - UpdatedAt = 'updated_at' + UpdatedAt = "updated_at" } /** input type for updating data in table "machines" */ export type Machines_Set_Input = { - created_at?: InputMaybe; - created_by?: InputMaybe; - depends_on?: InputMaybe; - description?: InputMaybe; - id?: InputMaybe; - name?: InputMaybe; - no_of_solves?: InputMaybe; - tags?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + created_by?: InputMaybe; + depends_on?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + no_of_solves?: InputMaybe; + tags?: InputMaybe; + updated_at?: InputMaybe; }; /** aggregate stddev on columns */ export type Machines_Stddev_Fields = { - __typename?: 'machines_stddev_fields'; - no_of_solves?: Maybe; + __typename?: "machines_stddev_fields"; + no_of_solves?: Maybe; }; /** aggregate stddev_pop on columns */ export type Machines_Stddev_Pop_Fields = { - __typename?: 'machines_stddev_pop_fields'; - no_of_solves?: Maybe; + __typename?: "machines_stddev_pop_fields"; + no_of_solves?: Maybe; }; /** aggregate stddev_samp on columns */ export type Machines_Stddev_Samp_Fields = { - __typename?: 'machines_stddev_samp_fields'; - no_of_solves?: Maybe; + __typename?: "machines_stddev_samp_fields"; + no_of_solves?: Maybe; }; /** Streaming cursor of the table "machines" */ @@ -1021,43 +1021,43 @@ export type Machines_Stream_Cursor_Input = { /** Initial value of the column from where the streaming should start */ export type Machines_Stream_Cursor_Value_Input = { - created_at?: InputMaybe; - created_by?: InputMaybe; - depends_on?: InputMaybe; - description?: InputMaybe; - id?: InputMaybe; - name?: InputMaybe; - no_of_solves?: InputMaybe; - tags?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + created_by?: InputMaybe; + depends_on?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + no_of_solves?: InputMaybe; + tags?: InputMaybe; + updated_at?: InputMaybe; }; /** aggregate sum on columns */ export type Machines_Sum_Fields = { - __typename?: 'machines_sum_fields'; - no_of_solves?: Maybe; + __typename?: "machines_sum_fields"; + no_of_solves?: Maybe; }; /** update columns of table "machines" */ export enum Machines_Update_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - CreatedBy = 'created_by', + CreatedBy = "created_by", /** column name */ - DependsOn = 'depends_on', + DependsOn = "depends_on", /** column name */ - Description = 'description', + Description = "description", /** column name */ - Id = 'id', + Id = "id", /** column name */ - Name = 'name', + Name = "name", /** column name */ - NoOfSolves = 'no_of_solves', + NoOfSolves = "no_of_solves", /** column name */ - Tags = 'tags', + Tags = "tags", /** column name */ - UpdatedAt = 'updated_at' + UpdatedAt = "updated_at" } export type Machines_Updates = { @@ -1071,25 +1071,25 @@ export type Machines_Updates = { /** aggregate var_pop on columns */ export type Machines_Var_Pop_Fields = { - __typename?: 'machines_var_pop_fields'; - no_of_solves?: Maybe; + __typename?: "machines_var_pop_fields"; + no_of_solves?: Maybe; }; /** aggregate var_samp on columns */ export type Machines_Var_Samp_Fields = { - __typename?: 'machines_var_samp_fields'; - no_of_solves?: Maybe; + __typename?: "machines_var_samp_fields"; + no_of_solves?: Maybe; }; /** aggregate variance on columns */ export type Machines_Variance_Fields = { - __typename?: 'machines_variance_fields'; - no_of_solves?: Maybe; + __typename?: "machines_variance_fields"; + no_of_solves?: Maybe; }; /** mutation root */ export type Mutation_Root = { - __typename?: 'mutation_root'; + __typename?: "mutation_root"; /** delete data from the table: "bans" */ delete_bans?: Maybe; /** delete single row from the table: "bans" */ @@ -1199,7 +1199,7 @@ export type Mutation_RootDelete_BansArgs = { /** mutation root */ export type Mutation_RootDelete_Bans_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; @@ -1211,7 +1211,7 @@ export type Mutation_RootDelete_ChallengesArgs = { /** mutation root */ export type Mutation_RootDelete_Challenges_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; @@ -1223,7 +1223,7 @@ export type Mutation_RootDelete_MachinesArgs = { /** mutation root */ export type Mutation_RootDelete_Machines_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; @@ -1235,7 +1235,7 @@ export type Mutation_RootDelete_ScoresArgs = { /** mutation root */ export type Mutation_RootDelete_Scores_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; @@ -1247,7 +1247,7 @@ export type Mutation_RootDelete_SubmissionsArgs = { /** mutation root */ export type Mutation_RootDelete_Submissions_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; @@ -1259,7 +1259,7 @@ export type Mutation_RootDelete_TeamsArgs = { /** mutation root */ export type Mutation_RootDelete_Teams_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; @@ -1271,7 +1271,7 @@ export type Mutation_RootDelete_UsersArgs = { /** mutation root */ export type Mutation_RootDelete_Users_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; @@ -1519,21 +1519,21 @@ export type Mutation_RootUpdate_Users_ManyArgs = { /** column ordering options */ export enum Order_By { /** in ascending order, nulls last */ - Asc = 'asc', + Asc = "asc", /** in ascending order, nulls first */ - AscNullsFirst = 'asc_nulls_first', + AscNullsFirst = "asc_nulls_first", /** in ascending order, nulls last */ - AscNullsLast = 'asc_nulls_last', + AscNullsLast = "asc_nulls_last", /** in descending order, nulls first */ - Desc = 'desc', + Desc = "desc", /** in descending order, nulls first */ - DescNullsFirst = 'desc_nulls_first', + DescNullsFirst = "desc_nulls_first", /** in descending order, nulls last */ - DescNullsLast = 'desc_nulls_last' + DescNullsLast = "desc_nulls_last" } export type Query_Root = { - __typename?: 'query_root'; + __typename?: "query_root"; /** An array relationship */ bans: Array; /** An aggregate relationship */ @@ -1581,8 +1581,8 @@ export type Query_Root = { export type Query_RootBansArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -1590,22 +1590,22 @@ export type Query_RootBansArgs = { export type Query_RootBans_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Query_RootBans_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Query_RootChallengesArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -1613,22 +1613,22 @@ export type Query_RootChallengesArgs = { export type Query_RootChallenges_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Query_RootChallenges_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Query_RootMachinesArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -1636,22 +1636,22 @@ export type Query_RootMachinesArgs = { export type Query_RootMachines_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Query_RootMachines_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Query_RootScoresArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -1659,22 +1659,22 @@ export type Query_RootScoresArgs = { export type Query_RootScores_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Query_RootScores_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Query_RootSubmissionsArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -1682,22 +1682,22 @@ export type Query_RootSubmissionsArgs = { export type Query_RootSubmissions_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Query_RootSubmissions_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Query_RootTeamsArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -1705,22 +1705,22 @@ export type Query_RootTeamsArgs = { export type Query_RootTeams_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Query_RootTeams_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Query_RootUsersArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -1728,40 +1728,40 @@ export type Query_RootUsersArgs = { export type Query_RootUsers_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Query_RootUsers_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; /** Scoreboard Data */ export type Scores = { - __typename?: 'scores'; + __typename?: "scores"; /** An object relationship */ challenge: Challenges; - challenge_id: Scalars['String']['output']; - created_at: Scalars['timestamptz']['output']; - id: Scalars['String']['output']; + challenge_id: Scalars["String"]["output"]; + created_at: Scalars["timestamptz"]["output"]; + id: Scalars["String"]["output"]; /** An object relationship */ submission: Submissions; - submission_id: Scalars['String']['output']; + submission_id: Scalars["String"]["output"]; /** An object relationship */ team: Teams; - team_id: Scalars['String']['output']; - updated_at: Scalars['timestamptz']['output']; + team_id: Scalars["String"]["output"]; + updated_at: Scalars["timestamptz"]["output"]; /** An object relationship */ user: Users; - user_id: Scalars['String']['output']; + user_id: Scalars["String"]["output"]; }; /** aggregated selection of "scores" */ export type Scores_Aggregate = { - __typename?: 'scores_aggregate'; + __typename?: "scores_aggregate"; aggregate?: Maybe; nodes: Array; }; @@ -1772,15 +1772,15 @@ export type Scores_Aggregate_Bool_Exp = { export type Scores_Aggregate_Bool_Exp_Count = { arguments?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; filter?: InputMaybe; predicate: Int_Comparison_Exp; }; /** aggregate fields of "scores" */ export type Scores_Aggregate_Fields = { - __typename?: 'scores_aggregate_fields'; - count: Scalars['Int']['output']; + __typename?: "scores_aggregate_fields"; + count: Scalars["Int"]["output"]; max?: Maybe; min?: Maybe; }; @@ -1789,7 +1789,7 @@ export type Scores_Aggregate_Fields = { /** aggregate fields of "scores" */ export type Scores_Aggregate_FieldsCountArgs = { columns?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; }; /** order by aggregate values of table "scores" */ @@ -1827,36 +1827,36 @@ export type Scores_Bool_Exp = { /** unique or primary key constraints on table "scores" */ export enum Scores_Constraint { /** unique or primary key constraint on columns "id" */ - ScoresPkey = 'scores_pkey', + ScoresPkey = "scores_pkey", /** unique or primary key constraint on columns "submission_id" */ - ScoresSubmissionIdKey = 'scores_submission_id_key' + ScoresSubmissionIdKey = "scores_submission_id_key" } /** input type for inserting data into table "scores" */ export type Scores_Insert_Input = { challenge?: InputMaybe; - challenge_id?: InputMaybe; - created_at?: InputMaybe; - id?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; submission?: InputMaybe; - submission_id?: InputMaybe; + submission_id?: InputMaybe; team?: InputMaybe; - team_id?: InputMaybe; - updated_at?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; user?: InputMaybe; - user_id?: InputMaybe; + user_id?: InputMaybe; }; /** aggregate max on columns */ export type Scores_Max_Fields = { - __typename?: 'scores_max_fields'; - challenge_id?: Maybe; - created_at?: Maybe; - id?: Maybe; - submission_id?: Maybe; - team_id?: Maybe; - updated_at?: Maybe; - user_id?: Maybe; + __typename?: "scores_max_fields"; + challenge_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + submission_id?: Maybe; + team_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; /** order by max() on columns of table "scores" */ @@ -1872,14 +1872,14 @@ export type Scores_Max_Order_By = { /** aggregate min on columns */ export type Scores_Min_Fields = { - __typename?: 'scores_min_fields'; - challenge_id?: Maybe; - created_at?: Maybe; - id?: Maybe; - submission_id?: Maybe; - team_id?: Maybe; - updated_at?: Maybe; - user_id?: Maybe; + __typename?: "scores_min_fields"; + challenge_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + submission_id?: Maybe; + team_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; /** order by min() on columns of table "scores" */ @@ -1895,9 +1895,9 @@ export type Scores_Min_Order_By = { /** response of any mutation on the table "scores" */ export type Scores_Mutation_Response = { - __typename?: 'scores_mutation_response'; + __typename?: "scores_mutation_response"; /** number of rows affected by the mutation */ - affected_rows: Scalars['Int']['output']; + affected_rows: Scalars["Int"]["output"]; /** data from the rows affected by the mutation */ returning: Array; }; @@ -1933,36 +1933,36 @@ export type Scores_Order_By = { /** primary key columns input for table: scores */ export type Scores_Pk_Columns_Input = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; /** select columns of table "scores" */ export enum Scores_Select_Column { /** column name */ - ChallengeId = 'challenge_id', + ChallengeId = "challenge_id", /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Id = 'id', + Id = "id", /** column name */ - SubmissionId = 'submission_id', + SubmissionId = "submission_id", /** column name */ - TeamId = 'team_id', + TeamId = "team_id", /** column name */ - UpdatedAt = 'updated_at', + UpdatedAt = "updated_at", /** column name */ - UserId = 'user_id' + UserId = "user_id" } /** input type for updating data in table "scores" */ export type Scores_Set_Input = { - challenge_id?: InputMaybe; - created_at?: InputMaybe; - id?: InputMaybe; - submission_id?: InputMaybe; - team_id?: InputMaybe; - updated_at?: InputMaybe; - user_id?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submission_id?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; }; /** Streaming cursor of the table "scores" */ @@ -1975,31 +1975,31 @@ export type Scores_Stream_Cursor_Input = { /** Initial value of the column from where the streaming should start */ export type Scores_Stream_Cursor_Value_Input = { - challenge_id?: InputMaybe; - created_at?: InputMaybe; - id?: InputMaybe; - submission_id?: InputMaybe; - team_id?: InputMaybe; - updated_at?: InputMaybe; - user_id?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submission_id?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; }; /** update columns of table "scores" */ export enum Scores_Update_Column { /** column name */ - ChallengeId = 'challenge_id', + ChallengeId = "challenge_id", /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Id = 'id', + Id = "id", /** column name */ - SubmissionId = 'submission_id', + SubmissionId = "submission_id", /** column name */ - TeamId = 'team_id', + TeamId = "team_id", /** column name */ - UpdatedAt = 'updated_at', + UpdatedAt = "updated_at", /** column name */ - UserId = 'user_id' + UserId = "user_id" } export type Scores_Updates = { @@ -2011,24 +2011,24 @@ export type Scores_Updates = { /** User flag submissions */ export type Submissions = { - __typename?: 'submissions'; + __typename?: "submissions"; /** An object relationship */ challenge: Challenges; - challenge_id: Scalars['String']['output']; - created_at: Scalars['timestamptz']['output']; - id: Scalars['String']['output']; + challenge_id: Scalars["String"]["output"]; + created_at: Scalars["timestamptz"]["output"]; + id: Scalars["String"]["output"]; /** An object relationship */ score?: Maybe; - submited_flag: Scalars['String']['output']; - updated_at: Scalars['timestamptz']['output']; + submited_flag: Scalars["String"]["output"]; + updated_at: Scalars["timestamptz"]["output"]; /** An object relationship */ user: Users; - user_id: Scalars['String']['output']; + user_id: Scalars["String"]["output"]; }; /** aggregated selection of "submissions" */ export type Submissions_Aggregate = { - __typename?: 'submissions_aggregate'; + __typename?: "submissions_aggregate"; aggregate?: Maybe; nodes: Array; }; @@ -2039,15 +2039,15 @@ export type Submissions_Aggregate_Bool_Exp = { export type Submissions_Aggregate_Bool_Exp_Count = { arguments?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; filter?: InputMaybe; predicate: Int_Comparison_Exp; }; /** aggregate fields of "submissions" */ export type Submissions_Aggregate_Fields = { - __typename?: 'submissions_aggregate_fields'; - count: Scalars['Int']['output']; + __typename?: "submissions_aggregate_fields"; + count: Scalars["Int"]["output"]; max?: Maybe; min?: Maybe; }; @@ -2056,7 +2056,7 @@ export type Submissions_Aggregate_Fields = { /** aggregate fields of "submissions" */ export type Submissions_Aggregate_FieldsCountArgs = { columns?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; }; /** order by aggregate values of table "submissions" */ @@ -2092,31 +2092,31 @@ export type Submissions_Bool_Exp = { /** unique or primary key constraints on table "submissions" */ export enum Submissions_Constraint { /** unique or primary key constraint on columns "id" */ - SubmissionsPkey = 'submissions_pkey' + SubmissionsPkey = "submissions_pkey" } /** input type for inserting data into table "submissions" */ export type Submissions_Insert_Input = { challenge?: InputMaybe; - challenge_id?: InputMaybe; - created_at?: InputMaybe; - id?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; score?: InputMaybe; - submited_flag?: InputMaybe; - updated_at?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; user?: InputMaybe; - user_id?: InputMaybe; + user_id?: InputMaybe; }; /** aggregate max on columns */ export type Submissions_Max_Fields = { - __typename?: 'submissions_max_fields'; - challenge_id?: Maybe; - created_at?: Maybe; - id?: Maybe; - submited_flag?: Maybe; - updated_at?: Maybe; - user_id?: Maybe; + __typename?: "submissions_max_fields"; + challenge_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + submited_flag?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; /** order by max() on columns of table "submissions" */ @@ -2131,13 +2131,13 @@ export type Submissions_Max_Order_By = { /** aggregate min on columns */ export type Submissions_Min_Fields = { - __typename?: 'submissions_min_fields'; - challenge_id?: Maybe; - created_at?: Maybe; - id?: Maybe; - submited_flag?: Maybe; - updated_at?: Maybe; - user_id?: Maybe; + __typename?: "submissions_min_fields"; + challenge_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + submited_flag?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; /** order by min() on columns of table "submissions" */ @@ -2152,9 +2152,9 @@ export type Submissions_Min_Order_By = { /** response of any mutation on the table "submissions" */ export type Submissions_Mutation_Response = { - __typename?: 'submissions_mutation_response'; + __typename?: "submissions_mutation_response"; /** number of rows affected by the mutation */ - affected_rows: Scalars['Int']['output']; + affected_rows: Scalars["Int"]["output"]; /** data from the rows affected by the mutation */ returning: Array; }; @@ -2188,33 +2188,33 @@ export type Submissions_Order_By = { /** primary key columns input for table: submissions */ export type Submissions_Pk_Columns_Input = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; /** select columns of table "submissions" */ export enum Submissions_Select_Column { /** column name */ - ChallengeId = 'challenge_id', + ChallengeId = "challenge_id", /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Id = 'id', + Id = "id", /** column name */ - SubmitedFlag = 'submited_flag', + SubmitedFlag = "submited_flag", /** column name */ - UpdatedAt = 'updated_at', + UpdatedAt = "updated_at", /** column name */ - UserId = 'user_id' + UserId = "user_id" } /** input type for updating data in table "submissions" */ export type Submissions_Set_Input = { - challenge_id?: InputMaybe; - created_at?: InputMaybe; - id?: InputMaybe; - submited_flag?: InputMaybe; - updated_at?: InputMaybe; - user_id?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; }; /** Streaming cursor of the table "submissions" */ @@ -2227,28 +2227,28 @@ export type Submissions_Stream_Cursor_Input = { /** Initial value of the column from where the streaming should start */ export type Submissions_Stream_Cursor_Value_Input = { - challenge_id?: InputMaybe; - created_at?: InputMaybe; - id?: InputMaybe; - submited_flag?: InputMaybe; - updated_at?: InputMaybe; - user_id?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; }; /** update columns of table "submissions" */ export enum Submissions_Update_Column { /** column name */ - ChallengeId = 'challenge_id', + ChallengeId = "challenge_id", /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Id = 'id', + Id = "id", /** column name */ - SubmitedFlag = 'submited_flag', + SubmitedFlag = "submited_flag", /** column name */ - UpdatedAt = 'updated_at', + UpdatedAt = "updated_at", /** column name */ - UserId = 'user_id' + UserId = "user_id" } export type Submissions_Updates = { @@ -2259,7 +2259,7 @@ export type Submissions_Updates = { }; export type Subscription_Root = { - __typename?: 'subscription_root'; + __typename?: "subscription_root"; /** An array relationship */ bans: Array; /** An aggregate relationship */ @@ -2321,8 +2321,8 @@ export type Subscription_Root = { export type Subscription_RootBansArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2330,20 +2330,20 @@ export type Subscription_RootBansArgs = { export type Subscription_RootBans_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Subscription_RootBans_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Subscription_RootBans_StreamArgs = { - batch_size: Scalars['Int']['input']; + batch_size: Scalars["Int"]["input"]; cursor: Array>; where?: InputMaybe; }; @@ -2351,8 +2351,8 @@ export type Subscription_RootBans_StreamArgs = { export type Subscription_RootChallengesArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2360,20 +2360,20 @@ export type Subscription_RootChallengesArgs = { export type Subscription_RootChallenges_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Subscription_RootChallenges_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Subscription_RootChallenges_StreamArgs = { - batch_size: Scalars['Int']['input']; + batch_size: Scalars["Int"]["input"]; cursor: Array>; where?: InputMaybe; }; @@ -2381,8 +2381,8 @@ export type Subscription_RootChallenges_StreamArgs = { export type Subscription_RootMachinesArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2390,20 +2390,20 @@ export type Subscription_RootMachinesArgs = { export type Subscription_RootMachines_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Subscription_RootMachines_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Subscription_RootMachines_StreamArgs = { - batch_size: Scalars['Int']['input']; + batch_size: Scalars["Int"]["input"]; cursor: Array>; where?: InputMaybe; }; @@ -2411,8 +2411,8 @@ export type Subscription_RootMachines_StreamArgs = { export type Subscription_RootScoresArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2420,20 +2420,20 @@ export type Subscription_RootScoresArgs = { export type Subscription_RootScores_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Subscription_RootScores_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Subscription_RootScores_StreamArgs = { - batch_size: Scalars['Int']['input']; + batch_size: Scalars["Int"]["input"]; cursor: Array>; where?: InputMaybe; }; @@ -2441,8 +2441,8 @@ export type Subscription_RootScores_StreamArgs = { export type Subscription_RootSubmissionsArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2450,20 +2450,20 @@ export type Subscription_RootSubmissionsArgs = { export type Subscription_RootSubmissions_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Subscription_RootSubmissions_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Subscription_RootSubmissions_StreamArgs = { - batch_size: Scalars['Int']['input']; + batch_size: Scalars["Int"]["input"]; cursor: Array>; where?: InputMaybe; }; @@ -2471,8 +2471,8 @@ export type Subscription_RootSubmissions_StreamArgs = { export type Subscription_RootTeamsArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2480,20 +2480,20 @@ export type Subscription_RootTeamsArgs = { export type Subscription_RootTeams_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Subscription_RootTeams_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Subscription_RootTeams_StreamArgs = { - batch_size: Scalars['Int']['input']; + batch_size: Scalars["Int"]["input"]; cursor: Array>; where?: InputMaybe; }; @@ -2501,8 +2501,8 @@ export type Subscription_RootTeams_StreamArgs = { export type Subscription_RootUsersArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2510,36 +2510,36 @@ export type Subscription_RootUsersArgs = { export type Subscription_RootUsers_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; export type Subscription_RootUsers_By_PkArgs = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; export type Subscription_RootUsers_StreamArgs = { - batch_size: Scalars['Int']['input']; + batch_size: Scalars["Int"]["input"]; cursor: Array>; where?: InputMaybe; }; /** Teams Data */ export type Teams = { - __typename?: 'teams'; - created_at: Scalars['timestamptz']['output']; - id: Scalars['String']['output']; - join_code: Scalars['String']['output']; - name: Scalars['String']['output']; + __typename?: "teams"; + created_at: Scalars["timestamptz"]["output"]; + id: Scalars["String"]["output"]; + join_code: Scalars["String"]["output"]; + name: Scalars["String"]["output"]; /** An array relationship */ scores: Array; /** An aggregate relationship */ scores_aggregate: Scores_Aggregate; - updated_at: Scalars['timestamptz']['output']; + updated_at: Scalars["timestamptz"]["output"]; /** An array relationship */ users: Array; /** An aggregate relationship */ @@ -2550,8 +2550,8 @@ export type Teams = { /** Teams Data */ export type TeamsScoresArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2560,8 +2560,8 @@ export type TeamsScoresArgs = { /** Teams Data */ export type TeamsScores_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2570,8 +2570,8 @@ export type TeamsScores_AggregateArgs = { /** Teams Data */ export type TeamsUsersArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2580,23 +2580,23 @@ export type TeamsUsersArgs = { /** Teams Data */ export type TeamsUsers_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; /** aggregated selection of "teams" */ export type Teams_Aggregate = { - __typename?: 'teams_aggregate'; + __typename?: "teams_aggregate"; aggregate?: Maybe; nodes: Array; }; /** aggregate fields of "teams" */ export type Teams_Aggregate_Fields = { - __typename?: 'teams_aggregate_fields'; - count: Scalars['Int']['output']; + __typename?: "teams_aggregate_fields"; + count: Scalars["Int"]["output"]; max?: Maybe; min?: Maybe; }; @@ -2605,7 +2605,7 @@ export type Teams_Aggregate_Fields = { /** aggregate fields of "teams" */ export type Teams_Aggregate_FieldsCountArgs = { columns?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; }; /** Boolean expression to filter rows from the table "teams". All fields are combined with a logical 'AND'. */ @@ -2627,49 +2627,49 @@ export type Teams_Bool_Exp = { /** unique or primary key constraints on table "teams" */ export enum Teams_Constraint { /** unique or primary key constraint on columns "join_code" */ - TeamsJoinCodeKey = 'teams_join_code_key', + TeamsJoinCodeKey = "teams_join_code_key", /** unique or primary key constraint on columns "name" */ - TeamsNameKey = 'teams_name_key', + TeamsNameKey = "teams_name_key", /** unique or primary key constraint on columns "id" */ - TeamsPkey = 'teams_pkey' + TeamsPkey = "teams_pkey" } /** input type for inserting data into table "teams" */ export type Teams_Insert_Input = { - created_at?: InputMaybe; - id?: InputMaybe; - join_code?: InputMaybe; - name?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + join_code?: InputMaybe; + name?: InputMaybe; scores?: InputMaybe; - updated_at?: InputMaybe; + updated_at?: InputMaybe; users?: InputMaybe; }; /** aggregate max on columns */ export type Teams_Max_Fields = { - __typename?: 'teams_max_fields'; - created_at?: Maybe; - id?: Maybe; - join_code?: Maybe; - name?: Maybe; - updated_at?: Maybe; + __typename?: "teams_max_fields"; + created_at?: Maybe; + id?: Maybe; + join_code?: Maybe; + name?: Maybe; + updated_at?: Maybe; }; /** aggregate min on columns */ export type Teams_Min_Fields = { - __typename?: 'teams_min_fields'; - created_at?: Maybe; - id?: Maybe; - join_code?: Maybe; - name?: Maybe; - updated_at?: Maybe; + __typename?: "teams_min_fields"; + created_at?: Maybe; + id?: Maybe; + join_code?: Maybe; + name?: Maybe; + updated_at?: Maybe; }; /** response of any mutation on the table "teams" */ export type Teams_Mutation_Response = { - __typename?: 'teams_mutation_response'; + __typename?: "teams_mutation_response"; /** number of rows affected by the mutation */ - affected_rows: Scalars['Int']['output']; + affected_rows: Scalars["Int"]["output"]; /** data from the rows affected by the mutation */ returning: Array; }; @@ -2701,30 +2701,30 @@ export type Teams_Order_By = { /** primary key columns input for table: teams */ export type Teams_Pk_Columns_Input = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; /** select columns of table "teams" */ export enum Teams_Select_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Id = 'id', + Id = "id", /** column name */ - JoinCode = 'join_code', + JoinCode = "join_code", /** column name */ - Name = 'name', + Name = "name", /** column name */ - UpdatedAt = 'updated_at' + UpdatedAt = "updated_at" } /** input type for updating data in table "teams" */ export type Teams_Set_Input = { - created_at?: InputMaybe; - id?: InputMaybe; - join_code?: InputMaybe; - name?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + join_code?: InputMaybe; + name?: InputMaybe; + updated_at?: InputMaybe; }; /** Streaming cursor of the table "teams" */ @@ -2737,25 +2737,25 @@ export type Teams_Stream_Cursor_Input = { /** Initial value of the column from where the streaming should start */ export type Teams_Stream_Cursor_Value_Input = { - created_at?: InputMaybe; - id?: InputMaybe; - join_code?: InputMaybe; - name?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + join_code?: InputMaybe; + name?: InputMaybe; + updated_at?: InputMaybe; }; /** update columns of table "teams" */ export enum Teams_Update_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Id = 'id', + Id = "id", /** column name */ - JoinCode = 'join_code', + JoinCode = "join_code", /** column name */ - Name = 'name', + Name = "name", /** column name */ - UpdatedAt = 'updated_at' + UpdatedAt = "updated_at" } export type Teams_Updates = { @@ -2767,35 +2767,35 @@ export type Teams_Updates = { /** Boolean expression to compare columns of type "timestamptz". All fields are combined with logical 'AND'. */ export type Timestamptz_Comparison_Exp = { - _eq?: InputMaybe; - _gt?: InputMaybe; - _gte?: InputMaybe; - _in?: InputMaybe>; - _is_null?: InputMaybe; - _lt?: InputMaybe; - _lte?: InputMaybe; - _neq?: InputMaybe; - _nin?: InputMaybe>; + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + _in?: InputMaybe>; + _is_null?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + _nin?: InputMaybe>; }; /** Users Data */ export type Users = { - __typename?: 'users'; + __typename?: "users"; /** An array relationship */ bans: Array; /** An aggregate relationship */ bans_aggregate: Bans_Aggregate; - created_at: Scalars['timestamptz']['output']; - email: Scalars['String']['output']; - email_verification_code: Scalars['String']['output']; - first_name: Scalars['String']['output']; - hash: Scalars['String']['output']; - id: Scalars['String']['output']; - is_admin: Scalars['Boolean']['output']; - is_banned: Scalars['Boolean']['output']; - is_email_verified: Scalars['Boolean']['output']; - last_name: Scalars['String']['output']; - salt: Scalars['String']['output']; + created_at: Scalars["timestamptz"]["output"]; + email: Scalars["String"]["output"]; + email_verification_code: Scalars["String"]["output"]; + first_name: Scalars["String"]["output"]; + hash: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + is_admin: Scalars["Boolean"]["output"]; + is_banned: Scalars["Boolean"]["output"]; + is_email_verified: Scalars["Boolean"]["output"]; + last_name: Scalars["String"]["output"]; + salt: Scalars["String"]["output"]; /** An array relationship */ scores: Array; /** An aggregate relationship */ @@ -2806,16 +2806,16 @@ export type Users = { submissions_aggregate: Submissions_Aggregate; /** An object relationship */ team?: Maybe; - team_id?: Maybe; - updated_at: Scalars['timestamptz']['output']; + team_id?: Maybe; + updated_at: Scalars["timestamptz"]["output"]; }; /** Users Data */ export type UsersBansArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2824,8 +2824,8 @@ export type UsersBansArgs = { /** Users Data */ export type UsersBans_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2834,8 +2834,8 @@ export type UsersBans_AggregateArgs = { /** Users Data */ export type UsersScoresArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2844,8 +2844,8 @@ export type UsersScoresArgs = { /** Users Data */ export type UsersScores_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2854,8 +2854,8 @@ export type UsersScores_AggregateArgs = { /** Users Data */ export type UsersSubmissionsArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2864,15 +2864,15 @@ export type UsersSubmissionsArgs = { /** Users Data */ export type UsersSubmissions_AggregateArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; /** aggregated selection of "users" */ export type Users_Aggregate = { - __typename?: 'users_aggregate'; + __typename?: "users_aggregate"; aggregate?: Maybe; nodes: Array; }; @@ -2885,29 +2885,29 @@ export type Users_Aggregate_Bool_Exp = { export type Users_Aggregate_Bool_Exp_Bool_And = { arguments: Users_Select_Column_Users_Aggregate_Bool_Exp_Bool_And_Arguments_Columns; - distinct?: InputMaybe; + distinct?: InputMaybe; filter?: InputMaybe; predicate: Boolean_Comparison_Exp; }; export type Users_Aggregate_Bool_Exp_Bool_Or = { arguments: Users_Select_Column_Users_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns; - distinct?: InputMaybe; + distinct?: InputMaybe; filter?: InputMaybe; predicate: Boolean_Comparison_Exp; }; export type Users_Aggregate_Bool_Exp_Count = { arguments?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; filter?: InputMaybe; predicate: Int_Comparison_Exp; }; /** aggregate fields of "users" */ export type Users_Aggregate_Fields = { - __typename?: 'users_aggregate_fields'; - count: Scalars['Int']['output']; + __typename?: "users_aggregate_fields"; + count: Scalars["Int"]["output"]; max?: Maybe; min?: Maybe; }; @@ -2916,7 +2916,7 @@ export type Users_Aggregate_Fields = { /** aggregate fields of "users" */ export type Users_Aggregate_FieldsCountArgs = { columns?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; }; /** order by aggregate values of table "users" */ @@ -2963,49 +2963,49 @@ export type Users_Bool_Exp = { /** unique or primary key constraints on table "users" */ export enum Users_Constraint { /** unique or primary key constraint on columns "email" */ - UsersEmailKey = 'users_email_key', + UsersEmailKey = "users_email_key", /** unique or primary key constraint on columns "hash" */ - UsersHashKey = 'users_hash_key', + UsersHashKey = "users_hash_key", /** unique or primary key constraint on columns "id" */ - UsersPkey = 'users_pkey', + UsersPkey = "users_pkey", /** unique or primary key constraint on columns "salt" */ - UsersSaltKey = 'users_salt_key' + UsersSaltKey = "users_salt_key" } /** input type for inserting data into table "users" */ export type Users_Insert_Input = { bans?: InputMaybe; - created_at?: InputMaybe; - email?: InputMaybe; - email_verification_code?: InputMaybe; - first_name?: InputMaybe; - hash?: InputMaybe; - id?: InputMaybe; - is_admin?: InputMaybe; - is_banned?: InputMaybe; - is_email_verified?: InputMaybe; - last_name?: InputMaybe; - salt?: InputMaybe; + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + is_admin?: InputMaybe; + is_banned?: InputMaybe; + is_email_verified?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; scores?: InputMaybe; submissions?: InputMaybe; team?: InputMaybe; - team_id?: InputMaybe; - updated_at?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; }; /** aggregate max on columns */ export type Users_Max_Fields = { - __typename?: 'users_max_fields'; - created_at?: Maybe; - email?: Maybe; - email_verification_code?: Maybe; - first_name?: Maybe; - hash?: Maybe; - id?: Maybe; - last_name?: Maybe; - salt?: Maybe; - team_id?: Maybe; - updated_at?: Maybe; + __typename?: "users_max_fields"; + created_at?: Maybe; + email?: Maybe; + email_verification_code?: Maybe; + first_name?: Maybe; + hash?: Maybe; + id?: Maybe; + last_name?: Maybe; + salt?: Maybe; + team_id?: Maybe; + updated_at?: Maybe; }; /** order by max() on columns of table "users" */ @@ -3024,17 +3024,17 @@ export type Users_Max_Order_By = { /** aggregate min on columns */ export type Users_Min_Fields = { - __typename?: 'users_min_fields'; - created_at?: Maybe; - email?: Maybe; - email_verification_code?: Maybe; - first_name?: Maybe; - hash?: Maybe; - id?: Maybe; - last_name?: Maybe; - salt?: Maybe; - team_id?: Maybe; - updated_at?: Maybe; + __typename?: "users_min_fields"; + created_at?: Maybe; + email?: Maybe; + email_verification_code?: Maybe; + first_name?: Maybe; + hash?: Maybe; + id?: Maybe; + last_name?: Maybe; + salt?: Maybe; + team_id?: Maybe; + updated_at?: Maybe; }; /** order by min() on columns of table "users" */ @@ -3053,9 +3053,9 @@ export type Users_Min_Order_By = { /** response of any mutation on the table "users" */ export type Users_Mutation_Response = { - __typename?: 'users_mutation_response'; + __typename?: "users_mutation_response"; /** number of rows affected by the mutation */ - affected_rows: Scalars['Int']['output']; + affected_rows: Scalars["Int"]["output"]; /** data from the rows affected by the mutation */ returning: Array; }; @@ -3097,74 +3097,74 @@ export type Users_Order_By = { /** primary key columns input for table: users */ export type Users_Pk_Columns_Input = { - id: Scalars['String']['input']; + id: Scalars["String"]["input"]; }; /** select columns of table "users" */ export enum Users_Select_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Email = 'email', + Email = "email", /** column name */ - EmailVerificationCode = 'email_verification_code', + EmailVerificationCode = "email_verification_code", /** column name */ - FirstName = 'first_name', + FirstName = "first_name", /** column name */ - Hash = 'hash', + Hash = "hash", /** column name */ - Id = 'id', + Id = "id", /** column name */ - IsAdmin = 'is_admin', + IsAdmin = "is_admin", /** column name */ - IsBanned = 'is_banned', + IsBanned = "is_banned", /** column name */ - IsEmailVerified = 'is_email_verified', + IsEmailVerified = "is_email_verified", /** column name */ - LastName = 'last_name', + LastName = "last_name", /** column name */ - Salt = 'salt', + Salt = "salt", /** column name */ - TeamId = 'team_id', + TeamId = "team_id", /** column name */ - UpdatedAt = 'updated_at' + UpdatedAt = "updated_at" } /** select "users_aggregate_bool_exp_bool_and_arguments_columns" columns of table "users" */ export enum Users_Select_Column_Users_Aggregate_Bool_Exp_Bool_And_Arguments_Columns { /** column name */ - IsAdmin = 'is_admin', + IsAdmin = "is_admin", /** column name */ - IsBanned = 'is_banned', + IsBanned = "is_banned", /** column name */ - IsEmailVerified = 'is_email_verified' + IsEmailVerified = "is_email_verified" } /** select "users_aggregate_bool_exp_bool_or_arguments_columns" columns of table "users" */ export enum Users_Select_Column_Users_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns { /** column name */ - IsAdmin = 'is_admin', + IsAdmin = "is_admin", /** column name */ - IsBanned = 'is_banned', + IsBanned = "is_banned", /** column name */ - IsEmailVerified = 'is_email_verified' + IsEmailVerified = "is_email_verified" } /** input type for updating data in table "users" */ export type Users_Set_Input = { - created_at?: InputMaybe; - email?: InputMaybe; - email_verification_code?: InputMaybe; - first_name?: InputMaybe; - hash?: InputMaybe; - id?: InputMaybe; - is_admin?: InputMaybe; - is_banned?: InputMaybe; - is_email_verified?: InputMaybe; - last_name?: InputMaybe; - salt?: InputMaybe; - team_id?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + is_admin?: InputMaybe; + is_banned?: InputMaybe; + is_email_verified?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; }; /** Streaming cursor of the table "users" */ @@ -3177,49 +3177,49 @@ export type Users_Stream_Cursor_Input = { /** Initial value of the column from where the streaming should start */ export type Users_Stream_Cursor_Value_Input = { - created_at?: InputMaybe; - email?: InputMaybe; - email_verification_code?: InputMaybe; - first_name?: InputMaybe; - hash?: InputMaybe; - id?: InputMaybe; - is_admin?: InputMaybe; - is_banned?: InputMaybe; - is_email_verified?: InputMaybe; - last_name?: InputMaybe; - salt?: InputMaybe; - team_id?: InputMaybe; - updated_at?: InputMaybe; + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + is_admin?: InputMaybe; + is_banned?: InputMaybe; + is_email_verified?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; }; /** update columns of table "users" */ export enum Users_Update_Column { /** column name */ - CreatedAt = 'created_at', + CreatedAt = "created_at", /** column name */ - Email = 'email', + Email = "email", /** column name */ - EmailVerificationCode = 'email_verification_code', + EmailVerificationCode = "email_verification_code", /** column name */ - FirstName = 'first_name', + FirstName = "first_name", /** column name */ - Hash = 'hash', + Hash = "hash", /** column name */ - Id = 'id', + Id = "id", /** column name */ - IsAdmin = 'is_admin', + IsAdmin = "is_admin", /** column name */ - IsBanned = 'is_banned', + IsBanned = "is_banned", /** column name */ - IsEmailVerified = 'is_email_verified', + IsEmailVerified = "is_email_verified", /** column name */ - LastName = 'last_name', + LastName = "last_name", /** column name */ - Salt = 'salt', + Salt = "salt", /** column name */ - TeamId = 'team_id', + TeamId = "team_id", /** column name */ - UpdatedAt = 'updated_at' + UpdatedAt = "updated_at" } export type Users_Updates = { diff --git a/packages/api/services/bans.service.ts b/packages/api/services/bans.service.ts index e5fba32..84b1e5e 100644 --- a/packages/api/services/bans.service.ts +++ b/packages/api/services/bans.service.ts @@ -13,13 +13,13 @@ export class BanService { id: snowflake.generate(), user_id: userId, ip, - } + }; const query = gql` - mutation createBanRecord($object: bans_insert_input!) { - insert_bans_one(object: $object) { - id - } - } + mutation createBanRecord($object: bans_insert_input!) { + insert_bans_one(object: $object) { + id + } + } `; const { insert_bans_one } : Mutation_Root = await client.request(query, { @@ -35,16 +35,16 @@ export class BanService { catch (error: any) { throw new Error(error.message); } - } + }; public checkBanListS = async (userId: string) => { try { const query = gql` - query checkUserForBan($userId: String!) { - users_by_pk(id: $userId) { - is_banned - } - } + query checkUserForBan($userId: String!) { + users_by_pk(id: $userId) { + is_banned + } + } `; const { users_by_pk } : Query_Root = await client.request(query, { @@ -60,5 +60,5 @@ export class BanService { catch (error: any) { throw new Error(error.message); } - } + }; } \ No newline at end of file diff --git a/packages/api/services/challenges.service.ts b/packages/api/services/challenges.service.ts index 390bf50..1974c7d 100644 --- a/packages/api/services/challenges.service.ts +++ b/packages/api/services/challenges.service.ts @@ -361,7 +361,7 @@ export class ChallengeService { description: machine.description, challenges: [], total_challenges: total_machines_progress[machine.id], - depends_on: machine.depends_on ?? '', + depends_on: machine.depends_on ?? "", }; for(const challenge of machine.challenges) { diff --git a/packages/scorefeed/.env.example b/packages/scorefeed/.env.example new file mode 100644 index 0000000..31855cc --- /dev/null +++ b/packages/scorefeed/.env.example @@ -0,0 +1,11 @@ +HASURA_GRAPHQL_ENDPOINT= +HASURA_GRAPHQL_ADMIN_SECRET= +MAIL_HOST= +MAIL_PORT= +MAIL_USER= +MAIL_PASS= +MAIL_LOGGER= +MAIL_FROM_EMAIL= +MAIL_FROM_NAME= +PORT= +NODE_ENV= \ No newline at end of file diff --git a/packages/scorefeed/.eslintignore b/packages/scorefeed/.eslintignore new file mode 100644 index 0000000..53c37a1 --- /dev/null +++ b/packages/scorefeed/.eslintignore @@ -0,0 +1 @@ +dist \ No newline at end of file diff --git a/packages/scorefeed/.gitignore b/packages/scorefeed/.gitignore new file mode 100644 index 0000000..3edfbfa --- /dev/null +++ b/packages/scorefeed/.gitignore @@ -0,0 +1,42 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# Dependencies +node_modules +.pnp +.pnp.js + +# Local env files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# Testing +coverage + +# Turbo +.turbo + +# Vercel +.vercel + +# Build Outputs +.next/ +out/ +build +dist + + +# Debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Misc +.DS_Store +*.pem + +# Keys +packages/api/keys/jwtRS256.key +packages/api/keys/jwtRS256.key.pub \ No newline at end of file diff --git a/packages/scorefeed/codegen.yml b/packages/scorefeed/codegen.yml new file mode 100644 index 0000000..77eeece --- /dev/null +++ b/packages/scorefeed/codegen.yml @@ -0,0 +1,6 @@ +schema: graphql/schema.graphql +generates: + graphql/types.ts: + plugins: + - 'typescript' + - 'typescript-operations' \ No newline at end of file diff --git a/packages/scorefeed/config/env.ts b/packages/scorefeed/config/env.ts new file mode 100644 index 0000000..271f18c --- /dev/null +++ b/packages/scorefeed/config/env.ts @@ -0,0 +1,20 @@ +import { z } from "zod"; +declare global { + namespace NodeJS { + interface ProcessEnv extends z.infer {} + } +} + +const ZodEnvironmentVariables = z.object({ + PORT: z.string(), + NODE_ENV: z.string(), + HASURA_GRAPHQL_ADMIN_SECRET: z.string(), + HASURA_GRAPHQL_ENDPOINT: z.string(), + CTFTIME_REDIRECT_URI: z.string(), + CTFTIME_CLIENT_ID: z.string(), + CTFTIME_CLIENT_SECRET: z.string(), +}); + +ZodEnvironmentVariables.parse(process.env); + +console.log("āœ… Environment variables verified!"); \ No newline at end of file diff --git a/packages/scorefeed/controllers/ctftime.controller.ts b/packages/scorefeed/controllers/ctftime.controller.ts new file mode 100644 index 0000000..38b2afd --- /dev/null +++ b/packages/scorefeed/controllers/ctftime.controller.ts @@ -0,0 +1,65 @@ +import { Context } from "hono"; + +import { CTFTimeClient } from "../helpers/ctftimeClient"; + +export class CTFTimeControtoller extends CTFTimeClient { + public generateAuthURL = async (ctx: Context) => { + try { + const authURL = await this.getAuthURL(); + return ctx.redirect(authURL as string); + } + catch { + return ctx.json({ + status: 500, + message: "Something went wrong, come to us :)" + }, 500); + } + }; + + public retriveAccessToken = async (ctx: Context) => { + try { + const { code } = ctx.req.query(); + if(!code) { + return ctx.json({ + status: 400, + message: "Bad Request" + }, 400); + } + const data = await this.getAccessToken(code); + return ctx.json({ + status: 200, + message: data + }); + } + catch(error: any) { + console.log(error); + return ctx.json({ + status: 500, + message: "Something went wrong, come to us :)" + }, 500); + } + }; + + public retriveProfile = async (ctx: Context) => { + try { + const { access_token } = ctx.req.query(); + if(!access_token) { + return ctx.json({ + status: 400, + message: "Bad Request" + }, 400); + } + const data = await this.getProfile(access_token); + return ctx.json({ + status: 200, + message: data + }); + } + catch { + return ctx.json({ + status: 500, + message: "Something went wrong, come to us :)" + }, 500); + } + }; +} \ No newline at end of file diff --git a/packages/scorefeed/graphql/schema.graphql b/packages/scorefeed/graphql/schema.graphql new file mode 100644 index 0000000..0b2444e --- /dev/null +++ b/packages/scorefeed/graphql/schema.graphql @@ -0,0 +1,3875 @@ +schema { + query: query_root + mutation: mutation_root + subscription: subscription_root +} + +"""whether this query should be cached (Hasura Cloud only)""" +directive @cached( + """measured in seconds""" + ttl: Int! = 60 + + """refresh the cache entry""" + refresh: Boolean! = false +) on QUERY + +""" +Boolean expression to compare columns of type "Boolean". All fields are combined with logical 'AND'. +""" +input Boolean_comparison_exp { + _eq: Boolean + _gt: Boolean + _gte: Boolean + _in: [Boolean!] + _is_null: Boolean + _lt: Boolean + _lte: Boolean + _neq: Boolean + _nin: [Boolean!] +} + +""" +Boolean expression to compare columns of type "Int". All fields are combined with logical 'AND'. +""" +input Int_comparison_exp { + _eq: Int + _gt: Int + _gte: Int + _in: [Int!] + _is_null: Boolean + _lt: Int + _lte: Int + _neq: Int + _nin: [Int!] +} + +""" +Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. +""" +input String_comparison_exp { + _eq: String + _gt: String + _gte: String + + """does the column match the given case-insensitive pattern""" + _ilike: String + _in: [String!] + + """ + does the column match the given POSIX regular expression, case insensitive + """ + _iregex: String + _is_null: Boolean + + """does the column match the given pattern""" + _like: String + _lt: String + _lte: String + _neq: String + + """does the column NOT match the given case-insensitive pattern""" + _nilike: String + _nin: [String!] + + """ + does the column NOT match the given POSIX regular expression, case insensitive + """ + _niregex: String + + """does the column NOT match the given pattern""" + _nlike: String + + """ + does the column NOT match the given POSIX regular expression, case sensitive + """ + _nregex: String + + """does the column NOT match the given SQL regular expression""" + _nsimilar: String + + """ + does the column match the given POSIX regular expression, case sensitive + """ + _regex: String + + """does the column match the given SQL regular expression""" + _similar: String +} + +"""Bans issued to users""" +type bans { + created_at: timestamptz! + id: String! + ip: String! + updated_at: timestamptz! + + """An object relationship""" + user: users! + user_id: String! +} + +""" +aggregated selection of "bans" +""" +type bans_aggregate { + aggregate: bans_aggregate_fields + nodes: [bans!]! +} + +input bans_aggregate_bool_exp { + count: bans_aggregate_bool_exp_count +} + +input bans_aggregate_bool_exp_count { + arguments: [bans_select_column!] + distinct: Boolean + filter: bans_bool_exp + predicate: Int_comparison_exp! +} + +""" +aggregate fields of "bans" +""" +type bans_aggregate_fields { + count(columns: [bans_select_column!], distinct: Boolean): Int! + max: bans_max_fields + min: bans_min_fields +} + +""" +order by aggregate values of table "bans" +""" +input bans_aggregate_order_by { + count: order_by + max: bans_max_order_by + min: bans_min_order_by +} + +""" +input type for inserting array relation for remote table "bans" +""" +input bans_arr_rel_insert_input { + data: [bans_insert_input!]! + + """upsert condition""" + on_conflict: bans_on_conflict +} + +""" +Boolean expression to filter rows from the table "bans". All fields are combined with a logical 'AND'. +""" +input bans_bool_exp { + _and: [bans_bool_exp!] + _not: bans_bool_exp + _or: [bans_bool_exp!] + created_at: timestamptz_comparison_exp + id: String_comparison_exp + ip: String_comparison_exp + updated_at: timestamptz_comparison_exp + user: users_bool_exp + user_id: String_comparison_exp +} + +""" +unique or primary key constraints on table "bans" +""" +enum bans_constraint { + """ + unique or primary key constraint on columns "id" + """ + bans_pkey +} + +""" +input type for inserting data into table "bans" +""" +input bans_insert_input { + created_at: timestamptz + id: String + ip: String + updated_at: timestamptz + user: users_obj_rel_insert_input + user_id: String +} + +"""aggregate max on columns""" +type bans_max_fields { + created_at: timestamptz + id: String + ip: String + updated_at: timestamptz + user_id: String +} + +""" +order by max() on columns of table "bans" +""" +input bans_max_order_by { + created_at: order_by + id: order_by + ip: order_by + updated_at: order_by + user_id: order_by +} + +"""aggregate min on columns""" +type bans_min_fields { + created_at: timestamptz + id: String + ip: String + updated_at: timestamptz + user_id: String +} + +""" +order by min() on columns of table "bans" +""" +input bans_min_order_by { + created_at: order_by + id: order_by + ip: order_by + updated_at: order_by + user_id: order_by +} + +""" +response of any mutation on the table "bans" +""" +type bans_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [bans!]! +} + +""" +on_conflict condition type for table "bans" +""" +input bans_on_conflict { + constraint: bans_constraint! + update_columns: [bans_update_column!]! = [] + where: bans_bool_exp +} + +"""Ordering options when selecting data from "bans".""" +input bans_order_by { + created_at: order_by + id: order_by + ip: order_by + updated_at: order_by + user: users_order_by + user_id: order_by +} + +"""primary key columns input for table: bans""" +input bans_pk_columns_input { + id: String! +} + +""" +select columns of table "bans" +""" +enum bans_select_column { + """column name""" + created_at + + """column name""" + id + + """column name""" + ip + + """column name""" + updated_at + + """column name""" + user_id +} + +""" +input type for updating data in table "bans" +""" +input bans_set_input { + created_at: timestamptz + id: String + ip: String + updated_at: timestamptz + user_id: String +} + +""" +Streaming cursor of the table "bans" +""" +input bans_stream_cursor_input { + """Stream column input with initial value""" + initial_value: bans_stream_cursor_value_input! + + """cursor ordering""" + ordering: cursor_ordering +} + +"""Initial value of the column from where the streaming should start""" +input bans_stream_cursor_value_input { + created_at: timestamptz + id: String + ip: String + updated_at: timestamptz + user_id: String +} + +""" +update columns of table "bans" +""" +enum bans_update_column { + """column name""" + created_at + + """column name""" + id + + """column name""" + ip + + """column name""" + updated_at + + """column name""" + user_id +} + +input bans_updates { + """sets the columns of the filtered rows to the given values""" + _set: bans_set_input + + """filter the rows which have to be updated""" + where: bans_bool_exp! +} + +"""Challenges Data""" +type challenges { + created_at: timestamptz! + description: String! + flag: String! + id: String! + + """An object relationship""" + machine: machines! + machine_id: String! + name: String! + point: Int! + + """An array relationship""" + scores( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): [scores!]! + + """An aggregate relationship""" + scores_aggregate( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): scores_aggregate! + stage: Int! + + """An array relationship""" + submissions( + """distinct select on columns""" + distinct_on: [submissions_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [submissions_order_by!] + + """filter the rows returned""" + where: submissions_bool_exp + ): [submissions!]! + + """An aggregate relationship""" + submissions_aggregate( + """distinct select on columns""" + distinct_on: [submissions_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [submissions_order_by!] + + """filter the rows returned""" + where: submissions_bool_exp + ): submissions_aggregate! + updated_at: timestamptz! +} + +""" +aggregated selection of "challenges" +""" +type challenges_aggregate { + aggregate: challenges_aggregate_fields + nodes: [challenges!]! +} + +input challenges_aggregate_bool_exp { + count: challenges_aggregate_bool_exp_count +} + +input challenges_aggregate_bool_exp_count { + arguments: [challenges_select_column!] + distinct: Boolean + filter: challenges_bool_exp + predicate: Int_comparison_exp! +} + +""" +aggregate fields of "challenges" +""" +type challenges_aggregate_fields { + avg: challenges_avg_fields + count(columns: [challenges_select_column!], distinct: Boolean): Int! + max: challenges_max_fields + min: challenges_min_fields + stddev: challenges_stddev_fields + stddev_pop: challenges_stddev_pop_fields + stddev_samp: challenges_stddev_samp_fields + sum: challenges_sum_fields + var_pop: challenges_var_pop_fields + var_samp: challenges_var_samp_fields + variance: challenges_variance_fields +} + +""" +order by aggregate values of table "challenges" +""" +input challenges_aggregate_order_by { + avg: challenges_avg_order_by + count: order_by + max: challenges_max_order_by + min: challenges_min_order_by + stddev: challenges_stddev_order_by + stddev_pop: challenges_stddev_pop_order_by + stddev_samp: challenges_stddev_samp_order_by + sum: challenges_sum_order_by + var_pop: challenges_var_pop_order_by + var_samp: challenges_var_samp_order_by + variance: challenges_variance_order_by +} + +""" +input type for inserting array relation for remote table "challenges" +""" +input challenges_arr_rel_insert_input { + data: [challenges_insert_input!]! + + """upsert condition""" + on_conflict: challenges_on_conflict +} + +"""aggregate avg on columns""" +type challenges_avg_fields { + point: Float + stage: Float +} + +""" +order by avg() on columns of table "challenges" +""" +input challenges_avg_order_by { + point: order_by + stage: order_by +} + +""" +Boolean expression to filter rows from the table "challenges". All fields are combined with a logical 'AND'. +""" +input challenges_bool_exp { + _and: [challenges_bool_exp!] + _not: challenges_bool_exp + _or: [challenges_bool_exp!] + created_at: timestamptz_comparison_exp + description: String_comparison_exp + flag: String_comparison_exp + id: String_comparison_exp + machine: machines_bool_exp + machine_id: String_comparison_exp + name: String_comparison_exp + point: Int_comparison_exp + scores: scores_bool_exp + scores_aggregate: scores_aggregate_bool_exp + stage: Int_comparison_exp + submissions: submissions_bool_exp + submissions_aggregate: submissions_aggregate_bool_exp + updated_at: timestamptz_comparison_exp +} + +""" +unique or primary key constraints on table "challenges" +""" +enum challenges_constraint { + """ + unique or primary key constraint on columns "flag" + """ + challenges_flag_key + + """ + unique or primary key constraint on columns "name" + """ + challenges_name_key + + """ + unique or primary key constraint on columns "id" + """ + challenges_pkey +} + +""" +input type for incrementing numeric columns in table "challenges" +""" +input challenges_inc_input { + point: Int + stage: Int +} + +""" +input type for inserting data into table "challenges" +""" +input challenges_insert_input { + created_at: timestamptz + description: String + flag: String + id: String + machine: machines_obj_rel_insert_input + machine_id: String + name: String + point: Int + scores: scores_arr_rel_insert_input + stage: Int + submissions: submissions_arr_rel_insert_input + updated_at: timestamptz +} + +"""aggregate max on columns""" +type challenges_max_fields { + created_at: timestamptz + description: String + flag: String + id: String + machine_id: String + name: String + point: Int + stage: Int + updated_at: timestamptz +} + +""" +order by max() on columns of table "challenges" +""" +input challenges_max_order_by { + created_at: order_by + description: order_by + flag: order_by + id: order_by + machine_id: order_by + name: order_by + point: order_by + stage: order_by + updated_at: order_by +} + +"""aggregate min on columns""" +type challenges_min_fields { + created_at: timestamptz + description: String + flag: String + id: String + machine_id: String + name: String + point: Int + stage: Int + updated_at: timestamptz +} + +""" +order by min() on columns of table "challenges" +""" +input challenges_min_order_by { + created_at: order_by + description: order_by + flag: order_by + id: order_by + machine_id: order_by + name: order_by + point: order_by + stage: order_by + updated_at: order_by +} + +""" +response of any mutation on the table "challenges" +""" +type challenges_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [challenges!]! +} + +""" +input type for inserting object relation for remote table "challenges" +""" +input challenges_obj_rel_insert_input { + data: challenges_insert_input! + + """upsert condition""" + on_conflict: challenges_on_conflict +} + +""" +on_conflict condition type for table "challenges" +""" +input challenges_on_conflict { + constraint: challenges_constraint! + update_columns: [challenges_update_column!]! = [] + where: challenges_bool_exp +} + +"""Ordering options when selecting data from "challenges".""" +input challenges_order_by { + created_at: order_by + description: order_by + flag: order_by + id: order_by + machine: machines_order_by + machine_id: order_by + name: order_by + point: order_by + scores_aggregate: scores_aggregate_order_by + stage: order_by + submissions_aggregate: submissions_aggregate_order_by + updated_at: order_by +} + +"""primary key columns input for table: challenges""" +input challenges_pk_columns_input { + id: String! +} + +""" +select columns of table "challenges" +""" +enum challenges_select_column { + """column name""" + created_at + + """column name""" + description + + """column name""" + flag + + """column name""" + id + + """column name""" + machine_id + + """column name""" + name + + """column name""" + point + + """column name""" + stage + + """column name""" + updated_at +} + +""" +input type for updating data in table "challenges" +""" +input challenges_set_input { + created_at: timestamptz + description: String + flag: String + id: String + machine_id: String + name: String + point: Int + stage: Int + updated_at: timestamptz +} + +"""aggregate stddev on columns""" +type challenges_stddev_fields { + point: Float + stage: Float +} + +""" +order by stddev() on columns of table "challenges" +""" +input challenges_stddev_order_by { + point: order_by + stage: order_by +} + +"""aggregate stddev_pop on columns""" +type challenges_stddev_pop_fields { + point: Float + stage: Float +} + +""" +order by stddev_pop() on columns of table "challenges" +""" +input challenges_stddev_pop_order_by { + point: order_by + stage: order_by +} + +"""aggregate stddev_samp on columns""" +type challenges_stddev_samp_fields { + point: Float + stage: Float +} + +""" +order by stddev_samp() on columns of table "challenges" +""" +input challenges_stddev_samp_order_by { + point: order_by + stage: order_by +} + +""" +Streaming cursor of the table "challenges" +""" +input challenges_stream_cursor_input { + """Stream column input with initial value""" + initial_value: challenges_stream_cursor_value_input! + + """cursor ordering""" + ordering: cursor_ordering +} + +"""Initial value of the column from where the streaming should start""" +input challenges_stream_cursor_value_input { + created_at: timestamptz + description: String + flag: String + id: String + machine_id: String + name: String + point: Int + stage: Int + updated_at: timestamptz +} + +"""aggregate sum on columns""" +type challenges_sum_fields { + point: Int + stage: Int +} + +""" +order by sum() on columns of table "challenges" +""" +input challenges_sum_order_by { + point: order_by + stage: order_by +} + +""" +update columns of table "challenges" +""" +enum challenges_update_column { + """column name""" + created_at + + """column name""" + description + + """column name""" + flag + + """column name""" + id + + """column name""" + machine_id + + """column name""" + name + + """column name""" + point + + """column name""" + stage + + """column name""" + updated_at +} + +input challenges_updates { + """increments the numeric columns with given value of the filtered values""" + _inc: challenges_inc_input + + """sets the columns of the filtered rows to the given values""" + _set: challenges_set_input + + """filter the rows which have to be updated""" + where: challenges_bool_exp! +} + +"""aggregate var_pop on columns""" +type challenges_var_pop_fields { + point: Float + stage: Float +} + +""" +order by var_pop() on columns of table "challenges" +""" +input challenges_var_pop_order_by { + point: order_by + stage: order_by +} + +"""aggregate var_samp on columns""" +type challenges_var_samp_fields { + point: Float + stage: Float +} + +""" +order by var_samp() on columns of table "challenges" +""" +input challenges_var_samp_order_by { + point: order_by + stage: order_by +} + +"""aggregate variance on columns""" +type challenges_variance_fields { + point: Float + stage: Float +} + +""" +order by variance() on columns of table "challenges" +""" +input challenges_variance_order_by { + point: order_by + stage: order_by +} + +"""ordering argument of a cursor""" +enum cursor_ordering { + """ascending ordering of the cursor""" + ASC + + """descending ordering of the cursor""" + DESC +} + +"""Machines Data""" +type machines { + """An array relationship""" + challenges( + """distinct select on columns""" + distinct_on: [challenges_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [challenges_order_by!] + + """filter the rows returned""" + where: challenges_bool_exp + ): [challenges!]! + + """An aggregate relationship""" + challenges_aggregate( + """distinct select on columns""" + distinct_on: [challenges_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [challenges_order_by!] + + """filter the rows returned""" + where: challenges_bool_exp + ): challenges_aggregate! + created_at: timestamptz! + created_by: String! + depends_on: String + description: String! + id: String! + name: String! + no_of_solves: Int! + tags: String! + updated_at: timestamptz! +} + +""" +aggregated selection of "machines" +""" +type machines_aggregate { + aggregate: machines_aggregate_fields + nodes: [machines!]! +} + +""" +aggregate fields of "machines" +""" +type machines_aggregate_fields { + avg: machines_avg_fields + count(columns: [machines_select_column!], distinct: Boolean): Int! + max: machines_max_fields + min: machines_min_fields + stddev: machines_stddev_fields + stddev_pop: machines_stddev_pop_fields + stddev_samp: machines_stddev_samp_fields + sum: machines_sum_fields + var_pop: machines_var_pop_fields + var_samp: machines_var_samp_fields + variance: machines_variance_fields +} + +"""aggregate avg on columns""" +type machines_avg_fields { + no_of_solves: Float +} + +""" +Boolean expression to filter rows from the table "machines". All fields are combined with a logical 'AND'. +""" +input machines_bool_exp { + _and: [machines_bool_exp!] + _not: machines_bool_exp + _or: [machines_bool_exp!] + challenges: challenges_bool_exp + challenges_aggregate: challenges_aggregate_bool_exp + created_at: timestamptz_comparison_exp + created_by: String_comparison_exp + depends_on: String_comparison_exp + description: String_comparison_exp + id: String_comparison_exp + name: String_comparison_exp + no_of_solves: Int_comparison_exp + tags: String_comparison_exp + updated_at: timestamptz_comparison_exp +} + +""" +unique or primary key constraints on table "machines" +""" +enum machines_constraint { + """ + unique or primary key constraint on columns "name" + """ + machines_name_key + + """ + unique or primary key constraint on columns "id" + """ + machines_pkey +} + +""" +input type for incrementing numeric columns in table "machines" +""" +input machines_inc_input { + no_of_solves: Int +} + +""" +input type for inserting data into table "machines" +""" +input machines_insert_input { + challenges: challenges_arr_rel_insert_input + created_at: timestamptz + created_by: String + depends_on: String + description: String + id: String + name: String + no_of_solves: Int + tags: String + updated_at: timestamptz +} + +"""aggregate max on columns""" +type machines_max_fields { + created_at: timestamptz + created_by: String + depends_on: String + description: String + id: String + name: String + no_of_solves: Int + tags: String + updated_at: timestamptz +} + +"""aggregate min on columns""" +type machines_min_fields { + created_at: timestamptz + created_by: String + depends_on: String + description: String + id: String + name: String + no_of_solves: Int + tags: String + updated_at: timestamptz +} + +""" +response of any mutation on the table "machines" +""" +type machines_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [machines!]! +} + +""" +input type for inserting object relation for remote table "machines" +""" +input machines_obj_rel_insert_input { + data: machines_insert_input! + + """upsert condition""" + on_conflict: machines_on_conflict +} + +""" +on_conflict condition type for table "machines" +""" +input machines_on_conflict { + constraint: machines_constraint! + update_columns: [machines_update_column!]! = [] + where: machines_bool_exp +} + +"""Ordering options when selecting data from "machines".""" +input machines_order_by { + challenges_aggregate: challenges_aggregate_order_by + created_at: order_by + created_by: order_by + depends_on: order_by + description: order_by + id: order_by + name: order_by + no_of_solves: order_by + tags: order_by + updated_at: order_by +} + +"""primary key columns input for table: machines""" +input machines_pk_columns_input { + id: String! +} + +""" +select columns of table "machines" +""" +enum machines_select_column { + """column name""" + created_at + + """column name""" + created_by + + """column name""" + depends_on + + """column name""" + description + + """column name""" + id + + """column name""" + name + + """column name""" + no_of_solves + + """column name""" + tags + + """column name""" + updated_at +} + +""" +input type for updating data in table "machines" +""" +input machines_set_input { + created_at: timestamptz + created_by: String + depends_on: String + description: String + id: String + name: String + no_of_solves: Int + tags: String + updated_at: timestamptz +} + +"""aggregate stddev on columns""" +type machines_stddev_fields { + no_of_solves: Float +} + +"""aggregate stddev_pop on columns""" +type machines_stddev_pop_fields { + no_of_solves: Float +} + +"""aggregate stddev_samp on columns""" +type machines_stddev_samp_fields { + no_of_solves: Float +} + +""" +Streaming cursor of the table "machines" +""" +input machines_stream_cursor_input { + """Stream column input with initial value""" + initial_value: machines_stream_cursor_value_input! + + """cursor ordering""" + ordering: cursor_ordering +} + +"""Initial value of the column from where the streaming should start""" +input machines_stream_cursor_value_input { + created_at: timestamptz + created_by: String + depends_on: String + description: String + id: String + name: String + no_of_solves: Int + tags: String + updated_at: timestamptz +} + +"""aggregate sum on columns""" +type machines_sum_fields { + no_of_solves: Int +} + +""" +update columns of table "machines" +""" +enum machines_update_column { + """column name""" + created_at + + """column name""" + created_by + + """column name""" + depends_on + + """column name""" + description + + """column name""" + id + + """column name""" + name + + """column name""" + no_of_solves + + """column name""" + tags + + """column name""" + updated_at +} + +input machines_updates { + """increments the numeric columns with given value of the filtered values""" + _inc: machines_inc_input + + """sets the columns of the filtered rows to the given values""" + _set: machines_set_input + + """filter the rows which have to be updated""" + where: machines_bool_exp! +} + +"""aggregate var_pop on columns""" +type machines_var_pop_fields { + no_of_solves: Float +} + +"""aggregate var_samp on columns""" +type machines_var_samp_fields { + no_of_solves: Float +} + +"""aggregate variance on columns""" +type machines_variance_fields { + no_of_solves: Float +} + +"""mutation root""" +type mutation_root { + """ + delete data from the table: "bans" + """ + delete_bans( + """filter the rows which have to be deleted""" + where: bans_bool_exp! + ): bans_mutation_response + + """ + delete single row from the table: "bans" + """ + delete_bans_by_pk(id: String!): bans + + """ + delete data from the table: "challenges" + """ + delete_challenges( + """filter the rows which have to be deleted""" + where: challenges_bool_exp! + ): challenges_mutation_response + + """ + delete single row from the table: "challenges" + """ + delete_challenges_by_pk(id: String!): challenges + + """ + delete data from the table: "machines" + """ + delete_machines( + """filter the rows which have to be deleted""" + where: machines_bool_exp! + ): machines_mutation_response + + """ + delete single row from the table: "machines" + """ + delete_machines_by_pk(id: String!): machines + + """ + delete data from the table: "scores" + """ + delete_scores( + """filter the rows which have to be deleted""" + where: scores_bool_exp! + ): scores_mutation_response + + """ + delete single row from the table: "scores" + """ + delete_scores_by_pk(id: String!): scores + + """ + delete data from the table: "submissions" + """ + delete_submissions( + """filter the rows which have to be deleted""" + where: submissions_bool_exp! + ): submissions_mutation_response + + """ + delete single row from the table: "submissions" + """ + delete_submissions_by_pk(id: String!): submissions + + """ + delete data from the table: "teams" + """ + delete_teams( + """filter the rows which have to be deleted""" + where: teams_bool_exp! + ): teams_mutation_response + + """ + delete single row from the table: "teams" + """ + delete_teams_by_pk(id: String!): teams + + """ + delete data from the table: "users" + """ + delete_users( + """filter the rows which have to be deleted""" + where: users_bool_exp! + ): users_mutation_response + + """ + delete single row from the table: "users" + """ + delete_users_by_pk(id: String!): users + + """ + insert data into the table: "bans" + """ + insert_bans( + """the rows to be inserted""" + objects: [bans_insert_input!]! + + """upsert condition""" + on_conflict: bans_on_conflict + ): bans_mutation_response + + """ + insert a single row into the table: "bans" + """ + insert_bans_one( + """the row to be inserted""" + object: bans_insert_input! + + """upsert condition""" + on_conflict: bans_on_conflict + ): bans + + """ + insert data into the table: "challenges" + """ + insert_challenges( + """the rows to be inserted""" + objects: [challenges_insert_input!]! + + """upsert condition""" + on_conflict: challenges_on_conflict + ): challenges_mutation_response + + """ + insert a single row into the table: "challenges" + """ + insert_challenges_one( + """the row to be inserted""" + object: challenges_insert_input! + + """upsert condition""" + on_conflict: challenges_on_conflict + ): challenges + + """ + insert data into the table: "machines" + """ + insert_machines( + """the rows to be inserted""" + objects: [machines_insert_input!]! + + """upsert condition""" + on_conflict: machines_on_conflict + ): machines_mutation_response + + """ + insert a single row into the table: "machines" + """ + insert_machines_one( + """the row to be inserted""" + object: machines_insert_input! + + """upsert condition""" + on_conflict: machines_on_conflict + ): machines + + """ + insert data into the table: "scores" + """ + insert_scores( + """the rows to be inserted""" + objects: [scores_insert_input!]! + + """upsert condition""" + on_conflict: scores_on_conflict + ): scores_mutation_response + + """ + insert a single row into the table: "scores" + """ + insert_scores_one( + """the row to be inserted""" + object: scores_insert_input! + + """upsert condition""" + on_conflict: scores_on_conflict + ): scores + + """ + insert data into the table: "submissions" + """ + insert_submissions( + """the rows to be inserted""" + objects: [submissions_insert_input!]! + + """upsert condition""" + on_conflict: submissions_on_conflict + ): submissions_mutation_response + + """ + insert a single row into the table: "submissions" + """ + insert_submissions_one( + """the row to be inserted""" + object: submissions_insert_input! + + """upsert condition""" + on_conflict: submissions_on_conflict + ): submissions + + """ + insert data into the table: "teams" + """ + insert_teams( + """the rows to be inserted""" + objects: [teams_insert_input!]! + + """upsert condition""" + on_conflict: teams_on_conflict + ): teams_mutation_response + + """ + insert a single row into the table: "teams" + """ + insert_teams_one( + """the row to be inserted""" + object: teams_insert_input! + + """upsert condition""" + on_conflict: teams_on_conflict + ): teams + + """ + insert data into the table: "users" + """ + insert_users( + """the rows to be inserted""" + objects: [users_insert_input!]! + + """upsert condition""" + on_conflict: users_on_conflict + ): users_mutation_response + + """ + insert a single row into the table: "users" + """ + insert_users_one( + """the row to be inserted""" + object: users_insert_input! + + """upsert condition""" + on_conflict: users_on_conflict + ): users + + """ + update data of the table: "bans" + """ + update_bans( + """sets the columns of the filtered rows to the given values""" + _set: bans_set_input + + """filter the rows which have to be updated""" + where: bans_bool_exp! + ): bans_mutation_response + + """ + update single row of the table: "bans" + """ + update_bans_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: bans_set_input + pk_columns: bans_pk_columns_input! + ): bans + + """ + update multiples rows of table: "bans" + """ + update_bans_many( + """updates to execute, in order""" + updates: [bans_updates!]! + ): [bans_mutation_response] + + """ + update data of the table: "challenges" + """ + update_challenges( + """increments the numeric columns with given value of the filtered values""" + _inc: challenges_inc_input + + """sets the columns of the filtered rows to the given values""" + _set: challenges_set_input + + """filter the rows which have to be updated""" + where: challenges_bool_exp! + ): challenges_mutation_response + + """ + update single row of the table: "challenges" + """ + update_challenges_by_pk( + """increments the numeric columns with given value of the filtered values""" + _inc: challenges_inc_input + + """sets the columns of the filtered rows to the given values""" + _set: challenges_set_input + pk_columns: challenges_pk_columns_input! + ): challenges + + """ + update multiples rows of table: "challenges" + """ + update_challenges_many( + """updates to execute, in order""" + updates: [challenges_updates!]! + ): [challenges_mutation_response] + + """ + update data of the table: "machines" + """ + update_machines( + """increments the numeric columns with given value of the filtered values""" + _inc: machines_inc_input + + """sets the columns of the filtered rows to the given values""" + _set: machines_set_input + + """filter the rows which have to be updated""" + where: machines_bool_exp! + ): machines_mutation_response + + """ + update single row of the table: "machines" + """ + update_machines_by_pk( + """increments the numeric columns with given value of the filtered values""" + _inc: machines_inc_input + + """sets the columns of the filtered rows to the given values""" + _set: machines_set_input + pk_columns: machines_pk_columns_input! + ): machines + + """ + update multiples rows of table: "machines" + """ + update_machines_many( + """updates to execute, in order""" + updates: [machines_updates!]! + ): [machines_mutation_response] + + """ + update data of the table: "scores" + """ + update_scores( + """sets the columns of the filtered rows to the given values""" + _set: scores_set_input + + """filter the rows which have to be updated""" + where: scores_bool_exp! + ): scores_mutation_response + + """ + update single row of the table: "scores" + """ + update_scores_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: scores_set_input + pk_columns: scores_pk_columns_input! + ): scores + + """ + update multiples rows of table: "scores" + """ + update_scores_many( + """updates to execute, in order""" + updates: [scores_updates!]! + ): [scores_mutation_response] + + """ + update data of the table: "submissions" + """ + update_submissions( + """sets the columns of the filtered rows to the given values""" + _set: submissions_set_input + + """filter the rows which have to be updated""" + where: submissions_bool_exp! + ): submissions_mutation_response + + """ + update single row of the table: "submissions" + """ + update_submissions_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: submissions_set_input + pk_columns: submissions_pk_columns_input! + ): submissions + + """ + update multiples rows of table: "submissions" + """ + update_submissions_many( + """updates to execute, in order""" + updates: [submissions_updates!]! + ): [submissions_mutation_response] + + """ + update data of the table: "teams" + """ + update_teams( + """sets the columns of the filtered rows to the given values""" + _set: teams_set_input + + """filter the rows which have to be updated""" + where: teams_bool_exp! + ): teams_mutation_response + + """ + update single row of the table: "teams" + """ + update_teams_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: teams_set_input + pk_columns: teams_pk_columns_input! + ): teams + + """ + update multiples rows of table: "teams" + """ + update_teams_many( + """updates to execute, in order""" + updates: [teams_updates!]! + ): [teams_mutation_response] + + """ + update data of the table: "users" + """ + update_users( + """sets the columns of the filtered rows to the given values""" + _set: users_set_input + + """filter the rows which have to be updated""" + where: users_bool_exp! + ): users_mutation_response + + """ + update single row of the table: "users" + """ + update_users_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: users_set_input + pk_columns: users_pk_columns_input! + ): users + + """ + update multiples rows of table: "users" + """ + update_users_many( + """updates to execute, in order""" + updates: [users_updates!]! + ): [users_mutation_response] +} + +"""column ordering options""" +enum order_by { + """in ascending order, nulls last""" + asc + + """in ascending order, nulls first""" + asc_nulls_first + + """in ascending order, nulls last""" + asc_nulls_last + + """in descending order, nulls first""" + desc + + """in descending order, nulls first""" + desc_nulls_first + + """in descending order, nulls last""" + desc_nulls_last +} + +type query_root { + """An array relationship""" + bans( + """distinct select on columns""" + distinct_on: [bans_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [bans_order_by!] + + """filter the rows returned""" + where: bans_bool_exp + ): [bans!]! + + """An aggregate relationship""" + bans_aggregate( + """distinct select on columns""" + distinct_on: [bans_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [bans_order_by!] + + """filter the rows returned""" + where: bans_bool_exp + ): bans_aggregate! + + """fetch data from the table: "bans" using primary key columns""" + bans_by_pk(id: String!): bans + + """An array relationship""" + challenges( + """distinct select on columns""" + distinct_on: [challenges_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [challenges_order_by!] + + """filter the rows returned""" + where: challenges_bool_exp + ): [challenges!]! + + """An aggregate relationship""" + challenges_aggregate( + """distinct select on columns""" + distinct_on: [challenges_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [challenges_order_by!] + + """filter the rows returned""" + where: challenges_bool_exp + ): challenges_aggregate! + + """fetch data from the table: "challenges" using primary key columns""" + challenges_by_pk(id: String!): challenges + + """ + fetch data from the table: "machines" + """ + machines( + """distinct select on columns""" + distinct_on: [machines_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [machines_order_by!] + + """filter the rows returned""" + where: machines_bool_exp + ): [machines!]! + + """ + fetch aggregated fields from the table: "machines" + """ + machines_aggregate( + """distinct select on columns""" + distinct_on: [machines_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [machines_order_by!] + + """filter the rows returned""" + where: machines_bool_exp + ): machines_aggregate! + + """fetch data from the table: "machines" using primary key columns""" + machines_by_pk(id: String!): machines + + """An array relationship""" + scores( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): [scores!]! + + """An aggregate relationship""" + scores_aggregate( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): scores_aggregate! + + """fetch data from the table: "scores" using primary key columns""" + scores_by_pk(id: String!): scores + + """An array relationship""" + submissions( + """distinct select on columns""" + distinct_on: [submissions_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [submissions_order_by!] + + """filter the rows returned""" + where: submissions_bool_exp + ): [submissions!]! + + """An aggregate relationship""" + submissions_aggregate( + """distinct select on columns""" + distinct_on: [submissions_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [submissions_order_by!] + + """filter the rows returned""" + where: submissions_bool_exp + ): submissions_aggregate! + + """fetch data from the table: "submissions" using primary key columns""" + submissions_by_pk(id: String!): submissions + + """ + fetch data from the table: "teams" + """ + teams( + """distinct select on columns""" + distinct_on: [teams_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [teams_order_by!] + + """filter the rows returned""" + where: teams_bool_exp + ): [teams!]! + + """ + fetch aggregated fields from the table: "teams" + """ + teams_aggregate( + """distinct select on columns""" + distinct_on: [teams_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [teams_order_by!] + + """filter the rows returned""" + where: teams_bool_exp + ): teams_aggregate! + + """fetch data from the table: "teams" using primary key columns""" + teams_by_pk(id: String!): teams + + """An array relationship""" + users( + """distinct select on columns""" + distinct_on: [users_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [users_order_by!] + + """filter the rows returned""" + where: users_bool_exp + ): [users!]! + + """An aggregate relationship""" + users_aggregate( + """distinct select on columns""" + distinct_on: [users_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [users_order_by!] + + """filter the rows returned""" + where: users_bool_exp + ): users_aggregate! + + """fetch data from the table: "users" using primary key columns""" + users_by_pk(id: String!): users +} + +"""Scoreboard Data""" +type scores { + """An object relationship""" + challenge: challenges! + challenge_id: String! + created_at: timestamptz! + id: String! + + """An object relationship""" + submission: submissions! + submission_id: String! + + """An object relationship""" + team: teams! + team_id: String! + updated_at: timestamptz! + + """An object relationship""" + user: users! + user_id: String! +} + +""" +aggregated selection of "scores" +""" +type scores_aggregate { + aggregate: scores_aggregate_fields + nodes: [scores!]! +} + +input scores_aggregate_bool_exp { + count: scores_aggregate_bool_exp_count +} + +input scores_aggregate_bool_exp_count { + arguments: [scores_select_column!] + distinct: Boolean + filter: scores_bool_exp + predicate: Int_comparison_exp! +} + +""" +aggregate fields of "scores" +""" +type scores_aggregate_fields { + count(columns: [scores_select_column!], distinct: Boolean): Int! + max: scores_max_fields + min: scores_min_fields +} + +""" +order by aggregate values of table "scores" +""" +input scores_aggregate_order_by { + count: order_by + max: scores_max_order_by + min: scores_min_order_by +} + +""" +input type for inserting array relation for remote table "scores" +""" +input scores_arr_rel_insert_input { + data: [scores_insert_input!]! + + """upsert condition""" + on_conflict: scores_on_conflict +} + +""" +Boolean expression to filter rows from the table "scores". All fields are combined with a logical 'AND'. +""" +input scores_bool_exp { + _and: [scores_bool_exp!] + _not: scores_bool_exp + _or: [scores_bool_exp!] + challenge: challenges_bool_exp + challenge_id: String_comparison_exp + created_at: timestamptz_comparison_exp + id: String_comparison_exp + submission: submissions_bool_exp + submission_id: String_comparison_exp + team: teams_bool_exp + team_id: String_comparison_exp + updated_at: timestamptz_comparison_exp + user: users_bool_exp + user_id: String_comparison_exp +} + +""" +unique or primary key constraints on table "scores" +""" +enum scores_constraint { + """ + unique or primary key constraint on columns "id" + """ + scores_pkey + + """ + unique or primary key constraint on columns "submission_id" + """ + scores_submission_id_key +} + +""" +input type for inserting data into table "scores" +""" +input scores_insert_input { + challenge: challenges_obj_rel_insert_input + challenge_id: String + created_at: timestamptz + id: String + submission: submissions_obj_rel_insert_input + submission_id: String + team: teams_obj_rel_insert_input + team_id: String + updated_at: timestamptz + user: users_obj_rel_insert_input + user_id: String +} + +"""aggregate max on columns""" +type scores_max_fields { + challenge_id: String + created_at: timestamptz + id: String + submission_id: String + team_id: String + updated_at: timestamptz + user_id: String +} + +""" +order by max() on columns of table "scores" +""" +input scores_max_order_by { + challenge_id: order_by + created_at: order_by + id: order_by + submission_id: order_by + team_id: order_by + updated_at: order_by + user_id: order_by +} + +"""aggregate min on columns""" +type scores_min_fields { + challenge_id: String + created_at: timestamptz + id: String + submission_id: String + team_id: String + updated_at: timestamptz + user_id: String +} + +""" +order by min() on columns of table "scores" +""" +input scores_min_order_by { + challenge_id: order_by + created_at: order_by + id: order_by + submission_id: order_by + team_id: order_by + updated_at: order_by + user_id: order_by +} + +""" +response of any mutation on the table "scores" +""" +type scores_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [scores!]! +} + +""" +input type for inserting object relation for remote table "scores" +""" +input scores_obj_rel_insert_input { + data: scores_insert_input! + + """upsert condition""" + on_conflict: scores_on_conflict +} + +""" +on_conflict condition type for table "scores" +""" +input scores_on_conflict { + constraint: scores_constraint! + update_columns: [scores_update_column!]! = [] + where: scores_bool_exp +} + +"""Ordering options when selecting data from "scores".""" +input scores_order_by { + challenge: challenges_order_by + challenge_id: order_by + created_at: order_by + id: order_by + submission: submissions_order_by + submission_id: order_by + team: teams_order_by + team_id: order_by + updated_at: order_by + user: users_order_by + user_id: order_by +} + +"""primary key columns input for table: scores""" +input scores_pk_columns_input { + id: String! +} + +""" +select columns of table "scores" +""" +enum scores_select_column { + """column name""" + challenge_id + + """column name""" + created_at + + """column name""" + id + + """column name""" + submission_id + + """column name""" + team_id + + """column name""" + updated_at + + """column name""" + user_id +} + +""" +input type for updating data in table "scores" +""" +input scores_set_input { + challenge_id: String + created_at: timestamptz + id: String + submission_id: String + team_id: String + updated_at: timestamptz + user_id: String +} + +""" +Streaming cursor of the table "scores" +""" +input scores_stream_cursor_input { + """Stream column input with initial value""" + initial_value: scores_stream_cursor_value_input! + + """cursor ordering""" + ordering: cursor_ordering +} + +"""Initial value of the column from where the streaming should start""" +input scores_stream_cursor_value_input { + challenge_id: String + created_at: timestamptz + id: String + submission_id: String + team_id: String + updated_at: timestamptz + user_id: String +} + +""" +update columns of table "scores" +""" +enum scores_update_column { + """column name""" + challenge_id + + """column name""" + created_at + + """column name""" + id + + """column name""" + submission_id + + """column name""" + team_id + + """column name""" + updated_at + + """column name""" + user_id +} + +input scores_updates { + """sets the columns of the filtered rows to the given values""" + _set: scores_set_input + + """filter the rows which have to be updated""" + where: scores_bool_exp! +} + +"""User flag submissions""" +type submissions { + """An object relationship""" + challenge: challenges! + challenge_id: String! + created_at: timestamptz! + id: String! + + """An object relationship""" + score: scores + submited_flag: String! + updated_at: timestamptz! + + """An object relationship""" + user: users! + user_id: String! +} + +""" +aggregated selection of "submissions" +""" +type submissions_aggregate { + aggregate: submissions_aggregate_fields + nodes: [submissions!]! +} + +input submissions_aggregate_bool_exp { + count: submissions_aggregate_bool_exp_count +} + +input submissions_aggregate_bool_exp_count { + arguments: [submissions_select_column!] + distinct: Boolean + filter: submissions_bool_exp + predicate: Int_comparison_exp! +} + +""" +aggregate fields of "submissions" +""" +type submissions_aggregate_fields { + count(columns: [submissions_select_column!], distinct: Boolean): Int! + max: submissions_max_fields + min: submissions_min_fields +} + +""" +order by aggregate values of table "submissions" +""" +input submissions_aggregate_order_by { + count: order_by + max: submissions_max_order_by + min: submissions_min_order_by +} + +""" +input type for inserting array relation for remote table "submissions" +""" +input submissions_arr_rel_insert_input { + data: [submissions_insert_input!]! + + """upsert condition""" + on_conflict: submissions_on_conflict +} + +""" +Boolean expression to filter rows from the table "submissions". All fields are combined with a logical 'AND'. +""" +input submissions_bool_exp { + _and: [submissions_bool_exp!] + _not: submissions_bool_exp + _or: [submissions_bool_exp!] + challenge: challenges_bool_exp + challenge_id: String_comparison_exp + created_at: timestamptz_comparison_exp + id: String_comparison_exp + score: scores_bool_exp + submited_flag: String_comparison_exp + updated_at: timestamptz_comparison_exp + user: users_bool_exp + user_id: String_comparison_exp +} + +""" +unique or primary key constraints on table "submissions" +""" +enum submissions_constraint { + """ + unique or primary key constraint on columns "id" + """ + submissions_pkey +} + +""" +input type for inserting data into table "submissions" +""" +input submissions_insert_input { + challenge: challenges_obj_rel_insert_input + challenge_id: String + created_at: timestamptz + id: String + score: scores_obj_rel_insert_input + submited_flag: String + updated_at: timestamptz + user: users_obj_rel_insert_input + user_id: String +} + +"""aggregate max on columns""" +type submissions_max_fields { + challenge_id: String + created_at: timestamptz + id: String + submited_flag: String + updated_at: timestamptz + user_id: String +} + +""" +order by max() on columns of table "submissions" +""" +input submissions_max_order_by { + challenge_id: order_by + created_at: order_by + id: order_by + submited_flag: order_by + updated_at: order_by + user_id: order_by +} + +"""aggregate min on columns""" +type submissions_min_fields { + challenge_id: String + created_at: timestamptz + id: String + submited_flag: String + updated_at: timestamptz + user_id: String +} + +""" +order by min() on columns of table "submissions" +""" +input submissions_min_order_by { + challenge_id: order_by + created_at: order_by + id: order_by + submited_flag: order_by + updated_at: order_by + user_id: order_by +} + +""" +response of any mutation on the table "submissions" +""" +type submissions_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [submissions!]! +} + +""" +input type for inserting object relation for remote table "submissions" +""" +input submissions_obj_rel_insert_input { + data: submissions_insert_input! + + """upsert condition""" + on_conflict: submissions_on_conflict +} + +""" +on_conflict condition type for table "submissions" +""" +input submissions_on_conflict { + constraint: submissions_constraint! + update_columns: [submissions_update_column!]! = [] + where: submissions_bool_exp +} + +"""Ordering options when selecting data from "submissions".""" +input submissions_order_by { + challenge: challenges_order_by + challenge_id: order_by + created_at: order_by + id: order_by + score: scores_order_by + submited_flag: order_by + updated_at: order_by + user: users_order_by + user_id: order_by +} + +"""primary key columns input for table: submissions""" +input submissions_pk_columns_input { + id: String! +} + +""" +select columns of table "submissions" +""" +enum submissions_select_column { + """column name""" + challenge_id + + """column name""" + created_at + + """column name""" + id + + """column name""" + submited_flag + + """column name""" + updated_at + + """column name""" + user_id +} + +""" +input type for updating data in table "submissions" +""" +input submissions_set_input { + challenge_id: String + created_at: timestamptz + id: String + submited_flag: String + updated_at: timestamptz + user_id: String +} + +""" +Streaming cursor of the table "submissions" +""" +input submissions_stream_cursor_input { + """Stream column input with initial value""" + initial_value: submissions_stream_cursor_value_input! + + """cursor ordering""" + ordering: cursor_ordering +} + +"""Initial value of the column from where the streaming should start""" +input submissions_stream_cursor_value_input { + challenge_id: String + created_at: timestamptz + id: String + submited_flag: String + updated_at: timestamptz + user_id: String +} + +""" +update columns of table "submissions" +""" +enum submissions_update_column { + """column name""" + challenge_id + + """column name""" + created_at + + """column name""" + id + + """column name""" + submited_flag + + """column name""" + updated_at + + """column name""" + user_id +} + +input submissions_updates { + """sets the columns of the filtered rows to the given values""" + _set: submissions_set_input + + """filter the rows which have to be updated""" + where: submissions_bool_exp! +} + +type subscription_root { + """An array relationship""" + bans( + """distinct select on columns""" + distinct_on: [bans_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [bans_order_by!] + + """filter the rows returned""" + where: bans_bool_exp + ): [bans!]! + + """An aggregate relationship""" + bans_aggregate( + """distinct select on columns""" + distinct_on: [bans_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [bans_order_by!] + + """filter the rows returned""" + where: bans_bool_exp + ): bans_aggregate! + + """fetch data from the table: "bans" using primary key columns""" + bans_by_pk(id: String!): bans + + """ + fetch data from the table in a streaming manner: "bans" + """ + bans_stream( + """maximum number of rows returned in a single batch""" + batch_size: Int! + + """cursor to stream the results returned by the query""" + cursor: [bans_stream_cursor_input]! + + """filter the rows returned""" + where: bans_bool_exp + ): [bans!]! + + """An array relationship""" + challenges( + """distinct select on columns""" + distinct_on: [challenges_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [challenges_order_by!] + + """filter the rows returned""" + where: challenges_bool_exp + ): [challenges!]! + + """An aggregate relationship""" + challenges_aggregate( + """distinct select on columns""" + distinct_on: [challenges_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [challenges_order_by!] + + """filter the rows returned""" + where: challenges_bool_exp + ): challenges_aggregate! + + """fetch data from the table: "challenges" using primary key columns""" + challenges_by_pk(id: String!): challenges + + """ + fetch data from the table in a streaming manner: "challenges" + """ + challenges_stream( + """maximum number of rows returned in a single batch""" + batch_size: Int! + + """cursor to stream the results returned by the query""" + cursor: [challenges_stream_cursor_input]! + + """filter the rows returned""" + where: challenges_bool_exp + ): [challenges!]! + + """ + fetch data from the table: "machines" + """ + machines( + """distinct select on columns""" + distinct_on: [machines_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [machines_order_by!] + + """filter the rows returned""" + where: machines_bool_exp + ): [machines!]! + + """ + fetch aggregated fields from the table: "machines" + """ + machines_aggregate( + """distinct select on columns""" + distinct_on: [machines_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [machines_order_by!] + + """filter the rows returned""" + where: machines_bool_exp + ): machines_aggregate! + + """fetch data from the table: "machines" using primary key columns""" + machines_by_pk(id: String!): machines + + """ + fetch data from the table in a streaming manner: "machines" + """ + machines_stream( + """maximum number of rows returned in a single batch""" + batch_size: Int! + + """cursor to stream the results returned by the query""" + cursor: [machines_stream_cursor_input]! + + """filter the rows returned""" + where: machines_bool_exp + ): [machines!]! + + """An array relationship""" + scores( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): [scores!]! + + """An aggregate relationship""" + scores_aggregate( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): scores_aggregate! + + """fetch data from the table: "scores" using primary key columns""" + scores_by_pk(id: String!): scores + + """ + fetch data from the table in a streaming manner: "scores" + """ + scores_stream( + """maximum number of rows returned in a single batch""" + batch_size: Int! + + """cursor to stream the results returned by the query""" + cursor: [scores_stream_cursor_input]! + + """filter the rows returned""" + where: scores_bool_exp + ): [scores!]! + + """An array relationship""" + submissions( + """distinct select on columns""" + distinct_on: [submissions_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [submissions_order_by!] + + """filter the rows returned""" + where: submissions_bool_exp + ): [submissions!]! + + """An aggregate relationship""" + submissions_aggregate( + """distinct select on columns""" + distinct_on: [submissions_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [submissions_order_by!] + + """filter the rows returned""" + where: submissions_bool_exp + ): submissions_aggregate! + + """fetch data from the table: "submissions" using primary key columns""" + submissions_by_pk(id: String!): submissions + + """ + fetch data from the table in a streaming manner: "submissions" + """ + submissions_stream( + """maximum number of rows returned in a single batch""" + batch_size: Int! + + """cursor to stream the results returned by the query""" + cursor: [submissions_stream_cursor_input]! + + """filter the rows returned""" + where: submissions_bool_exp + ): [submissions!]! + + """ + fetch data from the table: "teams" + """ + teams( + """distinct select on columns""" + distinct_on: [teams_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [teams_order_by!] + + """filter the rows returned""" + where: teams_bool_exp + ): [teams!]! + + """ + fetch aggregated fields from the table: "teams" + """ + teams_aggregate( + """distinct select on columns""" + distinct_on: [teams_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [teams_order_by!] + + """filter the rows returned""" + where: teams_bool_exp + ): teams_aggregate! + + """fetch data from the table: "teams" using primary key columns""" + teams_by_pk(id: String!): teams + + """ + fetch data from the table in a streaming manner: "teams" + """ + teams_stream( + """maximum number of rows returned in a single batch""" + batch_size: Int! + + """cursor to stream the results returned by the query""" + cursor: [teams_stream_cursor_input]! + + """filter the rows returned""" + where: teams_bool_exp + ): [teams!]! + + """An array relationship""" + users( + """distinct select on columns""" + distinct_on: [users_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [users_order_by!] + + """filter the rows returned""" + where: users_bool_exp + ): [users!]! + + """An aggregate relationship""" + users_aggregate( + """distinct select on columns""" + distinct_on: [users_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [users_order_by!] + + """filter the rows returned""" + where: users_bool_exp + ): users_aggregate! + + """fetch data from the table: "users" using primary key columns""" + users_by_pk(id: String!): users + + """ + fetch data from the table in a streaming manner: "users" + """ + users_stream( + """maximum number of rows returned in a single batch""" + batch_size: Int! + + """cursor to stream the results returned by the query""" + cursor: [users_stream_cursor_input]! + + """filter the rows returned""" + where: users_bool_exp + ): [users!]! +} + +"""Teams Data""" +type teams { + created_at: timestamptz! + id: String! + join_code: String! + name: String! + + """An array relationship""" + scores( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): [scores!]! + + """An aggregate relationship""" + scores_aggregate( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): scores_aggregate! + updated_at: timestamptz! + + """An array relationship""" + users( + """distinct select on columns""" + distinct_on: [users_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [users_order_by!] + + """filter the rows returned""" + where: users_bool_exp + ): [users!]! + + """An aggregate relationship""" + users_aggregate( + """distinct select on columns""" + distinct_on: [users_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [users_order_by!] + + """filter the rows returned""" + where: users_bool_exp + ): users_aggregate! +} + +""" +aggregated selection of "teams" +""" +type teams_aggregate { + aggregate: teams_aggregate_fields + nodes: [teams!]! +} + +""" +aggregate fields of "teams" +""" +type teams_aggregate_fields { + count(columns: [teams_select_column!], distinct: Boolean): Int! + max: teams_max_fields + min: teams_min_fields +} + +""" +Boolean expression to filter rows from the table "teams". All fields are combined with a logical 'AND'. +""" +input teams_bool_exp { + _and: [teams_bool_exp!] + _not: teams_bool_exp + _or: [teams_bool_exp!] + created_at: timestamptz_comparison_exp + id: String_comparison_exp + join_code: String_comparison_exp + name: String_comparison_exp + scores: scores_bool_exp + scores_aggregate: scores_aggregate_bool_exp + updated_at: timestamptz_comparison_exp + users: users_bool_exp + users_aggregate: users_aggregate_bool_exp +} + +""" +unique or primary key constraints on table "teams" +""" +enum teams_constraint { + """ + unique or primary key constraint on columns "join_code" + """ + teams_join_code_key + + """ + unique or primary key constraint on columns "name" + """ + teams_name_key + + """ + unique or primary key constraint on columns "id" + """ + teams_pkey +} + +""" +input type for inserting data into table "teams" +""" +input teams_insert_input { + created_at: timestamptz + id: String + join_code: String + name: String + scores: scores_arr_rel_insert_input + updated_at: timestamptz + users: users_arr_rel_insert_input +} + +"""aggregate max on columns""" +type teams_max_fields { + created_at: timestamptz + id: String + join_code: String + name: String + updated_at: timestamptz +} + +"""aggregate min on columns""" +type teams_min_fields { + created_at: timestamptz + id: String + join_code: String + name: String + updated_at: timestamptz +} + +""" +response of any mutation on the table "teams" +""" +type teams_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [teams!]! +} + +""" +input type for inserting object relation for remote table "teams" +""" +input teams_obj_rel_insert_input { + data: teams_insert_input! + + """upsert condition""" + on_conflict: teams_on_conflict +} + +""" +on_conflict condition type for table "teams" +""" +input teams_on_conflict { + constraint: teams_constraint! + update_columns: [teams_update_column!]! = [] + where: teams_bool_exp +} + +"""Ordering options when selecting data from "teams".""" +input teams_order_by { + created_at: order_by + id: order_by + join_code: order_by + name: order_by + scores_aggregate: scores_aggregate_order_by + updated_at: order_by + users_aggregate: users_aggregate_order_by +} + +"""primary key columns input for table: teams""" +input teams_pk_columns_input { + id: String! +} + +""" +select columns of table "teams" +""" +enum teams_select_column { + """column name""" + created_at + + """column name""" + id + + """column name""" + join_code + + """column name""" + name + + """column name""" + updated_at +} + +""" +input type for updating data in table "teams" +""" +input teams_set_input { + created_at: timestamptz + id: String + join_code: String + name: String + updated_at: timestamptz +} + +""" +Streaming cursor of the table "teams" +""" +input teams_stream_cursor_input { + """Stream column input with initial value""" + initial_value: teams_stream_cursor_value_input! + + """cursor ordering""" + ordering: cursor_ordering +} + +"""Initial value of the column from where the streaming should start""" +input teams_stream_cursor_value_input { + created_at: timestamptz + id: String + join_code: String + name: String + updated_at: timestamptz +} + +""" +update columns of table "teams" +""" +enum teams_update_column { + """column name""" + created_at + + """column name""" + id + + """column name""" + join_code + + """column name""" + name + + """column name""" + updated_at +} + +input teams_updates { + """sets the columns of the filtered rows to the given values""" + _set: teams_set_input + + """filter the rows which have to be updated""" + where: teams_bool_exp! +} + +scalar timestamptz + +""" +Boolean expression to compare columns of type "timestamptz". All fields are combined with logical 'AND'. +""" +input timestamptz_comparison_exp { + _eq: timestamptz + _gt: timestamptz + _gte: timestamptz + _in: [timestamptz!] + _is_null: Boolean + _lt: timestamptz + _lte: timestamptz + _neq: timestamptz + _nin: [timestamptz!] +} + +"""Users Data""" +type users { + """An array relationship""" + bans( + """distinct select on columns""" + distinct_on: [bans_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [bans_order_by!] + + """filter the rows returned""" + where: bans_bool_exp + ): [bans!]! + + """An aggregate relationship""" + bans_aggregate( + """distinct select on columns""" + distinct_on: [bans_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [bans_order_by!] + + """filter the rows returned""" + where: bans_bool_exp + ): bans_aggregate! + created_at: timestamptz! + email: String! + email_verification_code: String! + first_name: String! + hash: String! + id: String! + is_admin: Boolean! + is_banned: Boolean! + is_email_verified: Boolean! + last_name: String! + salt: String! + + """An array relationship""" + scores( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): [scores!]! + + """An aggregate relationship""" + scores_aggregate( + """distinct select on columns""" + distinct_on: [scores_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [scores_order_by!] + + """filter the rows returned""" + where: scores_bool_exp + ): scores_aggregate! + + """An array relationship""" + submissions( + """distinct select on columns""" + distinct_on: [submissions_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [submissions_order_by!] + + """filter the rows returned""" + where: submissions_bool_exp + ): [submissions!]! + + """An aggregate relationship""" + submissions_aggregate( + """distinct select on columns""" + distinct_on: [submissions_select_column!] + + """limit the number of rows returned""" + limit: Int + + """skip the first n rows. Use only with order_by""" + offset: Int + + """sort the rows by one or more columns""" + order_by: [submissions_order_by!] + + """filter the rows returned""" + where: submissions_bool_exp + ): submissions_aggregate! + + """An object relationship""" + team: teams + team_id: String + updated_at: timestamptz! +} + +""" +aggregated selection of "users" +""" +type users_aggregate { + aggregate: users_aggregate_fields + nodes: [users!]! +} + +input users_aggregate_bool_exp { + bool_and: users_aggregate_bool_exp_bool_and + bool_or: users_aggregate_bool_exp_bool_or + count: users_aggregate_bool_exp_count +} + +input users_aggregate_bool_exp_bool_and { + arguments: users_select_column_users_aggregate_bool_exp_bool_and_arguments_columns! + distinct: Boolean + filter: users_bool_exp + predicate: Boolean_comparison_exp! +} + +input users_aggregate_bool_exp_bool_or { + arguments: users_select_column_users_aggregate_bool_exp_bool_or_arguments_columns! + distinct: Boolean + filter: users_bool_exp + predicate: Boolean_comparison_exp! +} + +input users_aggregate_bool_exp_count { + arguments: [users_select_column!] + distinct: Boolean + filter: users_bool_exp + predicate: Int_comparison_exp! +} + +""" +aggregate fields of "users" +""" +type users_aggregate_fields { + count(columns: [users_select_column!], distinct: Boolean): Int! + max: users_max_fields + min: users_min_fields +} + +""" +order by aggregate values of table "users" +""" +input users_aggregate_order_by { + count: order_by + max: users_max_order_by + min: users_min_order_by +} + +""" +input type for inserting array relation for remote table "users" +""" +input users_arr_rel_insert_input { + data: [users_insert_input!]! + + """upsert condition""" + on_conflict: users_on_conflict +} + +""" +Boolean expression to filter rows from the table "users". All fields are combined with a logical 'AND'. +""" +input users_bool_exp { + _and: [users_bool_exp!] + _not: users_bool_exp + _or: [users_bool_exp!] + bans: bans_bool_exp + bans_aggregate: bans_aggregate_bool_exp + created_at: timestamptz_comparison_exp + email: String_comparison_exp + email_verification_code: String_comparison_exp + first_name: String_comparison_exp + hash: String_comparison_exp + id: String_comparison_exp + is_admin: Boolean_comparison_exp + is_banned: Boolean_comparison_exp + is_email_verified: Boolean_comparison_exp + last_name: String_comparison_exp + salt: String_comparison_exp + scores: scores_bool_exp + scores_aggregate: scores_aggregate_bool_exp + submissions: submissions_bool_exp + submissions_aggregate: submissions_aggregate_bool_exp + team: teams_bool_exp + team_id: String_comparison_exp + updated_at: timestamptz_comparison_exp +} + +""" +unique or primary key constraints on table "users" +""" +enum users_constraint { + """ + unique or primary key constraint on columns "email" + """ + users_email_key + + """ + unique or primary key constraint on columns "hash" + """ + users_hash_key + + """ + unique or primary key constraint on columns "id" + """ + users_pkey + + """ + unique or primary key constraint on columns "salt" + """ + users_salt_key +} + +""" +input type for inserting data into table "users" +""" +input users_insert_input { + bans: bans_arr_rel_insert_input + created_at: timestamptz + email: String + email_verification_code: String + first_name: String + hash: String + id: String + is_admin: Boolean + is_banned: Boolean + is_email_verified: Boolean + last_name: String + salt: String + scores: scores_arr_rel_insert_input + submissions: submissions_arr_rel_insert_input + team: teams_obj_rel_insert_input + team_id: String + updated_at: timestamptz +} + +"""aggregate max on columns""" +type users_max_fields { + created_at: timestamptz + email: String + email_verification_code: String + first_name: String + hash: String + id: String + last_name: String + salt: String + team_id: String + updated_at: timestamptz +} + +""" +order by max() on columns of table "users" +""" +input users_max_order_by { + created_at: order_by + email: order_by + email_verification_code: order_by + first_name: order_by + hash: order_by + id: order_by + last_name: order_by + salt: order_by + team_id: order_by + updated_at: order_by +} + +"""aggregate min on columns""" +type users_min_fields { + created_at: timestamptz + email: String + email_verification_code: String + first_name: String + hash: String + id: String + last_name: String + salt: String + team_id: String + updated_at: timestamptz +} + +""" +order by min() on columns of table "users" +""" +input users_min_order_by { + created_at: order_by + email: order_by + email_verification_code: order_by + first_name: order_by + hash: order_by + id: order_by + last_name: order_by + salt: order_by + team_id: order_by + updated_at: order_by +} + +""" +response of any mutation on the table "users" +""" +type users_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [users!]! +} + +""" +input type for inserting object relation for remote table "users" +""" +input users_obj_rel_insert_input { + data: users_insert_input! + + """upsert condition""" + on_conflict: users_on_conflict +} + +""" +on_conflict condition type for table "users" +""" +input users_on_conflict { + constraint: users_constraint! + update_columns: [users_update_column!]! = [] + where: users_bool_exp +} + +"""Ordering options when selecting data from "users".""" +input users_order_by { + bans_aggregate: bans_aggregate_order_by + created_at: order_by + email: order_by + email_verification_code: order_by + first_name: order_by + hash: order_by + id: order_by + is_admin: order_by + is_banned: order_by + is_email_verified: order_by + last_name: order_by + salt: order_by + scores_aggregate: scores_aggregate_order_by + submissions_aggregate: submissions_aggregate_order_by + team: teams_order_by + team_id: order_by + updated_at: order_by +} + +"""primary key columns input for table: users""" +input users_pk_columns_input { + id: String! +} + +""" +select columns of table "users" +""" +enum users_select_column { + """column name""" + created_at + + """column name""" + email + + """column name""" + email_verification_code + + """column name""" + first_name + + """column name""" + hash + + """column name""" + id + + """column name""" + is_admin + + """column name""" + is_banned + + """column name""" + is_email_verified + + """column name""" + last_name + + """column name""" + salt + + """column name""" + team_id + + """column name""" + updated_at +} + +""" +select "users_aggregate_bool_exp_bool_and_arguments_columns" columns of table "users" +""" +enum users_select_column_users_aggregate_bool_exp_bool_and_arguments_columns { + """column name""" + is_admin + + """column name""" + is_banned + + """column name""" + is_email_verified +} + +""" +select "users_aggregate_bool_exp_bool_or_arguments_columns" columns of table "users" +""" +enum users_select_column_users_aggregate_bool_exp_bool_or_arguments_columns { + """column name""" + is_admin + + """column name""" + is_banned + + """column name""" + is_email_verified +} + +""" +input type for updating data in table "users" +""" +input users_set_input { + created_at: timestamptz + email: String + email_verification_code: String + first_name: String + hash: String + id: String + is_admin: Boolean + is_banned: Boolean + is_email_verified: Boolean + last_name: String + salt: String + team_id: String + updated_at: timestamptz +} + +""" +Streaming cursor of the table "users" +""" +input users_stream_cursor_input { + """Stream column input with initial value""" + initial_value: users_stream_cursor_value_input! + + """cursor ordering""" + ordering: cursor_ordering +} + +"""Initial value of the column from where the streaming should start""" +input users_stream_cursor_value_input { + created_at: timestamptz + email: String + email_verification_code: String + first_name: String + hash: String + id: String + is_admin: Boolean + is_banned: Boolean + is_email_verified: Boolean + last_name: String + salt: String + team_id: String + updated_at: timestamptz +} + +""" +update columns of table "users" +""" +enum users_update_column { + """column name""" + created_at + + """column name""" + email + + """column name""" + email_verification_code + + """column name""" + first_name + + """column name""" + hash + + """column name""" + id + + """column name""" + is_admin + + """column name""" + is_banned + + """column name""" + is_email_verified + + """column name""" + last_name + + """column name""" + salt + + """column name""" + team_id + + """column name""" + updated_at +} + +input users_updates { + """sets the columns of the filtered rows to the given values""" + _set: users_set_input + + """filter the rows which have to be updated""" + where: users_bool_exp! +} + diff --git a/packages/scorefeed/graphql/types.ts b/packages/scorefeed/graphql/types.ts new file mode 100644 index 0000000..5c9e124 --- /dev/null +++ b/packages/scorefeed/graphql/types.ts @@ -0,0 +1,3230 @@ +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type MakeEmpty = { [_ in K]?: never }; +export type Incremental = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never }; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } + timestamptz: { input: any; output: any; } +}; + +/** Boolean expression to compare columns of type "Boolean". All fields are combined with logical 'AND'. */ +export type Boolean_Comparison_Exp = { + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + _in?: InputMaybe>; + _is_null?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + _nin?: InputMaybe>; +}; + +/** Boolean expression to compare columns of type "Int". All fields are combined with logical 'AND'. */ +export type Int_Comparison_Exp = { + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + _in?: InputMaybe>; + _is_null?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + _nin?: InputMaybe>; +}; + +/** Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. */ +export type String_Comparison_Exp = { + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + /** does the column match the given case-insensitive pattern */ + _ilike?: InputMaybe; + _in?: InputMaybe>; + /** does the column match the given POSIX regular expression, case insensitive */ + _iregex?: InputMaybe; + _is_null?: InputMaybe; + /** does the column match the given pattern */ + _like?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + /** does the column NOT match the given case-insensitive pattern */ + _nilike?: InputMaybe; + _nin?: InputMaybe>; + /** does the column NOT match the given POSIX regular expression, case insensitive */ + _niregex?: InputMaybe; + /** does the column NOT match the given pattern */ + _nlike?: InputMaybe; + /** does the column NOT match the given POSIX regular expression, case sensitive */ + _nregex?: InputMaybe; + /** does the column NOT match the given SQL regular expression */ + _nsimilar?: InputMaybe; + /** does the column match the given POSIX regular expression, case sensitive */ + _regex?: InputMaybe; + /** does the column match the given SQL regular expression */ + _similar?: InputMaybe; +}; + +/** Bans issued to users */ +export type Bans = { + __typename?: "bans"; + created_at: Scalars["timestamptz"]["output"]; + id: Scalars["String"]["output"]; + ip: Scalars["String"]["output"]; + updated_at: Scalars["timestamptz"]["output"]; + /** An object relationship */ + user: Users; + user_id: Scalars["String"]["output"]; +}; + +/** aggregated selection of "bans" */ +export type Bans_Aggregate = { + __typename?: "bans_aggregate"; + aggregate?: Maybe; + nodes: Array; +}; + +export type Bans_Aggregate_Bool_Exp = { + count?: InputMaybe; +}; + +export type Bans_Aggregate_Bool_Exp_Count = { + arguments?: InputMaybe>; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Int_Comparison_Exp; +}; + +/** aggregate fields of "bans" */ +export type Bans_Aggregate_Fields = { + __typename?: "bans_aggregate_fields"; + count: Scalars["Int"]["output"]; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "bans" */ +export type Bans_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** order by aggregate values of table "bans" */ +export type Bans_Aggregate_Order_By = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "bans" */ +export type Bans_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "bans". All fields are combined with a logical 'AND'. */ +export type Bans_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; + user?: InputMaybe; + user_id?: InputMaybe; +}; + +/** unique or primary key constraints on table "bans" */ +export enum Bans_Constraint { + /** unique or primary key constraint on columns "id" */ + BansPkey = "bans_pkey" +} + +/** input type for inserting data into table "bans" */ +export type Bans_Insert_Input = { + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; + user?: InputMaybe; + user_id?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Bans_Max_Fields = { + __typename?: "bans_max_fields"; + created_at?: Maybe; + id?: Maybe; + ip?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; + +/** order by max() on columns of table "bans" */ +export type Bans_Max_Order_By = { + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** aggregate min on columns */ +export type Bans_Min_Fields = { + __typename?: "bans_min_fields"; + created_at?: Maybe; + id?: Maybe; + ip?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; + +/** order by min() on columns of table "bans" */ +export type Bans_Min_Order_By = { + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** response of any mutation on the table "bans" */ +export type Bans_Mutation_Response = { + __typename?: "bans_mutation_response"; + /** number of rows affected by the mutation */ + affected_rows: Scalars["Int"]["output"]; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** on_conflict condition type for table "bans" */ +export type Bans_On_Conflict = { + constraint: Bans_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "bans". */ +export type Bans_Order_By = { + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; + user?: InputMaybe; + user_id?: InputMaybe; +}; + +/** primary key columns input for table: bans */ +export type Bans_Pk_Columns_Input = { + id: Scalars["String"]["input"]; +}; + +/** select columns of table "bans" */ +export enum Bans_Select_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + Id = "id", + /** column name */ + Ip = "ip", + /** column name */ + UpdatedAt = "updated_at", + /** column name */ + UserId = "user_id" +} + +/** input type for updating data in table "bans" */ +export type Bans_Set_Input = { + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** Streaming cursor of the table "bans" */ +export type Bans_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Bans_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Bans_Stream_Cursor_Value_Input = { + created_at?: InputMaybe; + id?: InputMaybe; + ip?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** update columns of table "bans" */ +export enum Bans_Update_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + Id = "id", + /** column name */ + Ip = "ip", + /** column name */ + UpdatedAt = "updated_at", + /** column name */ + UserId = "user_id" +} + +export type Bans_Updates = { + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: Bans_Bool_Exp; +}; + +/** Challenges Data */ +export type Challenges = { + __typename?: "challenges"; + created_at: Scalars["timestamptz"]["output"]; + description: Scalars["String"]["output"]; + flag: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + /** An object relationship */ + machine: Machines; + machine_id: Scalars["String"]["output"]; + name: Scalars["String"]["output"]; + point: Scalars["Int"]["output"]; + /** An array relationship */ + scores: Array; + /** An aggregate relationship */ + scores_aggregate: Scores_Aggregate; + stage: Scalars["Int"]["output"]; + /** An array relationship */ + submissions: Array; + /** An aggregate relationship */ + submissions_aggregate: Submissions_Aggregate; + updated_at: Scalars["timestamptz"]["output"]; +}; + + +/** Challenges Data */ +export type ChallengesScoresArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Challenges Data */ +export type ChallengesScores_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Challenges Data */ +export type ChallengesSubmissionsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Challenges Data */ +export type ChallengesSubmissions_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + +/** aggregated selection of "challenges" */ +export type Challenges_Aggregate = { + __typename?: "challenges_aggregate"; + aggregate?: Maybe; + nodes: Array; +}; + +export type Challenges_Aggregate_Bool_Exp = { + count?: InputMaybe; +}; + +export type Challenges_Aggregate_Bool_Exp_Count = { + arguments?: InputMaybe>; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Int_Comparison_Exp; +}; + +/** aggregate fields of "challenges" */ +export type Challenges_Aggregate_Fields = { + __typename?: "challenges_aggregate_fields"; + avg?: Maybe; + count: Scalars["Int"]["output"]; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "challenges" */ +export type Challenges_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** order by aggregate values of table "challenges" */ +export type Challenges_Aggregate_Order_By = { + avg?: InputMaybe; + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; + stddev?: InputMaybe; + stddev_pop?: InputMaybe; + stddev_samp?: InputMaybe; + sum?: InputMaybe; + var_pop?: InputMaybe; + var_samp?: InputMaybe; + variance?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "challenges" */ +export type Challenges_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Challenges_Avg_Fields = { + __typename?: "challenges_avg_fields"; + point?: Maybe; + stage?: Maybe; +}; + +/** order by avg() on columns of table "challenges" */ +export type Challenges_Avg_Order_By = { + point?: InputMaybe; + stage?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "challenges". All fields are combined with a logical 'AND'. */ +export type Challenges_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; + machine?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; + scores?: InputMaybe; + scores_aggregate?: InputMaybe; + stage?: InputMaybe; + submissions?: InputMaybe; + submissions_aggregate?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** unique or primary key constraints on table "challenges" */ +export enum Challenges_Constraint { + /** unique or primary key constraint on columns "flag" */ + ChallengesFlagKey = "challenges_flag_key", + /** unique or primary key constraint on columns "name" */ + ChallengesNameKey = "challenges_name_key", + /** unique or primary key constraint on columns "id" */ + ChallengesPkey = "challenges_pkey" +} + +/** input type for incrementing numeric columns in table "challenges" */ +export type Challenges_Inc_Input = { + point?: InputMaybe; + stage?: InputMaybe; +}; + +/** input type for inserting data into table "challenges" */ +export type Challenges_Insert_Input = { + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; + machine?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; + scores?: InputMaybe; + stage?: InputMaybe; + submissions?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Challenges_Max_Fields = { + __typename?: "challenges_max_fields"; + created_at?: Maybe; + description?: Maybe; + flag?: Maybe; + id?: Maybe; + machine_id?: Maybe; + name?: Maybe; + point?: Maybe; + stage?: Maybe; + updated_at?: Maybe; +}; + +/** order by max() on columns of table "challenges" */ +export type Challenges_Max_Order_By = { + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; + stage?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate min on columns */ +export type Challenges_Min_Fields = { + __typename?: "challenges_min_fields"; + created_at?: Maybe; + description?: Maybe; + flag?: Maybe; + id?: Maybe; + machine_id?: Maybe; + name?: Maybe; + point?: Maybe; + stage?: Maybe; + updated_at?: Maybe; +}; + +/** order by min() on columns of table "challenges" */ +export type Challenges_Min_Order_By = { + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; + stage?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** response of any mutation on the table "challenges" */ +export type Challenges_Mutation_Response = { + __typename?: "challenges_mutation_response"; + /** number of rows affected by the mutation */ + affected_rows: Scalars["Int"]["output"]; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "challenges" */ +export type Challenges_Obj_Rel_Insert_Input = { + data: Challenges_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "challenges" */ +export type Challenges_On_Conflict = { + constraint: Challenges_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "challenges". */ +export type Challenges_Order_By = { + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; + machine?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; + scores_aggregate?: InputMaybe; + stage?: InputMaybe; + submissions_aggregate?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** primary key columns input for table: challenges */ +export type Challenges_Pk_Columns_Input = { + id: Scalars["String"]["input"]; +}; + +/** select columns of table "challenges" */ +export enum Challenges_Select_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + Description = "description", + /** column name */ + Flag = "flag", + /** column name */ + Id = "id", + /** column name */ + MachineId = "machine_id", + /** column name */ + Name = "name", + /** column name */ + Point = "point", + /** column name */ + Stage = "stage", + /** column name */ + UpdatedAt = "updated_at" +} + +/** input type for updating data in table "challenges" */ +export type Challenges_Set_Input = { + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; + stage?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate stddev on columns */ +export type Challenges_Stddev_Fields = { + __typename?: "challenges_stddev_fields"; + point?: Maybe; + stage?: Maybe; +}; + +/** order by stddev() on columns of table "challenges" */ +export type Challenges_Stddev_Order_By = { + point?: InputMaybe; + stage?: InputMaybe; +}; + +/** aggregate stddev_pop on columns */ +export type Challenges_Stddev_Pop_Fields = { + __typename?: "challenges_stddev_pop_fields"; + point?: Maybe; + stage?: Maybe; +}; + +/** order by stddev_pop() on columns of table "challenges" */ +export type Challenges_Stddev_Pop_Order_By = { + point?: InputMaybe; + stage?: InputMaybe; +}; + +/** aggregate stddev_samp on columns */ +export type Challenges_Stddev_Samp_Fields = { + __typename?: "challenges_stddev_samp_fields"; + point?: Maybe; + stage?: Maybe; +}; + +/** order by stddev_samp() on columns of table "challenges" */ +export type Challenges_Stddev_Samp_Order_By = { + point?: InputMaybe; + stage?: InputMaybe; +}; + +/** Streaming cursor of the table "challenges" */ +export type Challenges_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Challenges_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Challenges_Stream_Cursor_Value_Input = { + created_at?: InputMaybe; + description?: InputMaybe; + flag?: InputMaybe; + id?: InputMaybe; + machine_id?: InputMaybe; + name?: InputMaybe; + point?: InputMaybe; + stage?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate sum on columns */ +export type Challenges_Sum_Fields = { + __typename?: "challenges_sum_fields"; + point?: Maybe; + stage?: Maybe; +}; + +/** order by sum() on columns of table "challenges" */ +export type Challenges_Sum_Order_By = { + point?: InputMaybe; + stage?: InputMaybe; +}; + +/** update columns of table "challenges" */ +export enum Challenges_Update_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + Description = "description", + /** column name */ + Flag = "flag", + /** column name */ + Id = "id", + /** column name */ + MachineId = "machine_id", + /** column name */ + Name = "name", + /** column name */ + Point = "point", + /** column name */ + Stage = "stage", + /** column name */ + UpdatedAt = "updated_at" +} + +export type Challenges_Updates = { + /** increments the numeric columns with given value of the filtered values */ + _inc?: InputMaybe; + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: Challenges_Bool_Exp; +}; + +/** aggregate var_pop on columns */ +export type Challenges_Var_Pop_Fields = { + __typename?: "challenges_var_pop_fields"; + point?: Maybe; + stage?: Maybe; +}; + +/** order by var_pop() on columns of table "challenges" */ +export type Challenges_Var_Pop_Order_By = { + point?: InputMaybe; + stage?: InputMaybe; +}; + +/** aggregate var_samp on columns */ +export type Challenges_Var_Samp_Fields = { + __typename?: "challenges_var_samp_fields"; + point?: Maybe; + stage?: Maybe; +}; + +/** order by var_samp() on columns of table "challenges" */ +export type Challenges_Var_Samp_Order_By = { + point?: InputMaybe; + stage?: InputMaybe; +}; + +/** aggregate variance on columns */ +export type Challenges_Variance_Fields = { + __typename?: "challenges_variance_fields"; + point?: Maybe; + stage?: Maybe; +}; + +/** order by variance() on columns of table "challenges" */ +export type Challenges_Variance_Order_By = { + point?: InputMaybe; + stage?: InputMaybe; +}; + +/** ordering argument of a cursor */ +export enum Cursor_Ordering { + /** ascending ordering of the cursor */ + Asc = "ASC", + /** descending ordering of the cursor */ + Desc = "DESC" +} + +/** Machines Data */ +export type Machines = { + __typename?: "machines"; + /** An array relationship */ + challenges: Array; + /** An aggregate relationship */ + challenges_aggregate: Challenges_Aggregate; + created_at: Scalars["timestamptz"]["output"]; + created_by: Scalars["String"]["output"]; + depends_on?: Maybe; + description: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + name: Scalars["String"]["output"]; + no_of_solves: Scalars["Int"]["output"]; + tags: Scalars["String"]["output"]; + updated_at: Scalars["timestamptz"]["output"]; +}; + + +/** Machines Data */ +export type MachinesChallengesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Machines Data */ +export type MachinesChallenges_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + +/** aggregated selection of "machines" */ +export type Machines_Aggregate = { + __typename?: "machines_aggregate"; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "machines" */ +export type Machines_Aggregate_Fields = { + __typename?: "machines_aggregate_fields"; + avg?: Maybe; + count: Scalars["Int"]["output"]; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "machines" */ +export type Machines_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** aggregate avg on columns */ +export type Machines_Avg_Fields = { + __typename?: "machines_avg_fields"; + no_of_solves?: Maybe; +}; + +/** Boolean expression to filter rows from the table "machines". All fields are combined with a logical 'AND'. */ +export type Machines_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + challenges?: InputMaybe; + challenges_aggregate?: InputMaybe; + created_at?: InputMaybe; + created_by?: InputMaybe; + depends_on?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + no_of_solves?: InputMaybe; + tags?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** unique or primary key constraints on table "machines" */ +export enum Machines_Constraint { + /** unique or primary key constraint on columns "name" */ + MachinesNameKey = "machines_name_key", + /** unique or primary key constraint on columns "id" */ + MachinesPkey = "machines_pkey" +} + +/** input type for incrementing numeric columns in table "machines" */ +export type Machines_Inc_Input = { + no_of_solves?: InputMaybe; +}; + +/** input type for inserting data into table "machines" */ +export type Machines_Insert_Input = { + challenges?: InputMaybe; + created_at?: InputMaybe; + created_by?: InputMaybe; + depends_on?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + no_of_solves?: InputMaybe; + tags?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Machines_Max_Fields = { + __typename?: "machines_max_fields"; + created_at?: Maybe; + created_by?: Maybe; + depends_on?: Maybe; + description?: Maybe; + id?: Maybe; + name?: Maybe; + no_of_solves?: Maybe; + tags?: Maybe; + updated_at?: Maybe; +}; + +/** aggregate min on columns */ +export type Machines_Min_Fields = { + __typename?: "machines_min_fields"; + created_at?: Maybe; + created_by?: Maybe; + depends_on?: Maybe; + description?: Maybe; + id?: Maybe; + name?: Maybe; + no_of_solves?: Maybe; + tags?: Maybe; + updated_at?: Maybe; +}; + +/** response of any mutation on the table "machines" */ +export type Machines_Mutation_Response = { + __typename?: "machines_mutation_response"; + /** number of rows affected by the mutation */ + affected_rows: Scalars["Int"]["output"]; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "machines" */ +export type Machines_Obj_Rel_Insert_Input = { + data: Machines_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "machines" */ +export type Machines_On_Conflict = { + constraint: Machines_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "machines". */ +export type Machines_Order_By = { + challenges_aggregate?: InputMaybe; + created_at?: InputMaybe; + created_by?: InputMaybe; + depends_on?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + no_of_solves?: InputMaybe; + tags?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** primary key columns input for table: machines */ +export type Machines_Pk_Columns_Input = { + id: Scalars["String"]["input"]; +}; + +/** select columns of table "machines" */ +export enum Machines_Select_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + CreatedBy = "created_by", + /** column name */ + DependsOn = "depends_on", + /** column name */ + Description = "description", + /** column name */ + Id = "id", + /** column name */ + Name = "name", + /** column name */ + NoOfSolves = "no_of_solves", + /** column name */ + Tags = "tags", + /** column name */ + UpdatedAt = "updated_at" +} + +/** input type for updating data in table "machines" */ +export type Machines_Set_Input = { + created_at?: InputMaybe; + created_by?: InputMaybe; + depends_on?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + no_of_solves?: InputMaybe; + tags?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate stddev on columns */ +export type Machines_Stddev_Fields = { + __typename?: "machines_stddev_fields"; + no_of_solves?: Maybe; +}; + +/** aggregate stddev_pop on columns */ +export type Machines_Stddev_Pop_Fields = { + __typename?: "machines_stddev_pop_fields"; + no_of_solves?: Maybe; +}; + +/** aggregate stddev_samp on columns */ +export type Machines_Stddev_Samp_Fields = { + __typename?: "machines_stddev_samp_fields"; + no_of_solves?: Maybe; +}; + +/** Streaming cursor of the table "machines" */ +export type Machines_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Machines_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Machines_Stream_Cursor_Value_Input = { + created_at?: InputMaybe; + created_by?: InputMaybe; + depends_on?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + no_of_solves?: InputMaybe; + tags?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate sum on columns */ +export type Machines_Sum_Fields = { + __typename?: "machines_sum_fields"; + no_of_solves?: Maybe; +}; + +/** update columns of table "machines" */ +export enum Machines_Update_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + CreatedBy = "created_by", + /** column name */ + DependsOn = "depends_on", + /** column name */ + Description = "description", + /** column name */ + Id = "id", + /** column name */ + Name = "name", + /** column name */ + NoOfSolves = "no_of_solves", + /** column name */ + Tags = "tags", + /** column name */ + UpdatedAt = "updated_at" +} + +export type Machines_Updates = { + /** increments the numeric columns with given value of the filtered values */ + _inc?: InputMaybe; + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: Machines_Bool_Exp; +}; + +/** aggregate var_pop on columns */ +export type Machines_Var_Pop_Fields = { + __typename?: "machines_var_pop_fields"; + no_of_solves?: Maybe; +}; + +/** aggregate var_samp on columns */ +export type Machines_Var_Samp_Fields = { + __typename?: "machines_var_samp_fields"; + no_of_solves?: Maybe; +}; + +/** aggregate variance on columns */ +export type Machines_Variance_Fields = { + __typename?: "machines_variance_fields"; + no_of_solves?: Maybe; +}; + +/** mutation root */ +export type Mutation_Root = { + __typename?: "mutation_root"; + /** delete data from the table: "bans" */ + delete_bans?: Maybe; + /** delete single row from the table: "bans" */ + delete_bans_by_pk?: Maybe; + /** delete data from the table: "challenges" */ + delete_challenges?: Maybe; + /** delete single row from the table: "challenges" */ + delete_challenges_by_pk?: Maybe; + /** delete data from the table: "machines" */ + delete_machines?: Maybe; + /** delete single row from the table: "machines" */ + delete_machines_by_pk?: Maybe; + /** delete data from the table: "scores" */ + delete_scores?: Maybe; + /** delete single row from the table: "scores" */ + delete_scores_by_pk?: Maybe; + /** delete data from the table: "submissions" */ + delete_submissions?: Maybe; + /** delete single row from the table: "submissions" */ + delete_submissions_by_pk?: Maybe; + /** delete data from the table: "teams" */ + delete_teams?: Maybe; + /** delete single row from the table: "teams" */ + delete_teams_by_pk?: Maybe; + /** delete data from the table: "users" */ + delete_users?: Maybe; + /** delete single row from the table: "users" */ + delete_users_by_pk?: Maybe; + /** insert data into the table: "bans" */ + insert_bans?: Maybe; + /** insert a single row into the table: "bans" */ + insert_bans_one?: Maybe; + /** insert data into the table: "challenges" */ + insert_challenges?: Maybe; + /** insert a single row into the table: "challenges" */ + insert_challenges_one?: Maybe; + /** insert data into the table: "machines" */ + insert_machines?: Maybe; + /** insert a single row into the table: "machines" */ + insert_machines_one?: Maybe; + /** insert data into the table: "scores" */ + insert_scores?: Maybe; + /** insert a single row into the table: "scores" */ + insert_scores_one?: Maybe; + /** insert data into the table: "submissions" */ + insert_submissions?: Maybe; + /** insert a single row into the table: "submissions" */ + insert_submissions_one?: Maybe; + /** insert data into the table: "teams" */ + insert_teams?: Maybe; + /** insert a single row into the table: "teams" */ + insert_teams_one?: Maybe; + /** insert data into the table: "users" */ + insert_users?: Maybe; + /** insert a single row into the table: "users" */ + insert_users_one?: Maybe; + /** update data of the table: "bans" */ + update_bans?: Maybe; + /** update single row of the table: "bans" */ + update_bans_by_pk?: Maybe; + /** update multiples rows of table: "bans" */ + update_bans_many?: Maybe>>; + /** update data of the table: "challenges" */ + update_challenges?: Maybe; + /** update single row of the table: "challenges" */ + update_challenges_by_pk?: Maybe; + /** update multiples rows of table: "challenges" */ + update_challenges_many?: Maybe>>; + /** update data of the table: "machines" */ + update_machines?: Maybe; + /** update single row of the table: "machines" */ + update_machines_by_pk?: Maybe; + /** update multiples rows of table: "machines" */ + update_machines_many?: Maybe>>; + /** update data of the table: "scores" */ + update_scores?: Maybe; + /** update single row of the table: "scores" */ + update_scores_by_pk?: Maybe; + /** update multiples rows of table: "scores" */ + update_scores_many?: Maybe>>; + /** update data of the table: "submissions" */ + update_submissions?: Maybe; + /** update single row of the table: "submissions" */ + update_submissions_by_pk?: Maybe; + /** update multiples rows of table: "submissions" */ + update_submissions_many?: Maybe>>; + /** update data of the table: "teams" */ + update_teams?: Maybe; + /** update single row of the table: "teams" */ + update_teams_by_pk?: Maybe; + /** update multiples rows of table: "teams" */ + update_teams_many?: Maybe>>; + /** update data of the table: "users" */ + update_users?: Maybe; + /** update single row of the table: "users" */ + update_users_by_pk?: Maybe; + /** update multiples rows of table: "users" */ + update_users_many?: Maybe>>; +}; + + +/** mutation root */ +export type Mutation_RootDelete_BansArgs = { + where: Bans_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootDelete_Bans_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +/** mutation root */ +export type Mutation_RootDelete_ChallengesArgs = { + where: Challenges_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootDelete_Challenges_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +/** mutation root */ +export type Mutation_RootDelete_MachinesArgs = { + where: Machines_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootDelete_Machines_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +/** mutation root */ +export type Mutation_RootDelete_ScoresArgs = { + where: Scores_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootDelete_Scores_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +/** mutation root */ +export type Mutation_RootDelete_SubmissionsArgs = { + where: Submissions_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootDelete_Submissions_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +/** mutation root */ +export type Mutation_RootDelete_TeamsArgs = { + where: Teams_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootDelete_Teams_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +/** mutation root */ +export type Mutation_RootDelete_UsersArgs = { + where: Users_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootDelete_Users_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +/** mutation root */ +export type Mutation_RootInsert_BansArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Bans_OneArgs = { + object: Bans_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_ChallengesArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Challenges_OneArgs = { + object: Challenges_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_MachinesArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Machines_OneArgs = { + object: Machines_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_ScoresArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Scores_OneArgs = { + object: Scores_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_SubmissionsArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Submissions_OneArgs = { + object: Submissions_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_TeamsArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Teams_OneArgs = { + object: Teams_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_UsersArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_Users_OneArgs = { + object: Users_Insert_Input; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_BansArgs = { + _set?: InputMaybe; + where: Bans_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Bans_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Bans_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Bans_ManyArgs = { + updates: Array; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_ChallengesArgs = { + _inc?: InputMaybe; + _set?: InputMaybe; + where: Challenges_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Challenges_By_PkArgs = { + _inc?: InputMaybe; + _set?: InputMaybe; + pk_columns: Challenges_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Challenges_ManyArgs = { + updates: Array; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_MachinesArgs = { + _inc?: InputMaybe; + _set?: InputMaybe; + where: Machines_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Machines_By_PkArgs = { + _inc?: InputMaybe; + _set?: InputMaybe; + pk_columns: Machines_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Machines_ManyArgs = { + updates: Array; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_ScoresArgs = { + _set?: InputMaybe; + where: Scores_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Scores_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Scores_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Scores_ManyArgs = { + updates: Array; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_SubmissionsArgs = { + _set?: InputMaybe; + where: Submissions_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Submissions_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Submissions_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Submissions_ManyArgs = { + updates: Array; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_TeamsArgs = { + _set?: InputMaybe; + where: Teams_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Teams_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Teams_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Teams_ManyArgs = { + updates: Array; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_UsersArgs = { + _set?: InputMaybe; + where: Users_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Users_By_PkArgs = { + _set?: InputMaybe; + pk_columns: Users_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_Users_ManyArgs = { + updates: Array; +}; + +/** column ordering options */ +export enum Order_By { + /** in ascending order, nulls last */ + Asc = "asc", + /** in ascending order, nulls first */ + AscNullsFirst = "asc_nulls_first", + /** in ascending order, nulls last */ + AscNullsLast = "asc_nulls_last", + /** in descending order, nulls first */ + Desc = "desc", + /** in descending order, nulls first */ + DescNullsFirst = "desc_nulls_first", + /** in descending order, nulls last */ + DescNullsLast = "desc_nulls_last" +} + +export type Query_Root = { + __typename?: "query_root"; + /** An array relationship */ + bans: Array; + /** An aggregate relationship */ + bans_aggregate: Bans_Aggregate; + /** fetch data from the table: "bans" using primary key columns */ + bans_by_pk?: Maybe; + /** An array relationship */ + challenges: Array; + /** An aggregate relationship */ + challenges_aggregate: Challenges_Aggregate; + /** fetch data from the table: "challenges" using primary key columns */ + challenges_by_pk?: Maybe; + /** fetch data from the table: "machines" */ + machines: Array; + /** fetch aggregated fields from the table: "machines" */ + machines_aggregate: Machines_Aggregate; + /** fetch data from the table: "machines" using primary key columns */ + machines_by_pk?: Maybe; + /** An array relationship */ + scores: Array; + /** An aggregate relationship */ + scores_aggregate: Scores_Aggregate; + /** fetch data from the table: "scores" using primary key columns */ + scores_by_pk?: Maybe; + /** An array relationship */ + submissions: Array; + /** An aggregate relationship */ + submissions_aggregate: Submissions_Aggregate; + /** fetch data from the table: "submissions" using primary key columns */ + submissions_by_pk?: Maybe; + /** fetch data from the table: "teams" */ + teams: Array; + /** fetch aggregated fields from the table: "teams" */ + teams_aggregate: Teams_Aggregate; + /** fetch data from the table: "teams" using primary key columns */ + teams_by_pk?: Maybe; + /** An array relationship */ + users: Array; + /** An aggregate relationship */ + users_aggregate: Users_Aggregate; + /** fetch data from the table: "users" using primary key columns */ + users_by_pk?: Maybe; +}; + + +export type Query_RootBansArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootBans_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootBans_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Query_RootChallengesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootChallenges_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootChallenges_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Query_RootMachinesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMachines_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootMachines_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Query_RootScoresArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootScores_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootScores_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Query_RootSubmissionsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootSubmissions_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootSubmissions_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Query_RootTeamsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootTeams_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootTeams_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Query_RootUsersArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootUsers_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootUsers_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + +/** Scoreboard Data */ +export type Scores = { + __typename?: "scores"; + /** An object relationship */ + challenge: Challenges; + challenge_id: Scalars["String"]["output"]; + created_at: Scalars["timestamptz"]["output"]; + id: Scalars["String"]["output"]; + /** An object relationship */ + submission: Submissions; + submission_id: Scalars["String"]["output"]; + /** An object relationship */ + team: Teams; + team_id: Scalars["String"]["output"]; + updated_at: Scalars["timestamptz"]["output"]; + /** An object relationship */ + user: Users; + user_id: Scalars["String"]["output"]; +}; + +/** aggregated selection of "scores" */ +export type Scores_Aggregate = { + __typename?: "scores_aggregate"; + aggregate?: Maybe; + nodes: Array; +}; + +export type Scores_Aggregate_Bool_Exp = { + count?: InputMaybe; +}; + +export type Scores_Aggregate_Bool_Exp_Count = { + arguments?: InputMaybe>; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Int_Comparison_Exp; +}; + +/** aggregate fields of "scores" */ +export type Scores_Aggregate_Fields = { + __typename?: "scores_aggregate_fields"; + count: Scalars["Int"]["output"]; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "scores" */ +export type Scores_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** order by aggregate values of table "scores" */ +export type Scores_Aggregate_Order_By = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "scores" */ +export type Scores_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "scores". All fields are combined with a logical 'AND'. */ +export type Scores_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + challenge?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submission?: InputMaybe; + submission_id?: InputMaybe; + team?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; + user?: InputMaybe; + user_id?: InputMaybe; +}; + +/** unique or primary key constraints on table "scores" */ +export enum Scores_Constraint { + /** unique or primary key constraint on columns "id" */ + ScoresPkey = "scores_pkey", + /** unique or primary key constraint on columns "submission_id" */ + ScoresSubmissionIdKey = "scores_submission_id_key" +} + +/** input type for inserting data into table "scores" */ +export type Scores_Insert_Input = { + challenge?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submission?: InputMaybe; + submission_id?: InputMaybe; + team?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; + user?: InputMaybe; + user_id?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Scores_Max_Fields = { + __typename?: "scores_max_fields"; + challenge_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + submission_id?: Maybe; + team_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; + +/** order by max() on columns of table "scores" */ +export type Scores_Max_Order_By = { + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submission_id?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** aggregate min on columns */ +export type Scores_Min_Fields = { + __typename?: "scores_min_fields"; + challenge_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + submission_id?: Maybe; + team_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; + +/** order by min() on columns of table "scores" */ +export type Scores_Min_Order_By = { + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submission_id?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** response of any mutation on the table "scores" */ +export type Scores_Mutation_Response = { + __typename?: "scores_mutation_response"; + /** number of rows affected by the mutation */ + affected_rows: Scalars["Int"]["output"]; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "scores" */ +export type Scores_Obj_Rel_Insert_Input = { + data: Scores_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "scores" */ +export type Scores_On_Conflict = { + constraint: Scores_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "scores". */ +export type Scores_Order_By = { + challenge?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submission?: InputMaybe; + submission_id?: InputMaybe; + team?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; + user?: InputMaybe; + user_id?: InputMaybe; +}; + +/** primary key columns input for table: scores */ +export type Scores_Pk_Columns_Input = { + id: Scalars["String"]["input"]; +}; + +/** select columns of table "scores" */ +export enum Scores_Select_Column { + /** column name */ + ChallengeId = "challenge_id", + /** column name */ + CreatedAt = "created_at", + /** column name */ + Id = "id", + /** column name */ + SubmissionId = "submission_id", + /** column name */ + TeamId = "team_id", + /** column name */ + UpdatedAt = "updated_at", + /** column name */ + UserId = "user_id" +} + +/** input type for updating data in table "scores" */ +export type Scores_Set_Input = { + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submission_id?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** Streaming cursor of the table "scores" */ +export type Scores_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Scores_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Scores_Stream_Cursor_Value_Input = { + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submission_id?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** update columns of table "scores" */ +export enum Scores_Update_Column { + /** column name */ + ChallengeId = "challenge_id", + /** column name */ + CreatedAt = "created_at", + /** column name */ + Id = "id", + /** column name */ + SubmissionId = "submission_id", + /** column name */ + TeamId = "team_id", + /** column name */ + UpdatedAt = "updated_at", + /** column name */ + UserId = "user_id" +} + +export type Scores_Updates = { + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: Scores_Bool_Exp; +}; + +/** User flag submissions */ +export type Submissions = { + __typename?: "submissions"; + /** An object relationship */ + challenge: Challenges; + challenge_id: Scalars["String"]["output"]; + created_at: Scalars["timestamptz"]["output"]; + id: Scalars["String"]["output"]; + /** An object relationship */ + score?: Maybe; + submited_flag: Scalars["String"]["output"]; + updated_at: Scalars["timestamptz"]["output"]; + /** An object relationship */ + user: Users; + user_id: Scalars["String"]["output"]; +}; + +/** aggregated selection of "submissions" */ +export type Submissions_Aggregate = { + __typename?: "submissions_aggregate"; + aggregate?: Maybe; + nodes: Array; +}; + +export type Submissions_Aggregate_Bool_Exp = { + count?: InputMaybe; +}; + +export type Submissions_Aggregate_Bool_Exp_Count = { + arguments?: InputMaybe>; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Int_Comparison_Exp; +}; + +/** aggregate fields of "submissions" */ +export type Submissions_Aggregate_Fields = { + __typename?: "submissions_aggregate_fields"; + count: Scalars["Int"]["output"]; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "submissions" */ +export type Submissions_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** order by aggregate values of table "submissions" */ +export type Submissions_Aggregate_Order_By = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "submissions" */ +export type Submissions_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "submissions". All fields are combined with a logical 'AND'. */ +export type Submissions_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + challenge?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + score?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; + user?: InputMaybe; + user_id?: InputMaybe; +}; + +/** unique or primary key constraints on table "submissions" */ +export enum Submissions_Constraint { + /** unique or primary key constraint on columns "id" */ + SubmissionsPkey = "submissions_pkey" +} + +/** input type for inserting data into table "submissions" */ +export type Submissions_Insert_Input = { + challenge?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + score?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; + user?: InputMaybe; + user_id?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Submissions_Max_Fields = { + __typename?: "submissions_max_fields"; + challenge_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + submited_flag?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; + +/** order by max() on columns of table "submissions" */ +export type Submissions_Max_Order_By = { + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** aggregate min on columns */ +export type Submissions_Min_Fields = { + __typename?: "submissions_min_fields"; + challenge_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + submited_flag?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; + +/** order by min() on columns of table "submissions" */ +export type Submissions_Min_Order_By = { + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** response of any mutation on the table "submissions" */ +export type Submissions_Mutation_Response = { + __typename?: "submissions_mutation_response"; + /** number of rows affected by the mutation */ + affected_rows: Scalars["Int"]["output"]; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "submissions" */ +export type Submissions_Obj_Rel_Insert_Input = { + data: Submissions_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "submissions" */ +export type Submissions_On_Conflict = { + constraint: Submissions_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "submissions". */ +export type Submissions_Order_By = { + challenge?: InputMaybe; + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + score?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; + user?: InputMaybe; + user_id?: InputMaybe; +}; + +/** primary key columns input for table: submissions */ +export type Submissions_Pk_Columns_Input = { + id: Scalars["String"]["input"]; +}; + +/** select columns of table "submissions" */ +export enum Submissions_Select_Column { + /** column name */ + ChallengeId = "challenge_id", + /** column name */ + CreatedAt = "created_at", + /** column name */ + Id = "id", + /** column name */ + SubmitedFlag = "submited_flag", + /** column name */ + UpdatedAt = "updated_at", + /** column name */ + UserId = "user_id" +} + +/** input type for updating data in table "submissions" */ +export type Submissions_Set_Input = { + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** Streaming cursor of the table "submissions" */ +export type Submissions_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Submissions_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Submissions_Stream_Cursor_Value_Input = { + challenge_id?: InputMaybe; + created_at?: InputMaybe; + id?: InputMaybe; + submited_flag?: InputMaybe; + updated_at?: InputMaybe; + user_id?: InputMaybe; +}; + +/** update columns of table "submissions" */ +export enum Submissions_Update_Column { + /** column name */ + ChallengeId = "challenge_id", + /** column name */ + CreatedAt = "created_at", + /** column name */ + Id = "id", + /** column name */ + SubmitedFlag = "submited_flag", + /** column name */ + UpdatedAt = "updated_at", + /** column name */ + UserId = "user_id" +} + +export type Submissions_Updates = { + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: Submissions_Bool_Exp; +}; + +export type Subscription_Root = { + __typename?: "subscription_root"; + /** An array relationship */ + bans: Array; + /** An aggregate relationship */ + bans_aggregate: Bans_Aggregate; + /** fetch data from the table: "bans" using primary key columns */ + bans_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "bans" */ + bans_stream: Array; + /** An array relationship */ + challenges: Array; + /** An aggregate relationship */ + challenges_aggregate: Challenges_Aggregate; + /** fetch data from the table: "challenges" using primary key columns */ + challenges_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "challenges" */ + challenges_stream: Array; + /** fetch data from the table: "machines" */ + machines: Array; + /** fetch aggregated fields from the table: "machines" */ + machines_aggregate: Machines_Aggregate; + /** fetch data from the table: "machines" using primary key columns */ + machines_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "machines" */ + machines_stream: Array; + /** An array relationship */ + scores: Array; + /** An aggregate relationship */ + scores_aggregate: Scores_Aggregate; + /** fetch data from the table: "scores" using primary key columns */ + scores_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "scores" */ + scores_stream: Array; + /** An array relationship */ + submissions: Array; + /** An aggregate relationship */ + submissions_aggregate: Submissions_Aggregate; + /** fetch data from the table: "submissions" using primary key columns */ + submissions_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "submissions" */ + submissions_stream: Array; + /** fetch data from the table: "teams" */ + teams: Array; + /** fetch aggregated fields from the table: "teams" */ + teams_aggregate: Teams_Aggregate; + /** fetch data from the table: "teams" using primary key columns */ + teams_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "teams" */ + teams_stream: Array; + /** An array relationship */ + users: Array; + /** An aggregate relationship */ + users_aggregate: Users_Aggregate; + /** fetch data from the table: "users" using primary key columns */ + users_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "users" */ + users_stream: Array; +}; + + +export type Subscription_RootBansArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootBans_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootBans_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Subscription_RootBans_StreamArgs = { + batch_size: Scalars["Int"]["input"]; + cursor: Array>; + where?: InputMaybe; +}; + + +export type Subscription_RootChallengesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootChallenges_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootChallenges_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Subscription_RootChallenges_StreamArgs = { + batch_size: Scalars["Int"]["input"]; + cursor: Array>; + where?: InputMaybe; +}; + + +export type Subscription_RootMachinesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMachines_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootMachines_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Subscription_RootMachines_StreamArgs = { + batch_size: Scalars["Int"]["input"]; + cursor: Array>; + where?: InputMaybe; +}; + + +export type Subscription_RootScoresArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootScores_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootScores_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Subscription_RootScores_StreamArgs = { + batch_size: Scalars["Int"]["input"]; + cursor: Array>; + where?: InputMaybe; +}; + + +export type Subscription_RootSubmissionsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootSubmissions_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootSubmissions_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Subscription_RootSubmissions_StreamArgs = { + batch_size: Scalars["Int"]["input"]; + cursor: Array>; + where?: InputMaybe; +}; + + +export type Subscription_RootTeamsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootTeams_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootTeams_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Subscription_RootTeams_StreamArgs = { + batch_size: Scalars["Int"]["input"]; + cursor: Array>; + where?: InputMaybe; +}; + + +export type Subscription_RootUsersArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootUsers_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootUsers_By_PkArgs = { + id: Scalars["String"]["input"]; +}; + + +export type Subscription_RootUsers_StreamArgs = { + batch_size: Scalars["Int"]["input"]; + cursor: Array>; + where?: InputMaybe; +}; + +/** Teams Data */ +export type Teams = { + __typename?: "teams"; + created_at: Scalars["timestamptz"]["output"]; + id: Scalars["String"]["output"]; + join_code: Scalars["String"]["output"]; + name: Scalars["String"]["output"]; + /** An array relationship */ + scores: Array; + /** An aggregate relationship */ + scores_aggregate: Scores_Aggregate; + updated_at: Scalars["timestamptz"]["output"]; + /** An array relationship */ + users: Array; + /** An aggregate relationship */ + users_aggregate: Users_Aggregate; +}; + + +/** Teams Data */ +export type TeamsScoresArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Teams Data */ +export type TeamsScores_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Teams Data */ +export type TeamsUsersArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Teams Data */ +export type TeamsUsers_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + +/** aggregated selection of "teams" */ +export type Teams_Aggregate = { + __typename?: "teams_aggregate"; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "teams" */ +export type Teams_Aggregate_Fields = { + __typename?: "teams_aggregate_fields"; + count: Scalars["Int"]["output"]; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "teams" */ +export type Teams_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "teams". All fields are combined with a logical 'AND'. */ +export type Teams_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + created_at?: InputMaybe; + id?: InputMaybe; + join_code?: InputMaybe; + name?: InputMaybe; + scores?: InputMaybe; + scores_aggregate?: InputMaybe; + updated_at?: InputMaybe; + users?: InputMaybe; + users_aggregate?: InputMaybe; +}; + +/** unique or primary key constraints on table "teams" */ +export enum Teams_Constraint { + /** unique or primary key constraint on columns "join_code" */ + TeamsJoinCodeKey = "teams_join_code_key", + /** unique or primary key constraint on columns "name" */ + TeamsNameKey = "teams_name_key", + /** unique or primary key constraint on columns "id" */ + TeamsPkey = "teams_pkey" +} + +/** input type for inserting data into table "teams" */ +export type Teams_Insert_Input = { + created_at?: InputMaybe; + id?: InputMaybe; + join_code?: InputMaybe; + name?: InputMaybe; + scores?: InputMaybe; + updated_at?: InputMaybe; + users?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Teams_Max_Fields = { + __typename?: "teams_max_fields"; + created_at?: Maybe; + id?: Maybe; + join_code?: Maybe; + name?: Maybe; + updated_at?: Maybe; +}; + +/** aggregate min on columns */ +export type Teams_Min_Fields = { + __typename?: "teams_min_fields"; + created_at?: Maybe; + id?: Maybe; + join_code?: Maybe; + name?: Maybe; + updated_at?: Maybe; +}; + +/** response of any mutation on the table "teams" */ +export type Teams_Mutation_Response = { + __typename?: "teams_mutation_response"; + /** number of rows affected by the mutation */ + affected_rows: Scalars["Int"]["output"]; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "teams" */ +export type Teams_Obj_Rel_Insert_Input = { + data: Teams_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "teams" */ +export type Teams_On_Conflict = { + constraint: Teams_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "teams". */ +export type Teams_Order_By = { + created_at?: InputMaybe; + id?: InputMaybe; + join_code?: InputMaybe; + name?: InputMaybe; + scores_aggregate?: InputMaybe; + updated_at?: InputMaybe; + users_aggregate?: InputMaybe; +}; + +/** primary key columns input for table: teams */ +export type Teams_Pk_Columns_Input = { + id: Scalars["String"]["input"]; +}; + +/** select columns of table "teams" */ +export enum Teams_Select_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + Id = "id", + /** column name */ + JoinCode = "join_code", + /** column name */ + Name = "name", + /** column name */ + UpdatedAt = "updated_at" +} + +/** input type for updating data in table "teams" */ +export type Teams_Set_Input = { + created_at?: InputMaybe; + id?: InputMaybe; + join_code?: InputMaybe; + name?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** Streaming cursor of the table "teams" */ +export type Teams_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Teams_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Teams_Stream_Cursor_Value_Input = { + created_at?: InputMaybe; + id?: InputMaybe; + join_code?: InputMaybe; + name?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** update columns of table "teams" */ +export enum Teams_Update_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + Id = "id", + /** column name */ + JoinCode = "join_code", + /** column name */ + Name = "name", + /** column name */ + UpdatedAt = "updated_at" +} + +export type Teams_Updates = { + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: Teams_Bool_Exp; +}; + +/** Boolean expression to compare columns of type "timestamptz". All fields are combined with logical 'AND'. */ +export type Timestamptz_Comparison_Exp = { + _eq?: InputMaybe; + _gt?: InputMaybe; + _gte?: InputMaybe; + _in?: InputMaybe>; + _is_null?: InputMaybe; + _lt?: InputMaybe; + _lte?: InputMaybe; + _neq?: InputMaybe; + _nin?: InputMaybe>; +}; + +/** Users Data */ +export type Users = { + __typename?: "users"; + /** An array relationship */ + bans: Array; + /** An aggregate relationship */ + bans_aggregate: Bans_Aggregate; + created_at: Scalars["timestamptz"]["output"]; + email: Scalars["String"]["output"]; + email_verification_code: Scalars["String"]["output"]; + first_name: Scalars["String"]["output"]; + hash: Scalars["String"]["output"]; + id: Scalars["String"]["output"]; + is_admin: Scalars["Boolean"]["output"]; + is_banned: Scalars["Boolean"]["output"]; + is_email_verified: Scalars["Boolean"]["output"]; + last_name: Scalars["String"]["output"]; + salt: Scalars["String"]["output"]; + /** An array relationship */ + scores: Array; + /** An aggregate relationship */ + scores_aggregate: Scores_Aggregate; + /** An array relationship */ + submissions: Array; + /** An aggregate relationship */ + submissions_aggregate: Submissions_Aggregate; + /** An object relationship */ + team?: Maybe; + team_id?: Maybe; + updated_at: Scalars["timestamptz"]["output"]; +}; + + +/** Users Data */ +export type UsersBansArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Users Data */ +export type UsersBans_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Users Data */ +export type UsersScoresArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Users Data */ +export type UsersScores_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Users Data */ +export type UsersSubmissionsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Users Data */ +export type UsersSubmissions_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + +/** aggregated selection of "users" */ +export type Users_Aggregate = { + __typename?: "users_aggregate"; + aggregate?: Maybe; + nodes: Array; +}; + +export type Users_Aggregate_Bool_Exp = { + bool_and?: InputMaybe; + bool_or?: InputMaybe; + count?: InputMaybe; +}; + +export type Users_Aggregate_Bool_Exp_Bool_And = { + arguments: Users_Select_Column_Users_Aggregate_Bool_Exp_Bool_And_Arguments_Columns; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Boolean_Comparison_Exp; +}; + +export type Users_Aggregate_Bool_Exp_Bool_Or = { + arguments: Users_Select_Column_Users_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Boolean_Comparison_Exp; +}; + +export type Users_Aggregate_Bool_Exp_Count = { + arguments?: InputMaybe>; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Int_Comparison_Exp; +}; + +/** aggregate fields of "users" */ +export type Users_Aggregate_Fields = { + __typename?: "users_aggregate_fields"; + count: Scalars["Int"]["output"]; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "users" */ +export type Users_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** order by aggregate values of table "users" */ +export type Users_Aggregate_Order_By = { + count?: InputMaybe; + max?: InputMaybe; + min?: InputMaybe; +}; + +/** input type for inserting array relation for remote table "users" */ +export type Users_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "users". All fields are combined with a logical 'AND'. */ +export type Users_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + bans?: InputMaybe; + bans_aggregate?: InputMaybe; + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + is_admin?: InputMaybe; + is_banned?: InputMaybe; + is_email_verified?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; + scores?: InputMaybe; + scores_aggregate?: InputMaybe; + submissions?: InputMaybe; + submissions_aggregate?: InputMaybe; + team?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** unique or primary key constraints on table "users" */ +export enum Users_Constraint { + /** unique or primary key constraint on columns "email" */ + UsersEmailKey = "users_email_key", + /** unique or primary key constraint on columns "hash" */ + UsersHashKey = "users_hash_key", + /** unique or primary key constraint on columns "id" */ + UsersPkey = "users_pkey", + /** unique or primary key constraint on columns "salt" */ + UsersSaltKey = "users_salt_key" +} + +/** input type for inserting data into table "users" */ +export type Users_Insert_Input = { + bans?: InputMaybe; + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + is_admin?: InputMaybe; + is_banned?: InputMaybe; + is_email_verified?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; + scores?: InputMaybe; + submissions?: InputMaybe; + team?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate max on columns */ +export type Users_Max_Fields = { + __typename?: "users_max_fields"; + created_at?: Maybe; + email?: Maybe; + email_verification_code?: Maybe; + first_name?: Maybe; + hash?: Maybe; + id?: Maybe; + last_name?: Maybe; + salt?: Maybe; + team_id?: Maybe; + updated_at?: Maybe; +}; + +/** order by max() on columns of table "users" */ +export type Users_Max_Order_By = { + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate min on columns */ +export type Users_Min_Fields = { + __typename?: "users_min_fields"; + created_at?: Maybe; + email?: Maybe; + email_verification_code?: Maybe; + first_name?: Maybe; + hash?: Maybe; + id?: Maybe; + last_name?: Maybe; + salt?: Maybe; + team_id?: Maybe; + updated_at?: Maybe; +}; + +/** order by min() on columns of table "users" */ +export type Users_Min_Order_By = { + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** response of any mutation on the table "users" */ +export type Users_Mutation_Response = { + __typename?: "users_mutation_response"; + /** number of rows affected by the mutation */ + affected_rows: Scalars["Int"]["output"]; + /** data from the rows affected by the mutation */ + returning: Array; +}; + +/** input type for inserting object relation for remote table "users" */ +export type Users_Obj_Rel_Insert_Input = { + data: Users_Insert_Input; + /** upsert condition */ + on_conflict?: InputMaybe; +}; + +/** on_conflict condition type for table "users" */ +export type Users_On_Conflict = { + constraint: Users_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "users". */ +export type Users_Order_By = { + bans_aggregate?: InputMaybe; + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + is_admin?: InputMaybe; + is_banned?: InputMaybe; + is_email_verified?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; + scores_aggregate?: InputMaybe; + submissions_aggregate?: InputMaybe; + team?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** primary key columns input for table: users */ +export type Users_Pk_Columns_Input = { + id: Scalars["String"]["input"]; +}; + +/** select columns of table "users" */ +export enum Users_Select_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + Email = "email", + /** column name */ + EmailVerificationCode = "email_verification_code", + /** column name */ + FirstName = "first_name", + /** column name */ + Hash = "hash", + /** column name */ + Id = "id", + /** column name */ + IsAdmin = "is_admin", + /** column name */ + IsBanned = "is_banned", + /** column name */ + IsEmailVerified = "is_email_verified", + /** column name */ + LastName = "last_name", + /** column name */ + Salt = "salt", + /** column name */ + TeamId = "team_id", + /** column name */ + UpdatedAt = "updated_at" +} + +/** select "users_aggregate_bool_exp_bool_and_arguments_columns" columns of table "users" */ +export enum Users_Select_Column_Users_Aggregate_Bool_Exp_Bool_And_Arguments_Columns { + /** column name */ + IsAdmin = "is_admin", + /** column name */ + IsBanned = "is_banned", + /** column name */ + IsEmailVerified = "is_email_verified" +} + +/** select "users_aggregate_bool_exp_bool_or_arguments_columns" columns of table "users" */ +export enum Users_Select_Column_Users_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns { + /** column name */ + IsAdmin = "is_admin", + /** column name */ + IsBanned = "is_banned", + /** column name */ + IsEmailVerified = "is_email_verified" +} + +/** input type for updating data in table "users" */ +export type Users_Set_Input = { + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + is_admin?: InputMaybe; + is_banned?: InputMaybe; + is_email_verified?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** Streaming cursor of the table "users" */ +export type Users_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Users_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type Users_Stream_Cursor_Value_Input = { + created_at?: InputMaybe; + email?: InputMaybe; + email_verification_code?: InputMaybe; + first_name?: InputMaybe; + hash?: InputMaybe; + id?: InputMaybe; + is_admin?: InputMaybe; + is_banned?: InputMaybe; + is_email_verified?: InputMaybe; + last_name?: InputMaybe; + salt?: InputMaybe; + team_id?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** update columns of table "users" */ +export enum Users_Update_Column { + /** column name */ + CreatedAt = "created_at", + /** column name */ + Email = "email", + /** column name */ + EmailVerificationCode = "email_verification_code", + /** column name */ + FirstName = "first_name", + /** column name */ + Hash = "hash", + /** column name */ + Id = "id", + /** column name */ + IsAdmin = "is_admin", + /** column name */ + IsBanned = "is_banned", + /** column name */ + IsEmailVerified = "is_email_verified", + /** column name */ + LastName = "last_name", + /** column name */ + Salt = "salt", + /** column name */ + TeamId = "team_id", + /** column name */ + UpdatedAt = "updated_at" +} + +export type Users_Updates = { + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: Users_Bool_Exp; +}; diff --git a/packages/scorefeed/helpers/ctftimeClient.ts b/packages/scorefeed/helpers/ctftimeClient.ts new file mode 100644 index 0000000..8e0394d --- /dev/null +++ b/packages/scorefeed/helpers/ctftimeClient.ts @@ -0,0 +1,59 @@ +import axios from "axios"; + +export class CTFTimeClient { + private readonly baseURL: string = "https://oauth.ctftime.org"; + private readonly axiosInstance = axios.create({ + baseURL: this.baseURL, + timeout: 10_000, + headers: { + "Content-Type": "application/json" + } + }); + + public async getAuthURL() { + try { + const urlparams = new URLSearchParams(); + urlparams.append("client_id", process.env.CTFTIME_CLIENT_ID ?? ""); + urlparams.append("redirect_uri", process.env.CTFTIME_REDIRECT_URI ?? ""); + urlparams.append("response_type", "code"); + urlparams.append("scope", "profile"); + urlparams.append("state", "eeCTF"); + return `${this.baseURL}/authorize?${urlparams.toString()}`; + } catch (error) { + return error; + } + } + + public async getAccessToken(code: string) { + try { + const { data } = await this.axiosInstance.post( + `/token?client_id=${process.env.CTFTIME_CLIENT_ID}&client_secret=${process.env.CTFTIME_CLIENT_SECRET}&code=${code}`, + { + grant_type: "authorization_code", + redirect_uri: process.env.CTFTIME_REDIRECT_URI, + } + ); + return data; + } catch (error: any) { + console.log(error); + if(error instanceof Error) { + throw new TypeError(error.message); + } + } + } + + public async getProfile(access_token: string) { + try { + const res = await this.axiosInstance.get("/user", { + headers: { + Authorization: `Bearer ${access_token}`, + }, + }); + return res.data; + } catch (error) { + if(error instanceof Error) { + throw new TypeError(error.message); + } + } + } +} \ No newline at end of file diff --git a/packages/scorefeed/helpers/gqlClient.ts b/packages/scorefeed/helpers/gqlClient.ts new file mode 100644 index 0000000..c16f64b --- /dev/null +++ b/packages/scorefeed/helpers/gqlClient.ts @@ -0,0 +1,17 @@ +import { GraphQLClient } from "graphql-request"; + +export let client = new GraphQLClient(""); + +export const hgqlInit = () => { + console.log("\nšŸš€ GraphQL Client Initialized"); + + let HASURA_URL: string = process.env.HASURA_GRAPHQL_ENDPOINT ?? ""; + HASURA_URL += HASURA_URL.endsWith("/") ? "v1/graphql" : "/v1/graphql"; + const HASURA_ADMIN: string = process.env.HASURA_GRAPHQL_ADMIN_SECRET ?? ""; + + client = new GraphQLClient(HASURA_URL, { + headers: { + "x-hasura-admin-secret": HASURA_ADMIN, + }, + }); +}; \ No newline at end of file diff --git a/packages/scorefeed/index.ts b/packages/scorefeed/index.ts new file mode 100644 index 0000000..8a8527b --- /dev/null +++ b/packages/scorefeed/index.ts @@ -0,0 +1,50 @@ +import "dotenv/config"; + +import { serve } from "@hono/node-server"; +import { Hono } from "hono"; +import { compress } from "hono/compress"; +import { cors } from "hono/cors"; +import { showRoutes } from "hono/dev"; +import { logger } from "hono/logger"; +import { poweredBy } from "hono/powered-by"; +import { prettyJSON } from "hono/pretty-json"; +import { secureHeaders } from "hono/secure-headers"; + +import "./config/env"; + +import { hgqlInit } from "./helpers/gqlClient"; +import { routes } from "./routes"; + +const app = new Hono(); + +hgqlInit(); + +app.use("*", logger()); +app.use("*", poweredBy()); +app.use("*", secureHeaders()); +app.use("*", compress({ + encoding: "gzip", +})); +app.use("*", cors({ + origin: "*", + allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"], + allowHeaders: ["Content-Type", "Authorization"], + credentials: true, +})); +app.use("*", prettyJSON( + { + space: 4, + } +)); + +app.route("/", routes); + +showRoutes(app); + +serve({ + fetch: app.fetch, + port: Number(process.env.PORT), + hostname: "0.0.0.0", +}); + +console.log("šŸš€","Server running at http://localhost:" + process.env.PORT); \ No newline at end of file diff --git a/packages/scorefeed/libs/error.ts b/packages/scorefeed/libs/error.ts new file mode 100644 index 0000000..bc3ac6a --- /dev/null +++ b/packages/scorefeed/libs/error.ts @@ -0,0 +1,24 @@ +export class CustomError extends Error { + public statusCode: number; + public data: any; + + constructor(args: { message?: string; statusCode?: number; data?: any }) { + super(args.message); + this.statusCode = args.statusCode ?? 500; + this.data = args.data; + } + + override toString() { + return { + message: this.message, + statusCode: this.statusCode, + data: this.data, + }; + } +} + +export class NotFoundError extends CustomError { + constructor() { + super({ message: "NOT_FOUND", statusCode: 404 }); + } +} \ No newline at end of file diff --git a/packages/scorefeed/libs/index.ts b/packages/scorefeed/libs/index.ts new file mode 100644 index 0000000..6376778 --- /dev/null +++ b/packages/scorefeed/libs/index.ts @@ -0,0 +1,3 @@ +export * from "./error"; +export * from "./middleware"; +export * from "./utilities"; \ No newline at end of file diff --git a/packages/scorefeed/libs/middleware.ts b/packages/scorefeed/libs/middleware.ts new file mode 100644 index 0000000..b933890 --- /dev/null +++ b/packages/scorefeed/libs/middleware.ts @@ -0,0 +1,10 @@ +import { Context } from "hono"; + +export const notFoundHandler = async (ctx: Context) => { + return ctx.json( + { + message: "Not Found", + }, + 404, + ); +}; \ No newline at end of file diff --git a/packages/scorefeed/libs/utilities.ts b/packages/scorefeed/libs/utilities.ts new file mode 100644 index 0000000..41ac7ce --- /dev/null +++ b/packages/scorefeed/libs/utilities.ts @@ -0,0 +1,124 @@ +export const makeResponse = ( + data: any, + meta_data: any = null, + message = "Success", + error = false, +) => ({ + message, + error, + meta_data, + data, +}); + +const joinPrefix = (...keys: string[]) => keys.join("_"); + +export const flattenObject = (obj: any, prefix = "") => { + let newObj: any = {}; + for (const key in obj) { + const pfx = prefix ? joinPrefix(prefix, key) : key; + newObj = obj[key] instanceof Object ? { ...newObj, ...flattenObject(obj[key], pfx) } : { ...newObj, [pfx]: obj[key] }; + } + return newObj; +}; + +export const cleanObject = (obj: any) => { + const newObj: any = obj; + for (const k in obj) { + if ( + (!k || !obj[k] || k === undefined) && + typeof obj[k] !== "boolean" && + obj[k] !== 0 + ) + delete obj[k]; + } + return newObj; +}; + +export const cleanObjectKeepNull = (obj: any) => { + const newObj: any = obj; + for (const k in obj) { + if ( + (!k || !obj[k] || k === undefined) && + typeof obj[k] !== "boolean" && + obj[k] !== 0 && + obj[k] !== null + ) + delete obj[k]; + } + return newObj; +}; + +export const paginateRequest = (q: any): PaginationType => { + const filter_keys = Object.keys(q).filter(c => c.startsWith("filter_")); + const filters = filter_keys.length > 0 + ? filter_keys + .map(filter_key => { + const filter_subset = filter_key.replace("filter_", "").split("."); + let mode = typeof q[filter_key] === "number" ? "_eq" : "_iregex"; + // check if the provided value if uuid - if so, we use the _eq operator to match + if (q[filter_key].includes("-")) { + mode = "_eq"; + } + + return parseFilter(filter_subset, q[filter_key], 0, mode); + }) + .reduceRight((agg, cur) => { + const [cur_key] = Object.keys(cur); + if (cur_key in agg) { + if (Array.isArray(agg[cur_key])) { + agg[cur_key].push(cur); + } else { + cur[cur_key] = [cur[cur_key], agg[cur_key]]; + } + return cur; + } + return { + ...agg, + ...cur, + }; + }, {}) + : undefined; + return { + page: Number.parseInt(q.page) || 0, + limit: Number.parseInt(q.limit || q.items) || 50, + sort_by: q.sort_by, + sort_order: q.sort_order || "asc", + filters, + } as PaginationType; +}; + +export const parseFilter = (filter: string[], value: string, index = 0, filterMode = "_iregex") => { + let fx: any = { [filterMode]: value }; + if (index < filter.length - 1) { + fx = parseFilter(filter, value, index + 1, filterMode); + } + + const key = filter[index]; + return { [key]: fx }; +}; + +export const subtractHours = (date: Date, hours: number) => { + date.setHours(date.getHours() - hours); + return date.toISOString(); +}; + +export const capitalizeEachWord = (str: string) => { + return str + .split(" ") + .map(word => (word.length === 0 ? "" : word[0].toUpperCase() + word.slice(1).toLowerCase())) + .join(" "); +}; + +export const pick = (object: any, keys: any) => { + return keys.reduce((obj: any, key: any) => { + if (object && key in object) { + obj[key] = object[key]; + } + return obj; + }, {}); +}; + +export const getSortColumn = (pg_sort_by?: string, def = "id", options: string[] = []) => { + pg_sort_by ||= def; + return options.includes(pg_sort_by) ? pg_sort_by : def; +}; \ No newline at end of file diff --git a/packages/scorefeed/package.json b/packages/scorefeed/package.json new file mode 100644 index 0000000..4f0578d --- /dev/null +++ b/packages/scorefeed/package.json @@ -0,0 +1,44 @@ +{ + "name": "scorefeed", + "version": "1.0.0", + "type": "module", + "scripts": { + "build": "tsc", + "build:watch": "tsc -w", + "lint": "eslint --fix .", + "dev": "nodemon --ext ts --exec \"node --loader @esbuild-kit/esm-loader\" index.ts", + "dev:no-reload": "node --loader @esbuild-kit/esm-loader index.ts", + "schema": "npm run schema:fetch && npm run schema:generate", + "schema:fetch": "bash ./scripts/fetch-schema.sh", + "schema:generate": "graphql-codegen --config codegen.yml", + "setup": "bash ./scripts/init.sh" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@esbuild-kit/esm-loader": "^2.6.5", + "@types/jsonwebtoken": "^9.0.5", + "@types/node": "^20.10.4", + "@types/nodemailer": "^6.4.14", + "graphqurl": "^1.0.1", + "hasura-cli": "^2.35.2", + "typescript": "^5.3.3" + }, + "dependencies": { + "@graphql-codegen/cli": "^5.0.0", + "@graphql-codegen/typescript": "^4.0.1", + "@graphql-codegen/typescript-operations": "^4.0.1", + "@hono/node-server": "^1.3.2", + "@upstash/redis": "^1.28.1", + "axios": "^1.6.2", + "dotenv": "^16.3.1", + "eslint": "^8.53.0", + "graphql-request": "^6.1.0", + "hono": "^3.11.7", + "hyperflake": "^0.1.2", + "jsonwebtoken": "^9.0.2", + "nodemailer": "^6.9.7", + "zod": "^3.22.4" + } +} diff --git a/packages/scorefeed/routes/ctftime.routes.ts b/packages/scorefeed/routes/ctftime.routes.ts new file mode 100644 index 0000000..d8020bf --- /dev/null +++ b/packages/scorefeed/routes/ctftime.routes.ts @@ -0,0 +1,11 @@ +import { Hono } from "hono"; + +import { CTFTimeControtoller } from "../controllers/ctftime.controller"; + +export const ctftimeRouter = new Hono(); + +const statsController = new CTFTimeControtoller(); + +ctftimeRouter.get("/connect", statsController.generateAuthURL); +ctftimeRouter.get("/callback", statsController.retriveAccessToken); +ctftimeRouter.get("/whoami", statsController.retriveProfile); \ No newline at end of file diff --git a/packages/scorefeed/routes/index.ts b/packages/scorefeed/routes/index.ts new file mode 100644 index 0000000..17db9cb --- /dev/null +++ b/packages/scorefeed/routes/index.ts @@ -0,0 +1,13 @@ +import { Hono } from "hono"; + +import { ctftimeRouter } from "./ctftime.routes"; + +export const routes = new Hono(); + +routes.get("/", ctx => ctx.text("Shushhhhhh! Dont look here. ;)")); + +routes.route("/ctftime", ctftimeRouter); + +routes.get("/health", ctx => ctx.text("OK", 200)); +routes.get("/flag.txt", ctx => ctx.text("flag{th1s_1s_n0t_th3_fl4g}", 418)); +routes.get("*", ctx => ctx.text("Are you lost, baby gurl?", 404)); \ No newline at end of file diff --git a/packages/scorefeed/scripts/fetch-schema.sh b/packages/scorefeed/scripts/fetch-schema.sh new file mode 100644 index 0000000..3aec7f6 --- /dev/null +++ b/packages/scorefeed/scripts/fetch-schema.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +source .env +FILE=graphql/schema.graphql +rm -rf $FILE +pnpm gq $HASURA_GRAPHQL_ENDPOINT/v1/graphql -H "X-Hasura-Admin-Secret: $HASURA_GRAPHQL_ADMIN_SECRET" --introspect > $FILE \ No newline at end of file diff --git a/packages/scorefeed/scripts/init.sh b/packages/scorefeed/scripts/init.sh new file mode 100644 index 0000000..7f7f36a --- /dev/null +++ b/packages/scorefeed/scripts/init.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +mkdir -p keys +cd keys || exit +ssh-keygen -t rsa -P "" -b 4096 -m PEM -f jwtRS256.key +ssh-keygen -e -m PEM -f jwtRS256.key > jwtRS256.key.pub +cd .. \ No newline at end of file diff --git a/packages/scorefeed/services/stats.service.ts b/packages/scorefeed/services/stats.service.ts new file mode 100644 index 0000000..e7d869d --- /dev/null +++ b/packages/scorefeed/services/stats.service.ts @@ -0,0 +1,119 @@ +import { gql } from "graphql-request"; + +import { Query_Root } from "../graphql/types"; +import { client } from "../helpers/gqlClient"; + +export class StatsService { + public getTeamScoreS = async (teamId: string) => { + try { + const query = gql` + query getTeamScore($teamId: String!) { + scores(where: {team_id: {_eq: $teamId}}) { + id + challenge { + id + name + machine { + id + name + } + point + } + team { + name + } + submission { + id + submited_flag + } + } + } + `; + + const { scores } : Query_Root = await client.request(query, { + teamId, + }); + + if(!scores){ + throw new Error("No team scores found"); + } + + const teamScore: ITeamStats = { + team_id: teamId, + team_name: scores[0].team.name, + score: 0, + submissions: [], + }; + + for (const score of scores) { + teamScore.score += score.challenge.point; + teamScore.submissions.push({ + challenge_id: score.challenge.id, + challenge_name: score.challenge.name, + machine_id: score.challenge.machine.id, + machine_name: score.challenge.machine.name, + submited_flag: score.submission.submited_flag, + id: score.submission.id, + }); + } + + return teamScore; + } + catch (error: any) { + throw new Error(error.message); + } + }; + + public getAllTeamScoreS = async () => { + try { + const query = gql` + query getAllTeamScore { + scores { + id + team { + id + name + } + challenge { + id + point + } + } + } + `; + + const { scores } : Query_Root = await client.request(query); + + if(!scores){ + throw new Error("No team scores found"); + } + + const teamsLeaderboard: IStatsLeaderboard[] = []; + + for (const score of scores) { + const teamIndex = teamsLeaderboard.findIndex(team => team.team_id === score.team.id); + if(teamIndex === -1) { + teamsLeaderboard.push({ + team_id: score.team.id, + team_name: score.team.name, + score: score.challenge.point, + rank: 0, + }); + } + else { + teamsLeaderboard[teamIndex].score += score.challenge.point; + } + } + + teamsLeaderboard.sort((a, b) => b.score - a.score); + for (const [index, team] of teamsLeaderboard.entries()) { + team.rank = index + 1; + } + + return teamsLeaderboard; + } + catch (error: any) { + throw new Error(error.message); + } + }; +} \ No newline at end of file diff --git a/packages/scorefeed/tsconfig.json b/packages/scorefeed/tsconfig.json new file mode 100644 index 0000000..94bc1ff --- /dev/null +++ b/packages/scorefeed/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "exclude": ["node_modules", "dist"], + "compilerOptions": { + "outDir": "dist", + } +} \ No newline at end of file diff --git a/packages/scorefeed/types/index.d.ts b/packages/scorefeed/types/index.d.ts new file mode 100644 index 0000000..11b8468 --- /dev/null +++ b/packages/scorefeed/types/index.d.ts @@ -0,0 +1,113 @@ +interface PaginationType { + page: number; + limit: number; + sort_order?: "asc" | "desc"; + sort_by?: string; + filters?: { [k: string]: any }; +} + +interface IUserRegisterInput { + email: string; + password: string; + firstName: string; + lastName: string; +} + +interface IUserLoginInput { + email: string; + password: string; +} + +interface IUserVerifyInput { + otp: string; +} + +interface ITeamCreateInput { + team_name: string; + join_code: string; +} + +interface ITeamEditInput { + id: string; + team_name: string; + join_code: string; +} + +interface ITeamLeaveInput { + user_id: string; +} + +interface ITeamJoinInput { + join_code: string; + user_id: string; +} + +interface IChallengeCreateInput { + name: string; + description: string; + flag: string; + point: number; + stage: number; +} + +interface IMachineCreateInput { + name: string; + description: string; + tags: string; + created_by: string; + challenges: IChallengeCreateInput[]; +} + +interface IMachineSubmitFlagInput { + team_id: string; + user_id: string; + challenge_id: string; + submited_flag: string; +} + +interface IJWTPayload { + id: string; + isAdmin: boolean; + iat: number; + exp: number; +} + +interface IParedMachineProgress { + id: string; + name: string; + description: string; + challenges?: IParsedChallengeProgress[]; + total_challenges?: number; + depends_on?: string; +} + +interface IParsedChallengeProgress { + id: string; + name: string; + point: number; + description: string; + solved: boolean; +} + +interface IStatSubmissions { + id: string; + challenge_id: string + challenge_name: string; + machine_id: string + machine_name: string; + submited_flag: string; +} + +interface IStatsLeaderboard { + rank: number; + team_id: string; + team_name: string; + score: number; +} + +interface ITeamStats { + team_id: string; + team_name: string; + score: number; + submissions: IStatSubmissions[]; +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ccc109a..c995fa8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -151,6 +151,73 @@ importers: packages/deployer-url: {} + packages/scorefeed: + dependencies: + '@graphql-codegen/cli': + specifier: ^5.0.0 + version: 5.0.0(@types/node@20.10.6)(graphql@16.8.1)(typescript@5.3.3) + '@graphql-codegen/typescript': + specifier: ^4.0.1 + version: 4.0.1(graphql@16.8.1) + '@graphql-codegen/typescript-operations': + specifier: ^4.0.1 + version: 4.0.1(graphql@16.8.1) + '@hono/node-server': + specifier: ^1.3.2 + version: 1.3.2 + '@upstash/redis': + specifier: ^1.28.1 + version: 1.28.1 + axios: + specifier: ^1.6.2 + version: 1.6.2 + dotenv: + specifier: ^16.3.1 + version: 16.3.1 + eslint: + specifier: ^8.53.0 + version: 8.56.0 + graphql-request: + specifier: ^6.1.0 + version: 6.1.0(graphql@16.8.1) + hono: + specifier: ^3.11.7 + version: 3.11.7 + hyperflake: + specifier: ^0.1.2 + version: 0.1.2 + jsonwebtoken: + specifier: ^9.0.2 + version: 9.0.2 + nodemailer: + specifier: ^6.9.7 + version: 6.9.7 + zod: + specifier: ^3.22.4 + version: 3.22.4 + devDependencies: + '@esbuild-kit/esm-loader': + specifier: ^2.6.5 + version: 2.6.5 + '@types/jsonwebtoken': + specifier: ^9.0.5 + version: 9.0.5 + '@types/node': + specifier: ^20.10.4 + version: 20.10.6 + '@types/nodemailer': + specifier: ^6.4.14 + version: 6.4.14 + graphqurl: + specifier: ^1.0.1 + version: 1.0.1(@types/node@20.10.6) + hasura-cli: + specifier: ^2.35.2 + version: 2.35.2 + typescript: + specifier: ^5.3.3 + version: 5.3.3 + packages: /@aashutoshrathi/word-wrap@1.2.6: @@ -2156,7 +2223,7 @@ packages: engines: {node: '>=8.0.0'} deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. dependencies: - '@oclif/errors': 1.3.4 + '@oclif/errors': 1.3.6 '@oclif/parser': 3.8.17 debug: 4.3.4(supports-color@5.5.0) globby: 11.1.0 @@ -2211,7 +2278,7 @@ packages: dependencies: '@oclif/command': 1.8.0(@oclif/config@1.17.0) '@oclif/config': 1.17.0 - '@oclif/errors': 1.3.4 + '@oclif/errors': 1.3.6 chalk: 2.4.2 indent-string: 4.0.0 lodash.template: 4.5.0 diff --git a/tsconfig.json b/tsconfig.json index e3e2766..69612a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,5 +5,6 @@ "apps/desktop/dist", "packages/api/dist", "packages/deployer-url", + "packages/scorefeed/dist", ] } \ No newline at end of file diff --git a/turbo.json b/turbo.json index d958a2c..5f775e6 100644 --- a/turbo.json +++ b/turbo.json @@ -4,6 +4,7 @@ "pipeline": { "build": { "dependsOn": ["^build"], + "cache": false, "outputs": [".next/**", "!.next/cache/**"] }, "build:client": {