Implement ActivityPub Followers/Following/Outbox

This commit is contained in:
mei23
2018-08-14 20:13:32 +09:00
parent 58d0ed1a2e
commit 0986301788
7 changed files with 321 additions and 70 deletions

View File

@@ -1,6 +1,19 @@
export default (id: string, totalItems: any, orderedItems: any) => ({
id,
type: 'OrderedCollection',
totalItems,
orderedItems
});
/**
* Render OrderedCollection
* @param id URL of self
* @param totalItems Total number of items
* @param first URL of first page (optional)
* @param last URL of last page (optional)
*/
export default function(id: string, totalItems: any, first: string, last: string) {
const page: any = {
id,
type: 'OrderedCollection',
totalItems,
};
if (first) page.first = first;
if (last) page.last = last;
return page;
}