]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/models/activitypub/activity.ts
Refractor activity pub lib/helpers
[github/Chocobozzz/PeerTube.git] / shared / models / activitypub / activity.ts
index f8e982fbb79b0622d7e73cf8b3f9e7e8f0149dda..3d035d7d7b4291d15e5d1c09c2421adce19e133d 100644 (file)
@@ -2,19 +2,20 @@ import { VideoChannelObject, VideoTorrentObject } from './objects'
 import { ActivityPubSignature } from './activitypub-signature'
 import { VideoAbuseObject } from './objects/video-abuse-object'
 
-export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | ActivityFlag |
-  ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce
+export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate |
+  ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
+  ActivityUndo
 
-// Flag -> report abuse
-export type ActivityType = 'Create' | 'Add' | 'Update' | 'Flag' | 'Delete' | 'Follow' | 'Accept' | 'Announce'
+export type ActivityType = 'Create' | 'Add' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo'
 
 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 {
@@ -33,11 +34,6 @@ export interface ActivityUpdate extends BaseActivity {
   object: VideoTorrentObject | VideoChannelObject
 }
 
-export interface ActivityFlag extends BaseActivity {
-  type: 'Flag'
-  object: string
-}
-
 export interface ActivityDelete extends BaseActivity {
   type: 'Delete'
 }
@@ -55,3 +51,8 @@ export interface ActivityAnnounce extends BaseActivity {
   type: 'Announce'
   object: ActivityCreate | ActivityAdd
 }
+
+export interface ActivityUndo extends BaseActivity {
+  type: 'Undo',
+  object: ActivityFollow
+}