fix: added new fields to constructors
This commit is contained in:
parent
e0f427a2b9
commit
960f7be291
5 changed files with 14 additions and 2 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
@ -140,7 +140,7 @@ checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "apb"
|
name = "apb"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
@ -4793,6 +4793,7 @@ dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
"hmac",
|
||||||
"httpsign",
|
"httpsign",
|
||||||
"jrd",
|
"jrd",
|
||||||
"nodeinfo",
|
"nodeinfo",
|
||||||
|
@ -4804,6 +4805,7 @@ dependencies = [
|
||||||
"serde-inline-default",
|
"serde-inline-default",
|
||||||
"serde_default",
|
"serde_default",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
"sha2",
|
||||||
"sha256",
|
"sha256",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
@ -4841,6 +4843,7 @@ dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
"futures",
|
"futures",
|
||||||
|
"mdhtml",
|
||||||
"openssl",
|
"openssl",
|
||||||
"sea-orm",
|
"sea-orm",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
|
@ -21,6 +21,9 @@ pub async fn faker(ctx: upub::Context, count: i64) -> Result<(), sea_orm::DbErr>
|
||||||
followers: None,
|
followers: None,
|
||||||
followers_count: 0,
|
followers_count: 0,
|
||||||
statuses_count: count as i32,
|
statuses_count: count as i32,
|
||||||
|
fields: vec![],
|
||||||
|
also_known_as: vec![],
|
||||||
|
moved_to: None,
|
||||||
icon: Some("https://cdn.alemi.dev/social/circle-square.png".to_string()),
|
icon: Some("https://cdn.alemi.dev/social/circle-square.png".to_string()),
|
||||||
image: Some("https://cdn.alemi.dev/social/someriver-xs.jpg".to_string()),
|
image: Some("https://cdn.alemi.dev/social/someriver-xs.jpg".to_string()),
|
||||||
inbox: None,
|
inbox: None,
|
||||||
|
|
|
@ -34,6 +34,9 @@ pub async fn application(
|
||||||
domain: Set(domain.clone()),
|
domain: Set(domain.clone()),
|
||||||
preferred_username: Set(domain.clone()),
|
preferred_username: Set(domain.clone()),
|
||||||
actor_type: Set(apb::ActorType::Application),
|
actor_type: Set(apb::ActorType::Application),
|
||||||
|
also_known_as: Set(vec![]),
|
||||||
|
moved_to: Set(None),
|
||||||
|
fields: Set(vec![]), // TODO we could put some useful things here actually
|
||||||
private_key: Set(Some(privk)),
|
private_key: Set(Some(privk)),
|
||||||
public_key: Set(pubk),
|
public_key: Set(pubk),
|
||||||
following: Set(None),
|
following: Set(None),
|
||||||
|
|
|
@ -210,7 +210,7 @@ impl Model {
|
||||||
.set_attachment(apb::Node::array(
|
.set_attachment(apb::Node::array(
|
||||||
self.fields
|
self.fields
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|x| serde_json::to_value(&x).ok())
|
.filter_map(|x| serde_json::to_value(x).ok())
|
||||||
.collect()
|
.collect()
|
||||||
))
|
))
|
||||||
.set_published(Some(self.published))
|
.set_published(Some(self.published))
|
||||||
|
|
|
@ -35,11 +35,14 @@ impl Administrable for crate::Context {
|
||||||
domain: Set(domain),
|
domain: Set(domain),
|
||||||
summary: Set(summary),
|
summary: Set(summary),
|
||||||
preferred_username: Set(username.clone()),
|
preferred_username: Set(username.clone()),
|
||||||
|
fields: Set(vec![]),
|
||||||
following: Set(None),
|
following: Set(None),
|
||||||
following_count: Set(0),
|
following_count: Set(0),
|
||||||
followers: Set(None),
|
followers: Set(None),
|
||||||
followers_count: Set(0),
|
followers_count: Set(0),
|
||||||
statuses_count: Set(0),
|
statuses_count: Set(0),
|
||||||
|
also_known_as: Set(vec![]),
|
||||||
|
moved_to: Set(None),
|
||||||
icon: Set(avatar_url),
|
icon: Set(avatar_url),
|
||||||
image: Set(banner_url),
|
image: Set(banner_url),
|
||||||
inbox: Set(None),
|
inbox: Set(None),
|
||||||
|
|
Loading…
Reference in a new issue