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