2018-01-03 16:38:50 +01:00
|
|
|
import { ActivityPubActor } from './activitypub-actor'
|
2017-11-09 17:51:58 +01:00
|
|
|
import { ActivityPubSignature } from './activitypub-signature'
|
2022-03-24 13:36:47 +01:00
|
|
|
import { ActivityFlagReasonObject, CacheFileObject, VideoObject, WatchActionObject } from './objects'
|
2020-07-01 16:05:30 +02:00
|
|
|
import { AbuseObject } from './objects/abuse-object'
|
2017-11-23 14:19:55 +01:00
|
|
|
import { DislikeObject } from './objects/dislike-object'
|
2019-01-15 11:14:12 +01:00
|
|
|
import { APObject } from './objects/object.model'
|
2019-02-26 10:55:40 +01:00
|
|
|
import { PlaylistObject } from './objects/playlist-object'
|
2020-07-01 16:05:30 +02:00
|
|
|
import { VideoCommentObject } from './objects/video-comment-object'
|
2017-11-09 17:51:58 +01:00
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type Activity =
|
|
|
|
ActivityCreate |
|
|
|
|
ActivityUpdate |
|
|
|
|
ActivityDelete |
|
|
|
|
ActivityFollow |
|
|
|
|
ActivityAccept |
|
|
|
|
ActivityAnnounce |
|
|
|
|
ActivityUndo |
|
|
|
|
ActivityLike |
|
|
|
|
ActivityReject |
|
|
|
|
ActivityView |
|
|
|
|
ActivityDislike |
|
|
|
|
ActivityFlag
|
|
|
|
|
|
|
|
export type ActivityType =
|
|
|
|
'Create' |
|
|
|
|
'Update' |
|
|
|
|
'Delete' |
|
|
|
|
'Follow' |
|
|
|
|
'Accept' |
|
|
|
|
'Announce' |
|
|
|
|
'Undo' |
|
|
|
|
'Like' |
|
|
|
|
'Reject' |
|
|
|
|
'View' |
|
|
|
|
'Dislike' |
|
|
|
|
'Flag'
|
2017-11-09 17:51:58 +01:00
|
|
|
|
2017-11-24 13:41:10 +01:00
|
|
|
export interface ActivityAudience {
|
|
|
|
to: string[]
|
|
|
|
cc: string[]
|
|
|
|
}
|
|
|
|
|
2017-11-09 17:51:58 +01:00
|
|
|
export interface BaseActivity {
|
|
|
|
'@context'?: any[]
|
|
|
|
id: string
|
2017-11-17 11:35:10 +01:00
|
|
|
to?: string[]
|
2017-11-17 15:20:42 +01:00
|
|
|
cc?: string[]
|
2018-03-22 18:40:33 +01:00
|
|
|
actor: string | ActivityPubActor
|
2017-11-09 17:51:58 +01:00
|
|
|
type: ActivityType
|
2017-11-17 11:35:10 +01:00
|
|
|
signature?: ActivityPubSignature
|
2017-11-09 17:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityCreate extends BaseActivity {
|
|
|
|
type: 'Create'
|
2022-03-24 13:36:47 +01:00
|
|
|
object: VideoObject | AbuseObject | DislikeObject | VideoCommentObject | CacheFileObject | PlaylistObject | WatchActionObject
|
2017-11-09 17:51:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityUpdate extends BaseActivity {
|
|
|
|
type: 'Update'
|
2020-09-17 13:59:02 +02:00
|
|
|
object: VideoObject | ActivityPubActor | CacheFileObject | PlaylistObject
|
2017-11-09 17:51:58 +01:00
|
|
|
}
|
|
|
|
|
2017-11-13 17:39:41 +01:00
|
|
|
export interface ActivityDelete extends BaseActivity {
|
|
|
|
type: 'Delete'
|
2018-01-04 17:50:30 +01:00
|
|
|
object: string | { id: string }
|
2017-11-13 17:39:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityFollow extends BaseActivity {
|
|
|
|
type: 'Follow'
|
|
|
|
object: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityAccept extends BaseActivity {
|
|
|
|
type: 'Accept'
|
2017-12-19 10:34:56 +01:00
|
|
|
object: ActivityFollow
|
2017-11-13 17:39:41 +01:00
|
|
|
}
|
2017-11-15 17:56:21 +01:00
|
|
|
|
2018-01-11 17:37:49 +01:00
|
|
|
export interface ActivityReject extends BaseActivity {
|
|
|
|
type: 'Reject'
|
|
|
|
object: ActivityFollow
|
|
|
|
}
|
|
|
|
|
2017-11-15 17:56:21 +01:00
|
|
|
export interface ActivityAnnounce extends BaseActivity {
|
|
|
|
type: 'Announce'
|
2019-01-15 11:14:12 +01:00
|
|
|
object: APObject
|
2017-11-15 17:56:21 +01:00
|
|
|
}
|
2017-11-20 09:43:39 +01:00
|
|
|
|
|
|
|
export interface ActivityUndo extends BaseActivity {
|
2020-01-31 16:56:52 +01:00
|
|
|
type: 'Undo'
|
2019-01-15 11:14:12 +01:00
|
|
|
object: ActivityFollow | ActivityLike | ActivityDislike | ActivityCreate | ActivityAnnounce
|
2017-11-23 14:19:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityLike extends BaseActivity {
|
2020-01-31 16:56:52 +01:00
|
|
|
type: 'Like'
|
2019-01-15 11:14:12 +01:00
|
|
|
object: APObject
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityView extends BaseActivity {
|
2020-01-31 16:56:52 +01:00
|
|
|
type: 'View'
|
2019-01-15 11:14:12 +01:00
|
|
|
actor: string
|
|
|
|
object: APObject
|
2022-03-24 13:36:47 +01:00
|
|
|
|
|
|
|
// If sending a "viewer" event
|
|
|
|
expires?: string
|
2019-01-15 11:14:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityDislike extends BaseActivity {
|
|
|
|
id: string
|
|
|
|
type: 'Dislike'
|
|
|
|
actor: string
|
|
|
|
object: APObject
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityFlag extends BaseActivity {
|
2020-01-31 16:56:52 +01:00
|
|
|
type: 'Flag'
|
|
|
|
content: string
|
2019-08-30 09:40:21 +02:00
|
|
|
object: APObject | APObject[]
|
2020-06-22 13:00:39 +02:00
|
|
|
tag?: ActivityFlagReasonObject[]
|
|
|
|
startAt?: number
|
|
|
|
endAt?: number
|
2017-11-20 09:43:39 +01:00
|
|
|
}
|