1 import { CONFIG } from '../../initializers/constants'
2 import { VideoInstance } from '../../models/video/video-interface'
3 import { VideoChannelInstance } from '../../models/video/video-channel-interface'
4 import { VideoAbuseInstance } from '../../models/video/video-abuse-interface'
5 import { AccountFollowInstance } from '../../models/account/account-follow-interface'
6 import { AccountInstance } from '../../models/account/account-interface'
8 function getVideoActivityPubUrl (video: VideoInstance) {
9 return CONFIG.WEBSERVER.URL + '/videos/watch/' + video.uuid
12 function getVideoChannelActivityPubUrl (videoChannel: VideoChannelInstance) {
13 return CONFIG.WEBSERVER.URL + '/video-channels/' + videoChannel.uuid
16 function getAccountActivityPubUrl (accountName: string) {
17 return CONFIG.WEBSERVER.URL + '/account/' + accountName
20 function getVideoAbuseActivityPubUrl (videoAbuse: VideoAbuseInstance) {
21 return CONFIG.WEBSERVER.URL + '/admin/video-abuses/' + videoAbuse.id
24 function getAccountFollowActivityPubUrl (accountFollow: AccountFollowInstance) {
25 const me = accountFollow.AccountFollower
26 const following = accountFollow.AccountFollowing
28 return me.url + '#follows/' + following.id
31 function getAccountFollowAcceptActivityPubUrl (accountFollow: AccountFollowInstance) {
32 const follower = accountFollow.AccountFollower
33 const me = accountFollow.AccountFollowing
35 return follower.url + '#accepts/follows/' + me.id
38 function getAnnounceActivityPubUrl (originalUrl: string, byAccount: AccountInstance) {
39 return originalUrl + '#announces/' + byAccount.id
42 function getUpdateActivityPubUrl (originalUrl: string, updatedAt: string) {
43 return originalUrl + '#updates/' + updatedAt
46 function getUndoActivityPubUrl (originalUrl: string) {
47 return originalUrl + '/undo'
51 getVideoActivityPubUrl,
52 getVideoChannelActivityPubUrl,
53 getAccountActivityPubUrl,
54 getVideoAbuseActivityPubUrl,
55 getAccountFollowActivityPubUrl,
56 getAccountFollowAcceptActivityPubUrl,
57 getAnnounceActivityPubUrl,
58 getUpdateActivityPubUrl,