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 | 'move-to-object-storage'
26 export interface Job {
34 createdAt: Date | string
35 finishedOn: Date | string
36 processedOn: Date | string
39 export type ActivitypubHttpBroadcastPayload = {
41 signatureActorId?: number
43 contextType?: ContextType
46 export type ActivitypubFollowPayload = {
47 followerActorId: number
50 isAutoFollow?: boolean
51 assertIsChannel?: boolean
54 export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists'
55 export type ActivitypubHttpFetcherPayload = {
61 export type ActivitypubHttpUnicastPayload = {
63 signatureActorId?: number
65 contextType?: ContextType
68 export type RefreshPayload = {
69 type: 'video' | 'video-playlist' | 'actor'
73 export type EmailPayload = SendEmailOptions
75 export type VideoFileImportPayload = {
80 export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
81 export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
83 export type VideoImportYoutubeDLPayload = {
84 type: VideoImportYoutubeDLPayloadType
89 export type VideoImportTorrentPayload = {
90 type: VideoImportTorrentPayloadType
93 export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
95 export type VideoRedundancyPayload = {
99 // Video transcoding payloads
101 interface BaseTranscodingPayload {
106 export interface HLSTranscodingPayload extends BaseTranscodingPayload {
107 type: 'new-resolution-to-hls'
108 resolution: VideoResolution
112 isPortraitMode?: boolean
114 autoDeleteWebTorrentIfNeeded: boolean
115 isMaxQuality: boolean
118 export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload {
119 type: 'new-resolution-to-webtorrent'
120 resolution: VideoResolution
123 createHLSIfNeeded: boolean
125 isPortraitMode?: boolean
128 export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
129 type: 'merge-audio-to-webtorrent'
130 resolution: VideoResolution
131 createHLSIfNeeded: true
134 export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
135 type: 'optimize-to-webtorrent'
138 export type VideoTranscodingPayload =
139 HLSTranscodingPayload
140 | NewWebTorrentResolutionTranscodingPayload
141 | OptimizeTranscodingPayload
142 | MergeAudioTranscodingPayload
144 export interface VideoLiveEndingPayload {
148 export interface ActorKeysPayload {
152 export interface DeleteResumableUploadMetaFilePayload {
156 export interface MoveObjectStoragePayload {
161 export type VideoEditorTaskCutPayload = VideoEditorTaskCut
163 export type VideoEditorTaskIntroPayload = {
171 export type VideoEditorTaskOutroPayload = {
179 export type VideoEditorTaskWatermarkPayload = {
180 name: 'add-watermark'
187 export type VideoEditionTaskPayload =
188 VideoEditorTaskCutPayload |
189 VideoEditorTaskIntroPayload |
190 VideoEditorTaskOutroPayload |
191 VideoEditorTaskWatermarkPayload
193 export interface VideoEditionPayload {
195 tasks: VideoEditionTaskPayload[]