aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/activitypub/activity.ts
blob: 0274416b23e1c01de03ce15a18f0608501b563b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import {
  VideoChannelObject,
  VideoTorrentObject
} from './objects'
import { ActivityPubSignature } from './activitypub-signature'

export type Activity = ActivityCreate | ActivityUpdate | ActivityFlag

// Flag -> report abuse
export type ActivityType = 'Create' | 'Update' | 'Flag'

export interface BaseActivity {
  '@context'?: any[]
  id: string
  to: string[]
  actor: string
  type: ActivityType
  signature: ActivityPubSignature
}

export interface ActivityCreate extends BaseActivity {
  type: 'Create'
  object: VideoTorrentObject | VideoChannelObject
}

export interface ActivityUpdate extends BaseActivity {
  type: 'Update'
  object: VideoTorrentObject | VideoChannelObject
}

export interface ActivityFlag extends BaseActivity {
  type: 'Flag'
  object: string
}