1 import { ContextType } from '../activitypub/context'
2 import { VideoState } from '../videos'
3 import { VideoResolution } from '../videos/file/video-resolution.enum'
4 import { VideoStudioTaskCut } from '../videos/studio'
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
130 autoDeleteWebTorrentIfNeeded: boolean
131 isMaxQuality: boolean
134 export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
135 type: 'new-resolution-to-webtorrent'
136 resolution: VideoResolution
139 createHLSIfNeeded: boolean
142 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
143 type: 'merge-audio-to-webtorrent'
144 resolution: VideoResolution
145 createHLSIfNeeded: true
148 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
149 type: 'optimize-to-webtorrent'
152 export type VideoTranscodingPayload =
153 HLSTranscodingPayload
154 | NewWebTorrentResolutionTranscodingPayload
155 | OptimizeTranscodingPayload
156 | MergeAudioTranscodingPayload
158 export interface VideoLiveEndingPayload {
161 liveSessionId: number
162 streamingPlaylistId: number
164 replayDirectory?: string
167 export interface ActorKeysPayload {
171 export interface DeleteResumableUploadMetaFilePayload {
175 export interface MoveObjectStoragePayload {
178 previousVideoState: VideoState
181 export type VideoStudioTaskCutPayload = VideoStudioTaskCut
183 export type VideoStudioTaskIntroPayload = {
191 export type VideoStudioTaskOutroPayload = {
199 export type VideoStudioTaskWatermarkPayload = {
200 name: 'add-watermark'
207 export type VideoStudioTaskPayload =
208 VideoStudioTaskCutPayload |
209 VideoStudioTaskIntroPayload |
210 VideoStudioTaskOutroPayload |
211 VideoStudioTaskWatermarkPayload
213 export interface VideoStudioEditionPayload {
215 tasks: VideoStudioTaskPayload[]