aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/activitypub/objects
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-11 14:09:23 +0100
committerChocobozzz <me@florianbigard.com>2019-02-11 14:09:23 +0100
commitb718fd22374d64534bcfe69932cf562894abed6a (patch)
tree311d3c67e2a4d1f33ebdd1dc163527de9d33d0f7 /shared/models/activitypub/objects
parentadb115f5522bea4d52456a9fc5eb4140bb064476 (diff)
parent501e961199578129629cf0567033d13efced9904 (diff)
downloadPeerTube-b718fd22374d64534bcfe69932cf562894abed6a.tar.gz
PeerTube-b718fd22374d64534bcfe69932cf562894abed6a.tar.zst
PeerTube-b718fd22374d64534bcfe69932cf562894abed6a.zip
Merge branch 'develop' into pr/1285
Diffstat (limited to 'shared/models/activitypub/objects')
-rw-r--r--shared/models/activitypub/objects/cache-file-object.ts4
-rw-r--r--shared/models/activitypub/objects/common-objects.ts60
-rw-r--r--shared/models/activitypub/objects/object.model.ts1
-rw-r--r--shared/models/activitypub/objects/video-torrent-object.ts3
4 files changed, 46 insertions, 22 deletions
diff --git a/shared/models/activitypub/objects/cache-file-object.ts b/shared/models/activitypub/objects/cache-file-object.ts
index 0a5125f5b..4b0a3a724 100644
--- a/shared/models/activitypub/objects/cache-file-object.ts
+++ b/shared/models/activitypub/objects/cache-file-object.ts
@@ -1,9 +1,9 @@
1import { ActivityVideoUrlObject } from './common-objects' 1import { ActivityVideoUrlObject, ActivityPlaylistUrlObject } from './common-objects'
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 8 url: ActivityVideoUrlObject | ActivityPlaylistUrlObject
9} 9}
diff --git a/shared/models/activitypub/objects/common-objects.ts b/shared/models/activitypub/objects/common-objects.ts
index 118a4f43d..8c89810d6 100644
--- a/shared/models/activitypub/objects/common-objects.ts
+++ b/shared/models/activitypub/objects/common-objects.ts
@@ -28,25 +28,47 @@ export type ActivityVideoUrlObject = {
28 fps: number 28 fps: number
29} 29}
30 30
31export type ActivityUrlObject = 31export type ActivityPlaylistSegmentHashesObject = {
32 ActivityVideoUrlObject 32 type: 'Link'
33 | 33 name: 'sha256'
34 { 34 // TODO: remove mimeType (backward compatibility, introduced in v1.1.0)
35 type: 'Link' 35 mimeType?: 'application/json'
36 // TODO: remove mimeType (backward compatibility, introduced in v1.1.0) 36 mediaType: 'application/json'
37 mimeType?: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet' 37 href: string
38 mediaType: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet' 38}
39 href: string 39
40 height: number 40export type ActivityPlaylistInfohashesObject = {
41 } 41 type: 'Infohash'
42 | 42 name: string
43 { 43}
44 type: 'Link' 44
45 // TODO: remove mimeType (backward compatibility, introduced in v1.1.0) 45export type ActivityPlaylistUrlObject = {
46 mimeType?: 'text/html' 46 type: 'Link'
47 mediaType: 'text/html' 47 // TODO: remove mimeType (backward compatibility, introduced in v1.1.0)
48 href: string 48 mimeType?: 'application/x-mpegURL'
49 } 49 mediaType: 'application/x-mpegURL'
50 href: string
51 tag?: (ActivityPlaylistSegmentHashesObject | ActivityPlaylistInfohashesObject)[]
52}
53
54export type ActivityBitTorrentUrlObject = {
55 type: 'Link'
56 // TODO: remove mimeType (backward compatibility, introduced in v1.1.0)
57 mimeType?: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet'
58 mediaType: 'application/x-bittorrent' | 'application/x-bittorrent;x-scheme-handler/magnet'
59 href: string
60 height: number
61}
62
63export type ActivityHtmlUrlObject = {
64 type: 'Link'
65 // TODO: remove mimeType (backward compatibility, introduced in v1.1.0)
66 mimeType?: 'text/html'
67 mediaType: 'text/html'
68 href: string
69}
70
71export type ActivityUrlObject = ActivityVideoUrlObject | ActivityPlaylistUrlObject | ActivityBitTorrentUrlObject | ActivityHtmlUrlObject
50 72
51export interface ActivityPubAttributedTo { 73export interface ActivityPubAttributedTo {
52 type: 'Group' | 'Person' 74 type: 'Group' | 'Person'
diff --git a/shared/models/activitypub/objects/object.model.ts b/shared/models/activitypub/objects/object.model.ts
new file mode 100644
index 000000000..3fd33800a
--- /dev/null
+++ b/shared/models/activitypub/objects/object.model.ts
@@ -0,0 +1 @@
export type APObject = string | { id: string }
diff --git a/shared/models/activitypub/objects/video-torrent-object.ts b/shared/models/activitypub/objects/video-torrent-object.ts
index df07507b4..239822bc4 100644
--- a/shared/models/activitypub/objects/video-torrent-object.ts
+++ b/shared/models/activitypub/objects/video-torrent-object.ts
@@ -20,7 +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 waitTranscoding: boolean 25 waitTranscoding: boolean
25 state: VideoState 26 state: VideoState
26 published: string 27 published: string