aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/activitypub/activity.ts18
-rw-r--r--shared/models/activitypub/activitypub-actor.ts9
-rw-r--r--shared/models/activitypub/objects/common-objects.ts5
-rw-r--r--shared/models/activitypub/objects/index.ts1
-rw-r--r--shared/models/activitypub/objects/video-channel-object.ts13
-rw-r--r--shared/models/activitypub/objects/video-torrent-object.ts4
-rw-r--r--shared/models/actors/account.model.ts (renamed from shared/models/accounts/account.model.ts)0
-rw-r--r--shared/models/actors/follow.model.ts (renamed from shared/models/accounts/follow.model.ts)0
-rw-r--r--shared/models/actors/index.ts (renamed from shared/models/accounts/index.ts)0
-rw-r--r--shared/models/index.ts2
-rw-r--r--shared/models/users/user.model.ts2
-rw-r--r--shared/models/videos/video.model.ts2
12 files changed, 23 insertions, 33 deletions
diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts
index 37f5400b9..1d248d3d7 100644
--- a/shared/models/activitypub/activity.ts
+++ b/shared/models/activitypub/activity.ts
@@ -1,14 +1,14 @@
1import { ActivityPubSignature } from './activitypub-signature' 1import { ActivityPubSignature } from './activitypub-signature'
2import { VideoChannelObject, VideoTorrentObject } from './objects' 2import { VideoTorrentObject } from './objects'
3import { DislikeObject } from './objects/dislike-object' 3import { DislikeObject } from './objects/dislike-object'
4import { VideoAbuseObject } from './objects/video-abuse-object' 4import { VideoAbuseObject } from './objects/video-abuse-object'
5import { ViewObject } from './objects/view-object' 5import { ViewObject } from './objects/view-object'
6 6
7export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | 7export type Activity = ActivityCreate | ActivityUpdate |
8 ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | 8 ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce |
9 ActivityUndo | ActivityLike 9 ActivityUndo | ActivityLike
10 10
11export type ActivityType = 'Create' | 'Add' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like' 11export type ActivityType = 'Create' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like'
12 12
13export interface ActivityAudience { 13export interface ActivityAudience {
14 to: string[] 14 to: string[]
@@ -27,18 +27,12 @@ export interface BaseActivity {
27 27
28export interface ActivityCreate extends BaseActivity { 28export interface ActivityCreate extends BaseActivity {
29 type: 'Create' 29 type: 'Create'
30 object: VideoChannelObject | VideoAbuseObject | ViewObject | DislikeObject 30 object: VideoTorrentObject | VideoAbuseObject | ViewObject | DislikeObject
31}
32
33export interface ActivityAdd extends BaseActivity {
34 type: 'Add'
35 target: string
36 object: VideoTorrentObject
37} 31}
38 32
39export interface ActivityUpdate extends BaseActivity { 33export interface ActivityUpdate extends BaseActivity {
40 type: 'Update' 34 type: 'Update'
41 object: VideoTorrentObject | VideoChannelObject 35 object: VideoTorrentObject
42} 36}
43 37
44export interface ActivityDelete extends BaseActivity { 38export interface ActivityDelete extends BaseActivity {
@@ -56,7 +50,7 @@ export interface ActivityAccept extends BaseActivity {
56 50
57export interface ActivityAnnounce extends BaseActivity { 51export interface ActivityAnnounce extends BaseActivity {
58 type: 'Announce' 52 type: 'Announce'
59 object: ActivityCreate | ActivityAdd 53 object: ActivityCreate
60} 54}
61 55
62export interface ActivityUndo extends BaseActivity { 56export interface ActivityUndo extends BaseActivity {
diff --git a/shared/models/activitypub/activitypub-actor.ts b/shared/models/activitypub/activitypub-actor.ts
index 05b911d81..d9f80b94c 100644
--- a/shared/models/activitypub/activitypub-actor.ts
+++ b/shared/models/activitypub/activitypub-actor.ts
@@ -1,6 +1,10 @@
1import { ActivityPubAttributedTo } from './objects/common-objects'
2
3export type ActivityPubActorType = 'Person' | 'Application' | 'Group'
4
1export interface ActivityPubActor { 5export interface ActivityPubActor {
2 '@context': any[] 6 '@context': any[]
3 type: 'Person' | 'Application' | 'Group' 7 type: ActivityPubActorType
4 id: string 8 id: string
5 following: string 9 following: string
6 followers: string 10 followers: string
@@ -12,6 +16,8 @@ export interface ActivityPubActor {
12 endpoints: { 16 endpoints: {
13 sharedInbox: string 17 sharedInbox: string
14 } 18 }
19 summary: string
20 attributedTo: ActivityPubAttributedTo[]
15 21
16 uuid: string 22 uuid: string
17 publicKey: { 23 publicKey: {
@@ -21,7 +27,6 @@ export interface ActivityPubActor {
21 } 27 }
22 28
23 // Not used 29 // Not used
24 // summary: string
25 // icon: string[] 30 // icon: string[]
26 // liked: string 31 // liked: string
27} 32}
diff --git a/shared/models/activitypub/objects/common-objects.ts b/shared/models/activitypub/objects/common-objects.ts
index 3eaab21b5..ea5a503ac 100644
--- a/shared/models/activitypub/objects/common-objects.ts
+++ b/shared/models/activitypub/objects/common-objects.ts
@@ -23,3 +23,8 @@ export interface ActivityUrlObject {
23 width: number 23 width: number
24 size?: number 24 size?: number
25} 25}
26
27export interface ActivityPubAttributedTo {
28 type: 'Group' | 'Person'
29 id: string
30}
diff --git a/shared/models/activitypub/objects/index.ts b/shared/models/activitypub/objects/index.ts
index f1f761e44..3efd3ef13 100644
--- a/shared/models/activitypub/objects/index.ts
+++ b/shared/models/activitypub/objects/index.ts
@@ -1,6 +1,5 @@
1export * from './common-objects' 1export * from './common-objects'
2export * from './video-abuse-object' 2export * from './video-abuse-object'
3export * from './video-channel-object'
4export * from './video-torrent-object' 3export * from './video-torrent-object'
5export * from './view-object' 4export * from './view-object'
6export * from './dislike-object' 5export * from './dislike-object'
diff --git a/shared/models/activitypub/objects/video-channel-object.ts b/shared/models/activitypub/objects/video-channel-object.ts
deleted file mode 100644
index dcce8696b..000000000
--- a/shared/models/activitypub/objects/video-channel-object.ts
+++ /dev/null
@@ -1,13 +0,0 @@
1import { ActivityPubOrderedCollection } from '../activitypub-ordered-collection'
2
3export interface VideoChannelObject {
4 type: 'VideoChannel'
5 id: string
6 name: string
7 content: string
8 uuid: string
9 published: string
10 updated: string
11 actor?: string
12 shares?: ActivityPubOrderedCollection<string>
13}
diff --git a/shared/models/activitypub/objects/video-torrent-object.ts b/shared/models/activitypub/objects/video-torrent-object.ts
index a15ec7142..1405f7748 100644
--- a/shared/models/activitypub/objects/video-torrent-object.ts
+++ b/shared/models/activitypub/objects/video-torrent-object.ts
@@ -1,6 +1,6 @@
1import { 1import {
2 ActivityIconObject, 2 ActivityIconObject,
3 ActivityIdentifierObject, 3 ActivityIdentifierObject, ActivityPubAttributedTo,
4 ActivityTagObject, 4 ActivityTagObject,
5 ActivityUrlObject 5 ActivityUrlObject
6} from './common-objects' 6} from './common-objects'
@@ -24,8 +24,8 @@ export interface VideoTorrentObject {
24 content: string 24 content: string
25 icon: ActivityIconObject 25 icon: ActivityIconObject
26 url: ActivityUrlObject[] 26 url: ActivityUrlObject[]
27 actor?: string
28 likes?: ActivityPubOrderedCollection<string> 27 likes?: ActivityPubOrderedCollection<string>
29 dislikes?: ActivityPubOrderedCollection<string> 28 dislikes?: ActivityPubOrderedCollection<string>
30 shares?: ActivityPubOrderedCollection<string> 29 shares?: ActivityPubOrderedCollection<string>
30 attributedTo: ActivityPubAttributedTo[]
31} 31}
diff --git a/shared/models/accounts/account.model.ts b/shared/models/actors/account.model.ts
index d14701317..d14701317 100644
--- a/shared/models/accounts/account.model.ts
+++ b/shared/models/actors/account.model.ts
diff --git a/shared/models/accounts/follow.model.ts b/shared/models/actors/follow.model.ts
index cdc3da560..cdc3da560 100644
--- a/shared/models/accounts/follow.model.ts
+++ b/shared/models/actors/follow.model.ts
diff --git a/shared/models/accounts/index.ts b/shared/models/actors/index.ts
index 8fe437b81..8fe437b81 100644
--- a/shared/models/accounts/index.ts
+++ b/shared/models/actors/index.ts
diff --git a/shared/models/index.ts b/shared/models/index.ts
index faf616bfc..a88c01608 100644
--- a/shared/models/index.ts
+++ b/shared/models/index.ts
@@ -1,4 +1,4 @@
1export * from './accounts' 1export * from './actors'
2export * from './activitypub' 2export * from './activitypub'
3export * from './users' 3export * from './users'
4export * from './videos' 4export * from './videos'
diff --git a/shared/models/users/user.model.ts b/shared/models/users/user.model.ts
index f2b43d371..b5f459f31 100644
--- a/shared/models/users/user.model.ts
+++ b/shared/models/users/user.model.ts
@@ -1,4 +1,4 @@
1import { Account } from '../accounts' 1import { Account } from '../actors'
2import { VideoChannel } from '../videos/video-channel.model' 2import { VideoChannel } from '../videos/video-channel.model'
3import { UserRole } from './user-role' 3import { UserRole } from './user-role'
4 4
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts
index 3a378419f..13b9c49b3 100644
--- a/shared/models/videos/video.model.ts
+++ b/shared/models/videos/video.model.ts
@@ -1,4 +1,4 @@
1import { Account } from '../accounts' 1import { Account } from '../actors'
2import { VideoChannel } from './video-channel.model' 2import { VideoChannel } from './video-channel.model'
3import { VideoPrivacy } from './video-privacy.enum' 3import { VideoPrivacy } from './video-privacy.enum'
4 4