From a219c9100b3ce8774d454497d46be87465bf664e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 23 Mar 2022 16:14:33 +0100 Subject: Refactor AP context builder --- shared/models/activitypub/context.ts | 16 +++++++++++++++- shared/models/activitypub/objects/common-objects.ts | 4 ++-- shared/models/server/job.model.ts | 6 +++--- 3 files changed, 20 insertions(+), 6 deletions(-) (limited to 'shared') 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 @@ -export type ContextType = 'All' | 'View' | 'Announce' | 'CacheFile' +export type ContextType = + 'Video' | + 'Comment' | + 'Playlist' | + 'Follow' | + 'Reject' | + 'Accept' | + 'View' | + 'Announce' | + 'CacheFile' | + 'Delete' | + 'Rate' | + 'Flag' | + 'Actor' | + '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 = { href: string } -export type ActivityPlaylistInfohashesObject = { +export type ActivityStreamingPlaylistInfohashesObject = { type: 'Infohash' name: string } @@ -97,7 +97,7 @@ export interface ActivityFlagReasonObject { export type ActivityTagObject = ActivityPlaylistSegmentHashesObject - | ActivityPlaylistInfohashesObject + | ActivityStreamingPlaylistInfohashesObject | ActivityVideoUrlObject | ActivityHashTagObject | 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 { export type ActivitypubHttpBroadcastPayload = { uris: string[] - signatureActorId?: number + contextType: ContextType body: any - contextType?: ContextType + signatureActorId?: number } export type ActivitypubFollowPayload = { @@ -62,9 +62,9 @@ export type ActivitypubHttpFetcherPayload = { export type ActivitypubHttpUnicastPayload = { uri: string + contextType: ContextType signatureActorId?: number body: object - contextType?: ContextType } export type RefreshPayload = { -- cgit v1.2.3