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-fetcher'
13 | 'activitypub-cleaner'
14 | 'activitypub-follow'
19 | 'videos-views-stats'
20 | 'activitypub-refresher'
24 | 'manage-video-torrent'
25 | 'move-to-object-storage'
26 | 'video-studio-edition'
28 export interface Job {
36 createdAt: Date | string
37 finishedOn: Date | string
38 processedOn: Date | string
41 export type ActivitypubHttpBroadcastPayload = {
43 contextType: ContextType
45 signatureActorId?: number
48 export type ActivitypubFollowPayload = {
49 followerActorId: number
52 isAutoFollow?: boolean
53 assertIsChannel?: boolean
56 export type FetchType = 'activity' | 'video-shares' | 'video-comments' | 'account-playlists'
57 export type ActivitypubHttpFetcherPayload = {
63 export type ActivitypubHttpUnicastPayload = {
65 contextType: ContextType
66 signatureActorId?: number
70 export type RefreshPayload = {
71 type: 'video' | 'video-playlist' | 'actor'
75 export type EmailPayload = SendEmailOptions
77 export type VideoFileImportPayload = {
82 export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
83 export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
85 export type VideoImportYoutubeDLPayload = {
86 type: VideoImportYoutubeDLPayloadType
91 export type VideoImportTorrentPayload = {
92 type: VideoImportTorrentPayloadType
95 export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
97 export type VideoRedundancyPayload = {
101 export type ManageVideoTorrentPayload =
107 action: 'update-metadata'
110 streamingPlaylistId?: number
115 // Video transcoding payloads
117 interface BaseTranscodingPayload {
122 export interface HLSTranscodingPayload extends BaseTranscodingPayload {
123 type: 'new-resolution-to-hls'
124 resolution: VideoResolution
128 isPortraitMode?: boolean
130 autoDeleteWebTorrentIfNeeded: boolean
131 isMaxQuality: boolean
134 export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
135 type: 'new-resolution-to-webtorrent'
136 resolution: VideoResolution
139 createHLSIfNeeded: boolean
141 isPortraitMode?: boolean
144 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
145 type: 'merge-audio-to-webtorrent'
146 resolution: VideoResolution
147 createHLSIfNeeded: true
150 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
151 type: 'optimize-to-webtorrent'
154 export type VideoTranscodingPayload =
155 HLSTranscodingPayload
156 | NewWebTorrentResolutionTranscodingPayload
157 | OptimizeTranscodingPayload
158 | MergeAudioTranscodingPayload
160 export interface VideoLiveEndingPayload {
163 liveSessionId: number
164 streamingPlaylistId: number
166 replayDirectory?: string
169 export interface ActorKeysPayload {
173 export interface DeleteResumableUploadMetaFilePayload {
177 export interface MoveObjectStoragePayload {
180 previousVideoState: VideoState
183 export type VideoStudioTaskCutPayload = VideoStudioTaskCut
185 export type VideoStudioTaskIntroPayload = {
193 export type VideoStudioTaskOutroPayload = {
201 export type VideoStudioTaskWatermarkPayload = {
202 name: 'add-watermark'
209 export type VideoStudioTaskPayload =
210 VideoStudioTaskCutPayload |
211 VideoStudioTaskIntroPayload |
212 VideoStudioTaskOutroPayload |
213 VideoStudioTaskWatermarkPayload
215 export interface VideoStudioEditionPayload {
217 tasks: VideoStudioTaskPayload[]