]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - shared/models/server/job.model.ts
Add a test for refreshing remote keys
[github/Chocobozzz/PeerTube.git] / shared / models / server / job.model.ts
CommitLineData
e307e4fc 1import { ContextType } from '../activitypub/context'
0fecf427
C
2import { VideoResolution } from '../videos/video-resolution.enum'
3import { SendEmailOptions } from './emailer.model'
8dc8a34e 4
402145b8 5export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' | 'paused'
94a5ff8a 6
a1587156
C
7export type JobType =
8 | 'activitypub-http-unicast'
9 | 'activitypub-http-broadcast'
10 | 'activitypub-http-fetcher'
11 | 'activitypub-follow'
12 | 'video-file-import'
13 | 'video-transcoding'
14 | 'email'
15 | 'video-import'
16 | 'videos-views'
17 | 'activitypub-refresher'
18 | 'video-redundancy'
a5cf76af 19 | 'video-live-ending'
8795d6f2 20 | 'actor-keys'
5cd80545
C
21
22export interface Job {
23 id: number
24 state: JobState
94a5ff8a 25 type: JobType
a1587156 26 data: any
77d7e851 27 priority: number
3b01f4c0 28 progress: number
a1587156 29 error: any
1061c73f
C
30 createdAt: Date | string
31 finishedOn: Date | string
32 processedOn: Date | string
5cd80545 33}
8dc8a34e
C
34
35export type ActivitypubHttpBroadcastPayload = {
36 uris: string[]
37 signatureActorId?: number
38 body: any
39 contextType?: ContextType
40}
41
42export type ActivitypubFollowPayload = {
43 followerActorId: number
44 name: string
45 host: string
46 isAutoFollow?: boolean
47 assertIsChannel?: boolean
48}
49
50export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists'
51export type ActivitypubHttpFetcherPayload = {
52 uri: string
53 type: FetchType
54 videoId?: number
55 accountId?: number
56}
57
58export type ActivitypubHttpUnicastPayload = {
59 uri: string
60 signatureActorId?: number
61 body: any
62 contextType?: ContextType
63}
64
65export type RefreshPayload = {
66 type: 'video' | 'video-playlist' | 'actor'
67 url: string
68}
69
70export type EmailPayload = SendEmailOptions
71
72export type VideoFileImportPayload = {
73 videoUUID: string
74 filePath: string
75}
76
2158ac90
RK
77export type VideoImportTorrentPayloadType = 'magnet-uri' | 'torrent-file'
78export type VideoImportYoutubeDLPayloadType = 'youtube-dl'
79
8dc8a34e 80export type VideoImportYoutubeDLPayload = {
2158ac90 81 type: VideoImportYoutubeDLPayloadType
8dc8a34e
C
82 videoImportId: number
83
8dc8a34e
C
84 fileExt?: string
85}
86export type VideoImportTorrentPayload = {
2158ac90 87 type: VideoImportTorrentPayloadType
8dc8a34e
C
88 videoImportId: number
89}
90export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
91
92export type VideoRedundancyPayload = {
93 videoId: number
94}
95
96// Video transcoding payloads
97
98interface BaseTranscodingPayload {
99 videoUUID: string
100 isNewVideo?: boolean
101}
102
24516aa2
C
103export interface HLSTranscodingPayload extends BaseTranscodingPayload {
104 type: 'new-resolution-to-hls'
8dc8a34e
C
105 isPortraitMode?: boolean
106 resolution: VideoResolution
107 copyCodecs: boolean
9129b769 108 isMaxQuality: boolean
8dc8a34e
C
109}
110
111export interface NewResolutionTranscodingPayload extends BaseTranscodingPayload {
24516aa2 112 type: 'new-resolution-to-webtorrent'
8dc8a34e
C
113 isPortraitMode?: boolean
114 resolution: VideoResolution
115}
116
117export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
24516aa2 118 type: 'merge-audio-to-webtorrent'
8dc8a34e
C
119 resolution: VideoResolution
120}
121
122export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
24516aa2 123 type: 'optimize-to-webtorrent'
8dc8a34e
C
124}
125
126export type VideoTranscodingPayload =
127 HLSTranscodingPayload
128 | NewResolutionTranscodingPayload
129 | OptimizeTranscodingPayload
130 | MergeAudioTranscodingPayload
a5cf76af
C
131
132export interface VideoLiveEndingPayload {
133 videoId: number
134}
8795d6f2
C
135
136export interface ActorKeysPayload {
137 actorId: number
138}