X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fmodels%2Factivitypub%2Factivity.ts;h=37f5400b90668fdb6bcde341a922e262558a350f;hb=63c93323ecdeaa4b6183d75dd3f13469e1ef3ebd;hp=0274416b23e1c01de03ce15a18f0608501b563b0;hpb=e4f97babf701481b55cc10fb3448feab5f97c867;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts index 0274416b2..37f5400b9 100644 --- a/shared/models/activitypub/activity.ts +++ b/shared/models/activitypub/activity.ts @@ -1,26 +1,39 @@ -import { - VideoChannelObject, - VideoTorrentObject -} from './objects' import { ActivityPubSignature } from './activitypub-signature' +import { VideoChannelObject, VideoTorrentObject } from './objects' +import { DislikeObject } from './objects/dislike-object' +import { VideoAbuseObject } from './objects/video-abuse-object' +import { ViewObject } from './objects/view-object' -export type Activity = ActivityCreate | ActivityUpdate | ActivityFlag +export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | + ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | + ActivityUndo | ActivityLike -// Flag -> report abuse -export type ActivityType = 'Create' | 'Update' | 'Flag' +export type ActivityType = 'Create' | 'Add' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like' + +export interface ActivityAudience { + to: string[] + cc: string[] +} export interface BaseActivity { '@context'?: any[] id: string - to: string[] + to?: string[] + cc?: string[] actor: string type: ActivityType - signature: ActivityPubSignature + signature?: ActivityPubSignature } export interface ActivityCreate extends BaseActivity { type: 'Create' - object: VideoTorrentObject | VideoChannelObject + object: VideoChannelObject | VideoAbuseObject | ViewObject | DislikeObject +} + +export interface ActivityAdd extends BaseActivity { + type: 'Add' + target: string + object: VideoTorrentObject } export interface ActivityUpdate extends BaseActivity { @@ -28,7 +41,30 @@ export interface ActivityUpdate extends BaseActivity { object: VideoTorrentObject | VideoChannelObject } -export interface ActivityFlag extends BaseActivity { - type: 'Flag' +export interface ActivityDelete extends BaseActivity { + type: 'Delete' +} + +export interface ActivityFollow extends BaseActivity { + type: 'Follow' + object: string +} + +export interface ActivityAccept extends BaseActivity { + type: 'Accept' +} + +export interface ActivityAnnounce extends BaseActivity { + type: 'Announce' + object: ActivityCreate | ActivityAdd +} + +export interface ActivityUndo extends BaseActivity { + type: 'Undo', + object: ActivityFollow | ActivityLike | ActivityCreate +} + +export interface ActivityLike extends BaseActivity { + type: 'Like', object: string }