Simplified the model naming

This commit is contained in:
Natty 2024-04-15 04:45:44 +02:00
parent ce46782318
commit e1fd078367
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
117 changed files with 114 additions and 91 deletions

52
Cargo.lock generated
View File

@ -931,7 +931,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]]
name = "ext_calckey_model_migration"
name = "ext_model_migration"
version = "0.3.0-alpha"
dependencies = [
"sea-orm-migration",
@ -1612,11 +1612,11 @@ dependencies = [
"idna",
"itertools",
"lru",
"magnetar_calckey_model",
"magnetar_common",
"magnetar_core",
"magnetar_federation",
"magnetar_host_meta",
"magnetar_model",
"magnetar_nodeinfo",
"magnetar_sdk",
"magnetar_webfinger",
@ -1666,30 +1666,6 @@ dependencies = [
"walkdir",
]
[[package]]
name = "magnetar_calckey_model"
version = "0.3.0-alpha"
dependencies = [
"chrono",
"ck",
"dotenvy",
"ext_calckey_model_migration",
"futures-core",
"futures-util",
"magnetar_common",
"magnetar_sdk",
"redis",
"sea-orm",
"serde",
"serde_json",
"strum",
"thiserror",
"tokio",
"tokio-util",
"tracing",
"url",
]
[[package]]
name = "magnetar_common"
version = "0.3.0-alpha"
@ -1774,6 +1750,30 @@ dependencies = [
"unicode-segmentation",
]
[[package]]
name = "magnetar_model"
version = "0.3.0-alpha"
dependencies = [
"chrono",
"ck",
"dotenvy",
"ext_model_migration",
"futures-core",
"futures-util",
"magnetar_common",
"magnetar_sdk",
"redis",
"sea-orm",
"serde",
"serde_json",
"strum",
"thiserror",
"tokio",
"tokio-util",
"tracing",
"url",
]
[[package]]
name = "magnetar_nodeinfo"
version = "0.3.0-alpha"

View File

@ -11,7 +11,7 @@ members = [
"ext_federation",
"ext_nodeinfo",
"ext_webfinger",
"ext_calckey_model",
"ext_model",
"fe_calckey",
"magnetar_common",
"magnetar_sdk",
@ -86,7 +86,7 @@ magnetar_federation = { path = "./ext_federation" }
magnetar_host_meta = { path = "./ext_host_meta" }
magnetar_webfinger = { path = "./ext_webfinger" }
magnetar_nodeinfo = { path = "./ext_nodeinfo" }
magnetar_calckey_model = { path = "./ext_calckey_model" }
magnetar_model = { path = "./ext_model" }
magnetar_sdk = { path = "./magnetar_sdk" }
cached = { workspace = true }

View File

@ -0,0 +1,21 @@
[package]
name = "magnetar_activity_streams"
version.workspace = true
edition.workspace = true
license = "MIT OR Apache-2.0"
[lib]
crate-type = ["rlib"]
[dependencies]
async-trait = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
thiserror = { workspace = true }
url = { workspace = true, features = ["serde"] }
[dev-dependencies]
tokio = { workspace = true, features = ["full"] }

View File

@ -0,0 +1 @@

View File

@ -1,5 +1,5 @@
[package]
name = "magnetar_calckey_model"
name = "magnetar_model"
version.workspace = true
edition.workspace = true
@ -8,7 +8,7 @@ crate-type = ["rlib"]
[dependencies]
ck = { path = "./entity_ck" }
ext_calckey_model_migration = { path = "./migration" }
ext_model_migration = { path = "./migration" }
magnetar_common = { path = "../magnetar_common" }
magnetar_sdk = { path = "../magnetar_sdk" }

View File

@ -1,5 +1,5 @@
[package]
name = "ext_calckey_model_migration"
name = "ext_model_migration"
version.workspace = true
edition.workspace = true
@ -8,9 +8,12 @@ name = "migrate"
path = "src/main.rs"
[lib]
name = "ext_calckey_model_migration"
name = "ext_model_migration"
path = "src/lib.rs"
[dependencies]
tokio = { workspace = true, features = ["full"] }
sea-orm-migration = { workspace = true, features = ["runtime-tokio-rustls", "sqlx-postgres"] }
sea-orm-migration = { workspace = true, features = [
"runtime-tokio-rustls",
"sqlx-postgres",
] }

View File

@ -2,5 +2,5 @@ use sea_orm_migration::prelude::*;
#[tokio::main]
async fn main() {
cli::run_cli(ext_calckey_model_migration::Migrator).await;
cli::run_cli(ext_model_migration::Migrator).await;
}

View File

@ -15,10 +15,10 @@ use crate::model_ext::IdShape;
use crate::note_model::NoteResolver;
use crate::notification_model::NotificationResolver;
use chrono::Utc;
use ext_calckey_model_migration::{Migrator, MigratorTrait};
use ext_model_migration::{Migrator, MigratorTrait};
use futures_util::StreamExt;
use redis::IntoConnectionInfo;
use sea_orm::ActiveValue::Set;
use sea_orm::{ActiveValue::Set, ConnectionTrait};
use sea_orm::{
ColumnTrait, ConnectOptions, DatabaseConnection, DbErr, EntityTrait, QueryFilter,
TransactionTrait,

View File

@ -1,7 +1,5 @@
use chrono::{DateTime, Utc};
use ext_calckey_model_migration::{
Alias, Expr, IntoIden, Quote, SelectExpr, SelectStatement, TableRef,
};
use ext_model_migration::{Alias, Expr, IntoIden, Quote, SelectExpr, SelectStatement, TableRef};
use magnetar_sdk::types::SpanFilter;
use sea_orm::{
ColumnTrait, Condition, ConnectionTrait, Cursor, DbErr, DynIden, EntityTrait, FromQueryResult,

View File

@ -1,6 +1,6 @@
pub mod data;
use ext_calckey_model_migration::SelectStatement;
use ext_model_migration::SelectStatement;
use sea_orm::sea_query::{Asterisk, Expr, IntoIden, Query, SelectExpr, SimpleExpr};
use sea_orm::{
Condition, EntityTrait, Iden, JoinType, QueryFilter, QueryOrder, QuerySelect, QueryTrait,

View File

@ -9,7 +9,7 @@ use crate::{CalckeyDbError, CalckeyModel};
use chrono::{DateTime, Utc};
use ck::sea_orm_active_enums::NotificationTypeEnum;
use ck::{access_token, notification, user};
use ext_calckey_model_migration::{JoinType, SelectStatement};
use ext_model_migration::{JoinType, SelectStatement};
use magnetar_sdk::types::SpanFilter;
use sea_orm::prelude::Expr;
use sea_orm::sea_query::{IntoCondition, Query};

View File

@ -4,7 +4,7 @@ use crate::model_ext::{
use crate::{model_ext::SelectColumnsExt, CalckeyDbError, CalckeyModel};
use chrono::{DateTime, Utc};
use ck::{drive_file, follow_request, following, user, user_profile};
use ext_calckey_model_migration::{IntoIden, SelectStatement};
use ext_model_migration::{IntoIden, SelectStatement};
use magnetar_sdk::types::SpanFilter;
use sea_orm::{
ColumnTrait, DbErr, EntityTrait, FromQueryResult, Iden, JoinType, QueryFilter, QueryResult,

View File

@ -8,8 +8,8 @@ use axum::response::sse::{Event, KeepAlive};
use axum::response::Sse;
use futures::Stream;
use futures_util::StreamExt as _;
use magnetar_calckey_model::model_ext::IdShape;
use magnetar_calckey_model::{CalckeySub, MainStreamMessage, SubMessage};
use magnetar_model::model_ext::IdShape;
use magnetar_model::{CalckeySub, MainStreamMessage, SubMessage};
use magnetar_sdk::types::streaming::ChannelEvent;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;

View File

@ -14,7 +14,7 @@ use crate::service::MagnetarService;
use axum::routing::get;
use axum::Router;
use dotenvy::dotenv;
use magnetar_calckey_model::{CacheConnectorConfig, CalckeyCache, CalckeyModel, ConnectorConfig};
use magnetar_model::{CacheConnectorConfig, CalckeyCache, CalckeyModel, ConnectorConfig};
use miette::{miette, IntoDiagnostic};
use std::net::SocketAddr;
use std::sync::Arc;

View File

@ -1,4 +1,4 @@
use magnetar_calckey_model::ck;
use magnetar_model::ck;
use magnetar_sdk::types::drive::{DriveFileBase, ImageMeta};
use serde::Deserialize;
use url::Url;

View File

@ -1,5 +1,5 @@
use crate::model::{PackType, PackingContext};
use magnetar_calckey_model::ck;
use magnetar_model::ck;
use magnetar_sdk::types::emoji::EmojiBase;
impl PackType<&ck::emoji::Model> for EmojiBase {

View File

@ -1,4 +1,4 @@
use magnetar_calckey_model::ck;
use magnetar_model::ck;
pub trait BaseId: 'static {
fn get_id(&self) -> &str;

View File

@ -1,5 +1,5 @@
use crate::model::{PackType, PackingContext};
use magnetar_calckey_model::ck;
use magnetar_model::ck;
use magnetar_sdk::types::instance::InstanceTicker;
impl<'a> PackType<&'a ck::instance::Model> for InstanceTicker {

View File

@ -1,5 +1,5 @@
use magnetar_calckey_model::ck;
use magnetar_calckey_model::note_model::data::sub_interaction_renote;
use magnetar_model::ck;
use magnetar_model::note_model::data::sub_interaction_renote;
use magnetar_sdk::types::note::{
NoteDetailExt, NoteSelfContextExt, PackNoteMaybeFull, PackPollBase, ReactionPair,
};

View File

@ -1,5 +1,5 @@
use crate::model::{PackType, PackingContext};
use magnetar_calckey_model::ck;
use magnetar_model::ck;
use magnetar_sdk::types::note::{PackNoteMaybeFull, Reaction};
use magnetar_sdk::types::notification::{
NotificationAppExt, NotificationBase, NotificationNoteExt, NotificationReactionExt,

View File

@ -1,6 +1,6 @@
use crate::model::{PackType, PackingContext};
use chrono::{DateTime, Utc};
use magnetar_calckey_model::ck;
use magnetar_model::ck;
use magnetar_sdk::types::note::{PollBase, PollChoice};
pub type PollPackInput<'a> = (&'a ck::poll::Model, Option<&'a [ck::poll_vote::Model]>);

View File

@ -1,5 +1,5 @@
use magnetar_calckey_model::ck;
use magnetar_calckey_model::ck::sea_orm_active_enums::UserProfileFfvisibilityEnum;
use magnetar_model::ck;
use magnetar_model::ck::sea_orm_active_enums::UserProfileFfvisibilityEnum;
use magnetar_sdk::types::drive::PackDriveFileBase;
use magnetar_sdk::types::emoji::{EmojiContext, PackEmojiBase};
use magnetar_sdk::types::instance::InstanceTicker;

Some files were not shown because too many files have changed in this diff Show More