diff options
Diffstat (limited to 'packages/models/src/runners/runner-job-success-body.model.ts')
-rw-r--r-- | packages/models/src/runners/runner-job-success-body.model.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/packages/models/src/runners/runner-job-success-body.model.ts b/packages/models/src/runners/runner-job-success-body.model.ts new file mode 100644 index 000000000..f45336b05 --- /dev/null +++ b/packages/models/src/runners/runner-job-success-body.model.ts | |||
@@ -0,0 +1,46 @@ | |||
1 | export interface RunnerJobSuccessBody { | ||
2 | runnerToken: string | ||
3 | jobToken: string | ||
4 | |||
5 | payload: RunnerJobSuccessPayload | ||
6 | } | ||
7 | |||
8 | // --------------------------------------------------------------------------- | ||
9 | |||
10 | export type RunnerJobSuccessPayload = | ||
11 | VODWebVideoTranscodingSuccess | | ||
12 | VODHLSTranscodingSuccess | | ||
13 | VODAudioMergeTranscodingSuccess | | ||
14 | LiveRTMPHLSTranscodingSuccess | | ||
15 | VideoStudioTranscodingSuccess | ||
16 | |||
17 | export interface VODWebVideoTranscodingSuccess { | ||
18 | videoFile: Blob | string | ||
19 | } | ||
20 | |||
21 | export interface VODHLSTranscodingSuccess { | ||
22 | videoFile: Blob | string | ||
23 | resolutionPlaylistFile: Blob | string | ||
24 | } | ||
25 | |||
26 | export interface VODAudioMergeTranscodingSuccess { | ||
27 | videoFile: Blob | string | ||
28 | } | ||
29 | |||
30 | export interface LiveRTMPHLSTranscodingSuccess { | ||
31 | |||
32 | } | ||
33 | |||
34 | export interface VideoStudioTranscodingSuccess { | ||
35 | videoFile: Blob | string | ||
36 | } | ||
37 | |||
38 | export function isWebVideoOrAudioMergeTranscodingPayloadSuccess ( | ||
39 | payload: RunnerJobSuccessPayload | ||
40 | ): payload is VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess { | ||
41 | return !!(payload as VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess)?.videoFile | ||
42 | } | ||
43 | |||
44 | export function isHLSTranscodingPayloadSuccess (payload: RunnerJobSuccessPayload): payload is VODHLSTranscodingSuccess { | ||
45 | return !!(payload as VODHLSTranscodingSuccess)?.resolutionPlaylistFile | ||
46 | } | ||