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" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]] [[package]]
name = "ext_calckey_model_migration" name = "ext_model_migration"
version = "0.3.0-alpha" version = "0.3.0-alpha"
dependencies = [ dependencies = [
"sea-orm-migration", "sea-orm-migration",
@ -1612,11 +1612,11 @@ dependencies = [
"idna", "idna",
"itertools", "itertools",
"lru", "lru",
"magnetar_calckey_model",
"magnetar_common", "magnetar_common",
"magnetar_core", "magnetar_core",
"magnetar_federation", "magnetar_federation",
"magnetar_host_meta", "magnetar_host_meta",
"magnetar_model",
"magnetar_nodeinfo", "magnetar_nodeinfo",
"magnetar_sdk", "magnetar_sdk",
"magnetar_webfinger", "magnetar_webfinger",
@ -1666,30 +1666,6 @@ dependencies = [
"walkdir", "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]] [[package]]
name = "magnetar_common" name = "magnetar_common"
version = "0.3.0-alpha" version = "0.3.0-alpha"
@ -1774,6 +1750,30 @@ dependencies = [
"unicode-segmentation", "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]] [[package]]
name = "magnetar_nodeinfo" name = "magnetar_nodeinfo"
version = "0.3.0-alpha" version = "0.3.0-alpha"

View File

@ -11,7 +11,7 @@ members = [
"ext_federation", "ext_federation",
"ext_nodeinfo", "ext_nodeinfo",
"ext_webfinger", "ext_webfinger",
"ext_calckey_model", "ext_model",
"fe_calckey", "fe_calckey",
"magnetar_common", "magnetar_common",
"magnetar_sdk", "magnetar_sdk",
@ -86,7 +86,7 @@ magnetar_federation = { path = "./ext_federation" }
magnetar_host_meta = { path = "./ext_host_meta" } magnetar_host_meta = { path = "./ext_host_meta" }
magnetar_webfinger = { path = "./ext_webfinger" } magnetar_webfinger = { path = "./ext_webfinger" }
magnetar_nodeinfo = { path = "./ext_nodeinfo" } magnetar_nodeinfo = { path = "./ext_nodeinfo" }
magnetar_calckey_model = { path = "./ext_calckey_model" } magnetar_model = { path = "./ext_model" }
magnetar_sdk = { path = "./magnetar_sdk" } magnetar_sdk = { path = "./magnetar_sdk" }
cached = { workspace = true } 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] [package]
name = "magnetar_calckey_model" name = "magnetar_model"
version.workspace = true version.workspace = true
edition.workspace = true edition.workspace = true
@ -8,7 +8,7 @@ crate-type = ["rlib"]
[dependencies] [dependencies]
ck = { path = "./entity_ck" } ck = { path = "./entity_ck" }
ext_calckey_model_migration = { path = "./migration" } ext_model_migration = { path = "./migration" }
magnetar_common = { path = "../magnetar_common" } magnetar_common = { path = "../magnetar_common" }
magnetar_sdk = { path = "../magnetar_sdk" } magnetar_sdk = { path = "../magnetar_sdk" }

View File

@ -1,5 +1,5 @@
[package] [package]
name = "ext_calckey_model_migration" name = "ext_model_migration"
version.workspace = true version.workspace = true
edition.workspace = true edition.workspace = true
@ -8,9 +8,12 @@ name = "migrate"
path = "src/main.rs" path = "src/main.rs"
[lib] [lib]
name = "ext_calckey_model_migration" name = "ext_model_migration"
path = "src/lib.rs" path = "src/lib.rs"
[dependencies] [dependencies]
tokio = { workspace = true, features = ["full"] } 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] #[tokio::main]
async fn 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::note_model::NoteResolver;
use crate::notification_model::NotificationResolver; use crate::notification_model::NotificationResolver;
use chrono::Utc; use chrono::Utc;
use ext_calckey_model_migration::{Migrator, MigratorTrait}; use ext_model_migration::{Migrator, MigratorTrait};
use futures_util::StreamExt; use futures_util::StreamExt;
use redis::IntoConnectionInfo; use redis::IntoConnectionInfo;
use sea_orm::ActiveValue::Set; use sea_orm::{ActiveValue::Set, ConnectionTrait};
use sea_orm::{ use sea_orm::{
ColumnTrait, ConnectOptions, DatabaseConnection, DbErr, EntityTrait, QueryFilter, ColumnTrait, ConnectOptions, DatabaseConnection, DbErr, EntityTrait, QueryFilter,
TransactionTrait, TransactionTrait,

View File

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

View File

@ -1,6 +1,6 @@
pub mod data; 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::sea_query::{Asterisk, Expr, IntoIden, Query, SelectExpr, SimpleExpr};
use sea_orm::{ use sea_orm::{
Condition, EntityTrait, Iden, JoinType, QueryFilter, QueryOrder, QuerySelect, QueryTrait, Condition, EntityTrait, Iden, JoinType, QueryFilter, QueryOrder, QuerySelect, QueryTrait,

View File

@ -9,7 +9,7 @@ use crate::{CalckeyDbError, CalckeyModel};
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use ck::sea_orm_active_enums::NotificationTypeEnum; use ck::sea_orm_active_enums::NotificationTypeEnum;
use ck::{access_token, notification, user}; 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 magnetar_sdk::types::SpanFilter;
use sea_orm::prelude::Expr; use sea_orm::prelude::Expr;
use sea_orm::sea_query::{IntoCondition, Query}; 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 crate::{model_ext::SelectColumnsExt, CalckeyDbError, CalckeyModel};
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use ck::{drive_file, follow_request, following, user, user_profile}; 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 magnetar_sdk::types::SpanFilter;
use sea_orm::{ use sea_orm::{
ColumnTrait, DbErr, EntityTrait, FromQueryResult, Iden, JoinType, QueryFilter, QueryResult, 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 axum::response::Sse;
use futures::Stream; use futures::Stream;
use futures_util::StreamExt as _; use futures_util::StreamExt as _;
use magnetar_calckey_model::model_ext::IdShape; use magnetar_model::model_ext::IdShape;
use magnetar_calckey_model::{CalckeySub, MainStreamMessage, SubMessage}; use magnetar_model::{CalckeySub, MainStreamMessage, SubMessage};
use magnetar_sdk::types::streaming::ChannelEvent; use magnetar_sdk::types::streaming::ChannelEvent;
use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc; use std::sync::Arc;

View File

@ -14,7 +14,7 @@ use crate::service::MagnetarService;
use axum::routing::get; use axum::routing::get;
use axum::Router; use axum::Router;
use dotenvy::dotenv; use dotenvy::dotenv;
use magnetar_calckey_model::{CacheConnectorConfig, CalckeyCache, CalckeyModel, ConnectorConfig}; use magnetar_model::{CacheConnectorConfig, CalckeyCache, CalckeyModel, ConnectorConfig};
use miette::{miette, IntoDiagnostic}; use miette::{miette, IntoDiagnostic};
use std::net::SocketAddr; use std::net::SocketAddr;
use std::sync::Arc; 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 magnetar_sdk::types::drive::{DriveFileBase, ImageMeta};
use serde::Deserialize; use serde::Deserialize;
use url::Url; use url::Url;

View File

@ -1,5 +1,5 @@
use crate::model::{PackType, PackingContext}; use crate::model::{PackType, PackingContext};
use magnetar_calckey_model::ck; use magnetar_model::ck;
use magnetar_sdk::types::emoji::EmojiBase; use magnetar_sdk::types::emoji::EmojiBase;
impl PackType<&ck::emoji::Model> for 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 { pub trait BaseId: 'static {
fn get_id(&self) -> &str; fn get_id(&self) -> &str;

View File

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

View File

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

View File

@ -1,5 +1,5 @@
use crate::model::{PackType, PackingContext}; 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::note::{PackNoteMaybeFull, Reaction};
use magnetar_sdk::types::notification::{ use magnetar_sdk::types::notification::{
NotificationAppExt, NotificationBase, NotificationNoteExt, NotificationReactionExt, NotificationAppExt, NotificationBase, NotificationNoteExt, NotificationReactionExt,

View File

@ -1,6 +1,6 @@
use crate::model::{PackType, PackingContext}; use crate::model::{PackType, PackingContext};
use chrono::{DateTime, Utc}; use chrono::{DateTime, Utc};
use magnetar_calckey_model::ck; use magnetar_model::ck;
use magnetar_sdk::types::note::{PollBase, PollChoice}; use magnetar_sdk::types::note::{PollBase, PollChoice};
pub type PollPackInput<'a> = (&'a ck::poll::Model, Option<&'a [ck::poll_vote::Model]>); 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_model::ck;
use magnetar_calckey_model::ck::sea_orm_active_enums::UserProfileFfvisibilityEnum; use magnetar_model::ck::sea_orm_active_enums::UserProfileFfvisibilityEnum;
use magnetar_sdk::types::drive::PackDriveFileBase; use magnetar_sdk::types::drive::PackDriveFileBase;
use magnetar_sdk::types::emoji::{EmojiContext, PackEmojiBase}; use magnetar_sdk::types::emoji::{EmojiContext, PackEmojiBase};
use magnetar_sdk::types::instance::InstanceTicker; use magnetar_sdk::types::instance::InstanceTicker;

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