aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-31 16:56:52 +0100
committerChocobozzz <me@florianbigard.com>2020-02-03 08:31:02 +0100
commita15871560f80e07386c1dabb8370cd2664ecfd1f (patch)
tree44440e140c9e43b0d7f97ade777a76e649e0553d /shared/models/activitypub
parenta22046d166805222ca76060e471b6cb3d419a32d (diff)
downloadPeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.gz
PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.zst
PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.zip
Move to eslintcontain
Diffstat (limited to 'shared/models/activitypub')
-rw-r--r--shared/models/activitypub/activity.ts43
-rw-r--r--shared/models/activitypub/activitypub-actor.ts8
-rw-r--r--shared/models/activitypub/activitypub-signature.ts4
-rw-r--r--shared/models/activitypub/objects/cache-file-object.ts2
-rw-r--r--shared/models/activitypub/objects/common-objects.ts32
-rw-r--r--shared/models/activitypub/objects/video-abuse-object.ts2
-rw-r--r--shared/models/activitypub/objects/video-torrent-object.ts4
-rw-r--r--shared/models/activitypub/objects/view-object.ts2
8 files changed, 58 insertions, 39 deletions
diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts
index 492b672c7..20ecf176c 100644
--- a/shared/models/activitypub/activity.ts
+++ b/shared/models/activitypub/activity.ts
@@ -8,12 +8,33 @@ import { ViewObject } from './objects/view-object'
8import { APObject } from './objects/object.model' 8import { APObject } from './objects/object.model'
9import { PlaylistObject } from './objects/playlist-object' 9import { PlaylistObject } from './objects/playlist-object'
10 10
11export type Activity = ActivityCreate | ActivityUpdate | 11export type Activity =
12 ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | 12 ActivityCreate |
13 ActivityUndo | ActivityLike | ActivityReject | ActivityView | ActivityDislike | ActivityFlag 13 ActivityUpdate |
14 14 ActivityDelete |
15export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like' | 'Reject' | 15 ActivityFollow |
16 'View' | 'Dislike' | 'Flag' 16 ActivityAccept |
17 ActivityAnnounce |
18 ActivityUndo |
19 ActivityLike |
20 ActivityReject |
21 ActivityView |
22 ActivityDislike |
23 ActivityFlag
24
25export type ActivityType =
26 'Create' |
27 'Update' |
28 'Delete' |
29 'Follow' |
30 'Accept' |
31 'Announce' |
32 'Undo' |
33 'Like' |
34 'Reject' |
35 'View' |
36 'Dislike' |
37 'Flag'
17 38
18export interface ActivityAudience { 39export interface ActivityAudience {
19 to: string[] 40 to: string[]
@@ -66,17 +87,17 @@ export interface ActivityAnnounce extends BaseActivity {
66} 87}
67 88
68export interface ActivityUndo extends BaseActivity { 89export interface ActivityUndo extends BaseActivity {
69 type: 'Undo', 90 type: 'Undo'
70 object: ActivityFollow | ActivityLike | ActivityDislike | ActivityCreate | ActivityAnnounce 91 object: ActivityFollow | ActivityLike | ActivityDislike | ActivityCreate | ActivityAnnounce
71} 92}
72 93
73export interface ActivityLike extends BaseActivity { 94export interface ActivityLike extends BaseActivity {
74 type: 'Like', 95 type: 'Like'
75 object: APObject 96 object: APObject
76} 97}
77 98
78export interface ActivityView extends BaseActivity { 99export interface ActivityView extends BaseActivity {
79 type: 'View', 100 type: 'View'
80 actor: string 101 actor: string
81 object: APObject 102 object: APObject
82} 103}
@@ -89,7 +110,7 @@ export interface ActivityDislike extends BaseActivity {
89} 110}
90 111
91export interface ActivityFlag extends BaseActivity { 112export interface ActivityFlag extends BaseActivity {
92 type: 'Flag', 113 type: 'Flag'
93 content: string, 114 content: string
94 object: APObject | APObject[] 115 object: APObject | APObject[]
95} 116}
diff --git a/shared/models/activitypub/activitypub-actor.ts b/shared/models/activitypub/activitypub-actor.ts
index b8a2dc925..f022f3d02 100644
--- a/shared/models/activitypub/activitypub-actor.ts
+++ b/shared/models/activitypub/activitypub-actor.ts
@@ -1,4 +1,4 @@
1import { ActivityPubAttributedTo } from './objects/common-objects' 1import { ActivityIconObject, ActivityPubAttributedTo } from './objects/common-objects'
2 2
3export type ActivityPubActorType = 'Person' | 'Application' | 'Group' | 'Service' | 'Organization' 3export type ActivityPubActorType = 'Person' | 'Application' | 'Group' | 'Service' | 'Organization'
4 4
@@ -27,9 +27,5 @@ export interface ActivityPubActor {
27 publicKeyPem: string 27 publicKeyPem: string
28 } 28 }
29 29
30 icon: { 30 icon: ActivityIconObject
31 type: 'Image'
32 mediaType: 'image/png'
33 url: string
34 }
35} 31}
diff --git a/shared/models/activitypub/activitypub-signature.ts b/shared/models/activitypub/activitypub-signature.ts
index 1d9f4b3b3..fafdc246d 100644
--- a/shared/models/activitypub/activitypub-signature.ts
+++ b/shared/models/activitypub/activitypub-signature.ts
@@ -1,6 +1,6 @@
1export interface ActivityPubSignature { 1export interface ActivityPubSignature {
2 type: 'GraphSignature2012' 2 type: string
3 created: Date, 3 created: Date
4 creator: string 4 creator: string
5 signatureValue: string 5 signatureValue: string
6} 6}
diff --git a/shared/models/activitypub/objects/cache-file-object.ts b/shared/models/activitypub/objects/cache-file-object.ts
index 4b0a3a724..19a817582 100644
--- a/shared/models/activitypub/objects/cache-file-object.ts
+++ b/shared/models/activitypub/objects/cache-file-object.ts
@@ -2,7 +2,7 @@ import { ActivityVideoUrlObject, ActivityPlaylistUrlObject } from './common-obje
2 2
3export interface CacheFileObject { 3export interface CacheFileObject {
4 id: string 4 id: string
5 type: 'CacheFile', 5 type: 'CacheFile'
6 object: string 6 object: string
7 expires: string 7 expires: string
8 url: ActivityVideoUrlObject | ActivityPlaylistUrlObject 8 url: ActivityVideoUrlObject | ActivityPlaylistUrlObject
diff --git a/shared/models/activitypub/objects/common-objects.ts b/shared/models/activitypub/objects/common-objects.ts
index bab3ce366..e94d05429 100644
--- a/shared/models/activitypub/objects/common-objects.ts
+++ b/shared/models/activitypub/objects/common-objects.ts
@@ -7,9 +7,9 @@ export interface ActivityIdentifierObject {
7export interface ActivityIconObject { 7export interface ActivityIconObject {
8 type: 'Image' 8 type: 'Image'
9 url: string 9 url: string
10 mediaType: 'image/jpeg' 10 mediaType: 'image/jpeg' | 'image/png'
11 width: number 11 width?: number
12 height: number 12 height?: number
13} 13}
14 14
15export type ActivityVideoUrlObject = { 15export type ActivityVideoUrlObject = {
@@ -72,19 +72,21 @@ export interface ActivityMentionObject {
72 name: string 72 name: string
73} 73}
74 74
75export type ActivityTagObject = ActivityPlaylistSegmentHashesObject | 75export type ActivityTagObject =
76 ActivityPlaylistInfohashesObject | 76 ActivityPlaylistSegmentHashesObject
77 ActivityVideoUrlObject | 77 | ActivityPlaylistInfohashesObject
78 ActivityHashTagObject | 78 | ActivityVideoUrlObject
79 ActivityMentionObject | 79 | ActivityHashTagObject
80 ActivityBitTorrentUrlObject | 80 | ActivityMentionObject
81 ActivityMagnetUrlObject 81 | ActivityBitTorrentUrlObject
82 | ActivityMagnetUrlObject
82 83
83export type ActivityUrlObject = ActivityVideoUrlObject | 84export type ActivityUrlObject =
84 ActivityPlaylistUrlObject | 85 ActivityVideoUrlObject
85 ActivityBitTorrentUrlObject | 86 | ActivityPlaylistUrlObject
86 ActivityMagnetUrlObject | 87 | ActivityBitTorrentUrlObject
87 ActivityHtmlUrlObject 88 | ActivityMagnetUrlObject
89 | ActivityHtmlUrlObject
88 90
89export interface ActivityPubAttributedTo { 91export interface ActivityPubAttributedTo {
90 type: 'Group' | 'Person' 92 type: 'Group' | 'Person'
diff --git a/shared/models/activitypub/objects/video-abuse-object.ts b/shared/models/activitypub/objects/video-abuse-object.ts
index 5f1264a76..d9622b414 100644
--- a/shared/models/activitypub/objects/video-abuse-object.ts
+++ b/shared/models/activitypub/objects/video-abuse-object.ts
@@ -1,5 +1,5 @@
1export interface VideoAbuseObject { 1export interface VideoAbuseObject {
2 type: 'Flag', 2 type: 'Flag'
3 content: string 3 content: string
4 object: string | string[] 4 object: string | string[]
5} 5}
diff --git a/shared/models/activitypub/objects/video-torrent-object.ts b/shared/models/activitypub/objects/video-torrent-object.ts
index cadd0ea49..11de8fc56 100644
--- a/shared/models/activitypub/objects/video-torrent-object.ts
+++ b/shared/models/activitypub/objects/video-torrent-object.ts
@@ -20,8 +20,8 @@ export interface VideoTorrentObject {
20 subtitleLanguage: ActivityIdentifierObject[] 20 subtitleLanguage: ActivityIdentifierObject[]
21 views: number 21 views: number
22 sensitive: boolean 22 sensitive: boolean
23 commentsEnabled: boolean, 23 commentsEnabled: boolean
24 downloadEnabled: boolean, 24 downloadEnabled: boolean
25 waitTranscoding: boolean 25 waitTranscoding: boolean
26 state: VideoState 26 state: VideoState
27 published: string 27 published: string
diff --git a/shared/models/activitypub/objects/view-object.ts b/shared/models/activitypub/objects/view-object.ts
index 00348116a..4dd21ce8e 100644
--- a/shared/models/activitypub/objects/view-object.ts
+++ b/shared/models/activitypub/objects/view-object.ts
@@ -1,5 +1,5 @@
1export interface ViewObject { 1export interface ViewObject {
2 type: 'View', 2 type: 'View'
3 actor: string 3 actor: string
4 object: string 4 object: string
5} 5}