diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-05 15:43:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-06 15:13:55 +0200 |
commit | 630d0a1bf5897fff203cb07e426223f55dcc882d (patch) | |
tree | 5e6fa9d26f3f21178a538bd1ac38fa0a3f4f228c /server/lib/activitypub | |
parent | 15b43b214eb37b05aa65aa8ef61fd0e6aa0b62d2 (diff) | |
download | PeerTube-630d0a1bf5897fff203cb07e426223f55dcc882d.tar.gz PeerTube-630d0a1bf5897fff203cb07e426223f55dcc882d.tar.zst PeerTube-630d0a1bf5897fff203cb07e426223f55dcc882d.zip |
Introduce experimental telemetry
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/activity.ts | 20 |
1 files changed, 20 insertions, 0 deletions
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 @@ | |||
1 | import { ActivityType } from "@shared/models" | ||
2 | |||
1 | function getAPId (object: string | { id: string }) { | 3 | function getAPId (object: string | { id: string }) { |
2 | if (typeof object === 'string') return object | 4 | if (typeof object === 'string') return object |
3 | 5 | ||
@@ -13,8 +15,26 @@ function getDurationFromActivityStream (duration: string) { | |||
13 | return parseInt(duration.replace(/[^\d]+/, '')) | 15 | return parseInt(duration.replace(/[^\d]+/, '')) |
14 | } | 16 | } |
15 | 17 | ||
18 | function buildAvailableActivities (): ActivityType[] { | ||
19 | return [ | ||
20 | 'Create', | ||
21 | 'Update', | ||
22 | 'Delete', | ||
23 | 'Follow', | ||
24 | 'Accept', | ||
25 | 'Announce', | ||
26 | 'Undo', | ||
27 | 'Like', | ||
28 | 'Reject', | ||
29 | 'View', | ||
30 | 'Dislike', | ||
31 | 'Flag' | ||
32 | ] | ||
33 | } | ||
34 | |||
16 | export { | 35 | export { |
17 | getAPId, | 36 | getAPId, |
18 | getActivityStreamDuration, | 37 | getActivityStreamDuration, |
38 | buildAvailableActivities, | ||
19 | getDurationFromActivityStream | 39 | getDurationFromActivityStream |
20 | } | 40 | } |