From 630d0a1bf5897fff203cb07e426223f55dcc882d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 5 Jul 2022 15:43:21 +0200 Subject: Introduce experimental telemetry --- server/lib/activitypub/activity.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'server/lib/activitypub') diff --git a/server/lib/activitypub/activity.ts b/server/lib/activitypub/activity.ts index e6cec1ba7..ba2967ce9 100644 --- a/server/lib/activitypub/activity.ts +++ b/server/lib/activitypub/activity.ts @@ -1,3 +1,5 @@ +import { ActivityType } from "@shared/models" + function getAPId (object: string | { id: string }) { if (typeof object === 'string') return object @@ -13,8 +15,26 @@ function getDurationFromActivityStream (duration: string) { return parseInt(duration.replace(/[^\d]+/, '')) } +function buildAvailableActivities (): ActivityType[] { + return [ + 'Create', + 'Update', + 'Delete', + 'Follow', + 'Accept', + 'Announce', + 'Undo', + 'Like', + 'Reject', + 'View', + 'Dislike', + 'Flag' + ] +} + export { getAPId, getActivityStreamDuration, + buildAvailableActivities, getDurationFromActivityStream } -- cgit v1.2.3