]>
Commit | Line | Data |
---|---|---|
e307e4fc | 1 | import { ContextType } from '../activitypub/context' |
c729caf6 | 2 | import { VideoEditorTaskCut } from '../videos/editor' |
ad5db104 | 3 | import { VideoResolution } from '../videos/file/video-resolution.enum' |
0fecf427 | 4 | import { SendEmailOptions } from './emailer.model' |
8dc8a34e | 5 | |
402145b8 | 6 | export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused' |
94a5ff8a | 7 | |
a1587156 C |
8 | export type JobType = |
9 | | 'activitypub-http-unicast' | |
10 | | 'activitypub-http-broadcast' | |
11 | | 'activitypub-http-fetcher' | |
74d249bc | 12 | | 'activitypub-cleaner' |
a1587156 C |
13 | | 'activitypub-follow' |
14 | | 'video-file-import' | |
15 | | 'video-transcoding' | |
16 | | 'email' | |
17 | | 'video-import' | |
51353d9a | 18 | | 'videos-views-stats' |
a1587156 C |
19 | | 'activitypub-refresher' |
20 | | 'video-redundancy' | |
a5cf76af | 21 | | 'video-live-ending' |
8795d6f2 | 22 | | 'actor-keys' |
f012319a | 23 | | 'manage-video-torrent' |
0305db28 | 24 | | 'move-to-object-storage' |
c729caf6 | 25 | | 'video-edition' |
5cd80545 C |
26 | |
27 | export interface Job { | |
28 | id: number | |
29 | state: JobState | |
94a5ff8a | 30 | type: JobType |
a1587156 | 31 | data: any |
77d7e851 | 32 | priority: number |
3b01f4c0 | 33 | progress: number |
a1587156 | 34 | error: any |
1061c73f C |
35 | createdAt: Date | string |
36 | finishedOn: Date | string | |
37 | processedOn: Date | string | |
5cd80545 | 38 | } |
8dc8a34e C |
39 | |
40 | export type ActivitypubHttpBroadcastPayload = { | |
41 | uris: string[] | |
42 | signatureActorId?: number | |
43 | body: any | |
44 | contextType?: ContextType | |
45 | } | |
46 | ||
47 | export type ActivitypubFollowPayload = { | |
48 | followerActorId: number | |
49 | name: string | |
50 | host: string | |
51 | isAutoFollow?: boolean | |
52 | assertIsChannel?: boolean | |
53 | } | |
54 | ||
55 | export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists' | |
56 | export type ActivitypubHttpFetcherPayload = { | |
57 | uri: string | |
58 | type: FetchType | |
59 | videoId?: number | |
8dc8a34e C |
60 | } |
61 | ||
62 | export type ActivitypubHttpUnicastPayload = { | |
63 | uri: string | |
64 | signatureActorId?: number | |
db4b15f2 | 65 | body: object |
8dc8a34e C |
66 | contextType?: ContextType |
67 | } | |
68 | ||
69 | export type RefreshPayload = { | |
70 | type: 'video' | 'video-playlist' | 'actor' | |
71 | url: string | |
72 | } | |
73 | ||
74 | export type EmailPayload = SendEmailOptions | |
75 | ||
76 | export type VideoFileImportPayload = { | |
77 | videoUUID: string | |
78 | filePath: string | |
79 | } | |
80 | ||
2158ac90 RK |
81 | export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file' |
82 | export type VideoImportYoutubeDLPayloadType = 'youtube-dl' | |
83 | ||
8dc8a34e | 84 | export type VideoImportYoutubeDLPayload = { |
2158ac90 | 85 | type: VideoImportYoutubeDLPayloadType |
8dc8a34e C |
86 | videoImportId: number |
87 | ||
8dc8a34e C |
88 | fileExt?: string |
89 | } | |
90 | export type VideoImportTorrentPayload = { | |
2158ac90 | 91 | type: VideoImportTorrentPayloadType |
8dc8a34e C |
92 | videoImportId: number |
93 | } | |
94 | export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload | |
95 | ||
96 | export type VideoRedundancyPayload = { | |
97 | videoId: number | |
98 | } | |
99 | ||
f012319a C |
100 | export type ManageVideoTorrentPayload = |
101 | { | |
102 | action: 'create' | |
103 | videoId: number | |
104 | videoFileId: number | |
105 | } | { | |
106 | action: 'update-metadata' | |
107 | ||
108 | videoId?: number | |
109 | streamingPlaylistId?: number | |
110 | ||
111 | videoFileId: number | |
112 | } | |
113 | ||
8dc8a34e C |
114 | // Video transcoding payloads |
115 | ||
116 | interface BaseTranscodingPayload { | |
117 | videoUUID: string | |
118 | isNewVideo?: boolean | |
119 | } | |
120 | ||
24516aa2 C |
121 | export interface HLSTranscodingPayload extends BaseTranscodingPayload { |
122 | type: 'new-resolution-to-hls' | |
8dc8a34e C |
123 | resolution: VideoResolution |
124 | copyCodecs: boolean | |
ad5db104 | 125 | |
cbe2f36d C |
126 | hasAudio: boolean |
127 | isPortraitMode?: boolean | |
128 | ||
ad5db104 | 129 | autoDeleteWebTorrentIfNeeded: boolean |
9129b769 | 130 | isMaxQuality: boolean |
8dc8a34e C |
131 | } |
132 | ||
0f11ec8d | 133 | export interface NewWebTorrentResolutionTranscodingPayload extends BaseTranscodingPayload { |
24516aa2 | 134 | type: 'new-resolution-to-webtorrent' |
8dc8a34e | 135 | resolution: VideoResolution |
cbe2f36d C |
136 | |
137 | hasAudio: boolean | |
0f11ec8d | 138 | createHLSIfNeeded: boolean |
cbe2f36d C |
139 | |
140 | isPortraitMode?: boolean | |
8dc8a34e C |
141 | } |
142 | ||
143 | export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload { | |
24516aa2 | 144 | type: 'merge-audio-to-webtorrent' |
8dc8a34e | 145 | resolution: VideoResolution |
0f11ec8d | 146 | createHLSIfNeeded: true |
8dc8a34e C |
147 | } |
148 | ||
149 | export interface OptimizeTranscodingPayload extends BaseTranscodingPayload { | |
24516aa2 | 150 | type: 'optimize-to-webtorrent' |
8dc8a34e C |
151 | } |
152 | ||
153 | export type VideoTranscodingPayload = | |
154 | HLSTranscodingPayload | |
0f11ec8d | 155 | | NewWebTorrentResolutionTranscodingPayload |
8dc8a34e C |
156 | | OptimizeTranscodingPayload |
157 | | MergeAudioTranscodingPayload | |
a5cf76af C |
158 | |
159 | export interface VideoLiveEndingPayload { | |
160 | videoId: number | |
161 | } | |
8795d6f2 C |
162 | |
163 | export interface ActorKeysPayload { | |
164 | actorId: number | |
165 | } | |
0305db28 | 166 | |
276250f0 RK |
167 | export interface DeleteResumableUploadMetaFilePayload { |
168 | filepath: string | |
169 | } | |
170 | ||
0305db28 JB |
171 | export interface MoveObjectStoragePayload { |
172 | videoUUID: string | |
173 | isNewVideo: boolean | |
174 | } | |
c729caf6 C |
175 | |
176 | export type VideoEditorTaskCutPayload = VideoEditorTaskCut | |
177 | ||
178 | export type VideoEditorTaskIntroPayload = { | |
179 | name: 'add-intro' | |
180 | ||
181 | options: { | |
182 | file: string | |
183 | } | |
184 | } | |
185 | ||
186 | export type VideoEditorTaskOutroPayload = { | |
187 | name: 'add-outro' | |
188 | ||
189 | options: { | |
190 | file: string | |
191 | } | |
192 | } | |
193 | ||
194 | export type VideoEditorTaskWatermarkPayload = { | |
195 | name: 'add-watermark' | |
196 | ||
197 | options: { | |
198 | file: string | |
199 | } | |
200 | } | |
201 | ||
202 | export type VideoEditionTaskPayload = | |
203 | VideoEditorTaskCutPayload | | |
204 | VideoEditorTaskIntroPayload | | |
205 | VideoEditorTaskOutroPayload | | |
206 | VideoEditorTaskWatermarkPayload | |
207 | ||
208 | export interface VideoEditionPayload { | |
209 | videoUUID: string | |
210 | tasks: VideoEditionTaskPayload[] | |
211 | } |