1 import { ContextType } from '../activitypub/context'
2 import { VideoEditorTaskCut } from '../videos/editor'
3 import { VideoResolution } from '../videos/file/video-resolution.enum'
4 import { SendEmailOptions } from './emailer.model'
6 export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused'
9 | 'activitypub-http-unicast'
10 | 'activitypub-http-broadcast'
11 | 'activitypub-http-fetcher'
12 | 'activitypub-cleaner'
13 | 'activitypub-follow'
18 | 'videos-views-stats'
19 | 'activitypub-refresher'
23 | 'manage-video-torrent'
24 | 'move-to-object-storage'
27 export interface Job {
35 createdAt: Date | string
36 finishedOn: Date | string
37 processedOn: Date | string
40 export type ActivitypubHttpBroadcastPayload = {
42 signatureActorId?: number
44 contextType?: ContextType
47 export type ActivitypubFollowPayload = {
48 followerActorId: number
51 isAutoFollow?: boolean
52 assertIsChannel?: boolean
55 export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists'
56 export type ActivitypubHttpFetcherPayload = {
62 export type ActivitypubHttpUnicastPayload = {
64 signatureActorId?: number
66 contextType?: ContextType
69 export type RefreshPayload = {
70 type: 'video' | 'video-playlist' | 'actor'
74 export type EmailPayload = SendEmailOptions
76 export type VideoFileImportPayload = {
81 export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
82 export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
84 export type VideoImportYoutubeDLPayload = {
85 type: VideoImportYoutubeDLPayloadType
90 export type VideoImportTorrentPayload = {
91 type: VideoImportTorrentPayloadType
94 export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
96 export type VideoRedundancyPayload = {
100 export type ManageVideoTorrentPayload =
106 action: 'update-metadata'
109 streamingPlaylistId?: number
114 // Video transcoding payloads
116 interface BaseTranscodingPayload {
121 export interface HLSTranscodingPayload extends BaseTranscodingPayload {
122 type: 'new-resolution-to-hls'
123 resolution: VideoResolution
127 isPortraitMode?: boolean
129 autoDeleteWebTorrentIfNeeded: boolean
130 isMaxQuality: boolean
133 export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
134 type: 'new-resolution-to-webtorrent'
135 resolution: VideoResolution
138 createHLSIfNeeded: boolean
140 isPortraitMode?: boolean
143 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
144 type: 'merge-audio-to-webtorrent'
145 resolution: VideoResolution
146 createHLSIfNeeded: true
149 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
150 type: 'optimize-to-webtorrent'
153 export type VideoTranscodingPayload =
154 HLSTranscodingPayload
155 | NewWebTorrentResolutionTranscodingPayload
156 | OptimizeTranscodingPayload
157 | MergeAudioTranscodingPayload
159 export interface VideoLiveEndingPayload {
163 export interface ActorKeysPayload {
167 export interface DeleteResumableUploadMetaFilePayload {
171 export interface MoveObjectStoragePayload {
176 export type VideoEditorTaskCutPayload = VideoEditorTaskCut
178 export type VideoEditorTaskIntroPayload = {
186 export type VideoEditorTaskOutroPayload = {
194 export type VideoEditorTaskWatermarkPayload = {
195 name: 'add-watermark'
202 export type VideoEditionTaskPayload =
203 VideoEditorTaskCutPayload |
204 VideoEditorTaskIntroPayload |
205 VideoEditorTaskOutroPayload |
206 VideoEditorTaskWatermarkPayload
208 export interface VideoEditionPayload {
210 tasks: VideoEditionTaskPayload[]