aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-26 10:55:40 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commit418d092afa81e2c8fe8ac6838fc4b5eb0af6a782 (patch)
tree5e9bc5604fd5d66a006cfebb7acdbdd5486e5d1e /shared/models/activitypub
parentb427febb4d5cebf03b815bca2c59af6e82491569 (diff)
downloadPeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.gz
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.zst
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.zip
Playlist server API
Diffstat (limited to 'shared/models/activitypub')
-rw-r--r--shared/models/activitypub/activity.ts5
-rw-r--r--shared/models/activitypub/activitypub-actor.ts1
-rw-r--r--shared/models/activitypub/objects/playlist-element-object.ts10
-rw-r--r--shared/models/activitypub/objects/playlist-object.ts23
4 files changed, 37 insertions, 2 deletions
diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts
index 89994f665..95801190d 100644
--- a/shared/models/activitypub/activity.ts
+++ b/shared/models/activitypub/activity.ts
@@ -6,6 +6,7 @@ import { VideoAbuseObject } from './objects/video-abuse-object'
6import { VideoCommentObject } from './objects/video-comment-object' 6import { VideoCommentObject } from './objects/video-comment-object'
7import { ViewObject } from './objects/view-object' 7import { ViewObject } from './objects/view-object'
8import { APObject } from './objects/object.model' 8import { APObject } from './objects/object.model'
9import { PlaylistObject } from './objects/playlist-object'
9 10
10export type Activity = ActivityCreate | ActivityUpdate | 11export type Activity = ActivityCreate | ActivityUpdate |
11 ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | 12 ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
@@ -31,12 +32,12 @@ export interface BaseActivity {
31 32
32export interface ActivityCreate extends BaseActivity { 33export interface ActivityCreate extends BaseActivity {
33 type: 'Create' 34 type: 'Create'
34 object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject | CacheFileObject 35 object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject | VideoCommentObject | CacheFileObject | PlaylistObject
35} 36}
36 37
37export interface ActivityUpdate extends BaseActivity { 38export interface ActivityUpdate extends BaseActivity {
38 type: 'Update' 39 type: 'Update'
39 object: VideoTorrentObject | ActivityPubActor | CacheFileObject 40 object: VideoTorrentObject | ActivityPubActor | CacheFileObject | PlaylistObject
40} 41}
41 42
42export interface ActivityDelete extends BaseActivity { 43export interface ActivityDelete extends BaseActivity {
diff --git a/shared/models/activitypub/activitypub-actor.ts b/shared/models/activitypub/activitypub-actor.ts
index 119bc22d4..5e30bf783 100644
--- a/shared/models/activitypub/activitypub-actor.ts
+++ b/shared/models/activitypub/activitypub-actor.ts
@@ -8,6 +8,7 @@ export interface ActivityPubActor {
8 id: string 8 id: string
9 following: string 9 following: string
10 followers: string 10 followers: string
11 playlists?: string
11 inbox: string 12 inbox: string
12 outbox: string 13 outbox: string
13 preferredUsername: string 14 preferredUsername: string
diff --git a/shared/models/activitypub/objects/playlist-element-object.ts b/shared/models/activitypub/objects/playlist-element-object.ts
new file mode 100644
index 000000000..b85e4fe19
--- /dev/null
+++ b/shared/models/activitypub/objects/playlist-element-object.ts
@@ -0,0 +1,10 @@
1export interface PlaylistElementObject {
2 id: string
3 type: 'PlaylistElement'
4
5 url: string
6 position: number
7
8 startTimestamp?: number
9 stopTimestamp?: number
10}
diff --git a/shared/models/activitypub/objects/playlist-object.ts b/shared/models/activitypub/objects/playlist-object.ts
new file mode 100644
index 000000000..5f6733f92
--- /dev/null
+++ b/shared/models/activitypub/objects/playlist-object.ts
@@ -0,0 +1,23 @@
1import { ActivityIconObject } from './common-objects'
2
3export interface PlaylistObject {
4 id: string
5 type: 'Playlist'
6
7 name: string
8 content: string
9 uuid: string
10
11 totalItems: number
12 attributedTo: string[]
13
14 icon: ActivityIconObject
15
16 orderedItems?: string[]
17
18 partOf?: string
19 next?: string
20 first?: string
21
22 to?: string[]
23}