mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
Make endpoints bigger
This commit is contained in:
parent
6d77c8edc7
commit
8e7f08678b
|
|
@ -24,20 +24,103 @@ export default async (
|
||||||
"@context": [
|
"@context": [
|
||||||
"https://www.w3.org/ns/activitystreams",
|
"https://www.w3.org/ns/activitystreams",
|
||||||
"https://w3id.org/security/v1",
|
"https://w3id.org/security/v1",
|
||||||
|
{
|
||||||
|
manuallyApprovesFollowers: "as:manuallyApprovesFollowers",
|
||||||
|
toot: "http://joinmastodon.org/ns#",
|
||||||
|
featured: {
|
||||||
|
"@id": "toot:featured",
|
||||||
|
"@type": "@id",
|
||||||
|
},
|
||||||
|
featuredTags: {
|
||||||
|
"@id": "toot:featuredTags",
|
||||||
|
"@type": "@id",
|
||||||
|
},
|
||||||
|
alsoKnownAs: {
|
||||||
|
"@id": "as:alsoKnownAs",
|
||||||
|
"@type": "@id",
|
||||||
|
},
|
||||||
|
movedTo: {
|
||||||
|
"@id": "as:movedTo",
|
||||||
|
"@type": "@id",
|
||||||
|
},
|
||||||
|
schema: "http://schema.org#",
|
||||||
|
PropertyValue: "schema:PropertyValue",
|
||||||
|
value: "schema:value",
|
||||||
|
discoverable: "toot:discoverable",
|
||||||
|
Device: "toot:Device",
|
||||||
|
Ed25519Signature: "toot:Ed25519Signature",
|
||||||
|
Ed25519Key: "toot:Ed25519Key",
|
||||||
|
Curve25519Key: "toot:Curve25519Key",
|
||||||
|
EncryptedMessage: "toot:EncryptedMessage",
|
||||||
|
publicKeyBase64: "toot:publicKeyBase64",
|
||||||
|
deviceId: "toot:deviceId",
|
||||||
|
claim: {
|
||||||
|
"@type": "@id",
|
||||||
|
"@id": "toot:claim",
|
||||||
|
},
|
||||||
|
fingerprintKey: {
|
||||||
|
"@type": "@id",
|
||||||
|
"@id": "toot:fingerprintKey",
|
||||||
|
},
|
||||||
|
identityKey: {
|
||||||
|
"@type": "@id",
|
||||||
|
"@id": "toot:identityKey",
|
||||||
|
},
|
||||||
|
devices: {
|
||||||
|
"@type": "@id",
|
||||||
|
"@id": "toot:devices",
|
||||||
|
},
|
||||||
|
messageFranking: "toot:messageFranking",
|
||||||
|
messageType: "toot:messageType",
|
||||||
|
cipherText: "toot:cipherText",
|
||||||
|
suspended: "toot:suspended",
|
||||||
|
Emoji: "toot:Emoji",
|
||||||
|
focalPoint: {
|
||||||
|
"@container": "@list",
|
||||||
|
"@id": "toot:focalPoint",
|
||||||
|
},
|
||||||
|
Hashtag: "as:Hashtag",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
id: `${getHost()}/@${user.username}/actor`,
|
id: `${getHost()}/@${user.username}/actor`,
|
||||||
type: "Person",
|
type: "Person",
|
||||||
preferredUsername: user.username, // TODO: Add user display name
|
preferredUsername: user.username, // TODO: Add user display name
|
||||||
name: user.username,
|
name: user.username,
|
||||||
summary: user.bio,
|
summary: user.bio,
|
||||||
icon: [
|
icon: /*{
|
||||||
// TODO: Add user avatar
|
type: "Image",
|
||||||
],
|
url: user.avatar,
|
||||||
|
mediaType: mimetype
|
||||||
|
}*/ undefined, // TODO: Add avatar
|
||||||
|
image: /*{
|
||||||
|
type: "Image",
|
||||||
|
url: user.avatar,
|
||||||
|
mediaType: mimetype
|
||||||
|
}*/ undefined, // TODO: Add banner
|
||||||
inbox: `${getHost()}/@${user.username}/inbox`,
|
inbox: `${getHost()}/@${user.username}/inbox`,
|
||||||
outbox: `${getHost()}/@${user.username}/outbox`,
|
outbox: `${getHost()}/@${user.username}/outbox`,
|
||||||
followers: `${getHost()}/@${user.username}/followers`,
|
followers: `${getHost()}/@${user.username}/followers`,
|
||||||
following: `${getHost()}/@${user.username}/following`,
|
following: `${getHost()}/@${user.username}/following`,
|
||||||
liked: `${getHost()}/@${user.username}/liked`,
|
liked: `${getHost()}/@${user.username}/liked`,
|
||||||
|
discoverable: true,
|
||||||
|
alsoKnownAs: [
|
||||||
|
// TODO: Add accounts from which the user migrated
|
||||||
|
],
|
||||||
|
manuallyApprovesFollowers: false, // TODO: Change
|
||||||
|
publicKey: {
|
||||||
|
id: `${getHost()}/@${user.username}/actor#main-key`,
|
||||||
|
owner: `${getHost()}/@${user.username}/actor`,
|
||||||
|
// TODO: Add user public key
|
||||||
|
},
|
||||||
|
tag: [
|
||||||
|
// TODO: Add emojis here, and hashtags
|
||||||
|
],
|
||||||
|
attachment: [
|
||||||
|
// TODO: Add user attachments (I.E. profile metadata)
|
||||||
|
],
|
||||||
|
endpoints: {
|
||||||
|
sharedInbox: `${getHost()}/inbox`,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -109,10 +109,27 @@ export default async (
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return jsonResponse(await compact({
|
return jsonResponse(
|
||||||
|
await compact({
|
||||||
"@context": [
|
"@context": [
|
||||||
"https://www.w3.org/ns/activitystreams",
|
"https://www.w3.org/ns/activitystreams",
|
||||||
"https://w3id.org/security/v1",
|
{
|
||||||
|
ostatus: "http://ostatus.org#",
|
||||||
|
atomUri: "ostatus:atomUri",
|
||||||
|
inReplyToAtomUri: "ostatus:inReplyToAtomUri",
|
||||||
|
conversation: "ostatus:conversation",
|
||||||
|
sensitive: "as:sensitive",
|
||||||
|
toot: "http://joinmastodon.org/ns#",
|
||||||
|
votersCount: "toot:votersCount",
|
||||||
|
litepub: "http://litepub.social/ns#",
|
||||||
|
directMessage: "litepub:directMessage",
|
||||||
|
Emoji: "toot:Emoji",
|
||||||
|
focalPoint: {
|
||||||
|
"@container": "@list",
|
||||||
|
"@id": "toot:focalPoint",
|
||||||
|
},
|
||||||
|
blurhash: "toot:blurhash",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
id: `${getHost()}/@${user.username}/inbox`,
|
id: `${getHost()}/@${user.username}/inbox`,
|
||||||
type: "OrderedCollectionPage",
|
type: "OrderedCollectionPage",
|
||||||
|
|
@ -126,7 +143,10 @@ export default async (
|
||||||
prev: `${getHost()}/@${user.username}/outbox?max_id=${
|
prev: `${getHost()}/@${user.username}/outbox?max_id=${
|
||||||
posts[0].id
|
posts[0].id
|
||||||
}&page=true`,
|
}&page=true`,
|
||||||
orderedItems: posts.slice(0, 10).map(post => post.data) as NodeObject[]
|
orderedItems: posts
|
||||||
}));
|
.slice(0, 10)
|
||||||
|
.map((post) => post.data) as NodeObject[],
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue