1 import { ContextType } from '../activitypub/context'
2 import { VideoState } from '../videos'
3 import { VideoStudioTaskCut } from '../videos/studio'
4 import { VideoResolution } from '../videos/file/video-resolution.enum'
5 import { SendEmailOptions } from './emailer.model'
7 export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused'
10 | 'activitypub-http-unicast'
11 | 'activitypub-http-broadcast'
12 | 'activitypub-http-broadcast-parallel'
13 | 'activitypub-http-fetcher'
14 | 'activitypub-cleaner'
15 | 'activitypub-follow'
20 | 'videos-views-stats'
21 | 'activitypub-refresher'
25 | 'manage-video-torrent'
26 | 'move-to-object-storage'
27 | 'video-studio-edition'
29 export interface Job {
37 createdAt: Date | string
38 finishedOn: Date | string
39 processedOn: Date | string
42 export type ActivitypubHttpBroadcastPayload = {
44 contextType: ContextType
46 signatureActorId?: number
49 export type ActivitypubFollowPayload = {
50 followerActorId: number
53 isAutoFollow?: boolean
54 assertIsChannel?: boolean
57 export type FetchType = 'activity' | 'video-shares' | 'video-comments' | 'account-playlists'
58 export type ActivitypubHttpFetcherPayload = {
64 export type ActivitypubHttpUnicastPayload = {
66 contextType: ContextType
67 signatureActorId?: number
71 export type RefreshPayload = {
72 type: 'video' | 'video-playlist' | 'actor'
76 export type EmailPayload = SendEmailOptions
78 export type VideoFileImportPayload = {
83 export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
84 export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
86 export type VideoImportYoutubeDLPayload = {
87 type: VideoImportYoutubeDLPayloadType
92 export type VideoImportTorrentPayload = {
93 type: VideoImportTorrentPayloadType
96 export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
98 export type VideoRedundancyPayload = {
102 export type ManageVideoTorrentPayload =
108 action: 'update-metadata'
111 streamingPlaylistId?: number
116 // Video transcoding payloads
118 interface BaseTranscodingPayload {
123 export interface HLSTranscodingPayload extends BaseTranscodingPayload {
124 type: 'new-resolution-to-hls'
125 resolution: VideoResolution
129 isPortraitMode?: boolean
131 autoDeleteWebTorrentIfNeeded: boolean
132 isMaxQuality: boolean
135 export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
136 type: 'new-resolution-to-webtorrent'
137 resolution: VideoResolution
140 createHLSIfNeeded: boolean
142 isPortraitMode?: boolean
145 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
146 type: 'merge-audio-to-webtorrent'
147 resolution: VideoResolution
148 createHLSIfNeeded: true
151 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
152 type: 'optimize-to-webtorrent'
155 export type VideoTranscodingPayload =
156 HLSTranscodingPayload
157 | NewWebTorrentResolutionTranscodingPayload
158 | OptimizeTranscodingPayload
159 | MergeAudioTranscodingPayload
161 export interface VideoLiveEndingPayload {
164 liveSessionId: number
165 streamingPlaylistId: number
167 replayDirectory?: string
170 export interface ActorKeysPayload {
174 export interface DeleteResumableUploadMetaFilePayload {
178 export interface MoveObjectStoragePayload {
181 previousVideoState: VideoState
184 export type VideoStudioTaskCutPayload = VideoStudioTaskCut
186 export type VideoStudioTaskIntroPayload = {
194 export type VideoStudioTaskOutroPayload = {
202 export type VideoStudioTaskWatermarkPayload = {
203 name: 'add-watermark'
210 export type VideoStudioTaskPayload =
211 VideoStudioTaskCutPayload |
212 VideoStudioTaskIntroPayload |
213 VideoStudioTaskOutroPayload |
214 VideoStudioTaskWatermarkPayload
216 export interface VideoStudioEditionPayload {
218 tasks: VideoStudioTaskPayload[]