feat: alter unsafe packages
This commit is contained in:
parent
f1d8318500
commit
0fcbc6bbe9
411
Cargo.lock
generated
411
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
23
Cargo.toml
23
Cargo.toml
@ -16,6 +16,13 @@ util-derive = { path = "./packages/util-derive" }
|
||||
fetch = { path = "./packages/fetch" }
|
||||
downloader = { path = "./packages/downloader" }
|
||||
|
||||
reqwest = { version = "0.12", features = [
|
||||
"charset",
|
||||
"http2",
|
||||
"json",
|
||||
"macos-system-configuration",
|
||||
"cookies",
|
||||
] }
|
||||
moka = "0.12"
|
||||
futures = "0.3"
|
||||
quirks_path = "0.1"
|
||||
@ -24,7 +31,12 @@ testcontainers = { version = "0.24" }
|
||||
testcontainers-modules = { version = "0.12" }
|
||||
testcontainers-ext = { version = "0.1.0", features = ["tracing"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tokio = { version = "1", features = ["macros", "fs", "rt-multi-thread"] }
|
||||
tokio = { version = "1.45.1", features = [
|
||||
"macros",
|
||||
"fs",
|
||||
"rt-multi-thread",
|
||||
"signal",
|
||||
] }
|
||||
serde_json = "1"
|
||||
async-trait = "0.1"
|
||||
tracing = "0.1"
|
||||
@ -37,19 +49,10 @@ serde_with = "3"
|
||||
regex = "1.11"
|
||||
lazy_static = "1.5"
|
||||
axum = { version = "0.8.3", features = ["macros"] }
|
||||
reqwest = { version = "0.12", default-features = false, features = [
|
||||
"charset",
|
||||
"http2",
|
||||
"json",
|
||||
"macos-system-configuration",
|
||||
"rustls-tls",
|
||||
"cookies",
|
||||
] }
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
|
||||
axum-extra = "0.10"
|
||||
mockito = { version = "1.6.1" }
|
||||
convert_case = "0.8"
|
||||
|
||||
[patch.crates-io]
|
||||
jwt-authorizer = { git = "https://github.com/blablacio/jwt-authorizer.git", rev = "e956774" }
|
||||
seaography = { git = "https://github.com/dumtruck/seaography.git", rev = "10ba248" }
|
||||
|
@ -59,13 +59,13 @@ mockito = { workspace = true, optional = true }
|
||||
sea-orm = { version = "1.1", features = [
|
||||
"sqlx-sqlite",
|
||||
"sqlx-postgres",
|
||||
"runtime-tokio-rustls",
|
||||
"runtime-tokio",
|
||||
"macros",
|
||||
"debug-print",
|
||||
] }
|
||||
figment = { version = "0.10", features = ["toml", "json", "env", "yaml"] }
|
||||
uuid = { version = "1.6.0", features = ["v4"] }
|
||||
sea-orm-migration = { version = "1.1", features = ["runtime-tokio-rustls"] }
|
||||
sea-orm-migration = { version = "1.1", features = ["runtime-tokio"] }
|
||||
rss = "2"
|
||||
fancy-regex = "0.14"
|
||||
maplit = "1.0.2"
|
||||
@ -76,7 +76,6 @@ zune-image = "0.4.15"
|
||||
once_cell = "1.20.2"
|
||||
scraper = "0.23"
|
||||
|
||||
jwt-authorizer = "0.15.0"
|
||||
log = "0.4"
|
||||
async-graphql = { version = "7", features = ["dynamic-schema"] }
|
||||
async-graphql-axum = "7"
|
||||
@ -102,8 +101,8 @@ tower-http = { version = "0.6", features = [
|
||||
"compression-full",
|
||||
] }
|
||||
tera = "1.20.0"
|
||||
openidconnect = { version = "4", features = ["rustls-tls"] }
|
||||
dotenv = "0.15.0"
|
||||
openidconnect = { version = "4" }
|
||||
dotenvy = "0.15.7"
|
||||
http = "1.2.0"
|
||||
async-stream = "0.3.6"
|
||||
serde_variant = "0.1.3"
|
||||
@ -111,7 +110,6 @@ tracing-appender = "0.2.3"
|
||||
clap = "4.5.31"
|
||||
ipnetwork = "0.21.1"
|
||||
typed-builder = "0.21.0"
|
||||
serde_yaml = "0.9.34"
|
||||
apalis = { version = "0.7", features = ["limit", "tracing", "catch-panic"] }
|
||||
apalis-sql = { version = "0.7", features = ["postgres"] }
|
||||
cocoon = { version = "0.4.3", features = ["getrandom", "thiserror"] }
|
||||
@ -119,11 +117,12 @@ rand = "0.9.1"
|
||||
rust_decimal = "1.37.1"
|
||||
reqwest_cookie_store = "0.8.0"
|
||||
nanoid = "0.4.0"
|
||||
jwtk = "0.4.0"
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
serial_test = "3"
|
||||
insta = { version = "1", features = ["redactions", "yaml", "filters"] }
|
||||
insta = { version = "1", features = ["redactions", "toml", "filters"] }
|
||||
rstest = "0.25"
|
||||
ctor = "0.4.0"
|
||||
mockito = { workspace = true }
|
||||
|
@ -110,12 +110,12 @@ impl AppConfig {
|
||||
for f in try_filenames.iter() {
|
||||
let p = try_dotenv_file_or_dir_path.join(f);
|
||||
if p.exists() && p.is_file() {
|
||||
dotenv::from_path(p)?;
|
||||
dotenvy::from_path(p)?;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if try_dotenv_file_or_dir_path.is_file() {
|
||||
dotenv::from_path(try_dotenv_file_or_dir_path)?;
|
||||
dotenvy::from_path(try_dotenv_file_or_dir_path)?;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
use jwt_authorizer::OneOrArray;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use jwtk::OneOrMany;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_with::{NoneAsEmptyString, serde_as};
|
||||
use serde_with::serde_as;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct BasicAuthConfig {
|
||||
@ -22,13 +24,9 @@ pub struct OidcAuthConfig {
|
||||
#[serde(rename = "oidc_client_secret")]
|
||||
pub client_secret: String,
|
||||
#[serde(rename = "oidc_extra_scopes")]
|
||||
pub extra_scopes: Option<OneOrArray<String>>,
|
||||
#[serde_as(as = "NoneAsEmptyString")]
|
||||
#[serde(rename = "oidc_extra_claim_key")]
|
||||
pub extra_claim_key: Option<String>,
|
||||
#[serde(rename = "oidc_extra_claim_value")]
|
||||
#[serde_as(as = "NoneAsEmptyString")]
|
||||
pub extra_claim_value: Option<String>,
|
||||
pub extra_scopes: Option<OneOrMany<String>>,
|
||||
#[serde(rename = "oidc_extra_claims")]
|
||||
pub extra_claims: Option<HashMap<String, Option<String>>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
|
@ -27,10 +27,6 @@ pub enum AuthError {
|
||||
FindAuthRecordError,
|
||||
#[snafu(display("Invalid credentials"))]
|
||||
BasicInvalidCredentials,
|
||||
#[snafu(transparent)]
|
||||
OidcInitError {
|
||||
source: jwt_authorizer::error::InitError,
|
||||
},
|
||||
#[snafu(display("Invalid oidc provider meta client error: {source}"))]
|
||||
OidcProviderHttpClientError { source: HttpClientError },
|
||||
#[snafu(transparent)]
|
||||
@ -66,8 +62,10 @@ pub enum AuthError {
|
||||
OidcSignatureVerificationError { source: SignatureVerificationError },
|
||||
#[snafu(transparent)]
|
||||
OidcSigningError { source: SigningError },
|
||||
#[snafu(display("Missing Bearer token"))]
|
||||
OidcMissingBearerToken,
|
||||
#[snafu(transparent)]
|
||||
OidcJwtAuthError { source: jwt_authorizer::AuthError },
|
||||
OidcJwtkError { source: jwtk::Error },
|
||||
#[snafu(display("Extra scopes {expected} do not match found scopes {found}"))]
|
||||
OidcExtraScopesMatchError { expected: String, found: String },
|
||||
#[snafu(display("Extra claim {key} does not match expected value {expected}, found {found}"))]
|
||||
|
@ -12,8 +12,9 @@ use axum::{
|
||||
http::{HeaderValue, request::Parts},
|
||||
};
|
||||
use fetch::{HttpClient, client::HttpClientError};
|
||||
use http::header::AUTHORIZATION;
|
||||
use itertools::Itertools;
|
||||
use jwt_authorizer::{NumericDate, OneOrArray, authorizer::Authorizer};
|
||||
use jwtk::jwk::RemoteJwksVerifier;
|
||||
use moka::future::Cache;
|
||||
use openidconnect::{
|
||||
AccessTokenHash, AuthorizationCode, ClientId, ClientSecret, CsrfToken, IssuerUrl, Nonce,
|
||||
@ -77,21 +78,6 @@ impl<'c> openidconnect::AsyncHttpClient<'c> for OidcHttpClient {
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
pub struct OidcAuthClaims {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub iss: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub sub: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub aud: Option<OneOrArray<String>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub exp: Option<NumericDate>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub nbf: Option<NumericDate>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub iat: Option<NumericDate>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub jti: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub scope: Option<String>,
|
||||
#[serde(flatten)]
|
||||
pub custom: HashMap<String, Value>,
|
||||
@ -101,40 +87,6 @@ impl OidcAuthClaims {
|
||||
pub fn scopes(&self) -> std::str::Split<'_, char> {
|
||||
self.scope.as_deref().unwrap_or_default().split(',')
|
||||
}
|
||||
|
||||
pub fn get_claim(&self, key: &str) -> Option<String> {
|
||||
match key {
|
||||
"iss" => self.iss.clone(),
|
||||
"sub" => self.sub.clone(),
|
||||
"aud" => self.aud.as_ref().map(|s| s.iter().join(",")),
|
||||
"exp" => self.exp.clone().map(|s| s.0.to_string()),
|
||||
"nbf" => self.nbf.clone().map(|s| s.0.to_string()),
|
||||
"iat" => self.iat.clone().map(|s| s.0.to_string()),
|
||||
"jti" => self.jti.clone(),
|
||||
"scope" => self.scope.clone(),
|
||||
key => self.custom.get(key).map(|s| s.to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn has_claim(&self, key: &str) -> bool {
|
||||
match key {
|
||||
"iss" => self.iss.is_some(),
|
||||
"sub" => self.sub.is_some(),
|
||||
"aud" => self.aud.is_some(),
|
||||
"exp" => self.exp.is_some(),
|
||||
"nbf" => self.nbf.is_some(),
|
||||
"iat" => self.iat.is_some(),
|
||||
"jti" => self.jti.is_some(),
|
||||
"scope" => self.scope.is_some(),
|
||||
key => self.custom.contains_key(key),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn contains_audience(&self, aud: &str) -> bool {
|
||||
self.aud
|
||||
.as_ref()
|
||||
.is_some_and(|arr| arr.iter().any(|s| s == aud))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
@ -164,7 +116,7 @@ pub struct OidcAuthCallbackPayload {
|
||||
|
||||
pub struct OidcAuthService {
|
||||
pub config: OidcAuthConfig,
|
||||
pub api_authorizer: Authorizer<OidcAuthClaims>,
|
||||
pub jwk_verifier: RemoteJwksVerifier,
|
||||
pub oidc_provider_client: Arc<HttpClient>,
|
||||
pub oidc_request_cache: Cache<String, OidcAuthRequest>,
|
||||
}
|
||||
@ -317,47 +269,68 @@ impl AuthServiceTrait for OidcAuthService {
|
||||
request: &mut Parts,
|
||||
) -> Result<AuthUserInfo, AuthError> {
|
||||
let config = &self.config;
|
||||
let token = self
|
||||
.api_authorizer
|
||||
.extract_token(&request.headers)
|
||||
.ok_or(jwt_authorizer::AuthError::MissingToken())?;
|
||||
let token = request
|
||||
.headers
|
||||
.get(AUTHORIZATION)
|
||||
.and_then(|authorization| {
|
||||
authorization
|
||||
.to_str()
|
||||
.ok()
|
||||
.and_then(|s| s.strip_prefix("Bearer "))
|
||||
})
|
||||
.ok_or(AuthError::OidcMissingBearerToken)?;
|
||||
|
||||
let token_data = self.api_authorizer.check_auth(&token).await?;
|
||||
let claims = token_data.claims;
|
||||
let token_data = self.jwk_verifier.verify::<OidcAuthClaims>(token).await?;
|
||||
let claims = token_data.claims();
|
||||
let sub = if let Some(sub) = claims.sub.as_deref() {
|
||||
sub
|
||||
} else {
|
||||
return Err(AuthError::OidcSubMissingError);
|
||||
};
|
||||
if !claims.contains_audience(&config.audience) {
|
||||
if !claims.aud.iter().any(|aud| aud == &config.audience) {
|
||||
return Err(AuthError::OidcAudMissingError {
|
||||
aud: config.audience.clone(),
|
||||
});
|
||||
}
|
||||
let extra_claims = &claims.extra;
|
||||
if let Some(expected_scopes) = config.extra_scopes.as_ref() {
|
||||
let found_scopes = claims.scopes().collect::<HashSet<_>>();
|
||||
let found_scopes = extra_claims.scopes().collect::<HashSet<_>>();
|
||||
if !expected_scopes
|
||||
.iter()
|
||||
.all(|es| found_scopes.contains(es as &str))
|
||||
{
|
||||
return Err(AuthError::OidcExtraScopesMatchError {
|
||||
expected: expected_scopes.iter().join(","),
|
||||
found: claims.scope.unwrap_or_default(),
|
||||
found: extra_claims
|
||||
.scope
|
||||
.as_deref()
|
||||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
});
|
||||
}
|
||||
}
|
||||
if let Some(key) = config.extra_claim_key.as_ref() {
|
||||
if !claims.has_claim(key) {
|
||||
return Err(AuthError::OidcExtraClaimMissingError { claim: key.clone() });
|
||||
}
|
||||
if let Some(value) = config.extra_claim_value.as_ref()
|
||||
&& claims.get_claim(key).is_none_or(|v| &v != value)
|
||||
{
|
||||
return Err(AuthError::OidcExtraClaimMatchError {
|
||||
expected: value.clone(),
|
||||
found: claims.get_claim(key).unwrap_or_default().to_string(),
|
||||
key: key.clone(),
|
||||
});
|
||||
if let Some(expected_extra_claims) = config.extra_claims.as_ref() {
|
||||
for (expected_key, expected_value) in expected_extra_claims.iter() {
|
||||
match (extra_claims.custom.get(expected_key), expected_value) {
|
||||
(found_value, Some(expected_value)) => {
|
||||
if let Some(Value::String(found_value)) = found_value
|
||||
&& expected_value == found_value
|
||||
{
|
||||
} else {
|
||||
return Err(AuthError::OidcExtraClaimMatchError {
|
||||
expected: expected_value.clone(),
|
||||
found: found_value.map(|v| v.to_string()).unwrap_or_default(),
|
||||
key: expected_key.clone(),
|
||||
});
|
||||
}
|
||||
}
|
||||
(None, None) => {
|
||||
return Err(AuthError::OidcExtraClaimMissingError {
|
||||
claim: expected_key.clone(),
|
||||
});
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
let subscriber_auth = match crate::models::auth::Model::find_by_pid(ctx, sub).await {
|
||||
|
@ -1,25 +1,22 @@
|
||||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use axum::{
|
||||
extract::FromRequestParts,
|
||||
http::request::Parts,
|
||||
response::{IntoResponse as _, Response},
|
||||
};
|
||||
use axum::http::request::Parts;
|
||||
use fetch::{
|
||||
HttpClient, HttpClientConfig,
|
||||
client::{HttpClientCacheBackendConfig, HttpClientCachePresetConfig},
|
||||
};
|
||||
use http::header::HeaderValue;
|
||||
use jwt_authorizer::{JwtAuthorizer, Validation};
|
||||
use jwtk::jwk::RemoteJwksVerifier;
|
||||
use moka::future::Cache;
|
||||
use openidconnect::{IssuerUrl, core::CoreProviderMetadata};
|
||||
use snafu::prelude::*;
|
||||
|
||||
use super::{
|
||||
AuthConfig,
|
||||
basic::BasicAuthService,
|
||||
errors::{AuthError, OidcProviderHttpClientSnafu},
|
||||
oidc::{OidcAuthClaims, OidcAuthService},
|
||||
errors::{AuthError, OidcProviderHttpClientSnafu, OidcProviderUrlSnafu},
|
||||
oidc::{OidcAuthService, OidcHttpClient},
|
||||
};
|
||||
use crate::{app::AppContextTrait, models::auth::AuthType};
|
||||
|
||||
@ -29,22 +26,6 @@ pub struct AuthUserInfo {
|
||||
pub auth_type: AuthType,
|
||||
}
|
||||
|
||||
impl FromRequestParts<Arc<dyn AppContextTrait>> for AuthUserInfo {
|
||||
type Rejection = Response;
|
||||
|
||||
async fn from_request_parts(
|
||||
parts: &mut Parts,
|
||||
state: &Arc<dyn AppContextTrait>,
|
||||
) -> Result<Self, Self::Rejection> {
|
||||
let auth_service = state.auth();
|
||||
|
||||
auth_service
|
||||
.extract_user_info(state.as_ref(), parts)
|
||||
.await
|
||||
.map_err(|err| err.into_response())
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait AuthServiceTrait {
|
||||
async fn extract_user_info(
|
||||
@ -66,27 +47,33 @@ impl AuthService {
|
||||
let result = match config {
|
||||
AuthConfig::Basic(config) => AuthService::Basic(Box::new(BasicAuthService { config })),
|
||||
AuthConfig::Oidc(config) => {
|
||||
let validation = Validation::new()
|
||||
.iss(&[&config.issuer])
|
||||
.aud(&[&config.audience]);
|
||||
let oidc_provider_client = Arc::new(
|
||||
HttpClient::from_config(HttpClientConfig {
|
||||
exponential_backoff_max_retries: Some(3),
|
||||
cache_backend: Some(HttpClientCacheBackendConfig::Moka { cache_size: 1 }),
|
||||
cache_preset: Some(HttpClientCachePresetConfig::RFC7234),
|
||||
..Default::default()
|
||||
})
|
||||
.context(OidcProviderHttpClientSnafu)?,
|
||||
);
|
||||
|
||||
let oidc_provider_client = HttpClient::from_config(HttpClientConfig {
|
||||
exponential_backoff_max_retries: Some(3),
|
||||
cache_backend: Some(HttpClientCacheBackendConfig::Moka { cache_size: 1 }),
|
||||
cache_preset: Some(HttpClientCachePresetConfig::RFC7234),
|
||||
..Default::default()
|
||||
})
|
||||
.context(OidcProviderHttpClientSnafu)?;
|
||||
let provider_metadata = {
|
||||
let client = OidcHttpClient(oidc_provider_client.clone());
|
||||
let issuer_url =
|
||||
IssuerUrl::new(config.issuer.clone()).context(OidcProviderUrlSnafu)?;
|
||||
CoreProviderMetadata::discover_async(issuer_url, &client).await
|
||||
}?;
|
||||
|
||||
let api_authorizer = JwtAuthorizer::<OidcAuthClaims>::from_oidc(&config.issuer)
|
||||
.validation(validation)
|
||||
.build()
|
||||
.await?;
|
||||
let jwk_verifier = RemoteJwksVerifier::new(
|
||||
provider_metadata.jwks_uri().to_string().clone(),
|
||||
None,
|
||||
Duration::from_secs(300),
|
||||
);
|
||||
|
||||
AuthService::Oidc(Box::new(OidcAuthService {
|
||||
config,
|
||||
api_authorizer,
|
||||
oidc_provider_client: Arc::new(oidc_provider_client),
|
||||
jwk_verifier,
|
||||
oidc_provider_client,
|
||||
oidc_request_cache: Cache::builder()
|
||||
.time_to_live(Duration::from_mins(5))
|
||||
.name("oidc_request_cache")
|
||||
@ -100,6 +87,7 @@ impl AuthService {
|
||||
|
||||
#[async_trait]
|
||||
impl AuthServiceTrait for AuthService {
|
||||
#[tracing::instrument(skip(self, ctx, request))]
|
||||
async fn extract_user_info(
|
||||
&self,
|
||||
ctx: &dyn AppContextTrait,
|
||||
|
@ -47,7 +47,7 @@ pub enum RecorderError {
|
||||
#[snafu(transparent)]
|
||||
RSSError { source: rss::Error },
|
||||
#[snafu(transparent)]
|
||||
DotEnvError { source: dotenv::Error },
|
||||
DotEnvError { source: dotenvy::Error },
|
||||
#[snafu(transparent)]
|
||||
TeraError { source: tera::Error },
|
||||
#[snafu(transparent)]
|
||||
|
@ -920,7 +920,7 @@ where
|
||||
pub fn register_jsonb_input_filter_to_dynamic_schema(
|
||||
schema_builder: SchemaBuilder,
|
||||
) -> SchemaBuilder {
|
||||
let json_filter_input_type = Scalar::new("JsonFilterInput");
|
||||
let json_filter_input_type = Scalar::new(JSONB_FILTER_NAME);
|
||||
schema_builder.register(json_filter_input_type)
|
||||
}
|
||||
|
||||
@ -1261,7 +1261,7 @@ mod tests {
|
||||
{
|
||||
"d": [
|
||||
{
|
||||
"$any": true
|
||||
"$match": "$any"
|
||||
},
|
||||
{
|
||||
"$eq": [1, 2, 3]
|
||||
|
@ -52,7 +52,7 @@ impl SyncOneSubscriptionInfo {
|
||||
Object::new(Self::object_type_name())
|
||||
.description("The output of the subscriptionSyncOne series of mutations")
|
||||
.field(Field::new(
|
||||
"taskId",
|
||||
SyncOneSubscriptionInfoFieldEnum::TaskId,
|
||||
TypeRef::named_nn(TypeRef::STRING),
|
||||
move |ctx| {
|
||||
FieldFuture::new(async move {
|
||||
|
@ -17,14 +17,14 @@ type Documents = {
|
||||
"\n query GetSubscriptions(\n $page: PageInput!,\n $filters: SubscriptionsFilterInput!,\n $orderBy: SubscriptionsOrderInput!\n) {\n subscriptions(\n pagination: {\n page: $page\n }\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n": typeof types.GetSubscriptionsDocument,
|
||||
"\n mutation UpdateSubscriptions(\n $data: SubscriptionsUpdateInput!,\n $filters: SubscriptionsFilterInput!,\n ) {\n subscriptionsUpdate (\n data: $data\n filter: $filters\n ) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n}\n": typeof types.UpdateSubscriptionsDocument,
|
||||
"\n mutation DeleteSubscriptions($filters: SubscriptionsFilterInput) {\n subscriptionsDelete(filter: $filters)\n }\n": typeof types.DeleteSubscriptionsDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n deleted\n homepage\n }\n }\n }\n }\n}\n": typeof types.GetSubscriptionDetailDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n homepage\n }\n }\n }\n }\n}\n": typeof types.GetSubscriptionDetailDocument,
|
||||
"\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n }\n }\n": typeof types.CreateSubscriptionDocument,
|
||||
};
|
||||
const documents: Documents = {
|
||||
"\n query GetSubscriptions(\n $page: PageInput!,\n $filters: SubscriptionsFilterInput!,\n $orderBy: SubscriptionsOrderInput!\n) {\n subscriptions(\n pagination: {\n page: $page\n }\n filters: $filters\n orderBy: $orderBy\n ) {\n nodes {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n paginationInfo {\n total\n pages\n }\n }\n }\n": types.GetSubscriptionsDocument,
|
||||
"\n mutation UpdateSubscriptions(\n $data: SubscriptionsUpdateInput!,\n $filters: SubscriptionsFilterInput!,\n ) {\n subscriptionsUpdate (\n data: $data\n filter: $filters\n ) {\n id\n createdAt\n updatedAt\n displayName\n category\n sourceUrl\n enabled\n }\n}\n": types.UpdateSubscriptionsDocument,
|
||||
"\n mutation DeleteSubscriptions($filters: SubscriptionsFilterInput) {\n subscriptionsDelete(filter: $filters)\n }\n": types.DeleteSubscriptionsDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n deleted\n homepage\n }\n }\n }\n }\n}\n": types.GetSubscriptionDetailDocument,
|
||||
"\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n homepage\n }\n }\n }\n }\n}\n": types.GetSubscriptionDetailDocument,
|
||||
"\n mutation CreateSubscription($input: SubscriptionsInsertInput!) {\n subscriptionsCreateOne(data: $input) {\n id\n displayName\n sourceUrl\n enabled\n category\n }\n }\n": types.CreateSubscriptionDocument,
|
||||
};
|
||||
|
||||
@ -57,7 +57,7 @@ export function gql(source: "\n mutation DeleteSubscriptions($filters: Subscr
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function gql(source: "\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n deleted\n homepage\n }\n }\n }\n }\n}\n"): (typeof documents)["\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n deleted\n homepage\n }\n }\n }\n }\n}\n"];
|
||||
export function gql(source: "\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n homepage\n }\n }\n }\n }\n}\n"): (typeof documents)["\nquery GetSubscriptionDetail ($id: Int!) {\n subscriptions(filters: { id: {\n eq: $id\n } }) {\n nodes {\n id\n displayName\n createdAt\n updatedAt\n category\n sourceUrl\n enabled\n bangumi {\n nodes {\n createdAt\n updatedAt\n id\n mikanBangumiId\n displayName\n rawName\n season\n seasonRaw\n fansub\n mikanFansubId\n rssLink\n posterLink\n savePath\n homepage\n }\n }\n }\n }\n}\n"];
|
||||
/**
|
||||
* The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
|
@ -14,12 +14,12 @@ export type Scalars = {
|
||||
Boolean: { input: boolean; output: boolean; }
|
||||
Int: { input: number; output: number; }
|
||||
Float: { input: number; output: number; }
|
||||
JsonbFilterInput: { input: any; output: any; }
|
||||
};
|
||||
|
||||
export type Bangumi = {
|
||||
__typename?: 'Bangumi';
|
||||
createdAt: Scalars['String']['output'];
|
||||
deleted: Scalars['Boolean']['output'];
|
||||
displayName: Scalars['String']['output'];
|
||||
episode: EpisodesConnection;
|
||||
fansub?: Maybe<Scalars['String']['output']>;
|
||||
@ -64,7 +64,6 @@ export type BangumiSubscriptionBangumiArgs = {
|
||||
export type BangumiBasic = {
|
||||
__typename?: 'BangumiBasic';
|
||||
createdAt: Scalars['String']['output'];
|
||||
deleted: Scalars['Boolean']['output'];
|
||||
displayName: Scalars['String']['output'];
|
||||
fansub?: Maybe<Scalars['String']['output']>;
|
||||
homepage?: Maybe<Scalars['String']['output']>;
|
||||
@ -98,7 +97,6 @@ export type BangumiEdge = {
|
||||
export type BangumiFilterInput = {
|
||||
and?: InputMaybe<Array<BangumiFilterInput>>;
|
||||
createdAt?: InputMaybe<TextFilterInput>;
|
||||
deleted?: InputMaybe<BooleanFilterInput>;
|
||||
displayName?: InputMaybe<StringFilterInput>;
|
||||
fansub?: InputMaybe<StringFilterInput>;
|
||||
homepage?: InputMaybe<StringFilterInput>;
|
||||
@ -118,7 +116,6 @@ export type BangumiFilterInput = {
|
||||
|
||||
export type BangumiInsertInput = {
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
deleted: Scalars['Boolean']['input'];
|
||||
displayName: Scalars['String']['input'];
|
||||
fansub?: InputMaybe<Scalars['String']['input']>;
|
||||
homepage?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -136,7 +133,6 @@ export type BangumiInsertInput = {
|
||||
|
||||
export type BangumiOrderInput = {
|
||||
createdAt?: InputMaybe<OrderByEnum>;
|
||||
deleted?: InputMaybe<OrderByEnum>;
|
||||
displayName?: InputMaybe<OrderByEnum>;
|
||||
extra?: InputMaybe<OrderByEnum>;
|
||||
fansub?: InputMaybe<OrderByEnum>;
|
||||
@ -157,7 +153,6 @@ export type BangumiOrderInput = {
|
||||
|
||||
export type BangumiUpdateInput = {
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
deleted?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
displayName?: InputMaybe<Scalars['String']['input']>;
|
||||
fansub?: InputMaybe<Scalars['String']['input']>;
|
||||
homepage?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -478,7 +473,6 @@ export type Episodes = {
|
||||
bangumi?: Maybe<Bangumi>;
|
||||
bangumiId: Scalars['Int']['output'];
|
||||
createdAt: Scalars['String']['output'];
|
||||
deleted: Scalars['Boolean']['output'];
|
||||
displayName: Scalars['String']['output'];
|
||||
download: SubscriptionsConnection;
|
||||
episodeIndex: Scalars['Int']['output'];
|
||||
@ -526,7 +520,6 @@ export type EpisodesBasic = {
|
||||
__typename?: 'EpisodesBasic';
|
||||
bangumiId: Scalars['Int']['output'];
|
||||
createdAt: Scalars['String']['output'];
|
||||
deleted: Scalars['Boolean']['output'];
|
||||
displayName: Scalars['String']['output'];
|
||||
episodeIndex: Scalars['Int']['output'];
|
||||
fansub?: Maybe<Scalars['String']['output']>;
|
||||
@ -563,7 +556,6 @@ export type EpisodesFilterInput = {
|
||||
and?: InputMaybe<Array<EpisodesFilterInput>>;
|
||||
bangumiId?: InputMaybe<IntegerFilterInput>;
|
||||
createdAt?: InputMaybe<TextFilterInput>;
|
||||
deleted?: InputMaybe<BooleanFilterInput>;
|
||||
displayName?: InputMaybe<StringFilterInput>;
|
||||
episodeIndex?: InputMaybe<IntegerFilterInput>;
|
||||
fansub?: InputMaybe<StringFilterInput>;
|
||||
@ -586,7 +578,6 @@ export type EpisodesFilterInput = {
|
||||
export type EpisodesInsertInput = {
|
||||
bangumiId: Scalars['Int']['input'];
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
deleted: Scalars['Boolean']['input'];
|
||||
displayName: Scalars['String']['input'];
|
||||
episodeIndex: Scalars['Int']['input'];
|
||||
fansub?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -607,7 +598,6 @@ export type EpisodesInsertInput = {
|
||||
export type EpisodesOrderInput = {
|
||||
bangumiId?: InputMaybe<OrderByEnum>;
|
||||
createdAt?: InputMaybe<OrderByEnum>;
|
||||
deleted?: InputMaybe<OrderByEnum>;
|
||||
displayName?: InputMaybe<OrderByEnum>;
|
||||
episodeIndex?: InputMaybe<OrderByEnum>;
|
||||
extra?: InputMaybe<OrderByEnum>;
|
||||
@ -630,7 +620,6 @@ export type EpisodesOrderInput = {
|
||||
export type EpisodesUpdateInput = {
|
||||
bangumiId?: InputMaybe<Scalars['Int']['input']>;
|
||||
createdAt?: InputMaybe<Scalars['String']['input']>;
|
||||
deleted?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
displayName?: InputMaybe<Scalars['String']['input']>;
|
||||
episodeIndex?: InputMaybe<Scalars['Int']['input']>;
|
||||
fansub?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -682,6 +671,10 @@ export type Mutation = {
|
||||
episodesCreateOne: EpisodesBasic;
|
||||
episodesDelete: Scalars['Int']['output'];
|
||||
episodesUpdate: Array<EpisodesBasic>;
|
||||
subscriberTasksCreateBatch: Array<SubscriberTasksBasic>;
|
||||
subscriberTasksCreateOne: SubscriberTasksBasic;
|
||||
subscriberTasksDelete: Scalars['Int']['output'];
|
||||
subscriberTasksUpdate: Array<SubscriberTasksBasic>;
|
||||
subscriptionBangumiCreateBatch: Array<SubscriptionBangumiBasic>;
|
||||
subscriptionBangumiCreateOne: SubscriptionBangumiBasic;
|
||||
subscriptionBangumiDelete: Scalars['Int']['output'];
|
||||
@ -690,6 +683,7 @@ export type Mutation = {
|
||||
subscriptionEpisodeCreateOne: SubscriptionEpisodeBasic;
|
||||
subscriptionEpisodeDelete: Scalars['Int']['output'];
|
||||
subscriptionEpisodeUpdate: Array<SubscriptionEpisodeBasic>;
|
||||
subscriptionSyncOneSources: SyncOneSubscriptionInfo;
|
||||
subscriptionsCreateBatch: Array<SubscriptionsBasic>;
|
||||
subscriptionsCreateOne: SubscriptionsBasic;
|
||||
subscriptionsDelete: Scalars['Int']['output'];
|
||||
@ -781,6 +775,27 @@ export type MutationEpisodesUpdateArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriberTasksCreateBatchArgs = {
|
||||
data: Array<SubscriberTasksInsertInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriberTasksCreateOneArgs = {
|
||||
data: SubscriberTasksInsertInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriberTasksDeleteArgs = {
|
||||
filter?: InputMaybe<SubscriberTasksFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriberTasksUpdateArgs = {
|
||||
data: SubscriberTasksUpdateInput;
|
||||
filter?: InputMaybe<SubscriberTasksFilterInput>;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionBangumiCreateBatchArgs = {
|
||||
data: Array<SubscriptionBangumiInsertInput>;
|
||||
};
|
||||
@ -823,6 +838,11 @@ export type MutationSubscriptionEpisodeUpdateArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionSyncOneSourcesArgs = {
|
||||
filter: SyncOneSubscriptionFilterInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubscriptionsCreateBatchArgs = {
|
||||
data: Array<SubscriptionsInsertInput>;
|
||||
};
|
||||
@ -887,9 +907,12 @@ export type Query = {
|
||||
downloaders: DownloadersConnection;
|
||||
downloads: DownloadsConnection;
|
||||
episodes: EpisodesConnection;
|
||||
subscriberTasks: SubscriberTasksConnection;
|
||||
subscribers: SubscribersConnection;
|
||||
subscriptionBangumi: SubscriptionBangumiConnection;
|
||||
subscriptionEpisode: SubscriptionEpisodeConnection;
|
||||
subscriptionSyncOneFeedsFull: SyncOneSubscriptionInfo;
|
||||
subscriptionSyncOneFeedsIncremental: SyncOneSubscriptionInfo;
|
||||
subscriptions: SubscriptionsConnection;
|
||||
};
|
||||
|
||||
@ -927,6 +950,13 @@ export type QueryEpisodesArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriberTasksArgs = {
|
||||
filters?: InputMaybe<SubscriberTasksFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriberTasksOrderInput>;
|
||||
pagination?: InputMaybe<PaginationInput>;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscribersArgs = {
|
||||
filters?: InputMaybe<SubscribersFilterInput>;
|
||||
orderBy?: InputMaybe<SubscribersOrderInput>;
|
||||
@ -948,6 +978,16 @@ export type QuerySubscriptionEpisodeArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriptionSyncOneFeedsFullArgs = {
|
||||
filter: SyncOneSubscriptionFilterInput;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriptionSyncOneFeedsIncrementalArgs = {
|
||||
filter: SyncOneSubscriptionFilterInput;
|
||||
};
|
||||
|
||||
|
||||
export type QuerySubscriptionsArgs = {
|
||||
filters?: InputMaybe<SubscriptionsFilterInput>;
|
||||
orderBy?: InputMaybe<SubscriptionsOrderInput>;
|
||||
@ -978,6 +1018,109 @@ export type SubscriberIdFilterInput = {
|
||||
eq?: InputMaybe<Scalars['Int']['input']>;
|
||||
};
|
||||
|
||||
export type SubscriberTasks = {
|
||||
__typename?: 'SubscriberTasks';
|
||||
attempts: Scalars['Int']['output'];
|
||||
doneAt?: Maybe<Scalars['String']['output']>;
|
||||
id: Scalars['String']['output'];
|
||||
lastError?: Maybe<Scalars['String']['output']>;
|
||||
lockAt?: Maybe<Scalars['String']['output']>;
|
||||
lockBy?: Maybe<Scalars['String']['output']>;
|
||||
maxAttempts: Scalars['Int']['output'];
|
||||
priority: Scalars['Int']['output'];
|
||||
runAt: Scalars['String']['output'];
|
||||
status: Scalars['String']['output'];
|
||||
subscriber?: Maybe<Subscribers>;
|
||||
subscriberId: Scalars['Int']['output'];
|
||||
};
|
||||
|
||||
export type SubscriberTasksBasic = {
|
||||
__typename?: 'SubscriberTasksBasic';
|
||||
attempts: Scalars['Int']['output'];
|
||||
doneAt?: Maybe<Scalars['String']['output']>;
|
||||
id: Scalars['String']['output'];
|
||||
lastError?: Maybe<Scalars['String']['output']>;
|
||||
lockAt?: Maybe<Scalars['String']['output']>;
|
||||
lockBy?: Maybe<Scalars['String']['output']>;
|
||||
maxAttempts: Scalars['Int']['output'];
|
||||
priority: Scalars['Int']['output'];
|
||||
runAt: Scalars['String']['output'];
|
||||
status: Scalars['String']['output'];
|
||||
subscriberId: Scalars['Int']['output'];
|
||||
};
|
||||
|
||||
export type SubscriberTasksConnection = {
|
||||
__typename?: 'SubscriberTasksConnection';
|
||||
edges: Array<SubscriberTasksEdge>;
|
||||
nodes: Array<SubscriberTasks>;
|
||||
pageInfo: PageInfo;
|
||||
paginationInfo?: Maybe<PaginationInfo>;
|
||||
};
|
||||
|
||||
export type SubscriberTasksEdge = {
|
||||
__typename?: 'SubscriberTasksEdge';
|
||||
cursor: Scalars['String']['output'];
|
||||
node: SubscriberTasks;
|
||||
};
|
||||
|
||||
export type SubscriberTasksFilterInput = {
|
||||
and?: InputMaybe<Array<SubscriberTasksFilterInput>>;
|
||||
attempts?: InputMaybe<IntegerFilterInput>;
|
||||
doneAt?: InputMaybe<TextFilterInput>;
|
||||
id?: InputMaybe<StringFilterInput>;
|
||||
job?: InputMaybe<Scalars['JsonbFilterInput']['input']>;
|
||||
lastError?: InputMaybe<StringFilterInput>;
|
||||
lockAt?: InputMaybe<TextFilterInput>;
|
||||
lockBy?: InputMaybe<StringFilterInput>;
|
||||
maxAttempts?: InputMaybe<IntegerFilterInput>;
|
||||
or?: InputMaybe<Array<SubscriberTasksFilterInput>>;
|
||||
priority?: InputMaybe<IntegerFilterInput>;
|
||||
runAt?: InputMaybe<TextFilterInput>;
|
||||
status?: InputMaybe<StringFilterInput>;
|
||||
subscriberId?: InputMaybe<SubscriberIdFilterInput>;
|
||||
};
|
||||
|
||||
export type SubscriberTasksInsertInput = {
|
||||
attempts: Scalars['Int']['input'];
|
||||
doneAt?: InputMaybe<Scalars['String']['input']>;
|
||||
id?: InputMaybe<Scalars['String']['input']>;
|
||||
lastError?: InputMaybe<Scalars['String']['input']>;
|
||||
lockAt?: InputMaybe<Scalars['String']['input']>;
|
||||
lockBy?: InputMaybe<Scalars['String']['input']>;
|
||||
maxAttempts: Scalars['Int']['input'];
|
||||
priority: Scalars['Int']['input'];
|
||||
runAt: Scalars['String']['input'];
|
||||
status: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type SubscriberTasksOrderInput = {
|
||||
attempts?: InputMaybe<OrderByEnum>;
|
||||
doneAt?: InputMaybe<OrderByEnum>;
|
||||
id?: InputMaybe<OrderByEnum>;
|
||||
job?: InputMaybe<OrderByEnum>;
|
||||
lastError?: InputMaybe<OrderByEnum>;
|
||||
lockAt?: InputMaybe<OrderByEnum>;
|
||||
lockBy?: InputMaybe<OrderByEnum>;
|
||||
maxAttempts?: InputMaybe<OrderByEnum>;
|
||||
priority?: InputMaybe<OrderByEnum>;
|
||||
runAt?: InputMaybe<OrderByEnum>;
|
||||
status?: InputMaybe<OrderByEnum>;
|
||||
subscriberId?: InputMaybe<OrderByEnum>;
|
||||
};
|
||||
|
||||
export type SubscriberTasksUpdateInput = {
|
||||
attempts?: InputMaybe<Scalars['Int']['input']>;
|
||||
doneAt?: InputMaybe<Scalars['String']['input']>;
|
||||
id?: InputMaybe<Scalars['String']['input']>;
|
||||
lastError?: InputMaybe<Scalars['String']['input']>;
|
||||
lockAt?: InputMaybe<Scalars['String']['input']>;
|
||||
lockBy?: InputMaybe<Scalars['String']['input']>;
|
||||
maxAttempts?: InputMaybe<Scalars['Int']['input']>;
|
||||
priority?: InputMaybe<Scalars['Int']['input']>;
|
||||
runAt?: InputMaybe<Scalars['String']['input']>;
|
||||
status?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type Subscribers = {
|
||||
__typename?: 'Subscribers';
|
||||
bangumi: BangumiConnection;
|
||||
@ -1051,6 +1194,7 @@ export type SubscriptionBangumi = {
|
||||
bangumi?: Maybe<Bangumi>;
|
||||
bangumiId: Scalars['Int']['output'];
|
||||
id: Scalars['Int']['output'];
|
||||
subscriber?: Maybe<Subscribers>;
|
||||
subscriberId: Scalars['Int']['output'];
|
||||
subscription?: Maybe<Subscriptions>;
|
||||
subscriptionId: Scalars['Int']['output'];
|
||||
@ -1108,7 +1252,9 @@ export type SubscriptionBangumiUpdateInput = {
|
||||
|
||||
export enum SubscriptionCategoryEnum {
|
||||
Manual = 'manual',
|
||||
Mikan = 'mikan'
|
||||
MikanBangumi = 'mikan_bangumi',
|
||||
MikanSeason = 'mikan_season',
|
||||
MikanSubscriber = 'mikan_subscriber'
|
||||
}
|
||||
|
||||
export type SubscriptionCategoryEnumFilterInput = {
|
||||
@ -1129,6 +1275,7 @@ export type SubscriptionEpisode = {
|
||||
episode?: Maybe<Episodes>;
|
||||
episodeId: Scalars['Int']['output'];
|
||||
id: Scalars['Int']['output'];
|
||||
subscriber?: Maybe<Subscribers>;
|
||||
subscriberId: Scalars['Int']['output'];
|
||||
subscription?: Maybe<Subscriptions>;
|
||||
subscriptionId: Scalars['Int']['output'];
|
||||
@ -1305,6 +1452,17 @@ export type SubscriptionsUpdateInput = {
|
||||
updatedAt?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
/** The input of the subscriptionSyncOne series of mutations */
|
||||
export type SyncOneSubscriptionFilterInput = {
|
||||
subscriptionId: Scalars['Int']['input'];
|
||||
};
|
||||
|
||||
/** The output of the subscriptionSyncOne series of mutations */
|
||||
export type SyncOneSubscriptionInfo = {
|
||||
__typename?: 'SyncOneSubscriptionInfo';
|
||||
taskId: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type TextFilterInput = {
|
||||
between?: InputMaybe<Array<Scalars['String']['input']>>;
|
||||
eq?: InputMaybe<Scalars['String']['input']>;
|
||||
@ -1349,7 +1507,7 @@ export type GetSubscriptionDetailQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type GetSubscriptionDetailQuery = { __typename?: 'Query', subscriptions: { __typename?: 'SubscriptionsConnection', nodes: Array<{ __typename?: 'Subscriptions', id: number, displayName: string, createdAt: string, updatedAt: string, category: SubscriptionCategoryEnum, sourceUrl: string, enabled: boolean, bangumi: { __typename?: 'BangumiConnection', nodes: Array<{ __typename?: 'Bangumi', createdAt: string, updatedAt: string, id: number, mikanBangumiId?: string | null, displayName: string, rawName: string, season: number, seasonRaw?: string | null, fansub?: string | null, mikanFansubId?: string | null, rssLink?: string | null, posterLink?: string | null, savePath?: string | null, deleted: boolean, homepage?: string | null }> } }> } };
|
||||
export type GetSubscriptionDetailQuery = { __typename?: 'Query', subscriptions: { __typename?: 'SubscriptionsConnection', nodes: Array<{ __typename?: 'Subscriptions', id: number, displayName: string, createdAt: string, updatedAt: string, category: SubscriptionCategoryEnum, sourceUrl: string, enabled: boolean, bangumi: { __typename?: 'BangumiConnection', nodes: Array<{ __typename?: 'Bangumi', createdAt: string, updatedAt: string, id: number, mikanBangumiId?: string | null, displayName: string, rawName: string, season: number, seasonRaw?: string | null, fansub?: string | null, mikanFansubId?: string | null, rssLink?: string | null, posterLink?: string | null, savePath?: string | null, homepage?: string | null }> } }> } };
|
||||
|
||||
export type CreateSubscriptionMutationVariables = Exact<{
|
||||
input: SubscriptionsInsertInput;
|
||||
@ -1362,5 +1520,5 @@ export type CreateSubscriptionMutation = { __typename?: 'Mutation', subscription
|
||||
export const GetSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"page"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PageInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsOrderInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"pagination"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"page"},"value":{"kind":"Variable","name":{"kind":"Name","value":"page"}}}]}},{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}},{"kind":"Argument","name":{"kind":"Name","value":"orderBy"},"value":{"kind":"Variable","name":{"kind":"Name","value":"orderBy"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}}]}},{"kind":"Field","name":{"kind":"Name","value":"paginationInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"total"}},{"kind":"Field","name":{"kind":"Name","value":"pages"}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionsQuery, GetSubscriptionsQueryVariables>;
|
||||
export const UpdateSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"data"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsUpdateInput"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsUpdate"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"data"}}},{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}}]}}]}}]} as unknown as DocumentNode<UpdateSubscriptionsMutation, UpdateSubscriptionsMutationVariables>;
|
||||
export const DeleteSubscriptionsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteSubscriptions"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"filters"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsFilterInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsDelete"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"Variable","name":{"kind":"Name","value":"filters"}}}]}]}}]} as unknown as DocumentNode<DeleteSubscriptionsMutation, DeleteSubscriptionsMutationVariables>;
|
||||
export const GetSubscriptionDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptionDetail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"bangumi"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"mikanBangumiId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"rawName"}},{"kind":"Field","name":{"kind":"Name","value":"season"}},{"kind":"Field","name":{"kind":"Name","value":"seasonRaw"}},{"kind":"Field","name":{"kind":"Name","value":"fansub"}},{"kind":"Field","name":{"kind":"Name","value":"mikanFansubId"}},{"kind":"Field","name":{"kind":"Name","value":"rssLink"}},{"kind":"Field","name":{"kind":"Name","value":"posterLink"}},{"kind":"Field","name":{"kind":"Name","value":"savePath"}},{"kind":"Field","name":{"kind":"Name","value":"deleted"}},{"kind":"Field","name":{"kind":"Name","value":"homepage"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionDetailQuery, GetSubscriptionDetailQueryVariables>;
|
||||
export const GetSubscriptionDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSubscriptionDetail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptions"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filters"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"id"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"eq"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}}]}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"bangumi"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"nodes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"mikanBangumiId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"rawName"}},{"kind":"Field","name":{"kind":"Name","value":"season"}},{"kind":"Field","name":{"kind":"Name","value":"seasonRaw"}},{"kind":"Field","name":{"kind":"Name","value":"fansub"}},{"kind":"Field","name":{"kind":"Name","value":"mikanFansubId"}},{"kind":"Field","name":{"kind":"Name","value":"rssLink"}},{"kind":"Field","name":{"kind":"Name","value":"posterLink"}},{"kind":"Field","name":{"kind":"Name","value":"savePath"}},{"kind":"Field","name":{"kind":"Name","value":"homepage"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetSubscriptionDetailQuery, GetSubscriptionDetailQueryVariables>;
|
||||
export const CreateSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateSubscription"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SubscriptionsInsertInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subscriptionsCreateOne"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"data"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"sourceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"category"}}]}}]}}]} as unknown as DocumentNode<CreateSubscriptionMutation, CreateSubscriptionMutationVariables>;
|
@ -35,8 +35,11 @@ qbit-rs = { git = "https://github.com/lonelyhentxi/qbit.git", rev = "72d53138ebe
|
||||
"builder",
|
||||
] }
|
||||
merge-struct = "0.1"
|
||||
librqbit-core = "4"
|
||||
librqbit = { version = "8", features = ["async-bt", "watch"] }
|
||||
librqbit-core = { git = "https://github.com/ikatson/rqbit.git", rev = "0936730" }
|
||||
librqbit = { git = "https://github.com/ikatson/rqbit.git", rev = "0936730", features = [
|
||||
"async-bt",
|
||||
"watch",
|
||||
] }
|
||||
|
||||
util = { workspace = true }
|
||||
testing-torrents = { workspace = true, optional = true }
|
||||
|
@ -128,6 +128,12 @@ impl DynamicGraphqlInfo {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<#enum_name> for String {
|
||||
fn from(value: #enum_name) -> Self {
|
||||
value.as_str().to_string()
|
||||
}
|
||||
}
|
||||
|
||||
impl std::str::FromStr for #enum_name {
|
||||
type Err = String;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user