chore(apb): moved jsonld under apb as feature
This commit is contained in:
parent
a3a1338c28
commit
78bc514012
4 changed files with 10 additions and 4 deletions
|
@ -32,6 +32,8 @@ activitypub-fe = [] # https://ns.alemi.dev/as/fe/#
|
||||||
ostatus = [] # https://ostatus.org# , but it redirects and 403??? just need this for conversation
|
ostatus = [] # https://ostatus.org# , but it redirects and 403??? just need this for conversation
|
||||||
toot = [] # http://joinmastodon.org/ns# , mastodon is weird tho??
|
toot = [] # http://joinmastodon.org/ns# , mastodon is weird tho??
|
||||||
litepub = [] # incomplete, https://litepub.social/
|
litepub = [] # incomplete, https://litepub.social/
|
||||||
|
# full jsonld utilities
|
||||||
|
jsonld = []
|
||||||
# builtin utils
|
# builtin utils
|
||||||
send = []
|
send = []
|
||||||
orm = ["dep:sea-orm"]
|
orm = ["dep:sea-orm"]
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use apb::Object;
|
use crate::Object;
|
||||||
|
|
||||||
|
|
||||||
pub trait LD {
|
pub trait LD {
|
||||||
fn ld_context(self) -> Self;
|
fn ld_context(self) -> Self;
|
||||||
|
@ -13,7 +12,7 @@ impl LD for serde_json::Value {
|
||||||
ctx.insert("sensitive".to_string(), serde_json::Value::String("as:sensitive".into()));
|
ctx.insert("sensitive".to_string(), serde_json::Value::String("as:sensitive".into()));
|
||||||
ctx.insert("quoteUrl".to_string(), serde_json::Value::String("as:quoteUrl".into()));
|
ctx.insert("quoteUrl".to_string(), serde_json::Value::String("as:quoteUrl".into()));
|
||||||
match o_type {
|
match o_type {
|
||||||
Some(apb::ObjectType::Actor(_)) => {
|
Some(crate::ObjectType::Actor(_)) => {
|
||||||
ctx.insert("counters".to_string(), serde_json::Value::String("https://ns.alemi.dev/as/counters/#".into()));
|
ctx.insert("counters".to_string(), serde_json::Value::String("https://ns.alemi.dev/as/counters/#".into()));
|
||||||
ctx.insert("followingCount".to_string(), serde_json::Value::String("counters:followingCount".into()));
|
ctx.insert("followingCount".to_string(), serde_json::Value::String("counters:followingCount".into()));
|
||||||
ctx.insert("followersCount".to_string(), serde_json::Value::String("counters:followersCount".into()));
|
ctx.insert("followersCount".to_string(), serde_json::Value::String("counters:followersCount".into()));
|
|
@ -99,6 +99,12 @@ pub mod target;
|
||||||
mod key;
|
mod key;
|
||||||
pub use key::{PublicKey, PublicKeyMut};
|
pub use key::{PublicKey, PublicKeyMut};
|
||||||
|
|
||||||
|
#[cfg(feature = "jsonld")]
|
||||||
|
mod jsonld;
|
||||||
|
|
||||||
|
#[cfg(feature = "jsonld")]
|
||||||
|
pub use jsonld::LD;
|
||||||
|
|
||||||
mod types;
|
mod types;
|
||||||
pub use types::{
|
pub use types::{
|
||||||
base::{Base, BaseMut, BaseType},
|
base::{Base, BaseMut, BaseType},
|
||||||
|
|
|
@ -10,6 +10,5 @@ pub mod auth;
|
||||||
pub mod httpsign;
|
pub mod httpsign;
|
||||||
pub mod normalizer;
|
pub mod normalizer;
|
||||||
pub mod side_effects;
|
pub mod side_effects;
|
||||||
pub mod jsonld;
|
|
||||||
|
|
||||||
pub use context::Context;
|
pub use context::Context;
|
||||||
|
|
Loading…
Reference in a new issue