]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/activitypub.ts
Misc cleanup
[github/Chocobozzz/PeerTube.git] / server / helpers / activitypub.ts
index 54c460200fe127abe5d528c3d90ce2d685dc34ac..1ea6422ca111f441dccc17c22543e84d7bf1248a 100644 (file)
@@ -24,6 +24,14 @@ function activityPubContextify <T> (data: T) {
   })
 }
 
+function activityPubCollection (results: any[]) {
+  return {
+    type: 'OrderedCollection',
+    totalItems: results.length,
+    orderedItems: results
+  }
+}
+
 function activityPubCollectionPagination (url: string, page: any, result: ResultList<any>) {
   let next: string
   let prev: string
@@ -74,5 +82,6 @@ function buildSignedActivity (byAccount: AccountInstance, data: Object) {
 export {
   activityPubContextify,
   activityPubCollectionPagination,
+  activityPubCollection,
   buildSignedActivity
 }