1 import { ContextType } from '../activitypub/context'
2 import { VideoResolution } from '../videos/video-resolution.enum'
3 import { SendEmailOptions } from './emailer.model'
5 export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed'
8 | 'activitypub-http-unicast'
9 | 'activitypub-http-broadcast'
10 | 'activitypub-http-fetcher'
11 | 'activitypub-follow'
17 | 'activitypub-refresher'
20 export interface Job {
26 createdAt: Date | string
27 finishedOn: Date | string
28 processedOn: Date | string
31 export type ActivitypubHttpBroadcastPayload = {
33 signatureActorId?: number
35 contextType?: ContextType
38 export type ActivitypubFollowPayload = {
39 followerActorId: number
42 isAutoFollow?: boolean
43 assertIsChannel?: boolean
46 export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists'
47 export type ActivitypubHttpFetcherPayload = {
54 export type ActivitypubHttpUnicastPayload = {
56 signatureActorId?: number
58 contextType?: ContextType
61 export type RefreshPayload = {
62 type: 'video' | 'video-playlist' | 'actor'
66 export type EmailPayload = SendEmailOptions
68 export type VideoFileImportPayload = {
73 export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
74 export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
76 export type VideoImportYoutubeDLPayload = {
77 type: VideoImportYoutubeDLPayloadType
80 generateThumbnail: boolean
81 generatePreview: boolean
85 export type VideoImportTorrentPayload = {
86 type: VideoImportTorrentPayloadType
89 export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
91 export type VideoRedundancyPayload = {
95 // Video transcoding payloads
97 interface BaseTranscodingPayload {
102 interface HLSTranscodingPayload extends BaseTranscodingPayload {
104 isPortraitMode?: boolean
105 resolution: VideoResolution
109 export interface NewResolutionTranscodingPayload extends BaseTranscodingPayload {
110 type: 'new-resolution'
111 isPortraitMode?: boolean
112 resolution: VideoResolution
115 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
117 resolution: VideoResolution
120 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
124 export type VideoTranscodingPayload =
125 HLSTranscodingPayload
126 | NewResolutionTranscodingPayload
127 | OptimizeTranscodingPayload
128 | MergeAudioTranscodingPayload