2018-01-03 15:38:50 +00:00
|
|
|
import { ActivityPubActor } from './activitypub-actor'
|
2017-11-09 16:51:58 +00:00
|
|
|
import { ActivityPubSignature } from './activitypub-signature'
|
2017-12-14 16:38:41 +00:00
|
|
|
import { VideoTorrentObject } from './objects'
|
2017-11-23 13:19:55 +00:00
|
|
|
import { DislikeObject } from './objects/dislike-object'
|
2017-11-15 14:12:23 +00:00
|
|
|
import { VideoAbuseObject } from './objects/video-abuse-object'
|
2017-12-22 08:14:50 +00:00
|
|
|
import { VideoCommentObject } from './objects/video-comment-object'
|
2017-11-22 15:25:03 +00:00
|
|
|
import { ViewObject } from './objects/view-object'
|
2017-11-09 16:51:58 +00:00
|
|
|
|
2017-12-14 16:38:41 +00:00
|
|
|
export type Activity = ActivityCreate | ActivityUpdate |
|
2017-11-20 08:43:39 +00:00
|
|
|
ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
|
2018-01-11 16:37:49 +00:00
|
|
|
ActivityUndo | ActivityLike | ActivityReject
|
2017-11-09 16:51:58 +00:00
|
|
|
|
2018-01-11 16:37:49 +00:00
|
|
|
export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like' | 'Reject'
|
2017-11-09 16:51:58 +00:00
|
|
|
|
2017-11-24 12:41:10 +00:00
|
|
|
export interface ActivityAudience {
|
|
|
|
to: string[]
|
|
|
|
cc: string[]
|
|
|
|
}
|
|
|
|
|
2017-11-09 16:51:58 +00:00
|
|
|
export interface BaseActivity {
|
|
|
|
'@context'?: any[]
|
|
|
|
id: string
|
2017-11-17 10:35:10 +00:00
|
|
|
to?: string[]
|
2017-11-17 14:20:42 +00:00
|
|
|
cc?: string[]
|
2018-03-22 17:40:33 +00:00
|
|
|
actor: string | ActivityPubActor
|
2017-11-09 16:51:58 +00:00
|
|
|
type: ActivityType
|
2017-11-17 10:35:10 +00:00
|
|
|
signature?: ActivityPubSignature
|
2017-11-09 16:51:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityCreate extends BaseActivity {
|
|
|
|
type: 'Create'
|
2017-12-22 08:14:50 +00:00
|
|
|
object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject
|
2017-11-09 16:51:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityUpdate extends BaseActivity {
|
|
|
|
type: 'Update'
|
2018-01-03 15:38:50 +00:00
|
|
|
object: VideoTorrentObject | ActivityPubActor
|
2017-11-09 16:51:58 +00:00
|
|
|
}
|
|
|
|
|
2017-11-13 16:39:41 +00:00
|
|
|
export interface ActivityDelete extends BaseActivity {
|
|
|
|
type: 'Delete'
|
2018-01-04 16:50:30 +00:00
|
|
|
object: string | { id: string }
|
2017-11-13 16:39:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityFollow extends BaseActivity {
|
|
|
|
type: 'Follow'
|
|
|
|
object: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityAccept extends BaseActivity {
|
|
|
|
type: 'Accept'
|
2017-12-19 09:34:56 +00:00
|
|
|
object: ActivityFollow
|
2017-11-13 16:39:41 +00:00
|
|
|
}
|
2017-11-15 16:56:21 +00:00
|
|
|
|
2018-01-11 16:37:49 +00:00
|
|
|
export interface ActivityReject extends BaseActivity {
|
|
|
|
type: 'Reject'
|
|
|
|
object: ActivityFollow
|
|
|
|
}
|
|
|
|
|
2017-11-15 16:56:21 +00:00
|
|
|
export interface ActivityAnnounce extends BaseActivity {
|
|
|
|
type: 'Announce'
|
2018-01-26 11:02:18 +00:00
|
|
|
object: string | { id: string }
|
2017-11-15 16:56:21 +00:00
|
|
|
}
|
2017-11-20 08:43:39 +00:00
|
|
|
|
|
|
|
export interface ActivityUndo extends BaseActivity {
|
|
|
|
type: 'Undo',
|
2018-05-11 13:10:13 +00:00
|
|
|
object: ActivityFollow | ActivityLike | ActivityCreate | ActivityAnnounce
|
2017-11-23 13:19:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ActivityLike extends BaseActivity {
|
|
|
|
type: 'Like',
|
|
|
|
object: string
|
2017-11-20 08:43:39 +00:00
|
|
|
}
|