X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fmodels%2Factivitypub%2Factivity.ts;h=d5359eba183229bdbf5df841a72be50b596c6461;hb=d7a7c248b36af5f9cf7375ba62720e4a1530eca6;hp=a2494da25af9a910be058725fc2bd0154e26d27f;hpb=571389d43b8fc8aaf27e77c06f19b320b08dbbc9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts index a2494da25..d5359eba1 100644 --- a/shared/models/activitypub/activity.ts +++ b/shared/models/activitypub/activity.ts @@ -1,39 +1,65 @@ -import { - VideoChannelObject, - VideoTorrentObject -} from './objects' import { ActivityPubSignature } from './activitypub-signature' +import { 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 | ActivityAdd | ActivityUpdate | ActivityFlag +export type Activity = ActivityCreate | ActivityUpdate | + ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | + ActivityUndo | ActivityLike -// Flag -> report abuse -export type ActivityType = 'Create' | 'Add' | 'Update' | 'Flag' +export type ActivityType = 'Create' | '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: VideoChannelObject + object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject } -export interface ActivityAdd extends BaseActivity { - type: 'Add' +export interface ActivityUpdate extends BaseActivity { + type: 'Update' object: VideoTorrentObject } -export interface ActivityUpdate extends BaseActivity { - type: 'Update' - object: VideoTorrentObject | VideoChannelObject +export interface ActivityDelete extends BaseActivity { + type: 'Delete' +} + +export interface ActivityFollow extends BaseActivity { + type: 'Follow' + object: string +} + +export interface ActivityAccept extends BaseActivity { + type: 'Accept' + object: ActivityFollow +} + +export interface ActivityAnnounce extends BaseActivity { + type: 'Announce' + object: ActivityCreate | string +} + +export interface ActivityUndo extends BaseActivity { + type: 'Undo', + object: ActivityFollow | ActivityLike | ActivityCreate } -export interface ActivityFlag extends BaseActivity { - type: 'Flag' +export interface ActivityLike extends BaseActivity { + type: 'Like', object: string }