diff --git a/.cargo/config.toml b/.cargo/config.toml old mode 100644 new mode 100755 diff --git a/.editorconfig b/.editorconfig old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.prettierignore b/.prettierignore old mode 100644 new mode 100755 diff --git a/.vscode/extensions.json b/.vscode/extensions.json old mode 100644 new mode 100755 diff --git a/.vscode/launch.json b/.vscode/launch.json old mode 100644 new mode 100755 diff --git a/.vscode/settings.json b/.vscode/settings.json old mode 100644 new mode 100755 diff --git a/Cargo.lock b/Cargo.lock old mode 100644 new mode 100755 index dda531b..9a50a16 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,16 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + [[package]] name = "addr2line" version = "0.24.2" @@ -165,6 +175,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "ascii_utils" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" + [[package]] name = "assert-json-diff" version = "2.0.2" @@ -191,6 +207,98 @@ dependencies = [ "zstd-safe", ] +[[package]] +name = "async-graphql" +version = "7.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fd6bd734afb8b6e4d0f84a3e77305ce0a7ccc60d70f6001cb5e1c3f38d8ff1" +dependencies = [ + "async-graphql-derive", + "async-graphql-parser", + "async-graphql-value", + "async-stream", + "async-trait", + "base64 0.22.1", + "bytes", + "fast_chemail", + "fnv", + "futures-timer", + "futures-util", + "handlebars", + "http 1.2.0", + "indexmap 2.7.0", + "mime", + "multer", + "num-traits", + "pin-project-lite", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "static_assertions_next", + "tempfile", + "thiserror 1.0.69", +] + +[[package]] +name = "async-graphql-axum" +version = "7.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8c1bb47161c37286e40e2fa58055e97b2a2b6cf1022a6686967e10636fa5d7" +dependencies = [ + "async-graphql", + "async-trait", + "axum", + "bytes", + "futures-util", + "serde_json", + "tokio", + "tokio-stream", + "tokio-util", + "tower-service", +] + +[[package]] +name = "async-graphql-derive" +version = "7.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac38b4dd452d529d6c0248b51df23603f0a875770352e26ae8c346ce6c149b3e" +dependencies = [ + "Inflector", + "async-graphql-parser", + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "strum", + "syn 2.0.92", + "thiserror 1.0.69", +] + +[[package]] +name = "async-graphql-parser" +version = "7.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d271ddda2f55b13970928abbcbc3423cfc18187c60e8769b48f21a93b7adaa" +dependencies = [ + "async-graphql-value", + "pest", + "serde", + "serde_json", +] + +[[package]] +name = "async-graphql-value" +version = "7.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aefe909173a037eaf3281b046dc22580b59a38b765d7b8d5116f2ffef098048d" +dependencies = [ + "bytes", + "indexmap 2.7.0", + "serde", + "serde_json", +] + [[package]] name = "async-stream" version = "0.3.6" @@ -282,6 +390,7 @@ dependencies = [ "async-trait", "axum-core", "axum-macros", + "base64 0.22.1", "bytes", "futures-util", "http 1.2.0", @@ -300,8 +409,10 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", + "sha1", "sync_wrapper", "tokio", + "tokio-tungstenite", "tower 0.5.2", "tower-layer", "tower-service", @@ -722,6 +833,9 @@ name = "bytes" version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +dependencies = [ + "serde", +] [[package]] name = "bytesize" @@ -1576,6 +1690,15 @@ dependencies = [ "regex-syntax 0.8.5", ] +[[package]] +name = "fast_chemail" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "495a39d30d624c2caabe6312bfead73e7717692b44e0b32df168c275a2e8e9e4" +dependencies = [ + "ascii_utils", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -1768,6 +1891,12 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + [[package]] name = "futures-util" version = "0.3.31" @@ -1904,6 +2033,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "handlebars" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -4369,6 +4512,8 @@ name = "recorder" version = "0.1.0" dependencies = [ "anyhow", + "async-graphql", + "async-graphql-axum", "async-trait", "axum", "axum-auth", @@ -5874,6 +6019,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "static_assertions_next" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7beae5182595e9a8b683fa98c4317f956c9a2dec3b9716990d20023cc60c766" + [[package]] name = "string_cache" version = "0.8.7" @@ -5945,6 +6096,22 @@ name = "strum" version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.92", +] [[package]] name = "subtle" @@ -6328,6 +6495,18 @@ dependencies = [ "xattr", ] +[[package]] +name = "tokio-tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + [[package]] name = "tokio-util" version = "0.7.13" @@ -6336,6 +6515,7 @@ checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -6559,6 +6739,24 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.2.0", + "httparse", + "log", + "rand", + "sha1", + "thiserror 1.0.69", + "utf-8", +] + [[package]] name = "typed-builder" version = "0.20.0" diff --git a/Cargo.toml b/Cargo.toml old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/apps/app/.env.development b/apps/app/.env.development old mode 100644 new mode 100755 diff --git a/apps/app/.env.example b/apps/app/.env.example old mode 100644 new mode 100755 diff --git a/apps/app/.gitignore b/apps/app/.gitignore old mode 100644 new mode 100755 diff --git a/apps/app/__tests__/sign-in.test.tsx b/apps/app/__tests__/sign-in.test.tsx old mode 100644 new mode 100755 diff --git a/apps/app/__tests__/sign-up.test.tsx b/apps/app/__tests__/sign-up.test.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(authenticated)/components/avatar-stack.tsx b/apps/app/app/(authenticated)/components/avatar-stack.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(authenticated)/components/collaboration-provider.tsx b/apps/app/app/(authenticated)/components/collaboration-provider.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(authenticated)/components/cursors.tsx b/apps/app/app/(authenticated)/components/cursors.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(authenticated)/components/header.tsx b/apps/app/app/(authenticated)/components/header.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(authenticated)/components/posthog-identifier.tsx b/apps/app/app/(authenticated)/components/posthog-identifier.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(authenticated)/components/sidebar.tsx b/apps/app/app/(authenticated)/components/sidebar.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(authenticated)/layout.tsx b/apps/app/app/(authenticated)/layout.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(authenticated)/page.tsx b/apps/app/app/(authenticated)/page.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(authenticated)/webhooks/page.tsx b/apps/app/app/(authenticated)/webhooks/page.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(unauthenticated)/layout.tsx b/apps/app/app/(unauthenticated)/layout.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(unauthenticated)/sign-in/[[...sign-in]]/page.tsx b/apps/app/app/(unauthenticated)/sign-in/[[...sign-in]]/page.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/(unauthenticated)/sign-up/[[...sign-up]]/page.tsx b/apps/app/app/(unauthenticated)/sign-up/[[...sign-up]]/page.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/.well-known/vercel/flags/route.ts b/apps/app/app/.well-known/vercel/flags/route.ts old mode 100644 new mode 100755 diff --git a/apps/app/app/actions/users/get.ts b/apps/app/app/actions/users/get.ts old mode 100644 new mode 100755 diff --git a/apps/app/app/actions/users/search.ts b/apps/app/app/actions/users/search.ts old mode 100644 new mode 100755 diff --git a/apps/app/app/api/collaboration/auth/route.ts b/apps/app/app/api/collaboration/auth/route.ts old mode 100644 new mode 100755 diff --git a/apps/app/app/apple-icon.png b/apps/app/app/apple-icon.png old mode 100644 new mode 100755 diff --git a/apps/app/app/cron/keep-alive/route.ts b/apps/app/app/cron/keep-alive/route.ts old mode 100644 new mode 100755 diff --git a/apps/app/app/global-error.tsx b/apps/app/app/global-error.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/health/route.ts b/apps/app/app/health/route.ts old mode 100644 new mode 100755 diff --git a/apps/app/app/icon.png b/apps/app/app/icon.png old mode 100644 new mode 100755 diff --git a/apps/app/app/layout.tsx b/apps/app/app/layout.tsx old mode 100644 new mode 100755 diff --git a/apps/app/app/opengraph-image.png b/apps/app/app/opengraph-image.png old mode 100644 new mode 100755 diff --git a/apps/app/instrumentation.ts b/apps/app/instrumentation.ts old mode 100644 new mode 100755 diff --git a/apps/app/liveblocks.config.ts b/apps/app/liveblocks.config.ts old mode 100644 new mode 100755 diff --git a/apps/app/middleware.ts b/apps/app/middleware.ts old mode 100644 new mode 100755 diff --git a/apps/app/next.config.ts b/apps/app/next.config.ts old mode 100644 new mode 100755 diff --git a/apps/app/package.json b/apps/app/package.json old mode 100644 new mode 100755 diff --git a/apps/app/postcss.config.mjs b/apps/app/postcss.config.mjs old mode 100644 new mode 100755 diff --git a/apps/app/sentry.client.config.ts b/apps/app/sentry.client.config.ts old mode 100644 new mode 100755 diff --git a/apps/app/tailwind.config.ts b/apps/app/tailwind.config.ts old mode 100644 new mode 100755 diff --git a/apps/app/tsconfig.json b/apps/app/tsconfig.json old mode 100644 new mode 100755 diff --git a/apps/app/vercel.json b/apps/app/vercel.json old mode 100644 new mode 100755 diff --git a/apps/app/vitest.config.ts b/apps/app/vitest.config.ts old mode 100644 new mode 100755 diff --git a/apps/docs/api-reference/endpoint/create.mdx b/apps/docs/api-reference/endpoint/create.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/api-reference/endpoint/delete.mdx b/apps/docs/api-reference/endpoint/delete.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/api-reference/endpoint/get.mdx b/apps/docs/api-reference/endpoint/get.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/api-reference/introduction.mdx b/apps/docs/api-reference/introduction.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/api-reference/openapi.json b/apps/docs/api-reference/openapi.json old mode 100644 new mode 100755 diff --git a/apps/docs/development.mdx b/apps/docs/development.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/essentials/code.mdx b/apps/docs/essentials/code.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/essentials/images.mdx b/apps/docs/essentials/images.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/essentials/markdown.mdx b/apps/docs/essentials/markdown.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/essentials/navigation.mdx b/apps/docs/essentials/navigation.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/essentials/reusable-snippets.mdx b/apps/docs/essentials/reusable-snippets.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/essentials/settings.mdx b/apps/docs/essentials/settings.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/favicon.svg b/apps/docs/favicon.svg old mode 100644 new mode 100755 diff --git a/apps/docs/images/checks-passed.png b/apps/docs/images/checks-passed.png old mode 100644 new mode 100755 diff --git a/apps/docs/images/hero-dark.svg b/apps/docs/images/hero-dark.svg old mode 100644 new mode 100755 diff --git a/apps/docs/images/hero-light.svg b/apps/docs/images/hero-light.svg old mode 100644 new mode 100755 diff --git a/apps/docs/introduction.mdx b/apps/docs/introduction.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/logo/dark.svg b/apps/docs/logo/dark.svg old mode 100644 new mode 100755 diff --git a/apps/docs/logo/light.svg b/apps/docs/logo/light.svg old mode 100644 new mode 100755 diff --git a/apps/docs/mint.json b/apps/docs/mint.json old mode 100644 new mode 100755 diff --git a/apps/docs/package.json b/apps/docs/package.json old mode 100644 new mode 100755 diff --git a/apps/docs/quickstart.mdx b/apps/docs/quickstart.mdx old mode 100644 new mode 100755 diff --git a/apps/docs/snippets/snippet-intro.mdx b/apps/docs/snippets/snippet-intro.mdx old mode 100644 new mode 100755 diff --git a/apps/email-playground/.gitignore b/apps/email-playground/.gitignore old mode 100644 new mode 100755 diff --git a/apps/email-playground/emails/contact.tsx b/apps/email-playground/emails/contact.tsx old mode 100644 new mode 100755 diff --git a/apps/email-playground/package.json b/apps/email-playground/package.json old mode 100644 new mode 100755 diff --git a/apps/email-playground/tsconfig.json b/apps/email-playground/tsconfig.json old mode 100644 new mode 100755 diff --git a/apps/proxy/.whistle/.gitignore b/apps/proxy/.whistle/.gitignore old mode 100644 new mode 100755 diff --git a/apps/proxy/.whistle/properties/properties b/apps/proxy/.whistle/properties/properties old mode 100644 new mode 100755 diff --git a/apps/proxy/.whistle/rules/files/0.webui b/apps/proxy/.whistle/rules/files/0.webui old mode 100644 new mode 100755 diff --git a/apps/proxy/.whistle/rules/files/2.recorder b/apps/proxy/.whistle/rules/files/2.recorder old mode 100644 new mode 100755 diff --git a/apps/proxy/.whistle/rules/properties b/apps/proxy/.whistle/rules/properties old mode 100644 new mode 100755 diff --git a/apps/proxy/.whistle/values/properties b/apps/proxy/.whistle/values/properties old mode 100644 new mode 100755 diff --git a/apps/proxy/package.json b/apps/proxy/package.json old mode 100644 new mode 100755 diff --git a/apps/recorder/.devcontainer/Dockerfile b/apps/recorder/.devcontainer/Dockerfile old mode 100644 new mode 100755 diff --git a/apps/recorder/.devcontainer/devcontainer.json b/apps/recorder/.devcontainer/devcontainer.json old mode 100644 new mode 100755 diff --git a/apps/recorder/.devcontainer/docker-compose.yml b/apps/recorder/.devcontainer/docker-compose.yml old mode 100644 new mode 100755 diff --git a/apps/recorder/.github/workflows/ci.yaml b/apps/recorder/.github/workflows/ci.yaml old mode 100644 new mode 100755 diff --git a/apps/recorder/.gitignore b/apps/recorder/.gitignore old mode 100644 new mode 100755 diff --git a/apps/recorder/Cargo.toml b/apps/recorder/Cargo.toml old mode 100644 new mode 100755 index a2eb6ce..b73a680 --- a/apps/recorder/Cargo.toml +++ b/apps/recorder/Cargo.toml @@ -44,7 +44,7 @@ axum = "0.7.9" uuid = { version = "1.6.0", features = ["v4"] } tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] } sea-orm-migration = { version = "1", features = ["runtime-tokio-rustls"] } -reqwest = "0.12.9" +reqwest = { version = "0.12.9" } thiserror = "2" rss = "2" bytes = "1.9" @@ -85,6 +85,8 @@ testcontainers-modules = { version = "0.11.4", optional = true } log = "0.4.22" anyhow = "1.0.95" bollard = { version = "0.18", optional = true } +async-graphql = "7.0.13" +async-graphql-axum = "7.0.13" [dev-dependencies] diff --git a/apps/recorder/examples/playground.rs b/apps/recorder/examples/playground.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/app.rs b/apps/recorder/src/app.rs old mode 100644 new mode 100755 index 88df8ba..974d8b6 --- a/apps/recorder/src/app.rs +++ b/apps/recorder/src/app.rs @@ -20,7 +20,7 @@ use crate::{ dal::{AppDalClient, AppDalInitalizer}, extract::mikan::{client::AppMikanClientInitializer, AppMikanClient}, migrations::Migrator, - models::entities::subscribers, + models::subscribers, workers::subscription_worker::SubscriptionWorker, }; diff --git a/apps/recorder/src/auth/basic.rs b/apps/recorder/src/auth/basic.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/auth/config.rs b/apps/recorder/src/auth/config.rs old mode 100644 new mode 100755 index 83ef12d..9382aa6 --- a/apps/recorder/src/auth/config.rs +++ b/apps/recorder/src/auth/config.rs @@ -24,7 +24,7 @@ pub struct OidcAuthConfig { } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[serde(tag = "type", rename_all = "snake_case")] +#[serde(tag = "auth_type", rename_all = "snake_case")] pub enum AppAuthConfig { Basic(BasicAuthConfig), Oidc(OidcAuthConfig), diff --git a/apps/recorder/src/auth/errors.rs b/apps/recorder/src/auth/errors.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/auth/mod.rs b/apps/recorder/src/auth/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/auth/oidc.rs b/apps/recorder/src/auth/oidc.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/auth/service.rs b/apps/recorder/src/auth/service.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/bin/main.rs b/apps/recorder/src/bin/main.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/config/mod.rs b/apps/recorder/src/config/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/config/settings_mixin.yaml b/apps/recorder/src/config/settings_mixin.yaml old mode 100644 new mode 100755 diff --git a/apps/recorder/src/controllers/bangumi.rs b/apps/recorder/src/controllers/bangumi.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/controllers/episodes.rs b/apps/recorder/src/controllers/episodes.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/controllers/mod.rs b/apps/recorder/src/controllers/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/controllers/subscribers.rs b/apps/recorder/src/controllers/subscribers.rs old mode 100644 new mode 100755 index 2dbddbb..f4e3484 --- a/apps/recorder/src/controllers/subscribers.rs +++ b/apps/recorder/src/controllers/subscribers.rs @@ -1,6 +1,6 @@ use loco_rs::prelude::*; -use crate::{models::entities::subscribers, views::subscribers::CurrentResponse}; +use crate::{models::subscribers, views::subscribers::CurrentResponse}; async fn current(State(ctx): State) -> Result { let subscriber = subscribers::Model::find_root(&ctx).await?; diff --git a/apps/recorder/src/controllers/subscriptions.rs b/apps/recorder/src/controllers/subscriptions.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/dal/client.rs b/apps/recorder/src/dal/client.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/dal/config.rs b/apps/recorder/src/dal/config.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/dal/mod.rs b/apps/recorder/src/dal/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/defs.rs b/apps/recorder/src/extract/defs.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/errors.rs b/apps/recorder/src/extract/errors.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/html/mod.rs b/apps/recorder/src/extract/html/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/html/styles.rs b/apps/recorder/src/extract/html/styles.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/mikan/client.rs b/apps/recorder/src/extract/mikan/client.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/mikan/config.rs b/apps/recorder/src/extract/mikan/config.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/mikan/constants.rs b/apps/recorder/src/extract/mikan/constants.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/mikan/mod.rs b/apps/recorder/src/extract/mikan/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/mikan/rss_parser.rs b/apps/recorder/src/extract/mikan/rss_parser.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/mikan/web_parser.rs b/apps/recorder/src/extract/mikan/web_parser.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/mod.rs b/apps/recorder/src/extract/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/rawname/mod.rs b/apps/recorder/src/extract/rawname/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/rawname/parser.rs b/apps/recorder/src/extract/rawname/parser.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/torrent/mod.rs b/apps/recorder/src/extract/torrent/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/extract/torrent/parser.rs b/apps/recorder/src/extract/torrent/parser.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/fetch/bytes.rs b/apps/recorder/src/fetch/bytes.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/fetch/client.rs b/apps/recorder/src/fetch/client.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/fetch/core.rs b/apps/recorder/src/fetch/core.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/fetch/html.rs b/apps/recorder/src/fetch/html.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/fetch/image.rs b/apps/recorder/src/fetch/image.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/fetch/mod.rs b/apps/recorder/src/fetch/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/lib.rs b/apps/recorder/src/lib.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/migrations/defs.rs b/apps/recorder/src/migrations/defs.rs old mode 100644 new mode 100755 index 29db28a..6f0c025 --- a/apps/recorder/src/migrations/defs.rs +++ b/apps/recorder/src/migrations/defs.rs @@ -38,7 +38,6 @@ pub enum Bangumi { Id, MikanBangumiId, DisplayName, - SubscriptionId, SubscriberId, RawName, Season, @@ -54,6 +53,14 @@ pub enum Bangumi { Extra, } +#[derive(DeriveIden)] +pub enum SubscriptionBangumi { + Table, + Id, + SubscriptionId, + BangumiId, +} + #[derive(DeriveIden)] pub enum Episodes { Table, @@ -62,7 +69,6 @@ pub enum Episodes { RawName, DisplayName, BangumiId, - SubscriptionId, SubscriberId, DownloadId, SavePath, @@ -79,13 +85,23 @@ pub enum Episodes { Extra, } +#[derive(DeriveIden)] +pub enum SubscriptionEpisode { + Table, + Id, + SubscriptionId, + EpisodeId, +} + #[derive(DeriveIden)] pub enum Downloads { Table, Id, - OriginalName, + RawName, DisplayName, - SubscriptionId, + SubscriberId, + DownloaderId, + EpisodeId, Status, CurrSize, AllSize, diff --git a/apps/recorder/src/migrations/m20220101_000001_init.rs b/apps/recorder/src/migrations/m20220101_000001_init.rs old mode 100644 new mode 100755 index a221e85..eb9ab52 --- a/apps/recorder/src/migrations/m20220101_000001_init.rs +++ b/apps/recorder/src/migrations/m20220101_000001_init.rs @@ -2,7 +2,8 @@ use loco_rs::schema::jsonb_null; use sea_orm_migration::{prelude::*, schema::*}; use super::defs::{ - Bangumi, CustomSchemaManagerExt, Episodes, GeneralIds, Subscribers, Subscriptions, + Bangumi, CustomSchemaManagerExt, Episodes, GeneralIds, Subscribers, SubscriptionBangumi, + SubscriptionEpisode, Subscriptions, }; use crate::models::{ subscribers::SEED_SUBSCRIBER, @@ -37,12 +38,15 @@ impl MigrationTrait for Migration { ) .await?; - let insert = Query::insert() - .into_table(Subscribers::Table) - .columns([Subscribers::Pid, Subscribers::DisplayName]) - .values_panic([SEED_SUBSCRIBER.into(), SEED_SUBSCRIBER.into()]) - .to_owned(); - manager.exec_stmt(insert).await?; + manager + .exec_stmt( + Query::insert() + .into_table(Subscribers::Table) + .columns([Subscribers::Pid, Subscribers::DisplayName]) + .values_panic([SEED_SUBSCRIBER.into(), SEED_SUBSCRIBER.into()]) + .to_owned(), + ) + .await?; create_postgres_enum_for_active_enum!( manager, @@ -70,7 +74,7 @@ impl MigrationTrait for Migration { .name("fk_subscriptions_subscriber_id") .from(Subscriptions::Table, Subscriptions::SubscriberId) .to(Subscribers::Table, Subscribers::Id) - .on_update(ForeignKeyAction::Restrict) + .on_update(ForeignKeyAction::Cascade) .on_delete(ForeignKeyAction::Cascade), ) .to_owned(), @@ -89,7 +93,6 @@ impl MigrationTrait for Migration { table_auto(Bangumi::Table) .col(pk_auto(Bangumi::Id)) .col(text_null(Bangumi::MikanBangumiId)) - .col(integer(Bangumi::SubscriptionId)) .col(integer(Bangumi::SubscriberId)) .col(text(Bangumi::DisplayName)) .col(text(Bangumi::RawName)) @@ -104,22 +107,24 @@ impl MigrationTrait for Migration { .col(boolean(Bangumi::Deleted).default(false)) .col(text_null(Bangumi::Homepage)) .col(jsonb_null(Bangumi::Extra)) - .foreign_key( - ForeignKey::create() - .name("fk_bangumi_subscription_id") - .from(Bangumi::Table, Bangumi::SubscriptionId) - .to(Subscriptions::Table, Subscriptions::Id) - .on_update(ForeignKeyAction::Restrict) - .on_delete(ForeignKeyAction::Cascade), - ) .foreign_key( ForeignKey::create() .name("fk_bangumi_subscriber_id") .from(Bangumi::Table, Bangumi::SubscriberId) .to(Subscribers::Table, Subscribers::Id) - .on_update(ForeignKeyAction::Restrict) + .on_update(ForeignKeyAction::Cascade) .on_delete(ForeignKeyAction::Cascade), ) + .index( + Index::create() + .if_not_exists() + .name("idx_bangumi_mikan_bangumi_id_mikan_fansub_id_subscriber_id") + .table(Bangumi::Table) + .col(Bangumi::MikanBangumiId) + .col(Bangumi::MikanFansubId) + .col(Bangumi::SubscriberId) + .unique(), + ) .to_owned(), ) .await?; @@ -150,6 +155,44 @@ impl MigrationTrait for Migration { .create_postgres_auto_update_ts_trigger_for_col(Bangumi::Table, GeneralIds::UpdatedAt) .await?; + manager + .create_table( + table_auto(SubscriptionBangumi::Table) + .col(pk_auto(SubscriptionBangumi::Id)) + .col(integer(SubscriptionBangumi::SubscriptionId)) + .col(integer(SubscriptionBangumi::BangumiId)) + .foreign_key( + ForeignKey::create() + .name("fk_subscription_bangumi_subscription_id") + .from( + SubscriptionBangumi::Table, + SubscriptionBangumi::SubscriptionId, + ) + .to(Subscriptions::Table, Subscriptions::Id) + .on_update(ForeignKeyAction::Cascade) + .on_delete(ForeignKeyAction::Cascade), + ) + .foreign_key( + ForeignKey::create() + .name("fk_subscription_bangumi_bangumi_id") + .from(SubscriptionBangumi::Table, SubscriptionBangumi::BangumiId) + .to(Bangumi::Table, Bangumi::Id) + .on_update(ForeignKeyAction::Cascade) + .on_delete(ForeignKeyAction::Cascade), + ) + .index( + Index::create() + .if_not_exists() + .name("constraint_subscription_bangumi_subscription_id_bangumi_id") + .table(SubscriptionBangumi::Table) + .col(SubscriptionBangumi::SubscriptionId) + .col(SubscriptionBangumi::BangumiId) + .unique(), + ) + .to_owned(), + ) + .await?; + manager .create_table( table_auto(Episodes::Table) @@ -158,7 +201,6 @@ impl MigrationTrait for Migration { .col(text(Episodes::RawName)) .col(text(Episodes::DisplayName)) .col(integer(Episodes::BangumiId)) - .col(integer(Episodes::SubscriptionId)) .col(integer(Episodes::SubscriberId)) .col(text_null(Episodes::SavePath)) .col(text_null(Episodes::Resolution)) @@ -172,20 +214,12 @@ impl MigrationTrait for Migration { .col(boolean(Episodes::Deleted).default(false)) .col(text_null(Episodes::Source)) .col(jsonb_null(Episodes::Extra)) - .foreign_key( - ForeignKey::create() - .name("fk_episodes_subscription_id") - .from(Episodes::Table, Episodes::SubscriptionId) - .to(Subscriptions::Table, Subscriptions::Id) - .on_update(ForeignKeyAction::Restrict) - .on_delete(ForeignKeyAction::Cascade), - ) .foreign_key( ForeignKey::create() .name("fk_episodes_bangumi_id") .from(Episodes::Table, Episodes::BangumiId) .to(Bangumi::Table, Bangumi::Id) - .on_update(ForeignKeyAction::Restrict) + .on_update(ForeignKeyAction::Cascade) .on_delete(ForeignKeyAction::Cascade), ) .foreign_key( @@ -193,7 +227,7 @@ impl MigrationTrait for Migration { .name("fk_episodes_subscriber_id") .from(Episodes::Table, Episodes::SubscriberId) .to(Subscribers::Table, Subscribers::Id) - .on_update(ForeignKeyAction::Restrict) + .on_update(ForeignKeyAction::Cascade) .on_delete(ForeignKeyAction::Cascade), ) .to_owned(), @@ -228,12 +262,50 @@ impl MigrationTrait for Migration { .create_postgres_auto_update_ts_trigger_for_col(Episodes::Table, GeneralIds::UpdatedAt) .await?; + manager + .create_table( + table_auto(SubscriptionEpisode::Table) + .col(pk_auto(SubscriptionEpisode::Id)) + .col(integer(SubscriptionEpisode::SubscriptionId)) + .col(integer(SubscriptionEpisode::EpisodeId)) + .foreign_key( + ForeignKey::create() + .name("fk_subscription_episode_subscription_id") + .from( + SubscriptionEpisode::Table, + SubscriptionEpisode::SubscriptionId, + ) + .to(Subscriptions::Table, Subscriptions::Id) + .on_update(ForeignKeyAction::Cascade) + .on_delete(ForeignKeyAction::Cascade), + ) + .foreign_key( + ForeignKey::create() + .name("fk_subscription_episode_episode_id") + .from(SubscriptionEpisode::Table, SubscriptionEpisode::EpisodeId) + .to(Episodes::Table, Episodes::Id) + .on_update(ForeignKeyAction::Cascade) + .on_delete(ForeignKeyAction::Cascade), + ) + .index( + Index::create() + .if_not_exists() + .name("constraint_subscription_episode_subscription_id_episode_id") + .table(SubscriptionEpisode::Table) + .col(SubscriptionEpisode::SubscriptionId) + .col(SubscriptionEpisode::EpisodeId) + .unique(), + ) + .to_owned(), + ) + .await?; + Ok(()) } async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { manager - .drop_table(Table::drop().table(Episodes::Table).to_owned()) + .drop_table(Table::drop().table(SubscriptionEpisode::Table).to_owned()) .await?; manager @@ -241,7 +313,11 @@ impl MigrationTrait for Migration { .await?; manager - .drop_table(Table::drop().table(Bangumi::Table).to_owned()) + .drop_table(Table::drop().table(Episodes::Table).to_owned()) + .await?; + + manager + .drop_table(Table::drop().table(SubscriptionBangumi::Table).to_owned()) .await?; manager @@ -249,7 +325,7 @@ impl MigrationTrait for Migration { .await?; manager - .drop_table(Table::drop().table(Subscriptions::Table).to_owned()) + .drop_table(Table::drop().table(Bangumi::Table).to_owned()) .await?; manager @@ -260,7 +336,7 @@ impl MigrationTrait for Migration { .await?; manager - .drop_table(Table::drop().table(Subscribers::Table).to_owned()) + .drop_table(Table::drop().table(Subscriptions::Table).to_owned()) .await?; manager @@ -268,17 +344,21 @@ impl MigrationTrait for Migration { .await?; manager - .drop_postgres_enum_for_active_enum(subscriptions::SubscriptionCategoryEnum) + .drop_table(Table::drop().table(Subscribers::Table).to_owned()) .await?; manager - .drop_postgres_auto_update_ts_fn_for_col(GeneralIds::UpdatedAt) + .drop_postgres_enum_for_active_enum(subscriptions::SubscriptionCategoryEnum) .await?; manager .drop_postgres_enum_for_active_enum(SubscriptionCategoryEnum) .await?; + manager + .drop_postgres_auto_update_ts_fn_for_col(GeneralIds::UpdatedAt) + .await?; + Ok(()) } } diff --git a/apps/recorder/src/migrations/m20240224_082543_add_downloads.rs b/apps/recorder/src/migrations/m20240224_082543_add_downloads.rs old mode 100644 new mode 100755 index 2f39eba..74781cb --- a/apps/recorder/src/migrations/m20240224_082543_add_downloads.rs +++ b/apps/recorder/src/migrations/m20240224_082543_add_downloads.rs @@ -2,9 +2,12 @@ use loco_rs::schema::table_auto; use sea_orm_migration::{prelude::*, schema::*}; use super::defs::*; -use crate::models::prelude::{ - downloads::{DownloadMimeEnum, DownloadStatusEnum}, - DownloadMime, DownloadStatus, +use crate::models::{ + downloaders::DownloaderCategoryEnum, + prelude::{ + downloads::{DownloadMimeEnum, DownloadStatusEnum}, + DownloadMime, DownloadStatus, DownloaderCategory, + }, }; #[derive(DeriveMigrationName)] @@ -13,6 +16,48 @@ pub struct Migration; #[async_trait::async_trait] impl MigrationTrait for Migration { async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { + create_postgres_enum_for_active_enum!( + manager, + DownloaderCategoryEnum, + DownloaderCategory::QBittorrent + ) + .await?; + + manager + .create_table( + table_auto(Downloaders::Table) + .col(pk_auto(Downloaders::Id)) + .col(text(Downloaders::Endpoint)) + .col(string_null(Downloaders::Username)) + .col(string_null(Downloaders::Password)) + .col(enumeration( + Downloaders::Category, + DownloaderCategoryEnum, + DownloaderCategory::iden_values(), + )) + .col(text(Downloaders::SavePath)) + .col(integer(Downloaders::SubscriberId)) + .foreign_key( + ForeignKey::create() + .name("fk_downloader_subscriber_id") + .from_tbl(Downloaders::Table) + .from_col(Downloaders::SubscriberId) + .to_tbl(Subscribers::Table) + .to_col(Subscribers::Id) + .on_delete(ForeignKeyAction::Cascade) + .on_update(ForeignKeyAction::Cascade), + ) + .to_owned(), + ) + .await?; + + manager + .create_postgres_auto_update_ts_trigger_for_col( + Downloaders::Table, + GeneralIds::UpdatedAt, + ) + .await?; + create_postgres_enum_for_active_enum!( manager, DownloadMimeEnum, @@ -37,9 +82,11 @@ impl MigrationTrait for Migration { .create_table( table_auto(Downloads::Table) .col(pk_auto(Downloads::Id)) - .col(string(Downloads::OriginalName)) + .col(string(Downloads::RawName)) .col(string(Downloads::DisplayName)) - .col(integer(Downloads::SubscriptionId)) + .col(integer(Downloads::SubscriberId)) + .col(integer(Downloads::DownloaderId)) + .col(integer(Downloads::EpisodeId)) .col(enumeration( Downloads::Status, DownloadStatusEnum, @@ -57,16 +104,42 @@ impl MigrationTrait for Migration { .col(text_null(Downloads::SavePath)) .foreign_key( ForeignKey::create() - .name("fk_downloads_subscription_id") - .from(Downloads::Table, Downloads::SubscriptionId) - .to(Subscriptions::Table, Subscriptions::Id) - .on_update(ForeignKeyAction::Restrict) - .on_delete(ForeignKeyAction::Cascade), + .name("fk_downloads_subscriber_id") + .from_tbl(Downloads::Table) + .from_col(Downloads::SubscriberId) + .to_tbl(Subscribers::Table) + .to_col(Subscribers::Id) + .on_delete(ForeignKeyAction::Cascade) + .on_update(ForeignKeyAction::Cascade), + ) + .foreign_key( + ForeignKey::create() + .name("fk_downloads_downloader_id") + .from_tbl(Downloads::Table) + .from_col(Downloads::DownloaderId) + .to_tbl(Downloaders::Table) + .to_col(Downloaders::Id) + .on_delete(ForeignKeyAction::Cascade) + .on_update(ForeignKeyAction::Cascade), + ) + .foreign_key( + ForeignKey::create() + .name("fk_downloads_episode_id") + .from_tbl(Downloads::Table) + .from_col(Downloads::EpisodeId) + .to_tbl(Episodes::Table) + .to_col(Episodes::Id) + .on_delete(ForeignKeyAction::Cascade) + .on_update(ForeignKeyAction::Cascade), ) .to_owned(), ) .await?; + manager + .create_postgres_auto_update_ts_trigger_for_col(Downloads::Table, GeneralIds::UpdatedAt) + .await?; + manager .create_index( Index::create() @@ -78,37 +151,12 @@ impl MigrationTrait for Migration { ) .await?; - manager - .alter_table( - Table::alter() - .table(Episodes::Table) - .add_column_if_not_exists(integer_null(Episodes::DownloadId)) - .add_foreign_key( - TableForeignKey::new() - .name("fk_episodes_download_id") - .from_tbl(Episodes::Table) - .from_col(Episodes::DownloadId) - .to_tbl(Downloads::Table) - .to_col(Downloads::Id) - .on_update(ForeignKeyAction::Restrict) - .on_delete(ForeignKeyAction::SetNull), - ) - .to_owned(), - ) - .await?; - Ok(()) } async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { manager - .alter_table( - Table::alter() - .table(Episodes::Table) - .drop_foreign_key(Alias::new("fk_episodes_download_id")) - .drop_column(Episodes::DownloadId) - .to_owned(), - ) + .drop_postgres_auto_update_ts_trigger_for_col(Downloads::Table, GeneralIds::UpdatedAt) .await?; manager @@ -123,6 +171,18 @@ impl MigrationTrait for Migration { .drop_postgres_enum_for_active_enum(DownloadStatusEnum) .await?; + manager + .drop_postgres_auto_update_ts_trigger_for_col(Downloaders::Table, GeneralIds::UpdatedAt) + .await?; + + manager + .drop_table(Table::drop().table(Downloaders::Table).to_owned()) + .await?; + + manager + .drop_postgres_enum_for_active_enum(DownloaderCategoryEnum) + .await?; + Ok(()) } } diff --git a/apps/recorder/src/migrations/m20240225_060853_subscriber_add_downloader.rs b/apps/recorder/src/migrations/m20240225_060853_subscriber_add_downloader.rs deleted file mode 100644 index 47df3a8..0000000 --- a/apps/recorder/src/migrations/m20240225_060853_subscriber_add_downloader.rs +++ /dev/null @@ -1,102 +0,0 @@ -use sea_orm_migration::{prelude::*, schema::*}; - -use crate::{ - migrations::defs::{CustomSchemaManagerExt, Downloaders, GeneralIds, Subscribers}, - models::{downloaders::DownloaderCategoryEnum, prelude::DownloaderCategory}, -}; - -#[derive(DeriveMigrationName)] -pub struct Migration; - -#[async_trait::async_trait] -impl MigrationTrait for Migration { - async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { - create_postgres_enum_for_active_enum!( - manager, - DownloaderCategoryEnum, - DownloaderCategory::QBittorrent - ) - .await?; - - manager - .create_table( - table_auto(Downloaders::Table) - .col(pk_auto(Downloaders::Id)) - .col(text(Downloaders::Endpoint)) - .col(string_null(Downloaders::Username)) - .col(string_null(Downloaders::Password)) - .col(enumeration( - Downloaders::Category, - DownloaderCategoryEnum, - DownloaderCategory::iden_values(), - )) - .col(text(Downloaders::SavePath)) - .col(integer(Downloaders::SubscriberId)) - .foreign_key( - ForeignKey::create() - .name("fk_downloader_subscriber_id") - .from_tbl(Downloaders::Table) - .from_col(Downloaders::SubscriberId) - .to_tbl(Subscribers::Table) - .to_col(Subscribers::Id) - .on_delete(ForeignKeyAction::Cascade) - .on_update(ForeignKeyAction::Restrict), - ) - .to_owned(), - ) - .await?; - - manager - .create_postgres_auto_update_ts_trigger_for_col( - Downloaders::Table, - GeneralIds::UpdatedAt, - ) - .await?; - - manager - .alter_table( - Table::alter() - .table(Subscribers::Table) - .add_column_if_not_exists(integer_null(Subscribers::DownloaderId)) - .add_foreign_key( - TableForeignKey::new() - .name("fk_subscribers_downloader_id") - .from_tbl(Subscribers::Table) - .from_col(Subscribers::DownloaderId) - .to_tbl(Downloaders::Table) - .to_col(Downloaders::Id) - .on_delete(ForeignKeyAction::SetNull) - .on_update(ForeignKeyAction::Restrict), - ) - .to_owned(), - ) - .await?; - Ok(()) - } - - async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { - manager - .alter_table( - Table::alter() - .table(Subscribers::Table) - .drop_foreign_key(Alias::new("fk_subscribers_downloader_id")) - .drop_column(Subscribers::DownloaderId) - .to_owned(), - ) - .await?; - - manager - .drop_postgres_auto_update_ts_trigger_for_col(Downloaders::Table, GeneralIds::UpdatedAt) - .await?; - - manager - .drop_table(Table::drop().table(Downloaders::Table).to_owned()) - .await?; - - manager - .drop_postgres_enum_for_active_enum(DownloaderCategoryEnum) - .await?; - - Ok(()) - } -} diff --git a/apps/recorder/src/migrations/m20241231_000001_auth.rs b/apps/recorder/src/migrations/m20241231_000001_auth.rs old mode 100644 new mode 100755 index 660e8ce..4cf90b7 --- a/apps/recorder/src/migrations/m20241231_000001_auth.rs +++ b/apps/recorder/src/migrations/m20241231_000001_auth.rs @@ -3,7 +3,10 @@ use sea_orm_migration::{prelude::*, schema::*}; use super::defs::Auth; use crate::{ migrations::defs::{CustomSchemaManagerExt, GeneralIds, Subscribers}, - models::auth::{AuthType, AuthTypeEnum}, + models::{ + auth::{AuthType, AuthTypeEnum}, + subscribers::SEED_SUBSCRIBER, + }, }; #[derive(DeriveMigrationName)] @@ -40,7 +43,7 @@ impl MigrationTrait for Migration { .to_tbl(Subscribers::Table) .to_col(Subscribers::Id) .on_delete(ForeignKeyAction::Cascade) - .on_update(ForeignKeyAction::Restrict), + .on_update(ForeignKeyAction::Cascade), ) .to_owned(), ) @@ -62,6 +65,20 @@ impl MigrationTrait for Migration { .create_postgres_auto_update_ts_trigger_for_col(Auth::Table, GeneralIds::UpdatedAt) .await?; + manager + .exec_stmt( + Query::insert() + .into_table(Auth::Table) + .columns([Auth::Pid, Auth::AuthType, Auth::SubscriberId]) + .values_panic([ + SEED_SUBSCRIBER.into(), + SimpleExpr::from(AuthType::Basic).as_enum(AuthTypeEnum), + 1.into(), + ]) + .to_owned(), + ) + .await?; + Ok(()) } diff --git a/apps/recorder/src/migrations/mod.rs b/apps/recorder/src/migrations/mod.rs old mode 100644 new mode 100755 index 5a84f45..cc9850f --- a/apps/recorder/src/migrations/mod.rs +++ b/apps/recorder/src/migrations/mod.rs @@ -4,7 +4,6 @@ pub use sea_orm_migration::prelude::*; pub mod defs; pub mod m20220101_000001_init; pub mod m20240224_082543_add_downloads; -pub mod m20240225_060853_subscriber_add_downloader; pub mod m20241231_000001_auth; pub struct Migrator; @@ -15,7 +14,6 @@ impl MigratorTrait for Migrator { vec![ Box::new(m20220101_000001_init::Migration), Box::new(m20240224_082543_add_downloads::Migration), - Box::new(m20240225_060853_subscriber_add_downloader::Migration), Box::new(m20241231_000001_auth::Migration), ] } diff --git a/apps/recorder/src/models/auth.rs b/apps/recorder/src/models/auth.rs old mode 100644 new mode 100755 index 9d7edb5..db3e6bc --- a/apps/recorder/src/models/auth.rs +++ b/apps/recorder/src/models/auth.rs @@ -1,6 +1,54 @@ use sea_orm::entity::prelude::*; +use serde::{Deserialize, Serialize}; -pub use super::entities::auth::*; +#[derive( + Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, DeriveDisplay, Serialize, Deserialize, +)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "auth_type")] +#[serde(rename_all = "snake_case")] +pub enum AuthType { + #[sea_orm(string_value = "basic")] + Basic, + #[sea_orm(string_value = "oidc")] + Oidc, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, DeriveEntityModel)] +#[sea_orm(table_name = "auth")] +pub struct Model { + pub created_at: DateTime, + pub updated_at: DateTime, + #[sea_orm(primary_key)] + pub id: i32, + pub pid: String, + pub subscriber_id: i32, + pub auth_type: AuthType, + pub avatar_url: Option, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::subscribers::Entity", + from = "Column::SubscriberId", + to = "super::subscribers::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + SubscriberId, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::SubscriberId.def() + } +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelatedEntity)] +pub enum RelatedEntity { + #[sea_orm(entity = "super::subscribers::Entity")] + Subscriber, +} #[async_trait::async_trait] impl ActiveModelBehavior for ActiveModel {} diff --git a/apps/recorder/src/models/bangumi.rs b/apps/recorder/src/models/bangumi.rs old mode 100644 new mode 100755 index 6583f85..3233317 --- a/apps/recorder/src/models/bangumi.rs +++ b/apps/recorder/src/models/bangumi.rs @@ -1,7 +1,87 @@ use loco_rs::app::AppContext; -use sea_orm::{entity::prelude::*, ActiveValue, TryIntoModel}; +use sea_orm::{entity::prelude::*, sea_query::OnConflict, ActiveValue, FromJsonQueryResult}; +use serde::{Deserialize, Serialize}; -pub use super::entities::bangumi::*; +use super::subscription_bangumi; + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)] +pub struct BangumiFilter { + pub name: Option>, + pub group: Option>, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)] +pub struct BangumiExtra { + pub name_zh: Option, + pub s_name_zh: Option, + pub name_en: Option, + pub s_name_en: Option, + pub name_jp: Option, + pub s_name_jp: Option, +} + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] +#[sea_orm(table_name = "bangumi")] +pub struct Model { + pub created_at: DateTime, + pub updated_at: DateTime, + #[sea_orm(primary_key)] + pub id: i32, + pub mikan_bangumi_id: Option, + pub subscriber_id: i32, + pub display_name: String, + pub raw_name: String, + pub season: i32, + pub season_raw: Option, + pub fansub: Option, + pub mikan_fansub_id: Option, + pub filter: Option, + pub rss_link: Option, + pub poster_link: Option, + pub save_path: Option, + #[sea_orm(default = "false")] + pub deleted: bool, + pub homepage: Option, + pub extra: Option, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm(has_many = "super::subscriptions::Entity")] + Subscription, + #[sea_orm( + belongs_to = "super::subscribers::Entity", + from = "Column::SubscriberId", + to = "super::subscribers::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Subscriber, + #[sea_orm(has_many = "super::episodes::Entity")] + Episode, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Episode.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + super::subscription_bangumi::Relation::Subscription.def() + } + + fn via() -> Option { + Some(super::subscription_bangumi::Relation::Bangumi.def().rev()) + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Subscriber.def() + } +} impl Model { pub async fn get_or_insert_from_mikan( @@ -30,12 +110,37 @@ impl Model { let mut bgm = ActiveModel { mikan_bangumi_id: ActiveValue::Set(Some(mikan_bangumi_id)), mikan_fansub_id: ActiveValue::Set(Some(mikan_fansub_id)), - subscription_id: ActiveValue::Set(subscription_id), subscriber_id: ActiveValue::Set(subscriber_id), ..Default::default() }; f(&mut bgm).await?; - let bgm: Model = bgm.save(db).await?.try_into_model()?; + let bgm = Entity::insert(bgm) + .on_conflict( + OnConflict::columns([ + Column::MikanBangumiId, + Column::MikanFansubId, + Column::SubscriberId, + ]) + .update_columns([ + Column::RawName, + Column::Extra, + Column::Fansub, + Column::PosterLink, + Column::Season, + Column::SeasonRaw, + ]) + .to_owned(), + ) + .exec_with_returning(db) + .await?; + subscription_bangumi::Entity::insert(subscription_bangumi::ActiveModel { + subscription_id: ActiveValue::Set(subscription_id), + bangumi_id: ActiveValue::Set(bgm.id), + ..Default::default() + }) + .on_conflict_do_nothing() + .exec(db) + .await?; Ok(bgm) } } diff --git a/apps/recorder/src/models/downloaders.rs b/apps/recorder/src/models/downloaders.rs old mode 100644 new mode 100755 index 5fc35aa..101cdde --- a/apps/recorder/src/models/downloaders.rs +++ b/apps/recorder/src/models/downloaders.rs @@ -1,7 +1,59 @@ -use sea_orm::prelude::*; +use sea_orm::entity::prelude::*; +use serde::{Deserialize, Serialize}; use url::Url; -pub use crate::models::entities::downloaders::*; +#[derive( + Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, DeriveDisplay, Serialize, Deserialize, +)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "downloader_type")] +#[serde(rename_all = "snake_case")] +pub enum DownloaderCategory { + #[sea_orm(string_value = "qbittorrent")] + QBittorrent, +} + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] +#[sea_orm(table_name = "downloaders")] +pub struct Model { + #[sea_orm(column_type = "Timestamp")] + pub created_at: DateTime, + #[sea_orm(column_type = "Timestamp")] + pub updated_at: DateTime, + #[sea_orm(primary_key)] + pub id: i32, + pub category: DownloaderCategory, + pub endpoint: String, + pub password: String, + pub username: String, + pub subscriber_id: i32, + pub save_path: String, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::subscribers::Entity", + from = "Column::SubscriberId", + to = "super::subscribers::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Subscriber, + #[sea_orm(has_many = "super::downloads::Entity")] + Download, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Subscriber.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Download.def() + } +} #[async_trait::async_trait] impl ActiveModelBehavior for ActiveModel {} @@ -10,6 +62,7 @@ impl Model { pub fn get_endpoint(&self) -> String { self.endpoint.clone() } + pub fn endpoint_url(&self) -> Result { let url = Url::parse(&self.endpoint)?; Ok(url) diff --git a/apps/recorder/src/models/downloads.rs b/apps/recorder/src/models/downloads.rs old mode 100644 new mode 100755 index b7ccfa6..162ae3e --- a/apps/recorder/src/models/downloads.rs +++ b/apps/recorder/src/models/downloads.rs @@ -1,27 +1,107 @@ -use sea_orm::{prelude::*, ActiveValue}; +use sea_orm::entity::prelude::*; +use serde::{Deserialize, Serialize}; -use crate::extract::mikan::MikanRssItem; -pub use crate::models::entities::downloads::*; +#[derive( + Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, DeriveDisplay, Serialize, Deserialize, +)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "download_status")] +#[serde(rename_all = "snake_case")] +pub enum DownloadStatus { + #[sea_orm(string_value = "pending")] + Pending, + #[sea_orm(string_value = "downloading")] + Downloading, + #[sea_orm(string_value = "paused")] + Paused, + #[sea_orm(string_value = "completed")] + Completed, + #[sea_orm(string_value = "failed")] + Failed, + #[sea_orm(string_value = "deleted")] + Deleted, +} + +#[derive( + Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, DeriveDisplay, Serialize, Deserialize, +)] +#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "download_mime")] +pub enum DownloadMime { + #[sea_orm(string_value = "application/octet-stream")] + #[serde(rename = "application/octet-stream")] + OctetStream, + #[sea_orm(string_value = "application/x-bittorrent")] + #[serde(rename = "application/x-bittorrent")] + BitTorrent, +} + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] +#[sea_orm(table_name = "downloads")] +pub struct Model { + pub created_at: DateTime, + pub updated_at: DateTime, + #[sea_orm(primary_key)] + pub id: i32, + pub raw_name: String, + pub display_name: String, + pub downloader_id: i32, + pub episode_id: i32, + pub subscriber_id: i32, + pub status: DownloadStatus, + pub mime: DownloadMime, + pub url: String, + pub all_size: Option, + pub curr_size: Option, + pub homepage: Option, + pub save_path: Option, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::subscribers::Entity", + from = "Column::SubscriberId", + to = "super::subscribers::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Subscriber, + #[sea_orm( + belongs_to = "super::downloaders::Entity", + from = "Column::DownloaderId", + to = "super::downloaders::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Downloader, + #[sea_orm( + belongs_to = "super::episodes::Entity", + from = "Column::EpisodeId", + to = "super::episodes::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Episode, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Subscriber.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Downloader.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Episode.def() + } +} #[async_trait::async_trait] impl ActiveModelBehavior for ActiveModel {} -impl ActiveModel { - pub fn from_mikan_rss_item(m: MikanRssItem, subscription_id: i32) -> Self { - let _ = Self { - origin_name: ActiveValue::Set(m.title.clone()), - display_name: ActiveValue::Set(m.title), - subscription_id: ActiveValue::Set(subscription_id), - status: ActiveValue::Set(DownloadStatus::Pending), - mime: ActiveValue::Set(DownloadMime::BitTorrent), - url: ActiveValue::Set(m.url.to_string()), - curr_size: ActiveValue::Set(m.content_length.as_ref().map(|_| 0)), - all_size: ActiveValue::Set(m.content_length), - homepage: ActiveValue::Set(Some(m.homepage.to_string())), - ..Default::default() - }; - todo!() - } -} - -impl Model {} +impl ActiveModel {} diff --git a/apps/recorder/src/models/entities/auth.rs b/apps/recorder/src/models/entities/auth.rs deleted file mode 100644 index 747e576..0000000 --- a/apps/recorder/src/models/entities/auth.rs +++ /dev/null @@ -1,43 +0,0 @@ -use sea_orm::entity::prelude::*; -use serde::{Deserialize, Serialize}; - -#[derive( - Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, DeriveDisplay, Serialize, Deserialize, -)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "auth_type")] -#[serde(rename_all = "snake_case")] -pub enum AuthType { - #[sea_orm(string_value = "basic")] - Basic, - #[sea_orm(string_value = "oidc")] - Oidc, -} - -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, DeriveEntityModel)] -#[sea_orm(table_name = "auth")] -pub struct Model { - pub created_at: DateTime, - pub updated_at: DateTime, - #[sea_orm(primary_key)] - pub id: i32, - pub pid: String, - pub subscriber_id: i32, - pub auth_type: AuthType, - pub avatar_url: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::subscribers::Entity", - from = "Column::SubscriberId", - to = "super::subscribers::Column::Id" - )] - SubscriberId, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::SubscriberId.def() - } -} diff --git a/apps/recorder/src/models/entities/bangumi.rs b/apps/recorder/src/models/entities/bangumi.rs deleted file mode 100644 index 4e3e960..0000000 --- a/apps/recorder/src/models/entities/bangumi.rs +++ /dev/null @@ -1,80 +0,0 @@ -use sea_orm::{entity::prelude::*, FromJsonQueryResult}; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)] -pub struct BangumiFilter { - pub name: Option>, - pub group: Option>, -} - -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)] -pub struct BangumiExtra { - pub name_zh: Option, - pub s_name_zh: Option, - pub name_en: Option, - pub s_name_en: Option, - pub name_jp: Option, - pub s_name_jp: Option, -} - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "bangumi")] -pub struct Model { - pub created_at: DateTime, - pub updated_at: DateTime, - #[sea_orm(primary_key)] - pub id: i32, - pub mikan_bangumi_id: Option, - pub subscription_id: i32, - pub subscriber_id: i32, - pub display_name: String, - pub raw_name: String, - pub season: i32, - pub season_raw: Option, - pub fansub: Option, - pub mikan_fansub_id: Option, - pub filter: Option, - pub rss_link: Option, - pub poster_link: Option, - pub save_path: Option, - #[sea_orm(default = "false")] - pub deleted: bool, - pub homepage: Option, - pub extra: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::subscriptions::Entity", - from = "Column::SubscriptionId", - to = "super::subscriptions::Column::Id" - )] - Subscription, - #[sea_orm( - belongs_to = "super::subscribers::Entity", - from = "Column::SubscriberId", - to = "super::subscribers::Column::Id" - )] - Subscriber, - #[sea_orm(has_many = "super::episodes::Entity")] - Episode, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Episode.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Subscription.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Subscriber.def() - } -} diff --git a/apps/recorder/src/models/entities/downloaders.rs b/apps/recorder/src/models/entities/downloaders.rs deleted file mode 100644 index fe86d0a..0000000 --- a/apps/recorder/src/models/entities/downloaders.rs +++ /dev/null @@ -1,45 +0,0 @@ -use sea_orm::entity::prelude::*; -use serde::{Deserialize, Serialize}; - -#[derive( - Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, DeriveDisplay, Serialize, Deserialize, -)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "downloader_type")] -#[serde(rename_all = "snake_case")] -pub enum DownloaderCategory { - #[sea_orm(string_value = "qbittorrent")] - QBittorrent, -} - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "downloaders")] -pub struct Model { - #[sea_orm(column_type = "Timestamp")] - pub created_at: DateTime, - #[sea_orm(column_type = "Timestamp")] - pub updated_at: DateTime, - #[sea_orm(primary_key)] - pub id: i32, - pub category: DownloaderCategory, - pub endpoint: String, - pub password: String, - pub username: String, - pub subscriber_id: i32, - pub save_path: String, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::subscribers::Entity", - from = "Column::SubscriberId", - to = "super::subscribers::Column::Id" - )] - Subscriber, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Subscriber.def() - } -} diff --git a/apps/recorder/src/models/entities/downloads.rs b/apps/recorder/src/models/entities/downloads.rs deleted file mode 100644 index f0bb76b..0000000 --- a/apps/recorder/src/models/entities/downloads.rs +++ /dev/null @@ -1,78 +0,0 @@ -use sea_orm::entity::prelude::*; -use serde::{Deserialize, Serialize}; - -#[derive( - Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, DeriveDisplay, Serialize, Deserialize, -)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "download_status")] -#[serde(rename_all = "snake_case")] -pub enum DownloadStatus { - #[sea_orm(string_value = "pending")] - Pending, - #[sea_orm(string_value = "downloading")] - Downloading, - #[sea_orm(string_value = "paused")] - Paused, - #[sea_orm(string_value = "completed")] - Completed, - #[sea_orm(string_value = "failed")] - Failed, - #[sea_orm(string_value = "deleted")] - Deleted, -} - -#[derive( - Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, DeriveDisplay, Serialize, Deserialize, -)] -#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "download_mime")] -pub enum DownloadMime { - #[sea_orm(string_value = "application/octet-stream")] - #[serde(rename = "application/octet-stream")] - OctetStream, - #[sea_orm(string_value = "application/x-bittorrent")] - #[serde(rename = "application/x-bittorrent")] - BitTorrent, -} - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "downloads")] -pub struct Model { - pub created_at: DateTime, - pub updated_at: DateTime, - #[sea_orm(primary_key)] - pub id: i32, - pub origin_name: String, - pub display_name: String, - pub subscription_id: i32, - pub status: DownloadStatus, - pub mime: DownloadMime, - pub url: String, - pub all_size: Option, - pub curr_size: Option, - pub homepage: Option, - pub save_path: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::subscriptions::Entity", - from = "Column::SubscriptionId", - to = "super::subscriptions::Column::Id" - )] - Subscription, - #[sea_orm(has_many = "super::episodes::Entity")] - Episode, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Subscription.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Episode.def() - } -} diff --git a/apps/recorder/src/models/entities/episodes.rs b/apps/recorder/src/models/entities/episodes.rs deleted file mode 100644 index d72ac2a..0000000 --- a/apps/recorder/src/models/entities/episodes.rs +++ /dev/null @@ -1,95 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 -use sea_orm::{entity::prelude::*, FromJsonQueryResult}; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult, Default)] -pub struct EpisodeExtra { - pub name_zh: Option, - pub s_name_zh: Option, - pub name_en: Option, - pub s_name_en: Option, - pub name_jp: Option, - pub s_name_jp: Option, -} - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "episodes")] -pub struct Model { - pub created_at: DateTime, - pub updated_at: DateTime, - #[sea_orm(primary_key)] - pub id: i32, - #[sea_orm(indexed)] - pub mikan_episode_id: Option, - pub raw_name: String, - pub display_name: String, - pub bangumi_id: i32, - pub subscription_id: i32, - pub subscriber_id: i32, - pub download_id: Option, - pub save_path: Option, - pub resolution: Option, - pub season: i32, - pub season_raw: Option, - pub fansub: Option, - pub poster_link: Option, - pub episode_index: i32, - pub homepage: Option, - pub subtitle: Option>, - #[sea_orm(default = "false")] - pub deleted: bool, - pub source: Option, - pub extra: EpisodeExtra, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::bangumi::Entity", - from = "Column::BangumiId", - to = "super::bangumi::Column::Id" - )] - Bangumi, - #[sea_orm( - belongs_to = "super::downloads::Entity", - from = "Column::DownloadId", - to = "super::downloads::Column::Id" - )] - Downloads, - #[sea_orm( - belongs_to = "super::subscriptions::Entity", - from = "Column::SubscriptionId", - to = "super::subscriptions::Column::Id" - )] - Subscriptions, - #[sea_orm( - belongs_to = "super::subscribers::Entity", - from = "Column::SubscriberId", - to = "super::subscribers::Column::Id" - )] - Subscriber, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Bangumi.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Downloads.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Subscriptions.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Subscriber.def() - } -} diff --git a/apps/recorder/src/models/entities/mod.rs b/apps/recorder/src/models/entities/mod.rs deleted file mode 100644 index e1820dc..0000000 --- a/apps/recorder/src/models/entities/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4 -pub mod auth; -pub mod bangumi; -pub mod downloaders; -pub mod downloads; -pub mod episodes; -pub mod subscribers; -pub mod subscriptions; diff --git a/apps/recorder/src/models/entities/subscribers.rs b/apps/recorder/src/models/entities/subscribers.rs deleted file mode 100644 index b6929d1..0000000 --- a/apps/recorder/src/models/entities/subscribers.rs +++ /dev/null @@ -1,71 +0,0 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 - -use sea_orm::{entity::prelude::*, FromJsonQueryResult}; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)] -pub struct SubscriberBangumiConfig { - pub leading_group_tag: Option, -} - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "subscribers")] -pub struct Model { - pub created_at: DateTime, - pub updated_at: DateTime, - #[sea_orm(primary_key)] - pub id: i32, - #[sea_orm(unique)] - pub pid: String, - pub display_name: String, - pub downloader_id: Option, - pub bangumi_conf: Option, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm(has_many = "super::subscriptions::Entity")] - Subscription, - #[sea_orm( - belongs_to = "super::downloaders::Entity", - from = "Column::DownloaderId", - to = "super::downloaders::Column::Id" - )] - Downloader, - #[sea_orm(has_many = "super::bangumi::Entity")] - Bangumi, - #[sea_orm(has_many = "super::episodes::Entity")] - Episode, - #[sea_orm(has_many = "super::auth::Entity")] - Auth, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Subscription.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Downloader.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Bangumi.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Episode.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Auth.def() - } -} diff --git a/apps/recorder/src/models/entities/subscriptions.rs b/apps/recorder/src/models/entities/subscriptions.rs deleted file mode 100644 index eba5e65..0000000 --- a/apps/recorder/src/models/entities/subscriptions.rs +++ /dev/null @@ -1,66 +0,0 @@ -use sea_orm::entity::prelude::*; -use serde::{Deserialize, Serialize}; - -#[derive( - Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize, DeriveDisplay, -)] -#[sea_orm( - rs_type = "String", - db_type = "Enum", - enum_name = "subscription_category" -)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionCategory { - #[sea_orm(string_value = "mikan")] - Mikan, - #[sea_orm(string_value = "manual")] - Manual, -} - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] -#[sea_orm(table_name = "subscriptions")] -pub struct Model { - #[sea_orm(column_type = "Timestamp")] - pub created_at: DateTime, - #[sea_orm(column_type = "Timestamp")] - pub updated_at: DateTime, - #[sea_orm(primary_key)] - pub id: i32, - pub display_name: String, - pub subscriber_id: i32, - pub category: SubscriptionCategory, - pub source_url: String, - pub enabled: bool, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation { - #[sea_orm( - belongs_to = "super::subscribers::Entity", - from = "Column::SubscriberId", - to = "super::subscribers::Column::Id" - )] - Subscriber, - #[sea_orm(has_many = "super::bangumi::Entity")] - Bangumi, - #[sea_orm(has_many = "super::episodes::Entity")] - Episodes, -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Subscriber.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Bangumi.def() - } -} - -impl Related for Entity { - fn to() -> RelationDef { - Relation::Episodes.def() - } -} diff --git a/apps/recorder/src/models/episodes.rs b/apps/recorder/src/models/episodes.rs old mode 100644 new mode 100755 index cd94364..2295ad4 --- a/apps/recorder/src/models/episodes.rs +++ b/apps/recorder/src/models/episodes.rs @@ -1,10 +1,10 @@ use std::sync::Arc; use loco_rs::app::AppContext; -use sea_orm::{entity::prelude::*, sea_query::OnConflict, ActiveValue}; +use sea_orm::{entity::prelude::*, sea_query::OnConflict, ActiveValue, FromJsonQueryResult}; +use serde::{Deserialize, Serialize}; -use super::bangumi; -pub use super::entities::episodes::*; +use super::{bangumi, query::InsertManyReturningExt, subscription_episode}; use crate::{ app::AppContextExt, extract::{ @@ -13,6 +13,92 @@ use crate::{ }, }; +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult, Default)] +pub struct EpisodeExtra { + pub name_zh: Option, + pub s_name_zh: Option, + pub name_en: Option, + pub s_name_en: Option, + pub name_jp: Option, + pub s_name_jp: Option, +} + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] +#[sea_orm(table_name = "episodes")] +pub struct Model { + pub created_at: DateTime, + pub updated_at: DateTime, + #[sea_orm(primary_key)] + pub id: i32, + #[sea_orm(indexed)] + pub mikan_episode_id: Option, + pub raw_name: String, + pub display_name: String, + pub bangumi_id: i32, + pub subscriber_id: i32, + pub save_path: Option, + pub resolution: Option, + pub season: i32, + pub season_raw: Option, + pub fansub: Option, + pub poster_link: Option, + pub episode_index: i32, + pub homepage: Option, + pub subtitle: Option>, + #[sea_orm(default = "false")] + pub deleted: bool, + pub source: Option, + pub extra: EpisodeExtra, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::subscribers::Entity", + from = "Column::SubscriberId", + to = "super::subscribers::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Subscriber, + #[sea_orm( + belongs_to = "super::bangumi::Entity", + from = "Column::BangumiId", + to = "super::bangumi::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Bangumi, + #[sea_orm(has_many = "super::subscriptions::Entity")] + Subscriptions, + #[sea_orm(has_one = "super::downloads::Entity")] + Downloads, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Bangumi.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Downloads.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Subscriptions.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Subscriber.def() + } +} + #[derive(Clone, Debug, PartialEq)] pub struct MikanEpsiodeCreation { pub episode: MikanEpisodeMeta, @@ -22,6 +108,7 @@ pub struct MikanEpsiodeCreation { impl Model { pub async fn add_episodes( ctx: &AppContext, + subscription_id: i32, creations: impl IntoIterator, ) -> eyre::Result<()> { let db = &ctx.db; @@ -35,13 +122,33 @@ impl Model { }) .flatten(); - Entity::insert_many(new_episode_active_modes) + let inserted_episodes = Entity::insert_many(new_episode_active_modes) .on_conflict( OnConflict::columns([Column::BangumiId, Column::MikanEpisodeId]) .do_nothing() .to_owned(), ) - .on_empty_do_nothing() + .exec_with_returning_columns(db, [Column::Id]) + .await? + .into_iter() + .flat_map(|r| r.try_get_many_by_index::()); + + let insert_subscription_episode_links = inserted_episodes.into_iter().map(|episode_id| { + subscription_episode::ActiveModel::from_subscription_and_episode( + subscription_id, + episode_id, + ) + }); + + subscription_episode::Entity::insert_many(insert_subscription_episode_links) + .on_conflict( + OnConflict::columns([ + subscription_episode::Column::SubscriptionId, + subscription_episode::Column::EpisodeId, + ]) + .do_nothing() + .to_owned(), + ) .exec(db) .await?; @@ -72,7 +179,6 @@ impl ActiveModel { raw_name: ActiveValue::Set(item.episode_title.clone()), display_name: ActiveValue::Set(item.episode_title.clone()), bangumi_id: ActiveValue::Set(bgm.id), - subscription_id: ActiveValue::Set(bgm.subscription_id), subscriber_id: ActiveValue::Set(bgm.subscriber_id), resolution: ActiveValue::Set(raw_meta.resolution), season: ActiveValue::Set(if raw_meta.season > 0 { diff --git a/apps/recorder/src/models/mod.rs b/apps/recorder/src/models/mod.rs old mode 100644 new mode 100755 index 5d5bdb4..1dc7407 --- a/apps/recorder/src/models/mod.rs +++ b/apps/recorder/src/models/mod.rs @@ -2,10 +2,10 @@ pub mod auth; pub mod bangumi; pub mod downloaders; pub mod downloads; -pub mod entities; pub mod episodes; -pub mod notifications; pub mod prelude; pub mod query; pub mod subscribers; +pub mod subscription_bangumi; +pub mod subscription_episode; pub mod subscriptions; diff --git a/apps/recorder/src/models/notifications.rs b/apps/recorder/src/models/notifications.rs deleted file mode 100644 index f52d531..0000000 --- a/apps/recorder/src/models/notifications.rs +++ /dev/null @@ -1,8 +0,0 @@ -use serde::{Deserialize, Serialize}; - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Notification { - season: i32, - episode_size: u32, - poster_url: Option, -} diff --git a/apps/recorder/src/models/prelude.rs b/apps/recorder/src/models/prelude.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/models/query/mod.rs b/apps/recorder/src/models/query/mod.rs old mode 100644 new mode 100755 index 5fa270e..1093dc3 --- a/apps/recorder/src/models/query/mod.rs +++ b/apps/recorder/src/models/query/mod.rs @@ -1,7 +1,8 @@ use sea_orm::{ prelude::Expr, sea_query::{Alias, IntoColumnRef, IntoTableRef, Query, SelectStatement}, - Value, + ActiveModelTrait, ColumnTrait, ConnectionTrait, DbErr, EntityTrait, Insert, IntoActiveModel, + Iterable, QueryResult, QueryTrait, SelectModel, SelectorRaw, Value, }; pub fn filter_values_in< @@ -24,3 +25,76 @@ pub fn filter_values_in< .and_where(Expr::col(col_ref).is_not_null()) .to_owned() } + +#[async_trait::async_trait] +pub trait InsertManyReturningExt: Sized +where + ::Model: IntoActiveModel, + A: ActiveModelTrait, +{ + fn exec_with_returning_models( + self, + db: &C, + ) -> SelectorRaw::Model>> + where + C: ConnectionTrait; + + async fn exec_with_returning_columns( + self, + db: &C, + columns: I, + ) -> Result, DbErr> + where + C: ConnectionTrait, + I: IntoIterator::Column> + Send; +} + +#[async_trait::async_trait] +impl InsertManyReturningExt for Insert +where + ::Model: IntoActiveModel, + A: ActiveModelTrait + Send, +{ + fn exec_with_returning_models( + self, + db: &C, + ) -> SelectorRaw::Model>> + where + C: ConnectionTrait, + { + let mut insert_statement = self.into_query(); + let db_backend = db.get_database_backend(); + let returning = Query::returning().exprs( + ::Column::iter() + .map(|c| c.select_as(c.into_returning_expr(db_backend))), + ); + insert_statement.returning(returning); + let insert_statement = db_backend.build(&insert_statement); + SelectorRaw::::Model>>::from_statement( + insert_statement, + ) + } + + async fn exec_with_returning_columns( + self, + db: &C, + columns: I, + ) -> Result, DbErr> + where + C: ConnectionTrait, + I: IntoIterator::Column> + Send, + { + let mut insert_statement = self.into_query(); + let db_backend = db.get_database_backend(); + let returning = Query::returning().exprs( + columns + .into_iter() + .map(|c| c.select_as(c.into_returning_expr(db_backend))), + ); + insert_statement.returning(returning); + + let statement = db_backend.build(&insert_statement); + + db.query_all(statement).await + } +} diff --git a/apps/recorder/src/models/subscribers.rs b/apps/recorder/src/models/subscribers.rs old mode 100644 new mode 100755 index 33ad6bb..99f6d43 --- a/apps/recorder/src/models/subscribers.rs +++ b/apps/recorder/src/models/subscribers.rs @@ -2,13 +2,73 @@ use loco_rs::{ app::AppContext, model::{ModelError, ModelResult}, }; -use sea_orm::{entity::prelude::*, ActiveValue, TransactionTrait}; +use sea_orm::{entity::prelude::*, ActiveValue, FromJsonQueryResult, TransactionTrait}; use serde::{Deserialize, Serialize}; -pub use super::entities::subscribers::*; - pub const SEED_SUBSCRIBER: &str = "konobangu"; +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)] +pub struct SubscriberBangumiConfig { + pub leading_group_tag: Option, +} + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] +#[sea_orm(table_name = "subscribers")] +pub struct Model { + pub created_at: DateTime, + pub updated_at: DateTime, + #[sea_orm(primary_key)] + pub id: i32, + #[sea_orm(unique)] + pub pid: String, + pub display_name: String, + pub bangumi_conf: Option, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm(has_many = "super::subscriptions::Entity")] + Subscription, + #[sea_orm(has_many = "super::downloaders::Entity")] + Downloader, + #[sea_orm(has_many = "super::bangumi::Entity")] + Bangumi, + #[sea_orm(has_many = "super::episodes::Entity")] + Episode, + #[sea_orm(has_many = "super::auth::Entity")] + Auth, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Subscription.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Downloader.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Bangumi.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Episode.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Auth.def() + } +} + #[derive(Debug, Deserialize, Serialize)] pub struct SubscriberIdParams { pub id: String, diff --git a/apps/recorder/src/models/subscription_bangumi.rs b/apps/recorder/src/models/subscription_bangumi.rs new file mode 100644 index 0000000..547ea03 --- /dev/null +++ b/apps/recorder/src/models/subscription_bangumi.rs @@ -0,0 +1,56 @@ +use sea_orm::{entity::prelude::*, ActiveValue}; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] +#[sea_orm(table_name = "subscription_bangumi")] +pub struct Model { + #[sea_orm(primary_key)] + pub id: i32, + pub subscription_id: i32, + pub bangumi_id: i32, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::subscriptions::Entity", + from = "Column::SubscriptionId", + to = "super::subscriptions::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Subscription, + #[sea_orm( + belongs_to = "super::bangumi::Entity", + from = "Column::BangumiId", + to = "super::bangumi::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Bangumi, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Subscription.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Bangumi.def() + } +} + +#[async_trait::async_trait] +impl ActiveModelBehavior for ActiveModel {} + +impl ActiveModel { + pub fn from_subscription_and_bangumi(subscription_id: i32, bangumi_id: i32) -> Self { + Self { + subscription_id: ActiveValue::Set(subscription_id), + bangumi_id: ActiveValue::Set(bangumi_id), + ..Default::default() + } + } +} diff --git a/apps/recorder/src/models/subscription_episode.rs b/apps/recorder/src/models/subscription_episode.rs new file mode 100644 index 0000000..3e99997 --- /dev/null +++ b/apps/recorder/src/models/subscription_episode.rs @@ -0,0 +1,56 @@ +use sea_orm::{entity::prelude::*, ActiveValue}; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] +#[sea_orm(table_name = "subscription_episode")] +pub struct Model { + #[sea_orm(primary_key)] + pub id: i32, + pub subscription_id: i32, + pub episode_id: i32, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::subscriptions::Entity", + from = "Column::SubscriptionId", + to = "super::subscriptions::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Subscription, + #[sea_orm( + belongs_to = "super::episodes::Entity", + from = "Column::EpisodeId", + to = "super::episodes::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Episode, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Subscription.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Episode.def() + } +} + +#[async_trait::async_trait] +impl ActiveModelBehavior for ActiveModel {} + +impl ActiveModel { + pub fn from_subscription_and_episode(subscription_id: i32, episode_id: i32) -> Self { + Self { + subscription_id: ActiveValue::Set(subscription_id), + episode_id: ActiveValue::Set(episode_id), + ..Default::default() + } + } +} diff --git a/apps/recorder/src/models/subscriptions.rs b/apps/recorder/src/models/subscriptions.rs old mode 100644 new mode 100755 index 490d6ad..9887b8a --- a/apps/recorder/src/models/subscriptions.rs +++ b/apps/recorder/src/models/subscriptions.rs @@ -5,7 +5,6 @@ use loco_rs::app::AppContext; use sea_orm::{entity::prelude::*, ActiveValue}; use serde::{Deserialize, Serialize}; -pub use super::entities::subscriptions::{self, *}; use super::{bangumi, episodes, query::filter_values_in}; use crate::{ app::AppContextExt, @@ -24,6 +23,92 @@ use crate::{ models::episodes::MikanEpsiodeCreation, }; +#[derive( + Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize, DeriveDisplay, +)] +#[sea_orm( + rs_type = "String", + db_type = "Enum", + enum_name = "subscription_category" +)] +#[serde(rename_all = "snake_case")] +pub enum SubscriptionCategory { + #[sea_orm(string_value = "mikan")] + Mikan, + #[sea_orm(string_value = "manual")] + Manual, +} + +#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] +#[sea_orm(table_name = "subscriptions")] +pub struct Model { + #[sea_orm(column_type = "Timestamp")] + pub created_at: DateTime, + #[sea_orm(column_type = "Timestamp")] + pub updated_at: DateTime, + #[sea_orm(primary_key)] + pub id: i32, + pub display_name: String, + pub subscriber_id: i32, + pub category: SubscriptionCategory, + pub source_url: String, + pub enabled: bool, +} + +#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] +pub enum Relation { + #[sea_orm( + belongs_to = "super::subscribers::Entity", + from = "Column::SubscriberId", + to = "super::subscribers::Column::Id", + on_update = "Cascade", + on_delete = "Cascade" + )] + Subscriber, + #[sea_orm(has_many = "super::bangumi::Entity")] + Bangumi, + #[sea_orm(has_many = "super::episodes::Entity")] + Episodes, + #[sea_orm(has_many = "super::subscription_episode::Entity")] + SubscriptionEpisode, + #[sea_orm(has_many = "super::subscription_bangumi::Entity")] + SubscriptionBangumi, +} + +impl Related for Entity { + fn to() -> RelationDef { + Relation::Subscriber.def() + } +} + +impl Related for Entity { + fn to() -> RelationDef { + super::subscription_bangumi::Relation::Bangumi.def() + } + + fn via() -> Option { + Some( + super::subscription_bangumi::Relation::Subscription + .def() + .rev(), + ) + } +} + +impl Related for Entity { + fn to() -> RelationDef { + super::subscription_episode::Relation::Episode.def() + } + + fn via() -> Option { + Some( + super::subscription_episode::Relation::Subscription + .def() + .rev(), + ) + } +} + #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct SubscriptionCreateFromRssDto { pub rss_link: String, @@ -77,7 +162,7 @@ impl Model { Ok(subscription.insert(db).await?) } - pub async fn toggle_iters( + pub async fn toggle_with_ids( ctx: &AppContext, ids: impl Iterator, enabled: bool, @@ -91,7 +176,7 @@ impl Model { Ok(()) } - pub async fn delete_iters( + pub async fn delete_with_ids( ctx: &AppContext, ids: impl Iterator, ) -> eyre::Result<()> { @@ -213,6 +298,7 @@ impl Model { ); episodes::Model::add_episodes( ctx, + self.id, new_ep_metas.into_iter().map(|item| MikanEpsiodeCreation { episode: item, bangumi: bgm.clone(), diff --git a/apps/recorder/src/sync/core.rs b/apps/recorder/src/sync/core.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/sync/error.rs b/apps/recorder/src/sync/error.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/sync/mod.rs b/apps/recorder/src/sync/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/sync/qbit.rs b/apps/recorder/src/sync/qbit.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/tasks/mod.rs b/apps/recorder/src/tasks/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/test_utils.rs b/apps/recorder/src/test_utils.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/views/mod.rs b/apps/recorder/src/views/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/views/subscribers.rs b/apps/recorder/src/views/subscribers.rs old mode 100644 new mode 100755 index b6d11e0..0aa3498 --- a/apps/recorder/src/views/subscribers.rs +++ b/apps/recorder/src/views/subscribers.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -use crate::models::entities::subscribers; +use crate::models::subscribers; #[derive(Debug, Deserialize, Serialize)] pub struct CurrentResponse { diff --git a/apps/recorder/src/workers/mod.rs b/apps/recorder/src/workers/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/src/workers/subscription_worker.rs b/apps/recorder/src/workers/subscription_worker.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/tests/mod.rs b/apps/recorder/tests/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/tests/models/mod.rs b/apps/recorder/tests/models/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/tests/models/snapshots/can_find_by_pid@subscribers-2.snap b/apps/recorder/tests/models/snapshots/can_find_by_pid@subscribers-2.snap old mode 100644 new mode 100755 diff --git a/apps/recorder/tests/models/snapshots/can_find_by_pid@subscribers.snap b/apps/recorder/tests/models/snapshots/can_find_by_pid@subscribers.snap old mode 100644 new mode 100755 diff --git a/apps/recorder/tests/models/subscribers.rs b/apps/recorder/tests/models/subscribers.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/tests/requests/mod.rs b/apps/recorder/tests/requests/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/tests/requests/subscribers.rs b/apps/recorder/tests/requests/subscribers.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/tests/tasks/mod.rs b/apps/recorder/tests/tasks/mod.rs old mode 100644 new mode 100755 diff --git a/apps/recorder/tests/tasks/seed.rs b/apps/recorder/tests/tasks/seed.rs old mode 100644 new mode 100755 diff --git a/apps/storybook/.gitignore b/apps/storybook/.gitignore old mode 100644 new mode 100755 diff --git a/apps/storybook/.storybook/main.ts b/apps/storybook/.storybook/main.ts old mode 100644 new mode 100755 diff --git a/apps/storybook/.storybook/preview-head.html b/apps/storybook/.storybook/preview-head.html old mode 100644 new mode 100755 diff --git a/apps/storybook/.storybook/preview.tsx b/apps/storybook/.storybook/preview.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/README.md b/apps/storybook/README.md old mode 100644 new mode 100755 diff --git a/apps/storybook/next.config.ts b/apps/storybook/next.config.ts old mode 100644 new mode 100755 diff --git a/apps/storybook/package.json b/apps/storybook/package.json old mode 100644 new mode 100755 diff --git a/apps/storybook/postcss.config.mjs b/apps/storybook/postcss.config.mjs old mode 100644 new mode 100755 diff --git a/apps/storybook/public/favicon.ico b/apps/storybook/public/favicon.ico old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/accordion.stories.tsx b/apps/storybook/stories/accordion.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/alert-dialog.stories.tsx b/apps/storybook/stories/alert-dialog.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/alert.stories.tsx b/apps/storybook/stories/alert.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/aspect-ratio.stories.tsx b/apps/storybook/stories/aspect-ratio.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/avatar.stories.tsx b/apps/storybook/stories/avatar.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/badge.stories.tsx b/apps/storybook/stories/badge.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/breadcrumb.stories.tsx b/apps/storybook/stories/breadcrumb.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/button.stories.tsx b/apps/storybook/stories/button.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/calendar.stories.tsx b/apps/storybook/stories/calendar.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/card.stories.tsx b/apps/storybook/stories/card.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/carousel.stories.tsx b/apps/storybook/stories/carousel.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/chart.stories.tsx b/apps/storybook/stories/chart.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/checkbox.stories.tsx b/apps/storybook/stories/checkbox.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/collapsible.stories.tsx b/apps/storybook/stories/collapsible.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/command.stories.tsx b/apps/storybook/stories/command.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/context-menu.stories.tsx b/apps/storybook/stories/context-menu.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/dialog.stories.tsx b/apps/storybook/stories/dialog.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/drawer.stories.tsx b/apps/storybook/stories/drawer.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/dropdown-menu.stories.tsx b/apps/storybook/stories/dropdown-menu.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/form.stories.tsx b/apps/storybook/stories/form.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/hover-card.stories.tsx b/apps/storybook/stories/hover-card.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/input-otp.stories.tsx b/apps/storybook/stories/input-otp.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/input.stories.tsx b/apps/storybook/stories/input.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/label.stories.tsx b/apps/storybook/stories/label.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/menubar.stories.tsx b/apps/storybook/stories/menubar.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/navigation-menu.stories.tsx b/apps/storybook/stories/navigation-menu.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/pagination.stories.tsx b/apps/storybook/stories/pagination.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/popover.stories.tsx b/apps/storybook/stories/popover.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/progress.stories.tsx b/apps/storybook/stories/progress.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/radio-group.stories.tsx b/apps/storybook/stories/radio-group.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/resizable.stories.tsx b/apps/storybook/stories/resizable.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/scroll-area.stories.tsx b/apps/storybook/stories/scroll-area.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/select.stories.tsx b/apps/storybook/stories/select.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/separator.stories.tsx b/apps/storybook/stories/separator.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/sheet.stories.tsx b/apps/storybook/stories/sheet.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/sidebar.stories.tsx b/apps/storybook/stories/sidebar.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/skeleton.stories.tsx b/apps/storybook/stories/skeleton.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/slider.stories.tsx b/apps/storybook/stories/slider.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/sonner.stories.tsx b/apps/storybook/stories/sonner.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/switch.stories.tsx b/apps/storybook/stories/switch.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/table.stories.tsx b/apps/storybook/stories/table.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/tabs.stories.tsx b/apps/storybook/stories/tabs.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/textarea.stories.tsx b/apps/storybook/stories/textarea.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/toast.stories.tsx b/apps/storybook/stories/toast.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/toggle-group.stories.tsx b/apps/storybook/stories/toggle-group.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/toggle.stories.tsx b/apps/storybook/stories/toggle.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/stories/tooltip.stories.tsx b/apps/storybook/stories/tooltip.stories.tsx old mode 100644 new mode 100755 diff --git a/apps/storybook/tailwind.config.ts b/apps/storybook/tailwind.config.ts old mode 100644 new mode 100755 diff --git a/apps/storybook/tsconfig.json b/apps/storybook/tsconfig.json old mode 100644 new mode 100755 diff --git a/apps/web/.env.development b/apps/web/.env.development old mode 100644 new mode 100755 diff --git a/apps/web/.env.example b/apps/web/.env.example old mode 100644 new mode 100755 diff --git a/apps/web/.gitignore b/apps/web/.gitignore old mode 100644 new mode 100755 diff --git a/apps/web/.well-known/vercel/flags/route.ts b/apps/web/.well-known/vercel/flags/route.ts old mode 100644 new mode 100755 diff --git a/apps/web/app/(home)/components/cases.tsx b/apps/web/app/(home)/components/cases.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/(home)/components/cta.tsx b/apps/web/app/(home)/components/cta.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/(home)/components/faq.tsx b/apps/web/app/(home)/components/faq.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/(home)/components/features.tsx b/apps/web/app/(home)/components/features.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/(home)/components/hero.tsx b/apps/web/app/(home)/components/hero.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/(home)/components/stats.tsx b/apps/web/app/(home)/components/stats.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/(home)/components/testimonials.tsx b/apps/web/app/(home)/components/testimonials.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/(home)/page.tsx b/apps/web/app/(home)/page.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/apple-icon.png b/apps/web/app/apple-icon.png old mode 100644 new mode 100755 diff --git a/apps/web/app/blog/[slug]/page.tsx b/apps/web/app/blog/[slug]/page.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/blog/layout.tsx b/apps/web/app/blog/layout.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/blog/page.tsx b/apps/web/app/blog/page.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/components/footer.tsx b/apps/web/app/components/footer.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/components/header/index.tsx b/apps/web/app/components/header/index.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/components/header/logo.svg b/apps/web/app/components/header/logo.svg old mode 100644 new mode 100755 diff --git a/apps/web/app/contact/actions/contact.tsx b/apps/web/app/contact/actions/contact.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/contact/components/contact-form.tsx b/apps/web/app/contact/components/contact-form.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/contact/page.tsx b/apps/web/app/contact/page.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/global-error.tsx b/apps/web/app/global-error.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/icon.png b/apps/web/app/icon.png old mode 100644 new mode 100755 diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/legal/[slug]/page.tsx b/apps/web/app/legal/[slug]/page.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/legal/layout.tsx b/apps/web/app/legal/layout.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/opengraph-image.png b/apps/web/app/opengraph-image.png old mode 100644 new mode 100755 diff --git a/apps/web/app/pricing/page.tsx b/apps/web/app/pricing/page.tsx old mode 100644 new mode 100755 diff --git a/apps/web/app/robots.ts b/apps/web/app/robots.ts old mode 100644 new mode 100755 diff --git a/apps/web/app/sitemap.ts b/apps/web/app/sitemap.ts old mode 100644 new mode 100755 diff --git a/apps/web/app/styles/web.css b/apps/web/app/styles/web.css old mode 100644 new mode 100755 diff --git a/apps/web/components/sidebar.tsx b/apps/web/components/sidebar.tsx old mode 100644 new mode 100755 diff --git a/apps/web/content-collections.ts b/apps/web/content-collections.ts old mode 100644 new mode 100755 diff --git a/apps/web/content/blog/my-first-blog.mdx b/apps/web/content/blog/my-first-blog.mdx old mode 100644 new mode 100755 diff --git a/apps/web/instrumentation.ts b/apps/web/instrumentation.ts old mode 100644 new mode 100755 diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts old mode 100644 new mode 100755 diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts old mode 100644 new mode 100755 diff --git a/apps/web/package.json b/apps/web/package.json old mode 100644 new mode 100755 diff --git a/apps/web/postcss.config.mjs b/apps/web/postcss.config.mjs old mode 100644 new mode 100755 diff --git a/apps/web/tailwind.config.ts b/apps/web/tailwind.config.ts old mode 100644 new mode 100755 diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json old mode 100644 new mode 100755 diff --git a/apps/web/vercel.json b/apps/web/vercel.json old mode 100644 new mode 100755 diff --git a/biome.json b/biome.json old mode 100644 new mode 100755 diff --git a/config/development.yaml b/config/development.yaml old mode 100644 new mode 100755 diff --git a/config/production.yaml b/config/production.yaml old mode 100644 new mode 100755 diff --git a/config/test.yaml b/config/test.yaml old mode 100644 new mode 100755 diff --git a/docker-compose.yaml b/docker-compose.yaml old mode 100644 new mode 100755 diff --git a/justfile b/justfile old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755 diff --git a/packages/ai/components/message.tsx b/packages/ai/components/message.tsx old mode 100644 new mode 100755 diff --git a/packages/ai/components/thread.tsx b/packages/ai/components/thread.tsx old mode 100644 new mode 100755 diff --git a/packages/ai/index.ts b/packages/ai/index.ts old mode 100644 new mode 100755 diff --git a/packages/ai/lib/provider.ts b/packages/ai/lib/provider.ts old mode 100644 new mode 100755 diff --git a/packages/ai/lib/react.ts b/packages/ai/lib/react.ts old mode 100644 new mode 100755 diff --git a/packages/ai/package.json b/packages/ai/package.json old mode 100644 new mode 100755 diff --git a/packages/ai/tsconfig.json b/packages/ai/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/analytics/client.tsx b/packages/analytics/client.tsx old mode 100644 new mode 100755 diff --git a/packages/analytics/index.tsx b/packages/analytics/index.tsx old mode 100644 new mode 100755 diff --git a/packages/analytics/package.json b/packages/analytics/package.json old mode 100644 new mode 100755 diff --git a/packages/analytics/server.ts b/packages/analytics/server.ts old mode 100644 new mode 100755 diff --git a/packages/analytics/tsconfig.json b/packages/analytics/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/auth/better-auth.config.ts b/packages/auth/better-auth.config.ts old mode 100644 new mode 100755 diff --git a/packages/auth/client.ts b/packages/auth/client.ts old mode 100644 new mode 100755 diff --git a/packages/auth/components/sign-in.tsx b/packages/auth/components/sign-in.tsx old mode 100644 new mode 100755 diff --git a/packages/auth/components/sign-up.tsx b/packages/auth/components/sign-up.tsx old mode 100644 new mode 100755 diff --git a/packages/auth/middleware.ts b/packages/auth/middleware.ts old mode 100644 new mode 100755 diff --git a/packages/auth/package.json b/packages/auth/package.json old mode 100644 new mode 100755 diff --git a/packages/auth/provider.tsx b/packages/auth/provider.tsx old mode 100644 new mode 100755 diff --git a/packages/auth/server.ts b/packages/auth/server.ts old mode 100644 new mode 100755 diff --git a/packages/auth/tsconfig.json b/packages/auth/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/cms/collections.ts b/packages/cms/collections.ts old mode 100644 new mode 100755 diff --git a/packages/cms/components/body.tsx b/packages/cms/components/body.tsx old mode 100644 new mode 100755 diff --git a/packages/cms/components/image.tsx b/packages/cms/components/image.tsx old mode 100644 new mode 100755 diff --git a/packages/cms/components/toc.tsx b/packages/cms/components/toc.tsx old mode 100644 new mode 100755 diff --git a/packages/cms/components/toolbar.tsx b/packages/cms/components/toolbar.tsx old mode 100644 new mode 100755 diff --git a/packages/cms/index.ts b/packages/cms/index.ts old mode 100644 new mode 100755 diff --git a/packages/cms/next-config.ts b/packages/cms/next-config.ts old mode 100644 new mode 100755 diff --git a/packages/cms/package.json b/packages/cms/package.json old mode 100644 new mode 100755 diff --git a/packages/cms/tsconfig.json b/packages/cms/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/cms/typescript-config.json b/packages/cms/typescript-config.json old mode 100644 new mode 100755 diff --git a/packages/collaboration/auth.ts b/packages/collaboration/auth.ts old mode 100644 new mode 100755 diff --git a/packages/collaboration/config.ts b/packages/collaboration/config.ts old mode 100644 new mode 100755 diff --git a/packages/collaboration/hooks.ts b/packages/collaboration/hooks.ts old mode 100644 new mode 100755 diff --git a/packages/collaboration/package.json b/packages/collaboration/package.json old mode 100644 new mode 100755 diff --git a/packages/collaboration/room.tsx b/packages/collaboration/room.tsx old mode 100644 new mode 100755 diff --git a/packages/collaboration/tsconfig.json b/packages/collaboration/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/database/.gitignore b/packages/database/.gitignore old mode 100644 new mode 100755 diff --git a/packages/database/builder.ts b/packages/database/builder.ts old mode 100644 new mode 100755 diff --git a/packages/database/index.ts b/packages/database/index.ts old mode 100644 new mode 100755 diff --git a/packages/database/migrate/migrator.ts b/packages/database/migrate/migrator.ts old mode 100644 new mode 100755 diff --git a/packages/database/migrations/m20241229_000001_init.ts b/packages/database/migrations/m20241229_000001_init.ts old mode 100644 new mode 100755 diff --git a/packages/database/package.json b/packages/database/package.json old mode 100644 new mode 100755 diff --git a/packages/database/schema/database.ts b/packages/database/schema/database.ts old mode 100644 new mode 100755 diff --git a/packages/database/schema/page.ts b/packages/database/schema/page.ts old mode 100644 new mode 100755 diff --git a/packages/database/tsconfig.json b/packages/database/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/design-system/components.json b/packages/design-system/components.json old mode 100644 new mode 100755 diff --git a/packages/design-system/components/mode-toggle.tsx b/packages/design-system/components/mode-toggle.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/accordion.tsx b/packages/design-system/components/ui/accordion.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/alert-dialog.tsx b/packages/design-system/components/ui/alert-dialog.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/alert.tsx b/packages/design-system/components/ui/alert.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/aspect-ratio.tsx b/packages/design-system/components/ui/aspect-ratio.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/avatar.tsx b/packages/design-system/components/ui/avatar.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/badge.tsx b/packages/design-system/components/ui/badge.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/breadcrumb.tsx b/packages/design-system/components/ui/breadcrumb.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/button.tsx b/packages/design-system/components/ui/button.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/calendar.tsx b/packages/design-system/components/ui/calendar.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/card.tsx b/packages/design-system/components/ui/card.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/carousel.tsx b/packages/design-system/components/ui/carousel.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/chart.tsx b/packages/design-system/components/ui/chart.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/checkbox.tsx b/packages/design-system/components/ui/checkbox.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/collapsible.tsx b/packages/design-system/components/ui/collapsible.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/command.tsx b/packages/design-system/components/ui/command.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/context-menu.tsx b/packages/design-system/components/ui/context-menu.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/dialog.tsx b/packages/design-system/components/ui/dialog.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/drawer.tsx b/packages/design-system/components/ui/drawer.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/dropdown-menu.tsx b/packages/design-system/components/ui/dropdown-menu.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/form.tsx b/packages/design-system/components/ui/form.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/hover-card.tsx b/packages/design-system/components/ui/hover-card.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/input-otp.tsx b/packages/design-system/components/ui/input-otp.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/input.tsx b/packages/design-system/components/ui/input.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/label.tsx b/packages/design-system/components/ui/label.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/menubar.tsx b/packages/design-system/components/ui/menubar.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/navigation-menu.tsx b/packages/design-system/components/ui/navigation-menu.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/pagination.tsx b/packages/design-system/components/ui/pagination.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/popover.tsx b/packages/design-system/components/ui/popover.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/progress.tsx b/packages/design-system/components/ui/progress.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/radio-group.tsx b/packages/design-system/components/ui/radio-group.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/resizable.tsx b/packages/design-system/components/ui/resizable.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/scroll-area.tsx b/packages/design-system/components/ui/scroll-area.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/select.tsx b/packages/design-system/components/ui/select.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/separator.tsx b/packages/design-system/components/ui/separator.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/sheet.tsx b/packages/design-system/components/ui/sheet.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/sidebar.tsx b/packages/design-system/components/ui/sidebar.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/skeleton.tsx b/packages/design-system/components/ui/skeleton.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/slider.tsx b/packages/design-system/components/ui/slider.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/sonner.tsx b/packages/design-system/components/ui/sonner.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/switch.tsx b/packages/design-system/components/ui/switch.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/table.tsx b/packages/design-system/components/ui/table.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/tabs.tsx b/packages/design-system/components/ui/tabs.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/textarea.tsx b/packages/design-system/components/ui/textarea.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/toast.tsx b/packages/design-system/components/ui/toast.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/toaster.tsx b/packages/design-system/components/ui/toaster.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/toggle-group.tsx b/packages/design-system/components/ui/toggle-group.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/toggle.tsx b/packages/design-system/components/ui/toggle.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/tooltip.tsx b/packages/design-system/components/ui/tooltip.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/components/ui/use-toast.ts b/packages/design-system/components/ui/use-toast.ts old mode 100644 new mode 100755 diff --git a/packages/design-system/hooks/use-mobile.tsx b/packages/design-system/hooks/use-mobile.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/hooks/use-toast.ts b/packages/design-system/hooks/use-toast.ts old mode 100644 new mode 100755 diff --git a/packages/design-system/index.tsx b/packages/design-system/index.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/lib/fonts.ts b/packages/design-system/lib/fonts.ts old mode 100644 new mode 100755 diff --git a/packages/design-system/lib/utils.ts b/packages/design-system/lib/utils.ts old mode 100644 new mode 100755 diff --git a/packages/design-system/package.json b/packages/design-system/package.json old mode 100644 new mode 100755 diff --git a/packages/design-system/postcss.config.mjs b/packages/design-system/postcss.config.mjs old mode 100644 new mode 100755 diff --git a/packages/design-system/providers/theme.tsx b/packages/design-system/providers/theme.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/styles/globals.css b/packages/design-system/styles/globals.css old mode 100644 new mode 100755 diff --git a/packages/design-system/tsconfig.json b/packages/design-system/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/email/index.tsx b/packages/email/index.tsx old mode 100644 new mode 100755 diff --git a/packages/email/package.json b/packages/email/package.json old mode 100644 new mode 100755 diff --git a/packages/email/templates/contact.tsx b/packages/email/templates/contact.tsx old mode 100644 new mode 100755 diff --git a/packages/email/tsconfig.json b/packages/email/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/env/index.ts b/packages/env/index.ts old mode 100644 new mode 100755 diff --git a/packages/env/package.json b/packages/env/package.json old mode 100644 new mode 100755 diff --git a/packages/env/tsconfig.json b/packages/env/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/feature-flags/access.ts b/packages/feature-flags/access.ts old mode 100644 new mode 100755 diff --git a/packages/feature-flags/index.ts b/packages/feature-flags/index.ts old mode 100644 new mode 100755 diff --git a/packages/feature-flags/lib/create-flag.ts b/packages/feature-flags/lib/create-flag.ts old mode 100644 new mode 100755 diff --git a/packages/feature-flags/package.json b/packages/feature-flags/package.json old mode 100644 new mode 100755 diff --git a/packages/feature-flags/tsconfig.json b/packages/feature-flags/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/migrate/.gitignore b/packages/migrate/.gitignore old mode 100644 new mode 100755 diff --git a/packages/migrate/index.ts b/packages/migrate/index.ts old mode 100644 new mode 100755 diff --git a/packages/migrate/package.json b/packages/migrate/package.json old mode 100644 new mode 100755 diff --git a/packages/migrate/scripts/down.ts b/packages/migrate/scripts/down.ts old mode 100644 new mode 100755 diff --git a/packages/migrate/scripts/up.ts b/packages/migrate/scripts/up.ts old mode 100644 new mode 100755 diff --git a/packages/migrate/tsconfig.json b/packages/migrate/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/next-config/index.ts b/packages/next-config/index.ts old mode 100644 new mode 100755 diff --git a/packages/next-config/instrumentation.ts b/packages/next-config/instrumentation.ts old mode 100644 new mode 100755 diff --git a/packages/next-config/package.json b/packages/next-config/package.json old mode 100644 new mode 100755 diff --git a/packages/next-config/tsconfig.json b/packages/next-config/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/observability/error.ts b/packages/observability/error.ts old mode 100644 new mode 100755 diff --git a/packages/observability/log.ts b/packages/observability/log.ts old mode 100644 new mode 100755 diff --git a/packages/observability/package.json b/packages/observability/package.json old mode 100644 new mode 100755 diff --git a/packages/observability/status/index.tsx b/packages/observability/status/index.tsx old mode 100644 new mode 100755 diff --git a/packages/observability/status/types.ts b/packages/observability/status/types.ts old mode 100644 new mode 100755 diff --git a/packages/observability/tsconfig.json b/packages/observability/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/quirks-path/Cargo.toml b/packages/quirks-path/Cargo.toml old mode 100644 new mode 100755 diff --git a/packages/quirks-path/src/lib.rs b/packages/quirks-path/src/lib.rs old mode 100644 new mode 100755 diff --git a/packages/quirks-path/src/url.rs b/packages/quirks-path/src/url.rs old mode 100644 new mode 100755 diff --git a/packages/quirks-path/src/windows.rs b/packages/quirks-path/src/windows.rs old mode 100644 new mode 100755 diff --git a/packages/rate-limit/index.ts b/packages/rate-limit/index.ts old mode 100644 new mode 100755 diff --git a/packages/rate-limit/package.json b/packages/rate-limit/package.json old mode 100644 new mode 100755 diff --git a/packages/security/index.ts b/packages/security/index.ts old mode 100644 new mode 100755 diff --git a/packages/security/middleware.ts b/packages/security/middleware.ts old mode 100644 new mode 100755 diff --git a/packages/security/package.json b/packages/security/package.json old mode 100644 new mode 100755 diff --git a/packages/security/tsconfig.json b/packages/security/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/seo/json-ld.tsx b/packages/seo/json-ld.tsx old mode 100644 new mode 100755 diff --git a/packages/seo/metadata.ts b/packages/seo/metadata.ts old mode 100644 new mode 100755 diff --git a/packages/seo/package.json b/packages/seo/package.json old mode 100644 new mode 100755 diff --git a/packages/seo/tsconfig.json b/packages/seo/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/storage/client.ts b/packages/storage/client.ts old mode 100644 new mode 100755 diff --git a/packages/storage/index.ts b/packages/storage/index.ts old mode 100644 new mode 100755 diff --git a/packages/storage/package.json b/packages/storage/package.json old mode 100644 new mode 100755 diff --git a/packages/storage/tsconfig.json b/packages/storage/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/tailwind-config/config.ts b/packages/tailwind-config/config.ts old mode 100644 new mode 100755 diff --git a/packages/tailwind-config/index.ts b/packages/tailwind-config/index.ts old mode 100644 new mode 100755 diff --git a/packages/tailwind-config/package.json b/packages/tailwind-config/package.json old mode 100644 new mode 100755 diff --git a/packages/tailwind-config/tsconfig.json b/packages/tailwind-config/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/tailwind-config/typography.config.ts b/packages/tailwind-config/typography.config.ts old mode 100644 new mode 100755 diff --git a/packages/testing/package.json b/packages/testing/package.json old mode 100644 new mode 100755 diff --git a/packages/testing/tsconfig.json b/packages/testing/tsconfig.json old mode 100644 new mode 100755 diff --git a/packages/typescript-config/base.json b/packages/typescript-config/base.json old mode 100644 new mode 100755 diff --git a/packages/typescript-config/nextjs.json b/packages/typescript-config/nextjs.json old mode 100644 new mode 100755 diff --git a/packages/typescript-config/package.json b/packages/typescript-config/package.json old mode 100644 new mode 100755 diff --git a/packages/typescript-config/react-library.json b/packages/typescript-config/react-library.json old mode 100644 new mode 100755 diff --git a/packages/webhooks/index.ts b/packages/webhooks/index.ts old mode 100644 new mode 100755 diff --git a/packages/webhooks/lib/svix.ts b/packages/webhooks/lib/svix.ts old mode 100644 new mode 100755 diff --git a/packages/webhooks/package.json b/packages/webhooks/package.json old mode 100644 new mode 100755 diff --git a/patches/.gitkeep b/patches/.gitkeep old mode 100644 new mode 100755 diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml old mode 100644 new mode 100755 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml old mode 100644 new mode 100755 diff --git a/rust-toolchain.toml b/rust-toolchain.toml old mode 100644 new mode 100755 diff --git a/rustfmt.toml b/rustfmt.toml old mode 100644 new mode 100755 diff --git a/turbo.json b/turbo.json old mode 100644 new mode 100755 diff --git a/turbo/generators/config.ts b/turbo/generators/config.ts old mode 100644 new mode 100755 diff --git a/turbo/generators/package.json b/turbo/generators/package.json old mode 100644 new mode 100755 diff --git a/turbo/generators/templates/package.json.hbs b/turbo/generators/templates/package.json.hbs old mode 100644 new mode 100755 diff --git a/turbo/generators/templates/tsconfig.json.hbs b/turbo/generators/templates/tsconfig.json.hbs old mode 100644 new mode 100755