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
-
+
+
Guides
+
-
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