diff --git a/apps/web/src/App.jsx b/apps/web/src/App.jsx index efbc9c9..300660b 100644 --- a/apps/web/src/App.jsx +++ b/apps/web/src/App.jsx @@ -1,4 +1,3 @@ -// App.js import { Routes, Route } from "react-router-dom"; import Home from "./pages/home"; import Player from "./pages/app"; diff --git a/apps/web/src/components/news.jsx b/apps/web/src/components/news.jsx new file mode 100644 index 0000000..7b5b62c --- /dev/null +++ b/apps/web/src/components/news.jsx @@ -0,0 +1,38 @@ +import { useEffect, useState } from "react"; +import apiClient from "../libs/api.client"; + +const News = () => { + const [news, setNews] = useState([]); + + useEffect(() => { + apiClient.get("/news", { + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${localStorage.getItem("token")}`, + } + }).then((response) => { + setNews(response.data.message); + }); + }, []); + + return ( +
+ {news.map((item) => ( +
+

+ message : { + item.msg + } +

+

+ posted_at : { + (new Date(item.created_at)).toUTCString() + } +

+
+ ))} +
+ ); +} + +export default News diff --git a/apps/web/src/pages/about.jsx b/apps/web/src/pages/about.jsx index 1af6f83..8dfc8c0 100644 --- a/apps/web/src/pages/about.jsx +++ b/apps/web/src/pages/about.jsx @@ -1,24 +1,21 @@ - - import Navbar from "../components/navbar"; import { url } from '../libs/api.client'; - function Home() { return ( <> -
-

Guides

-
- How to use the scoreboard -
+
+

Guides

+
+ RCS CTF Guide +
-

API URL

-
- {url} -
-
+

API URL

+
+ {url} +
+
); } diff --git a/apps/web/src/pages/app.jsx b/apps/web/src/pages/app.jsx index 087e415..fb8838b 100644 --- a/apps/web/src/pages/app.jsx +++ b/apps/web/src/pages/app.jsx @@ -1,4 +1,3 @@ - import { useEffect, useState } from "react"; import Machines from "../components/machine"; import Challenge from "../components/challenge"; diff --git a/apps/web/src/pages/leaderboard.jsx b/apps/web/src/pages/leaderboard.jsx index 21d5629..a4ef0b6 100644 --- a/apps/web/src/pages/leaderboard.jsx +++ b/apps/web/src/pages/leaderboard.jsx @@ -1,4 +1,3 @@ - import { useEffect, useState } from "react"; import apiClient from "../libs/api.client"; import Navbar from "../components/navbar"; @@ -18,8 +17,8 @@ function Leaderboard() { }, }) .then((response) => { - if (!Array.isArray(response.data)) return (window.location.href = "/"); - setLeaderboard(response.data); + if (!Array.isArray(response.data.message)) return (window.location.href = "/"); + setLeaderboard(response.data.message); }) .catch(() => { console.log("Failed to get leaderboard"); diff --git a/apps/web/src/pages/news.jsx b/apps/web/src/pages/news.jsx index b8fedc8..69f55c9 100644 --- a/apps/web/src/pages/news.jsx +++ b/apps/web/src/pages/news.jsx @@ -1,12 +1,13 @@ - import Navbar from "../components/navbar"; +import News from "../components/news"; -function News() { +function NewsHome() { return ( <> + ); } -export default News; +export default NewsHome; diff --git a/apps/web/src/pages/whoami.jsx b/apps/web/src/pages/whoami.jsx index d0305b5..076335e 100644 --- a/apps/web/src/pages/whoami.jsx +++ b/apps/web/src/pages/whoami.jsx @@ -48,8 +48,8 @@ function WhoAmI() { "Authorization": "Bearer " + token, } }).then(res => { - if(res.data.error) return window.location.href = '/login' - if(res.data.message === 'Invalid token') return window.location.href = '/login'; + if(res.data.error) return window.location.href = '/' + if(res.data.message === 'Invalid token') return window.location.href = '/'; setTeamStats(res.data.message); }) }, []) @@ -68,6 +68,8 @@ function WhoAmI() { {userWhoami?.first_name} {userWhoami?.last_name}
+ Email: {userWhoami?.email} +

$ Team

@@ -75,10 +77,16 @@ function WhoAmI() {
Name: {teamWhoami?.name}
+ Join Code: {teamWhoami?.join_code} +
+ Total Member: {teamWhoami?.users?.length}

$ Stats

+

+ Total Score : {teamStats?.score} +

diff --git a/apps/web/src/styles/App.css b/apps/web/src/styles/App.css index 0a90d8b..d74788b 100644 --- a/apps/web/src/styles/App.css +++ b/apps/web/src/styles/App.css @@ -141,9 +141,11 @@ height: 100%; display: flex; flex-direction: column; - gap: 1em; + gap: 2em; align-items: center; justify-content: center; + padding: 2rem 0 2rem 0; + margin: auto; } .btn { @@ -159,33 +161,6 @@ animation: t 1.2s 0.5s both, b 1.2s 1.3s both; - /* This adds pixilated border */ - clip-path: polygon( - 0px calc(100% - 9px), - 3px calc(100% - 9px), - 3px calc(100% - 6px), - 6px calc(100% - 3px), - 9px calc(100% - 3px), - 9px 100%, - calc(100% - 9px) 100%, - calc(100% - 9px) calc(100% - 3px), - calc(100% - 6px) calc(100% - 3px), - calc(100% - 3px) calc(100% - 6px), - calc(100% - 3px) calc(100% - 9px), - 100% calc(100% - 9px), - 100% 9px, - calc(100% - 3px) 9px, - calc(100% - 3px) 6px, - calc(100% - 6px) 3px, - calc(100% - 9px) 3px, - calc(100% - 9px) 0px, - 9px 0px, - 9px 3px, - 6px 3px, - 3px 6px, - 3px 9px, - 0px 9px - ); } @keyframes t { to { @@ -204,7 +179,7 @@ width: 90%; border-radius: 0.5em; padding: 0.5em; - font-family: Minecraft; + font-family: "Roboto", sans-serif; font-size: 0.7em; } @@ -212,8 +187,6 @@ animation: slide-in-bck-center 1000ms normal; } -/* This is challenge section components */ - /* This gives pixilated borders to website */ .player-component { clip-path: polygon( @@ -249,56 +222,22 @@ } .player-challenge-button { margin: 10px; - clip-path: polygon( - 0px calc(100% - 6px), - 2px calc(100% - 6px), - 2px calc(100% - 4px), - 4px calc(100% - 2px), - 6px calc(100% - 2px), - 6px 100%, - calc(100% - 6px) 100%, - calc(100% - 6px) calc(100% - 2px), - calc(100% - 4px) calc(100% - 2px), - calc(100% - 2px) calc(100% - 4px), - calc(100% - 2px) calc(100% - 6px), - 100% calc(100% - 6px), - 100% 6px, - calc(100% - 2px) 6px, - calc(100% - 2px) 4px, - calc(100% - 4px) 2px, - calc(100% - 6px) 2px, - calc(100% - 6px) 0px, - 6px 0px, - 6px 2px, - 4px 2px, - 2px 4px, - 2px 6px, - 0px 6px - ); } .player-challenge-compl-button { margin: 5px; border: #646cff 1px solid; - clip-path: polygon( - 0px calc(100% - 4px), - 2px calc(100% - 4px), - 2px calc(100% - 2px), - 4px calc(100% - 2px), - 4px 100%, - calc(100% - 4px) 100%, - calc(100% - 4px) calc(100% - 2px), - calc(100% - 2px) calc(100% - 2px), - calc(100% - 2px) calc(100% - 4px), - 100% calc(100% - 4px), - 100% 4px, - calc(100% - 2px) 4px, - calc(100% - 2px) 2px, - calc(100% - 4px) 2px, - calc(100% - 4px) 0px, - 4px 0px, - 4px 2px, - 2px 2px, - 2px 4px, - 0px 4px - ); } + +.news { + margin: 10px; + padding: 10px; + border: 1px solid #ccc; + border-radius: 10px; +} + +.news-item { + font-size: 1.5em; + font-weight: bold; + border: 1px solid #ccc; + border-radius: 10px; +} \ No newline at end of file diff --git a/packages/api/config/env.ts b/packages/api/config/env.ts index ca93cfe..f9a223e 100644 --- a/packages/api/config/env.ts +++ b/packages/api/config/env.ts @@ -18,6 +18,7 @@ const ZodEnvironmentVariables = z.object({ MAIL_FROM_EMAIL: z.string(), MAIL_FROM_NAME: z.string(), DISCORD_BLOOD_HOOK: z.string(), + DISCORD_NEWS_HOOK: z.string(), UPSTASH_REDIS_REST_URL: z.string(), UPSTASH_REDIS_REST_TOKEN: z.string(), }); diff --git a/packages/api/controllers/news.controller.ts b/packages/api/controllers/news.controller.ts new file mode 100644 index 0000000..9d69e3a --- /dev/null +++ b/packages/api/controllers/news.controller.ts @@ -0,0 +1,44 @@ +import { Context } from "hono"; + +import { NewsService } from "../services/news.service"; + +export class NewsController extends NewsService { + public getNews = async (ctx: Context) => { + try { + const data = await this.getNewsS(); + return ctx.json({ + status: 200, + message: data + }); + } + catch (error: any) { + return ctx.json({ + status: 500, + message: error.message + }, 500); + } + }; + + public addNews = async (ctx: Context) => { + try { + const { msg } = await ctx.req.json(); + if (!msg) { + return ctx.json({ + status: 400, + message: "No message provided" + }, 400); + } + const data = await this.addNewsS(msg); + return ctx.json({ + status: 201, + message: data + }, 201); + } + catch (error: any) { + return ctx.json({ + status: 500, + message: error.message + }, 500); + } + }; +} \ No newline at end of file diff --git a/packages/api/graphql/schema.graphql b/packages/api/graphql/schema.graphql index 0b2444e..339dc75 100644 --- a/packages/api/graphql/schema.graphql +++ b/packages/api/graphql/schema.graphql @@ -950,6 +950,45 @@ type machines { depends_on: String description: String! id: String! + + """An object relationship""" + machine: machines + + """An array relationship""" + 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!]! + + """An aggregate relationship""" + 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! name: String! no_of_solves: Int! tags: String! @@ -964,6 +1003,17 @@ type machines_aggregate { nodes: [machines!]! } +input machines_aggregate_bool_exp { + count: machines_aggregate_bool_exp_count +} + +input machines_aggregate_bool_exp_count { + arguments: [machines_select_column!] + distinct: Boolean + filter: machines_bool_exp + predicate: Int_comparison_exp! +} + """ aggregate fields of "machines" """ @@ -981,11 +1031,45 @@ type machines_aggregate_fields { variance: machines_variance_fields } +""" +order by aggregate values of table "machines" +""" +input machines_aggregate_order_by { + avg: machines_avg_order_by + count: order_by + max: machines_max_order_by + min: machines_min_order_by + stddev: machines_stddev_order_by + stddev_pop: machines_stddev_pop_order_by + stddev_samp: machines_stddev_samp_order_by + sum: machines_sum_order_by + var_pop: machines_var_pop_order_by + var_samp: machines_var_samp_order_by + variance: machines_variance_order_by +} + +""" +input type for inserting array relation for remote table "machines" +""" +input machines_arr_rel_insert_input { + data: [machines_insert_input!]! + + """upsert condition""" + on_conflict: machines_on_conflict +} + """aggregate avg on columns""" type machines_avg_fields { no_of_solves: Float } +""" +order by avg() on columns of table "machines" +""" +input machines_avg_order_by { + no_of_solves: order_by +} + """ Boolean expression to filter rows from the table "machines". All fields are combined with a logical 'AND'. """ @@ -1000,6 +1084,9 @@ input machines_bool_exp { depends_on: String_comparison_exp description: String_comparison_exp id: String_comparison_exp + machine: machines_bool_exp + machines: machines_bool_exp + machines_aggregate: machines_aggregate_bool_exp name: String_comparison_exp no_of_solves: Int_comparison_exp tags: String_comparison_exp @@ -1038,6 +1125,8 @@ input machines_insert_input { depends_on: String description: String id: String + machine: machines_obj_rel_insert_input + machines: machines_arr_rel_insert_input name: String no_of_solves: Int tags: String @@ -1057,6 +1146,21 @@ type machines_max_fields { updated_at: timestamptz } +""" +order by max() on columns of table "machines" +""" +input machines_max_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 +} + """aggregate min on columns""" type machines_min_fields { created_at: timestamptz @@ -1070,6 +1174,21 @@ type machines_min_fields { updated_at: timestamptz } +""" +order by min() on columns of table "machines" +""" +input machines_min_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 +} + """ response of any mutation on the table "machines" """ @@ -1108,6 +1227,8 @@ input machines_order_by { depends_on: order_by description: order_by id: order_by + machine: machines_order_by + machines_aggregate: machines_aggregate_order_by name: order_by no_of_solves: order_by tags: order_by @@ -1171,16 +1292,37 @@ type machines_stddev_fields { no_of_solves: Float } +""" +order by stddev() on columns of table "machines" +""" +input machines_stddev_order_by { + no_of_solves: order_by +} + """aggregate stddev_pop on columns""" type machines_stddev_pop_fields { no_of_solves: Float } +""" +order by stddev_pop() on columns of table "machines" +""" +input machines_stddev_pop_order_by { + no_of_solves: order_by +} + """aggregate stddev_samp on columns""" type machines_stddev_samp_fields { no_of_solves: Float } +""" +order by stddev_samp() on columns of table "machines" +""" +input machines_stddev_samp_order_by { + no_of_solves: order_by +} + """ Streaming cursor of the table "machines" """ @@ -1210,6 +1352,13 @@ type machines_sum_fields { no_of_solves: Int } +""" +order by sum() on columns of table "machines" +""" +input machines_sum_order_by { + no_of_solves: order_by +} + """ update columns of table "machines" """ @@ -1258,16 +1407,37 @@ type machines_var_pop_fields { no_of_solves: Float } +""" +order by var_pop() on columns of table "machines" +""" +input machines_var_pop_order_by { + no_of_solves: order_by +} + """aggregate var_samp on columns""" type machines_var_samp_fields { no_of_solves: Float } +""" +order by var_samp() on columns of table "machines" +""" +input machines_var_samp_order_by { + no_of_solves: order_by +} + """aggregate variance on columns""" type machines_variance_fields { no_of_solves: Float } +""" +order by variance() on columns of table "machines" +""" +input machines_variance_order_by { + no_of_solves: order_by +} + """mutation root""" type mutation_root { """ @@ -1309,6 +1479,19 @@ type mutation_root { """ delete_machines_by_pk(id: String!): machines + """ + delete data from the table: "news" + """ + delete_news( + """filter the rows which have to be deleted""" + where: news_bool_exp! + ): news_mutation_response + + """ + delete single row from the table: "news" + """ + delete_news_by_pk(id: String!): news + """ delete data from the table: "scores" """ @@ -1427,6 +1610,28 @@ type mutation_root { on_conflict: machines_on_conflict ): machines + """ + insert data into the table: "news" + """ + insert_news( + """the rows to be inserted""" + objects: [news_insert_input!]! + + """upsert condition""" + on_conflict: news_on_conflict + ): news_mutation_response + + """ + insert a single row into the table: "news" + """ + insert_news_one( + """the row to be inserted""" + object: news_insert_input! + + """upsert condition""" + on_conflict: news_on_conflict + ): news + """ insert data into the table: "scores" """ @@ -1611,6 +1816,34 @@ type mutation_root { updates: [machines_updates!]! ): [machines_mutation_response] + """ + update data of the table: "news" + """ + update_news( + """sets the columns of the filtered rows to the given values""" + _set: news_set_input + + """filter the rows which have to be updated""" + where: news_bool_exp! + ): news_mutation_response + + """ + update single row of the table: "news" + """ + update_news_by_pk( + """sets the columns of the filtered rows to the given values""" + _set: news_set_input + pk_columns: news_pk_columns_input! + ): news + + """ + update multiples rows of table: "news" + """ + update_news_many( + """updates to execute, in order""" + updates: [news_updates!]! + ): [news_mutation_response] + """ update data of the table: "scores" """ @@ -1724,6 +1957,186 @@ type mutation_root { ): [users_mutation_response] } +""" +columns and relationships of "news" +""" +type news { + created_at: timestamptz! + id: String! + msg: String! + updated_at: timestamptz! +} + +""" +aggregated selection of "news" +""" +type news_aggregate { + aggregate: news_aggregate_fields + nodes: [news!]! +} + +""" +aggregate fields of "news" +""" +type news_aggregate_fields { + count(columns: [news_select_column!], distinct: Boolean): Int! + max: news_max_fields + min: news_min_fields +} + +""" +Boolean expression to filter rows from the table "news". All fields are combined with a logical 'AND'. +""" +input news_bool_exp { + _and: [news_bool_exp!] + _not: news_bool_exp + _or: [news_bool_exp!] + created_at: timestamptz_comparison_exp + id: String_comparison_exp + msg: String_comparison_exp + updated_at: timestamptz_comparison_exp +} + +""" +unique or primary key constraints on table "news" +""" +enum news_constraint { + """ + unique or primary key constraint on columns "id" + """ + news_pkey +} + +""" +input type for inserting data into table "news" +""" +input news_insert_input { + created_at: timestamptz + id: String + msg: String + updated_at: timestamptz +} + +"""aggregate max on columns""" +type news_max_fields { + created_at: timestamptz + id: String + msg: String + updated_at: timestamptz +} + +"""aggregate min on columns""" +type news_min_fields { + created_at: timestamptz + id: String + msg: String + updated_at: timestamptz +} + +""" +response of any mutation on the table "news" +""" +type news_mutation_response { + """number of rows affected by the mutation""" + affected_rows: Int! + + """data from the rows affected by the mutation""" + returning: [news!]! +} + +""" +on_conflict condition type for table "news" +""" +input news_on_conflict { + constraint: news_constraint! + update_columns: [news_update_column!]! = [] + where: news_bool_exp +} + +"""Ordering options when selecting data from "news".""" +input news_order_by { + created_at: order_by + id: order_by + msg: order_by + updated_at: order_by +} + +"""primary key columns input for table: news""" +input news_pk_columns_input { + id: String! +} + +""" +select columns of table "news" +""" +enum news_select_column { + """column name""" + created_at + + """column name""" + id + + """column name""" + msg + + """column name""" + updated_at +} + +""" +input type for updating data in table "news" +""" +input news_set_input { + created_at: timestamptz + id: String + msg: String + updated_at: timestamptz +} + +""" +Streaming cursor of the table "news" +""" +input news_stream_cursor_input { + """Stream column input with initial value""" + initial_value: news_stream_cursor_value_input! + + """cursor ordering""" + ordering: cursor_ordering +} + +"""Initial value of the column from where the streaming should start""" +input news_stream_cursor_value_input { + created_at: timestamptz + id: String + msg: String + updated_at: timestamptz +} + +""" +update columns of table "news" +""" +enum news_update_column { + """column name""" + created_at + + """column name""" + id + + """column name""" + msg + + """column name""" + updated_at +} + +input news_updates { + """sets the columns of the filtered rows to the given values""" + _set: news_set_input + + """filter the rows which have to be updated""" + where: news_bool_exp! +} + """column ordering options""" enum order_by { """in ascending order, nulls last""" @@ -1824,9 +2237,7 @@ type query_root { """fetch data from the table: "challenges" using primary key columns""" challenges_by_pk(id: String!): challenges - """ - fetch data from the table: "machines" - """ + """An array relationship""" machines( """distinct select on columns""" distinct_on: [machines_select_column!] @@ -1844,9 +2255,7 @@ type query_root { where: machines_bool_exp ): [machines!]! - """ - fetch aggregated fields from the table: "machines" - """ + """An aggregate relationship""" machines_aggregate( """distinct select on columns""" distinct_on: [machines_select_column!] @@ -1867,6 +2276,49 @@ type query_root { """fetch data from the table: "machines" using primary key columns""" machines_by_pk(id: String!): machines + """ + fetch data from the table: "news" + """ + news( + """distinct select on columns""" + distinct_on: [news_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: [news_order_by!] + + """filter the rows returned""" + where: news_bool_exp + ): [news!]! + + """ + fetch aggregated fields from the table: "news" + """ + news_aggregate( + """distinct select on columns""" + distinct_on: [news_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: [news_order_by!] + + """filter the rows returned""" + where: news_bool_exp + ): news_aggregate! + + """fetch data from the table: "news" using primary key columns""" + news_by_pk(id: String!): news + """An array relationship""" scores( """distinct select on columns""" @@ -2736,9 +3188,7 @@ type subscription_root { where: challenges_bool_exp ): [challenges!]! - """ - fetch data from the table: "machines" - """ + """An array relationship""" machines( """distinct select on columns""" distinct_on: [machines_select_column!] @@ -2756,9 +3206,7 @@ type subscription_root { where: machines_bool_exp ): [machines!]! - """ - fetch aggregated fields from the table: "machines" - """ + """An aggregate relationship""" machines_aggregate( """distinct select on columns""" distinct_on: [machines_select_column!] @@ -2793,6 +3241,63 @@ type subscription_root { where: machines_bool_exp ): [machines!]! + """ + fetch data from the table: "news" + """ + news( + """distinct select on columns""" + distinct_on: [news_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: [news_order_by!] + + """filter the rows returned""" + where: news_bool_exp + ): [news!]! + + """ + fetch aggregated fields from the table: "news" + """ + news_aggregate( + """distinct select on columns""" + distinct_on: [news_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: [news_order_by!] + + """filter the rows returned""" + where: news_bool_exp + ): news_aggregate! + + """fetch data from the table: "news" using primary key columns""" + news_by_pk(id: String!): news + + """ + fetch data from the table in a streaming manner: "news" + """ + news_stream( + """maximum number of rows returned in a single batch""" + batch_size: Int! + + """cursor to stream the results returned by the query""" + cursor: [news_stream_cursor_input]! + + """filter the rows returned""" + where: news_bool_exp + ): [news!]! + """An array relationship""" scores( """distinct select on columns""" @@ -3357,6 +3862,7 @@ type users { where: bans_bool_exp ): bans_aggregate! created_at: timestamptz! + ctftime_username: String email: String! email_verification_code: String! first_name: String! @@ -3519,6 +4025,7 @@ input users_bool_exp { bans: bans_bool_exp bans_aggregate: bans_aggregate_bool_exp created_at: timestamptz_comparison_exp + ctftime_username: String_comparison_exp email: String_comparison_exp email_verification_code: String_comparison_exp first_name: String_comparison_exp @@ -3569,6 +4076,7 @@ input type for inserting data into table "users" input users_insert_input { bans: bans_arr_rel_insert_input created_at: timestamptz + ctftime_username: String email: String email_verification_code: String first_name: String @@ -3589,6 +4097,7 @@ input users_insert_input { """aggregate max on columns""" type users_max_fields { created_at: timestamptz + ctftime_username: String email: String email_verification_code: String first_name: String @@ -3605,6 +4114,7 @@ order by max() on columns of table "users" """ input users_max_order_by { created_at: order_by + ctftime_username: order_by email: order_by email_verification_code: order_by first_name: order_by @@ -3619,6 +4129,7 @@ input users_max_order_by { """aggregate min on columns""" type users_min_fields { created_at: timestamptz + ctftime_username: String email: String email_verification_code: String first_name: String @@ -3635,6 +4146,7 @@ order by min() on columns of table "users" """ input users_min_order_by { created_at: order_by + ctftime_username: order_by email: order_by email_verification_code: order_by first_name: order_by @@ -3680,6 +4192,7 @@ input users_on_conflict { input users_order_by { bans_aggregate: bans_aggregate_order_by created_at: order_by + ctftime_username: order_by email: order_by email_verification_code: order_by first_name: order_by @@ -3709,6 +4222,9 @@ enum users_select_column { """column name""" created_at + """column name""" + ctftime_username + """column name""" email @@ -3779,6 +4295,7 @@ input type for updating data in table "users" """ input users_set_input { created_at: timestamptz + ctftime_username: String email: String email_verification_code: String first_name: String @@ -3807,6 +4324,7 @@ input users_stream_cursor_input { """Initial value of the column from where the streaming should start""" input users_stream_cursor_value_input { created_at: timestamptz + ctftime_username: String email: String email_verification_code: String first_name: String @@ -3828,6 +4346,9 @@ enum users_update_column { """column name""" created_at + """column name""" + ctftime_username + """column name""" email diff --git a/packages/api/graphql/types.ts b/packages/api/graphql/types.ts index 5c9e124..ada1592 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,41 @@ 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']; + /** An object relationship */ + machine?: Maybe; + /** An array relationship */ + machines: Array; + /** An aggregate relationship */ + machines_aggregate: Machines_Aggregate; + 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 +807,55 @@ 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; }; + +/** Machines Data */ +export type MachinesMachinesArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +/** Machines Data */ +export type MachinesMachines_AggregateArgs = { + distinct_on?: 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; }; +export type Machines_Aggregate_Bool_Exp = { + count?: InputMaybe; +}; + +export type Machines_Aggregate_Bool_Exp_Count = { + arguments?: InputMaybe>; + distinct?: InputMaybe; + filter?: InputMaybe; + predicate: Int_Comparison_Exp; +}; + /** 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 +871,40 @@ export type Machines_Aggregate_Fields = { /** aggregate fields of "machines" */ export type Machines_Aggregate_FieldsCountArgs = { columns?: InputMaybe>; - distinct?: InputMaybe; + distinct?: InputMaybe; +}; + +/** order by aggregate values of table "machines" */ +export type Machines_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 "machines" */ +export type Machines_Arr_Rel_Insert_Input = { + data: Array; + /** upsert condition */ + on_conflict?: 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; +}; + +/** order by avg() on columns of table "machines" */ +export type Machines_Avg_Order_By = { + no_of_solves?: InputMaybe; }; /** Boolean expression to filter rows from the table "machines". All fields are combined with a logical 'AND'. */ @@ -855,6 +919,9 @@ export type Machines_Bool_Exp = { depends_on?: InputMaybe; description?: InputMaybe; id?: InputMaybe; + machine?: InputMaybe; + machines?: InputMaybe; + machines_aggregate?: InputMaybe; name?: InputMaybe; no_of_solves?: InputMaybe; tags?: InputMaybe; @@ -864,63 +931,91 @@ 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; + machine?: InputMaybe; + machines?: 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; +}; + +/** order by max() on columns of table "machines" */ +export type Machines_Max_Order_By = { + 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 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; +}; + +/** order by min() on columns of table "machines" */ +export type Machines_Min_Order_By = { + created_at?: InputMaybe; + created_by?: InputMaybe; + depends_on?: InputMaybe; + description?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; + no_of_solves?: InputMaybe; + tags?: InputMaybe; + updated_at?: InputMaybe; }; /** 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; }; @@ -947,6 +1042,8 @@ export type Machines_Order_By = { depends_on?: InputMaybe; description?: InputMaybe; id?: InputMaybe; + machine?: InputMaybe; + machines_aggregate?: InputMaybe; name?: InputMaybe; no_of_solves?: InputMaybe; tags?: InputMaybe; @@ -955,60 +1052,75 @@ 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; +}; + +/** order by stddev() on columns of table "machines" */ +export type Machines_Stddev_Order_By = { + no_of_solves?: InputMaybe; }; /** 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; +}; + +/** order by stddev_pop() on columns of table "machines" */ +export type Machines_Stddev_Pop_Order_By = { + no_of_solves?: InputMaybe; }; /** 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; +}; + +/** order by stddev_samp() on columns of table "machines" */ +export type Machines_Stddev_Samp_Order_By = { + no_of_solves?: InputMaybe; }; /** Streaming cursor of the table "machines" */ @@ -1021,43 +1133,48 @@ 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; +}; + +/** order by sum() on columns of table "machines" */ +export type Machines_Sum_Order_By = { + no_of_solves?: InputMaybe; }; /** 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 +1188,40 @@ 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; +}; + +/** order by var_pop() on columns of table "machines" */ +export type Machines_Var_Pop_Order_By = { + no_of_solves?: InputMaybe; }; /** 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; +}; + +/** order by var_samp() on columns of table "machines" */ +export type Machines_Var_Samp_Order_By = { + no_of_solves?: InputMaybe; }; /** 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; +}; + +/** order by variance() on columns of table "machines" */ +export type Machines_Variance_Order_By = { + no_of_solves?: InputMaybe; }; /** 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" */ @@ -1102,6 +1234,10 @@ export type Mutation_Root = { delete_machines?: Maybe; /** delete single row from the table: "machines" */ delete_machines_by_pk?: Maybe; + /** delete data from the table: "news" */ + delete_news?: Maybe; + /** delete single row from the table: "news" */ + delete_news_by_pk?: Maybe; /** delete data from the table: "scores" */ delete_scores?: Maybe; /** delete single row from the table: "scores" */ @@ -1130,6 +1266,10 @@ export type Mutation_Root = { insert_machines?: Maybe; /** insert a single row into the table: "machines" */ insert_machines_one?: Maybe; + /** insert data into the table: "news" */ + insert_news?: Maybe; + /** insert a single row into the table: "news" */ + insert_news_one?: Maybe; /** insert data into the table: "scores" */ insert_scores?: Maybe; /** insert a single row into the table: "scores" */ @@ -1164,6 +1304,12 @@ export type Mutation_Root = { update_machines_by_pk?: Maybe; /** update multiples rows of table: "machines" */ update_machines_many?: Maybe>>; + /** update data of the table: "news" */ + update_news?: Maybe; + /** update single row of the table: "news" */ + update_news_by_pk?: Maybe; + /** update multiples rows of table: "news" */ + update_news_many?: Maybe>>; /** update data of the table: "scores" */ update_scores?: Maybe; /** update single row of the table: "scores" */ @@ -1199,7 +1345,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 +1357,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 +1369,19 @@ export type Mutation_RootDelete_MachinesArgs = { /** mutation root */ export type Mutation_RootDelete_Machines_By_PkArgs = { - id: Scalars["String"]["input"]; + id: Scalars['String']['input']; +}; + + +/** mutation root */ +export type Mutation_RootDelete_NewsArgs = { + where: News_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootDelete_News_By_PkArgs = { + id: Scalars['String']['input']; }; @@ -1235,7 +1393,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 +1405,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 +1417,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 +1429,7 @@ export type Mutation_RootDelete_UsersArgs = { /** mutation root */ export type Mutation_RootDelete_Users_By_PkArgs = { - id: Scalars["String"]["input"]; + id: Scalars['String']['input']; }; @@ -1317,6 +1475,20 @@ export type Mutation_RootInsert_Machines_OneArgs = { }; +/** mutation root */ +export type Mutation_RootInsert_NewsArgs = { + objects: Array; + on_conflict?: InputMaybe; +}; + + +/** mutation root */ +export type Mutation_RootInsert_News_OneArgs = { + object: News_Insert_Input; + on_conflict?: InputMaybe; +}; + + /** mutation root */ export type Mutation_RootInsert_ScoresArgs = { objects: Array; @@ -1437,6 +1609,26 @@ export type Mutation_RootUpdate_Machines_ManyArgs = { }; +/** mutation root */ +export type Mutation_RootUpdate_NewsArgs = { + _set?: InputMaybe; + where: News_Bool_Exp; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_News_By_PkArgs = { + _set?: InputMaybe; + pk_columns: News_Pk_Columns_Input; +}; + + +/** mutation root */ +export type Mutation_RootUpdate_News_ManyArgs = { + updates: Array; +}; + + /** mutation root */ export type Mutation_RootUpdate_ScoresArgs = { _set?: InputMaybe; @@ -1516,24 +1708,182 @@ export type Mutation_RootUpdate_Users_ManyArgs = { updates: Array; }; +/** columns and relationships of "news" */ +export type News = { + __typename?: 'news'; + created_at: Scalars['timestamptz']['output']; + id: Scalars['String']['output']; + msg: Scalars['String']['output']; + updated_at: Scalars['timestamptz']['output']; +}; + +/** aggregated selection of "news" */ +export type News_Aggregate = { + __typename?: 'news_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; + +/** aggregate fields of "news" */ +export type News_Aggregate_Fields = { + __typename?: 'news_aggregate_fields'; + count: Scalars['Int']['output']; + max?: Maybe; + min?: Maybe; +}; + + +/** aggregate fields of "news" */ +export type News_Aggregate_FieldsCountArgs = { + columns?: InputMaybe>; + distinct?: InputMaybe; +}; + +/** Boolean expression to filter rows from the table "news". All fields are combined with a logical 'AND'. */ +export type News_Bool_Exp = { + _and?: InputMaybe>; + _not?: InputMaybe; + _or?: InputMaybe>; + created_at?: InputMaybe; + id?: InputMaybe; + msg?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** unique or primary key constraints on table "news" */ +export enum News_Constraint { + /** unique or primary key constraint on columns "id" */ + NewsPkey = 'news_pkey' +} + +/** input type for inserting data into table "news" */ +export type News_Insert_Input = { + created_at?: InputMaybe; + id?: InputMaybe; + msg?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** aggregate max on columns */ +export type News_Max_Fields = { + __typename?: 'news_max_fields'; + created_at?: Maybe; + id?: Maybe; + msg?: Maybe; + updated_at?: Maybe; +}; + +/** aggregate min on columns */ +export type News_Min_Fields = { + __typename?: 'news_min_fields'; + created_at?: Maybe; + id?: Maybe; + msg?: Maybe; + updated_at?: Maybe; +}; + +/** response of any mutation on the table "news" */ +export type News_Mutation_Response = { + __typename?: 'news_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 "news" */ +export type News_On_Conflict = { + constraint: News_Constraint; + update_columns?: Array; + where?: InputMaybe; +}; + +/** Ordering options when selecting data from "news". */ +export type News_Order_By = { + created_at?: InputMaybe; + id?: InputMaybe; + msg?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** primary key columns input for table: news */ +export type News_Pk_Columns_Input = { + id: Scalars['String']['input']; +}; + +/** select columns of table "news" */ +export enum News_Select_Column { + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + Msg = 'msg', + /** column name */ + UpdatedAt = 'updated_at' +} + +/** input type for updating data in table "news" */ +export type News_Set_Input = { + created_at?: InputMaybe; + id?: InputMaybe; + msg?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** Streaming cursor of the table "news" */ +export type News_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: News_Stream_Cursor_Value_Input; + /** cursor ordering */ + ordering?: InputMaybe; +}; + +/** Initial value of the column from where the streaming should start */ +export type News_Stream_Cursor_Value_Input = { + created_at?: InputMaybe; + id?: InputMaybe; + msg?: InputMaybe; + updated_at?: InputMaybe; +}; + +/** update columns of table "news" */ +export enum News_Update_Column { + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + Msg = 'msg', + /** column name */ + UpdatedAt = 'updated_at' +} + +export type News_Updates = { + /** sets the columns of the filtered rows to the given values */ + _set?: InputMaybe; + /** filter the rows which have to be updated */ + where: News_Bool_Exp; +}; + /** 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 */ @@ -1546,12 +1896,18 @@ export type Query_Root = { challenges_aggregate: Challenges_Aggregate; /** fetch data from the table: "challenges" using primary key columns */ challenges_by_pk?: Maybe; - /** fetch data from the table: "machines" */ + /** An array relationship */ machines: Array; - /** fetch aggregated fields from the table: "machines" */ + /** An aggregate relationship */ machines_aggregate: Machines_Aggregate; /** fetch data from the table: "machines" using primary key columns */ machines_by_pk?: Maybe; + /** fetch data from the table: "news" */ + news: Array; + /** fetch aggregated fields from the table: "news" */ + news_aggregate: News_Aggregate; + /** fetch data from the table: "news" using primary key columns */ + news_by_pk?: Maybe; /** An array relationship */ scores: Array; /** An aggregate relationship */ @@ -1581,8 +1937,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 +1946,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 +1969,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 +1992,45 @@ 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_RootNewsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootNews_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Query_RootNews_By_PkArgs = { + 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 +2038,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 +2061,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 +2084,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 +2107,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 +2151,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 +2168,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 +2206,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 +2251,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 +2274,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 +2312,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 +2354,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 +2390,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 +2418,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 +2435,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 +2471,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 +2510,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 +2531,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 +2567,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 +2606,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 +2638,7 @@ export type Submissions_Updates = { }; export type Subscription_Root = { - __typename?: "subscription_root"; + __typename?: 'subscription_root'; /** An array relationship */ bans: Array; /** An aggregate relationship */ @@ -2276,14 +2655,22 @@ export type Subscription_Root = { challenges_by_pk?: Maybe; /** fetch data from the table in a streaming manner: "challenges" */ challenges_stream: Array; - /** fetch data from the table: "machines" */ + /** An array relationship */ machines: Array; - /** fetch aggregated fields from the table: "machines" */ + /** An aggregate relationship */ 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; + /** fetch data from the table: "news" */ + news: Array; + /** fetch aggregated fields from the table: "news" */ + news_aggregate: News_Aggregate; + /** fetch data from the table: "news" using primary key columns */ + news_by_pk?: Maybe; + /** fetch data from the table in a streaming manner: "news" */ + news_stream: Array; /** An array relationship */ scores: Array; /** An aggregate relationship */ @@ -2321,8 +2708,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 +2717,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 +2738,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 +2747,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 +2768,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,29 +2777,59 @@ 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; }; +export type Subscription_RootNewsArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootNews_AggregateArgs = { + distinct_on?: InputMaybe>; + limit?: InputMaybe; + offset?: InputMaybe; + order_by?: InputMaybe>; + where?: InputMaybe; +}; + + +export type Subscription_RootNews_By_PkArgs = { + id: Scalars['String']['input']; +}; + + +export type Subscription_RootNews_StreamArgs = { + batch_size: Scalars['Int']['input']; + cursor: Array>; + where?: InputMaybe; +}; + + export type Subscription_RootScoresArgs = { distinct_on?: InputMaybe>; - limit?: InputMaybe; - offset?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; order_by?: InputMaybe>; where?: InputMaybe; }; @@ -2420,20 +2837,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 +2858,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 +2867,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 +2888,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 +2897,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 +2918,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 +2927,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 +2967,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 +2977,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 +2987,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 +2997,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 +3022,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 +3044,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 +3118,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 +3154,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 +3184,36 @@ 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']; + ctftime_username?: Maybe; + 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 +3224,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 +3242,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 +3252,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 +3262,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 +3272,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 +3282,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 +3303,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 +3334,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" */ @@ -2941,6 +3359,7 @@ export type Users_Bool_Exp = { bans?: InputMaybe; bans_aggregate?: InputMaybe; created_at?: InputMaybe; + ctftime_username?: InputMaybe; email?: InputMaybe; email_verification_code?: InputMaybe; first_name?: InputMaybe; @@ -2963,54 +3382,57 @@ 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; + ctftime_username?: 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; + ctftime_username?: 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; + ctftime_username?: InputMaybe; email?: InputMaybe; email_verification_code?: InputMaybe; first_name?: InputMaybe; @@ -3024,22 +3446,24 @@ 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; + ctftime_username?: 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; + ctftime_username?: InputMaybe; email?: InputMaybe; email_verification_code?: InputMaybe; first_name?: InputMaybe; @@ -3053,9 +3477,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; }; @@ -3078,6 +3502,7 @@ export type Users_On_Conflict = { export type Users_Order_By = { bans_aggregate?: InputMaybe; created_at?: InputMaybe; + ctftime_username?: InputMaybe; email?: InputMaybe; email_verification_code?: InputMaybe; first_name?: InputMaybe; @@ -3097,74 +3522,77 @@ 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 */ + CtftimeUsername = 'ctftime_username', /** 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; + ctftime_username?: 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 +3605,52 @@ 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; + ctftime_username?: 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 */ + CtftimeUsername = 'ctftime_username', /** 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/helpers/notifyNews.ts b/packages/api/helpers/notifyNews.ts new file mode 100644 index 0000000..3447581 --- /dev/null +++ b/packages/api/helpers/notifyNews.ts @@ -0,0 +1,41 @@ +import axios from "axios"; + +export const notifyForNews = async ( + { + notifText, + }: { + notifText: string; + } +) => { + try { + const res = await axios.post(process.env.DISCORD_NEWS_HOOK, { + content: "@here", + tts: false, + embeds: [ + { + id: Date.now().toString(), + description: notifText, + fields: [], + title: `📢 Announcement by CTF Team`, + color: 12_728_376, + footer: { + icon_url: "https://rcs.encryptedge.in/logo.png", + text: "eeCTF" + }, + author: { + name: "RCS CTF 2024" + } + } + ], + components: [], + actions: {}, + username: "eeCTF CTF Notification" + } + ); + return res.data; + } catch (error) { + if(error instanceof Error) { + throw new TypeError(error.message); + } +} +}; diff --git a/packages/api/index.ts b/packages/api/index.ts index d206b61..636a746 100644 --- a/packages/api/index.ts +++ b/packages/api/index.ts @@ -13,7 +13,7 @@ import { secureHeaders } from "hono/secure-headers"; import "./config/env"; import { hgqlInit } from "./helpers/gqlClient"; -import { CheckIPMiddleware } from "./middlewares/checkip.middleware"; +// import { CheckIPMiddleware } from "./middlewares/checkip.middleware"; import { routes } from "./routes"; const app = new Hono(); @@ -37,7 +37,7 @@ app.use("*", prettyJSON( space: 4, } )); -app.use("*", new CheckIPMiddleware().checkIP); +// app.use("*", new CheckIPMiddleware().checkIP); app.route("/", routes); diff --git a/packages/api/routes/index.ts b/packages/api/routes/index.ts index 0d37e51..409b24b 100644 --- a/packages/api/routes/index.ts +++ b/packages/api/routes/index.ts @@ -4,6 +4,7 @@ import { challengeRouter } from "./challenges.routes"; import { statsRouter } from "./stats.routes"; import { teamRouter } from "./teams.routes"; import { userRoutes } from "./users.routes"; +import { newsRouter } from "./news.routes"; export const routes = new Hono(); @@ -13,6 +14,7 @@ routes.route("/challenge", challengeRouter); routes.route("/stats", statsRouter); routes.route("/team", teamRouter); routes.route("/user", userRoutes); +routes.route("/news", newsRouter); routes.get("/health", ctx => ctx.text("OK", 200)); routes.get("/flag.txt", ctx => ctx.text("flag{th1s_1s_n0t_th3_fl4g}", 418)); diff --git a/packages/api/routes/news.routes.ts b/packages/api/routes/news.routes.ts new file mode 100644 index 0000000..7ea1335 --- /dev/null +++ b/packages/api/routes/news.routes.ts @@ -0,0 +1,13 @@ +import { Hono } from "hono"; + +import { NewsController } from "../controllers/news.controller"; +import { AUTH_PERMS } from "../extras/permissions"; +import { AuthMiddleware } from "../middlewares/auth.middleware"; + +export const newsRouter = new Hono(); +const authMiddleware = new AuthMiddleware(); + +const newsController = new NewsController(); + +newsRouter.get("/", authMiddleware.authenticate(AUTH_PERMS.AUTHENTICATED), newsController.getNews); +newsRouter.post("/", authMiddleware.authenticate(AUTH_PERMS.ADMIN), newsController.addNews); \ No newline at end of file diff --git a/packages/api/services/news.service.ts b/packages/api/services/news.service.ts new file mode 100644 index 0000000..2fe9dbc --- /dev/null +++ b/packages/api/services/news.service.ts @@ -0,0 +1,71 @@ +import { gql } from "graphql-request"; +import { SnowflakeId } from "hyperflake"; + +import { Query_Root, Mutation_Root } from "../graphql/types"; +import { client } from "../helpers/gqlClient"; +import { notifyForNews } from "../helpers/notifyNews"; + +const snowflake = SnowflakeId(); + +export class NewsService { + public getNewsS = async () => { + try { + const query = gql` + query getNews { + news { + id + msg + created_at + } + } + `; + + const { news } : Query_Root = await client.request(query); + + if(!news){ + throw new Error("No news found"); + } + + return news; + } catch (error) { + if(error instanceof Error) { + throw new TypeError(error.message); + } + } + } + + public addNewsS = async (msg: string) => { + try { + const query = gql` + mutation addNews($msg_obj: news_insert_input!) { + insert_news_one(object: $msg_obj) { + id + msg + created_at + } + } + `; + + const { insert_news_one } : Mutation_Root = await client.request(query, { + msg_obj: { + id: snowflake.generate(), + msg, + }, + }); + + if(!insert_news_one){ + throw new Error("No news added"); + } + + await notifyForNews({ + notifText: msg, + }); + + return insert_news_one; + } catch (error) { + if(error instanceof Error) { + throw new TypeError(error.message); + } + } + } +} \ No newline at end of file