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' | 'waiting-children'
10 | 'activitypub-cleaner'
11 | 'activitypub-follow'
12 | 'activitypub-http-broadcast-parallel'
13 | 'activitypub-http-broadcast'
14 | 'activitypub-http-fetcher'
15 | 'activitypub-http-unicast'
16 | 'activitypub-refresher'
18 | 'after-video-channel-import'
21 | 'transcoding-job-builder'
22 | 'manage-video-torrent'
23 | 'move-to-object-storage'
25 | 'video-channel-import'
30 | 'video-studio-edition'
32 | 'videos-views-stats'
34 export interface Job {
36 state: JobState | 'unknown'
42 createdAt: Date | string
43 finishedOn: Date | string
44 processedOn: Date | string
51 export type ActivitypubHttpBroadcastPayload = {
53 contextType: ContextType
55 signatureActorId?: number
58 export type ActivitypubFollowPayload = {
59 followerActorId: number
62 isAutoFollow?: boolean
63 assertIsChannel?: boolean
66 export type FetchType = 'activity' | 'video-shares' | 'video-comments' | 'account-playlists'
67 export type ActivitypubHttpFetcherPayload = {
73 export type ActivitypubHttpUnicastPayload = {
75 contextType: ContextType
76 signatureActorId?: number
80 export type RefreshPayload = {
81 type: 'video' | 'video-playlist' | 'actor'
85 export type EmailPayload = SendEmailOptions
87 export type VideoFileImportPayload = {
92 // ---------------------------------------------------------------------------
94 export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
95 export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
97 export interface VideoImportYoutubeDLPayload {
98 type: VideoImportYoutubeDLPayloadType
104 export interface VideoImportTorrentPayload {
105 type: VideoImportTorrentPayloadType
106 videoImportId: number
109 export type VideoImportPayload = (VideoImportYoutubeDLPayload | VideoImportTorrentPayload) & {
110 preventException: boolean
113 export interface VideoImportPreventExceptionResult {
114 resultType: 'success' | 'error'
117 // ---------------------------------------------------------------------------
119 export type VideoRedundancyPayload = {
123 export type ManageVideoTorrentPayload =
129 action: 'update-metadata'
132 streamingPlaylistId?: number
137 // Video transcoding payloads
139 interface BaseTranscodingPayload {
144 export interface HLSTranscodingPayload extends BaseTranscodingPayload {
145 type: 'new-resolution-to-hls'
146 resolution: VideoResolution
150 deleteWebTorrentFiles: boolean
153 export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
154 type: 'new-resolution-to-webtorrent'
155 resolution: VideoResolution
159 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
160 type: 'merge-audio-to-webtorrent'
162 resolution: VideoResolution
168 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
169 type: 'optimize-to-webtorrent'
171 quickTranscode: boolean
176 export type VideoTranscodingPayload =
177 HLSTranscodingPayload
178 | NewWebTorrentResolutionTranscodingPayload
179 | OptimizeTranscodingPayload
180 | MergeAudioTranscodingPayload
182 export interface VideoLiveEndingPayload {
185 liveSessionId: number
186 streamingPlaylistId: number
188 replayDirectory?: string
191 export interface ActorKeysPayload {
195 export interface DeleteResumableUploadMetaFilePayload {
199 export interface MoveObjectStoragePayload {
202 previousVideoState: VideoState
205 export type VideoStudioTaskCutPayload = VideoStudioTaskCut
207 export type VideoStudioTaskIntroPayload = {
215 export type VideoStudioTaskOutroPayload = {
223 export type VideoStudioTaskWatermarkPayload = {
224 name: 'add-watermark'
231 export type VideoStudioTaskPayload =
232 VideoStudioTaskCutPayload |
233 VideoStudioTaskIntroPayload |
234 VideoStudioTaskOutroPayload |
235 VideoStudioTaskWatermarkPayload
237 export interface VideoStudioEditionPayload {
239 tasks: VideoStudioTaskPayload[]
242 // ---------------------------------------------------------------------------
244 export interface VideoChannelImportPayload {
245 externalChannelUrl: string
246 videoChannelId: number
248 partOfChannelSyncId?: number
251 export interface AfterVideoChannelImportPayload {
252 channelSyncId: number
255 // ---------------------------------------------------------------------------
257 export type NotifyPayload =
263 // ---------------------------------------------------------------------------
265 export interface FederateVideoPayload {
270 // ---------------------------------------------------------------------------
272 export interface TranscodingJobBuilderPayload {
279 // Array of jobs to create
281 type: 'video-transcoding'
282 payload: VideoTranscodingPayload
286 // Array of sequential jobs to create
288 type: 'video-transcoding'
289 payload: VideoTranscodingPayload