mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-08-02 04:14:45 +02:00
cargo updates
This commit is contained in:
parent
bc6dfc4e4f
commit
374b309f8c
6 changed files with 1054 additions and 1200 deletions
2180
Cargo.lock
generated
2180
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
24
Cargo.toml
24
Cargo.toml
|
|
@ -11,9 +11,9 @@ opentelemetry = { version = "0.32.0" }
|
|||
opentelemetry_sdk = { version = "0.32.0", features = ["rt-tokio"] }
|
||||
opentelemetry-otlp = { version = "0.32.0", features = ["tls", "grpc-tonic"] }
|
||||
serde = { version = "1.0.203", features = ["derive"] }
|
||||
sqlx = { version = "0.8.3", features = ["postgres", "time", "runtime-tokio-rustls"] }
|
||||
sea-query = { version = "0.32.3", features = ["backend-postgres", "with-time", "derive"] }
|
||||
sea-query-binder = { version = "0.7.0", features = ["with-time", "sqlx-postgres"] }
|
||||
sqlx = { version = "0.9.0", features = ["postgres", "time", "runtime-tokio", "tls-rustls-aws-lc-rs"] }
|
||||
sea-query = { version = "1.0.1", features = ["backend-postgres", "with-time", "derive"] }
|
||||
sea-query-sqlx = {version = "0.9.0", features = ["with-time", "sqlx-postgres"]}
|
||||
thiserror = "2.0.12"
|
||||
tokio = { version = "1.38.0", features = ["full"] }
|
||||
config = { version = "0.15.11", features = ["toml"] }
|
||||
|
|
@ -22,18 +22,20 @@ maud = { version = "0.27.0", features = ["axum"] }
|
|||
axum = { version = "0.8.1", features = ["macros"] }
|
||||
hyper = "1.3.1"
|
||||
hyper-util = { version = "0.1.5", features = ["tokio", "server"] }
|
||||
axum-extra = { version = "0.10.0", features = ["typed-header", "cookie"] }
|
||||
tower-http = { version = "0.6.2", features = ["trace", "fs"] }
|
||||
steamid-ng = "1.0.0"
|
||||
itertools = "0.14.0"
|
||||
axum-extra = { version = "0.12.6", features = ["typed-header", "cookie"] }
|
||||
tower-http = { version = "0.7.0", features = ["trace", "fs"] }
|
||||
steamid-ng = "3.0.0"
|
||||
itertools = "0.15.0"
|
||||
steam-openid = "0.2.0"
|
||||
async-session = "3.0.0"
|
||||
quick-xml = { version = "0.37.2", features = ["serialize"] }
|
||||
reqwest = "0.12.4"
|
||||
rand = "0.9.0"
|
||||
quick-xml = { version = "0.41.0", features = ["serialize"] }
|
||||
reqwest = "0.13.4"
|
||||
rand = "0.10.2"
|
||||
demostf-build = { path = "./build", version = "*" }
|
||||
include_dir = "0.7.3"
|
||||
serde-env = "0.2.0"
|
||||
serde-env = "0.3.0"
|
||||
tonic = { version = "0.14.6", features = ["tls-aws-lc", "tls-webpki-roots"] }
|
||||
secretfile = "0.1.0"
|
||||
urlencoding = "2.1.3"
|
||||
# https://github.com/transact-rs/sqlx/pull/4303 should be safe to remove after the next sqlx release
|
||||
whoami = { version = "2.0.2", features = ["std"], default-features = false }
|
||||
|
|
|
|||
|
|
@ -6,11 +6,12 @@ use crate::Result;
|
|||
use maud::Render;
|
||||
use sea_query::extension::postgres::PgExpr;
|
||||
use sea_query::{
|
||||
Alias, Expr, Func, JoinType, Order, PostgresQueryBuilder, Query, SelectStatement, SimpleExpr,
|
||||
Alias, Expr, ExprTrait, Func, JoinType, Order, PostgresQueryBuilder, Query, SelectStatement,
|
||||
SimpleExpr,
|
||||
};
|
||||
use sea_query_binder::SqlxBinder;
|
||||
use sea_query_sqlx::SqlxBinder;
|
||||
use serde::{Deserialize, Deserializer};
|
||||
use sqlx::{query_as, Executor, FromRow, Postgres};
|
||||
use sqlx::{query_as, AssertSqlSafe, Executor, FromRow, Postgres};
|
||||
use std::borrow::Cow;
|
||||
use std::fmt::{Debug, Formatter, Write};
|
||||
use std::ops::Range;
|
||||
|
|
@ -263,9 +264,11 @@ impl ListDemo {
|
|||
|
||||
let (sql, values) = query.build_sqlx(PostgresQueryBuilder);
|
||||
|
||||
Ok(sqlx::query_as_with::<_, ListDemo, _>(&sql, values)
|
||||
Ok(
|
||||
sqlx::query_as_with::<_, ListDemo, _>(AssertSqlSafe(sql), values)
|
||||
.fetch_all(connection)
|
||||
.await?)
|
||||
.await?,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -523,7 +526,7 @@ impl Filter {
|
|||
);
|
||||
query.group_by_col((Demos::Table, Players::Id));
|
||||
query.and_having(
|
||||
Expr::cust(&players_arr)
|
||||
Expr::cust(players_arr)
|
||||
.cast_as(Alias::new("text[]"))
|
||||
.contained(
|
||||
Func::cust(ArrayAgg).arg(Expr::col((Players::Table, Players::SteamId))),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
use sea_query::Iden;
|
||||
use std::fmt::Write;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Iden)]
|
||||
|
|
@ -54,8 +53,8 @@ pub enum Demos {
|
|||
pub struct CleanMapName;
|
||||
|
||||
impl Iden for CleanMapName {
|
||||
fn unquoted(&self, s: &mut dyn Write) {
|
||||
write!(s, "clean_map_name").unwrap()
|
||||
fn unquoted(&self) -> &str {
|
||||
"clean_map_name"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,19 +38,23 @@ impl SteamId {
|
|||
|
||||
pub fn steam3(&self) -> String {
|
||||
match self {
|
||||
SteamId::Id(id) => SteamID::from(*id).steam3(),
|
||||
SteamId::Id(id) => SteamID::from_steam64(*id)
|
||||
.map(|id| id.steam3())
|
||||
.unwrap_or_else(|_| String::from("unknown")),
|
||||
SteamId::Raw(raw) => raw.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn steam2(&self) -> String {
|
||||
match self {
|
||||
SteamId::Id(id) => SteamID::from(*id).steam2(),
|
||||
SteamId::Id(id) => SteamID::from_steam64(*id)
|
||||
.map(|id| id.steam2())
|
||||
.unwrap_or_else(|_| String::from("unknown")),
|
||||
SteamId::Raw(raw) => raw.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_steam3(s: &str) -> Result<Self, steamid_ng::SteamIDError> {
|
||||
pub fn from_steam3(s: &str) -> Result<Self, steamid_ng::SteamIDParseError> {
|
||||
let id = SteamID::from_steam3(s)?;
|
||||
Ok(SteamId::Id(id.into()))
|
||||
}
|
||||
|
|
@ -169,12 +173,12 @@ impl FromStr for SteamId {
|
|||
|
||||
impl From<SteamId> for Value {
|
||||
fn from(value: SteamId) -> Self {
|
||||
Value::String(Some(Box::new(value.steamid64())))
|
||||
Value::String(Some(value.steamid64()))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&SteamId> for Value {
|
||||
fn from(value: &SteamId) -> Self {
|
||||
Value::String(Some(Box::new(value.steamid64())))
|
||||
Value::String(Some(value.steamid64()))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use crate::data::steam_id::SteamId;
|
|||
use crate::{Error, Result};
|
||||
use maud::Render;
|
||||
use rand::distr::Alphanumeric;
|
||||
use rand::Rng;
|
||||
use rand::RngExt;
|
||||
use reqwest::get;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::{query, query_as, Executor, Postgres};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue