aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/models/src/runners/runner-job.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/models/src/runners/runner-job.model.ts')
-rw-r--r--packages/models/src/runners/runner-job.model.ts45
1 files changed, 45 insertions, 0 deletions
diff --git a/packages/models/src/runners/runner-job.model.ts b/packages/models/src/runners/runner-job.model.ts
new file mode 100644
index 000000000..6d6427396
--- /dev/null
+++ b/packages/models/src/runners/runner-job.model.ts
@@ -0,0 +1,45 @@
1import { VideoConstant } from '../videos/index.js'
2import { RunnerJobPayload } from './runner-job-payload.model.js'
3import { RunnerJobPrivatePayload } from './runner-job-private-payload.model.js'
4import { RunnerJobStateType } from './runner-job-state.model.js'
5import { RunnerJobType } from './runner-job-type.type.js'
6
7export interface RunnerJob <T extends RunnerJobPayload = RunnerJobPayload> {
8 uuid: string
9
10 type: RunnerJobType
11
12 state: VideoConstant<RunnerJobStateType>
13
14 payload: T
15
16 failures: number
17 error: string | null
18
19 progress: number
20 priority: number
21
22 startedAt: Date | string
23 createdAt: Date | string
24 updatedAt: Date | string
25 finishedAt: Date | string
26
27 parent?: {
28 type: RunnerJobType
29 state: VideoConstant<RunnerJobStateType>
30 uuid: string
31 }
32
33 // If associated to a runner
34 runner?: {
35 id: number
36 name: string
37
38 description: string
39 }
40}
41
42// eslint-disable-next-line max-len
43export interface RunnerJobAdmin <T extends RunnerJobPayload = RunnerJobPayload, U extends RunnerJobPrivatePayload = RunnerJobPrivatePayload> extends RunnerJob<T> {
44 privatePayload: U
45}