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 | 'manage-video-torrent'
22 | 'move-to-object-storage'
24 | 'video-channel-import'
29 | 'video-studio-edition'
31 | 'videos-views-stats'
33 export interface Job {
35 state: JobState | 'unknown'
41 createdAt: Date | string
42 finishedOn: Date | string
43 processedOn: Date | string
46 export type ActivitypubHttpBroadcastPayload = {
48 contextType: ContextType
50 signatureActorId?: number
53 export type ActivitypubFollowPayload = {
54 followerActorId: number
57 isAutoFollow?: boolean
58 assertIsChannel?: boolean
61 export type FetchType = 'activity' | 'video-shares' | 'video-comments' | 'account-playlists'
62 export type ActivitypubHttpFetcherPayload = {
68 export type ActivitypubHttpUnicastPayload = {
70 contextType: ContextType
71 signatureActorId?: number
75 export type RefreshPayload = {
76 type: 'video' | 'video-playlist' | 'actor'
80 export type EmailPayload = SendEmailOptions
82 export type VideoFileImportPayload = {
87 // ---------------------------------------------------------------------------
89 export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
90 export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
92 export interface VideoImportYoutubeDLPayload {
93 type: VideoImportYoutubeDLPayloadType
99 export interface VideoImportTorrentPayload {
100 type: VideoImportTorrentPayloadType
101 videoImportId: number
104 export type VideoImportPayload = (VideoImportYoutubeDLPayload | VideoImportTorrentPayload) & {
105 preventException: boolean
108 export interface VideoImportPreventExceptionResult {
109 resultType: 'success' | 'error'
112 // ---------------------------------------------------------------------------
114 export type VideoRedundancyPayload = {
118 export type ManageVideoTorrentPayload =
124 action: 'update-metadata'
127 streamingPlaylistId?: number
132 // Video transcoding payloads
134 interface BaseTranscodingPayload {
139 export interface HLSTranscodingPayload extends BaseTranscodingPayload {
140 type: 'new-resolution-to-hls'
141 resolution: VideoResolution
146 autoDeleteWebTorrentIfNeeded: boolean
147 isMaxQuality: boolean
150 export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
151 type: 'new-resolution-to-webtorrent'
152 resolution: VideoResolution
155 createHLSIfNeeded: boolean
158 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
159 type: 'merge-audio-to-webtorrent'
160 resolution: VideoResolution
161 createHLSIfNeeded: true
164 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
165 type: 'optimize-to-webtorrent'
168 export type VideoTranscodingPayload =
169 HLSTranscodingPayload
170 | NewWebTorrentResolutionTranscodingPayload
171 | OptimizeTranscodingPayload
172 | MergeAudioTranscodingPayload
174 export interface VideoLiveEndingPayload {
177 liveSessionId: number
178 streamingPlaylistId: number
180 replayDirectory?: string
183 export interface ActorKeysPayload {
187 export interface DeleteResumableUploadMetaFilePayload {
191 export interface MoveObjectStoragePayload {
194 previousVideoState: VideoState
197 export type VideoStudioTaskCutPayload = VideoStudioTaskCut
199 export type VideoStudioTaskIntroPayload = {
207 export type VideoStudioTaskOutroPayload = {
215 export type VideoStudioTaskWatermarkPayload = {
216 name: 'add-watermark'
223 export type VideoStudioTaskPayload =
224 VideoStudioTaskCutPayload |
225 VideoStudioTaskIntroPayload |
226 VideoStudioTaskOutroPayload |
227 VideoStudioTaskWatermarkPayload
229 export interface VideoStudioEditionPayload {
231 tasks: VideoStudioTaskPayload[]
234 // ---------------------------------------------------------------------------
236 export interface VideoChannelImportPayload {
237 externalChannelUrl: string
238 videoChannelId: number
240 partOfChannelSyncId?: number
243 export interface AfterVideoChannelImportPayload {
244 channelSyncId: number
247 // ---------------------------------------------------------------------------
249 export type NotifyPayload =
255 // ---------------------------------------------------------------------------
257 export interface FederateVideoPayload {