aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-23 16:14:33 +0100
committerChocobozzz <me@florianbigard.com>2022-03-24 09:40:46 +0100
commita219c9100b3ce8774d454497d46be87465bf664e (patch)
treecaa869e47919a9e23cc86dcece1100e239683b8c /shared
parent7e98a7df7d04e19ba67163a86c7b876d78d76839 (diff)
downloadPeerTube-a219c9100b3ce8774d454497d46be87465bf664e.tar.gz
PeerTube-a219c9100b3ce8774d454497d46be87465bf664e.tar.zst
PeerTube-a219c9100b3ce8774d454497d46be87465bf664e.zip
Refactor AP context builder
Diffstat (limited to 'shared')
-rw-r--r--shared/models/activitypub/context.ts16
-rw-r--r--shared/models/activitypub/objects/common-objects.ts4
-rw-r--r--shared/models/server/job.model.ts6
3 files changed, 20 insertions, 6 deletions
diff --git a/shared/models/activitypub/context.ts b/shared/models/activitypub/context.ts
index bd795a2fd..4ada3b083 100644
--- a/shared/models/activitypub/context.ts
+++ b/shared/models/activitypub/context.ts
@@ -1 +1,15 @@
1export type ContextType = 'All' | 'View' | 'Announce' | 'CacheFile' 1export type ContextType =
2 'Video' |
3 'Comment' |
4 'Playlist' |
5 'Follow' |
6 'Reject' |
7 'Accept' |
8 'View' |
9 'Announce' |
10 'CacheFile' |
11 'Delete' |
12 'Rate' |
13 'Flag' |
14 'Actor' |
15 'Collection'
diff --git a/shared/models/activitypub/objects/common-objects.ts b/shared/models/activitypub/objects/common-objects.ts
index 43d7f7f74..9bf994379 100644
--- a/shared/models/activitypub/objects/common-objects.ts
+++ b/shared/models/activitypub/objects/common-objects.ts
@@ -46,7 +46,7 @@ export type ActivityTrackerUrlObject = {
46 href: string 46 href: string
47} 47}
48 48
49export type ActivityPlaylistInfohashesObject = { 49export type ActivityStreamingPlaylistInfohashesObject = {
50 type: 'Infohash' 50 type: 'Infohash'
51 name: string 51 name: string
52} 52}
@@ -97,7 +97,7 @@ export interface ActivityFlagReasonObject {
97 97
98export type ActivityTagObject = 98export type ActivityTagObject =
99 ActivityPlaylistSegmentHashesObject 99 ActivityPlaylistSegmentHashesObject
100 | ActivityPlaylistInfohashesObject 100 | ActivityStreamingPlaylistInfohashesObject
101 | ActivityVideoUrlObject 101 | ActivityVideoUrlObject
102 | ActivityHashTagObject 102 | ActivityHashTagObject
103 | ActivityMentionObject 103 | ActivityMentionObject
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts
index 91469d010..92d1b5698 100644
--- a/shared/models/server/job.model.ts
+++ b/shared/models/server/job.model.ts
@@ -40,9 +40,9 @@ export interface Job {
40 40
41export type ActivitypubHttpBroadcastPayload = { 41export type ActivitypubHttpBroadcastPayload = {
42 uris: string[] 42 uris: string[]
43 signatureActorId?: number 43 contextType: ContextType
44 body: any 44 body: any
45 contextType?: ContextType 45 signatureActorId?: number
46} 46}
47 47
48export type ActivitypubFollowPayload = { 48export type ActivitypubFollowPayload = {
@@ -62,9 +62,9 @@ export type ActivitypubHttpFetcherPayload = {
62 62
63export type ActivitypubHttpUnicastPayload = { 63export type ActivitypubHttpUnicastPayload = {
64 uri: string 64 uri: string
65 contextType: ContextType
65 signatureActorId?: number 66 signatureActorId?: number
66 body: object 67 body: object
67 contextType?: ContextType
68} 68}
69 69
70export type RefreshPayload = { 70export type RefreshPayload = {