aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-23 09:32:53 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-05-04 16:21:39 +0200
commit8dc8a34ee8428e7657414115d1c137592efa174d (patch)
treee9b5ef0d7446d1b7766eac18da5a759edc7a9040 /shared/models
parent7fed637506043e4432cbebe041ada0625171cceb (diff)
downloadPeerTube-8dc8a34ee8428e7657414115d1c137592efa174d.tar.gz
PeerTube-8dc8a34ee8428e7657414115d1c137592efa174d.tar.zst
PeerTube-8dc8a34ee8428e7657414115d1c137592efa174d.zip
Avoir some circular dependencies
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/server/emailer.model.ts8
-rw-r--r--shared/models/server/index.ts1
-rw-r--r--shared/models/server/job.model.ts100
3 files changed, 109 insertions, 0 deletions
diff --git a/shared/models/server/emailer.model.ts b/shared/models/server/emailer.model.ts
new file mode 100644
index 000000000..2d8feda81
--- /dev/null
+++ b/shared/models/server/emailer.model.ts
@@ -0,0 +1,8 @@
1export type SendEmailOptions = {
2 to: string[]
3 subject: string
4 text: string
5
6 fromDisplayName?: string
7 replyTo?: string
8}
diff --git a/shared/models/server/index.ts b/shared/models/server/index.ts
index bf61ab270..b0afb2c66 100644
--- a/shared/models/server/index.ts
+++ b/shared/models/server/index.ts
@@ -2,6 +2,7 @@ export * from './about.model'
2export * from './contact-form.model' 2export * from './contact-form.model'
3export * from './custom-config.model' 3export * from './custom-config.model'
4export * from './debug.model' 4export * from './debug.model'
5export * from './emailer.model'
5export * from './job.model' 6export * from './job.model'
6export * from './server-config.model' 7export * from './server-config.model'
7export * from './server-stats.model' 8export * from './server-stats.model'
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts
index cf29d20d4..694361276 100644
--- a/shared/models/server/job.model.ts
+++ b/shared/models/server/job.model.ts
@@ -1,3 +1,7 @@
1import { ContextType } from '@server/helpers/activitypub'
2import { SendEmailOptions } from './emailer.model'
3import { VideoResolution } from '@shared/models'
4
1export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed' 5export type JobState = 'active' | 'completed' | 'failed' | 'waiting' | 'delayed'
2 6
3export type JobType = 7export type JobType =
@@ -23,3 +27,99 @@ export interface Job {
23 finishedOn: Date | string 27 finishedOn: Date | string
24 processedOn: Date | string 28 processedOn: Date | string
25} 29}
30
31export type ActivitypubHttpBroadcastPayload = {
32 uris: string[]
33 signatureActorId?: number
34 body: any
35 contextType?: ContextType
36}
37
38export type ActivitypubFollowPayload = {
39 followerActorId: number
40 name: string
41 host: string
42 isAutoFollow?: boolean
43 assertIsChannel?: boolean
44}
45
46export type FetchType = 'activity' | 'video-likes' | 'video-dislikes' | 'video-shares' | 'video-comments' | 'account-playlists'
47export type ActivitypubHttpFetcherPayload = {
48 uri: string
49 type: FetchType
50 videoId?: number
51 accountId?: number
52}
53
54export type ActivitypubHttpUnicastPayload = {
55 uri: string
56 signatureActorId?: number
57 body: any
58 contextType?: ContextType
59}
60
61export type RefreshPayload = {
62 type: 'video' | 'video-playlist' | 'actor'
63 url: string
64}
65
66export type EmailPayload = SendEmailOptions
67
68export type VideoFileImportPayload = {
69 videoUUID: string
70 filePath: string
71}
72
73export type VideoImportYoutubeDLPayload = {
74 type: 'youtube-dl'
75 videoImportId: number
76
77 generateThumbnail: boolean
78 generatePreview: boolean
79
80 fileExt?: string
81}
82export type VideoImportTorrentPayload = {
83 type: 'magnet-uri' | 'torrent-file'
84 videoImportId: number
85}
86export type VideoImportPayload = VideoImportYoutubeDLPayload | VideoImportTorrentPayload
87
88export type VideoRedundancyPayload = {
89 videoId: number
90}
91
92// Video transcoding payloads
93
94interface BaseTranscodingPayload {
95 videoUUID: string
96 isNewVideo?: boolean
97}
98
99interface HLSTranscodingPayload extends BaseTranscodingPayload {
100 type: 'hls'
101 isPortraitMode?: boolean
102 resolution: VideoResolution
103 copyCodecs: boolean
104}
105
106export interface NewResolutionTranscodingPayload extends BaseTranscodingPayload {
107 type: 'new-resolution'
108 isPortraitMode?: boolean
109 resolution: VideoResolution
110}
111
112export interface MergeAudioTranscodingPayload extends BaseTranscodingPayload {
113 type: 'merge-audio'
114 resolution: VideoResolution
115}
116
117export interface OptimizeTranscodingPayload extends BaseTranscodingPayload {
118 type: 'optimize'
119}
120
121export type VideoTranscodingPayload =
122 HLSTranscodingPayload
123 | NewResolutionTranscodingPayload
124 | OptimizeTranscodingPayload
125 | MergeAudioTranscodingPayload