aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/job/job-interface.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-12 17:53:50 +0100
committerChocobozzz <me@florianbigard.com>2017-12-13 16:50:33 +0100
commit3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch)
treee5ca358287fca6ecacce83defcf23af1e8e9f419 /server/models/job/job-interface.ts
parentc893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff)
downloadPeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.gz
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.zst
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.zip
Move models to typescript-sequelize
Diffstat (limited to 'server/models/job/job-interface.ts')
-rw-r--r--server/models/job/job-interface.ts33
1 files changed, 0 insertions, 33 deletions
diff --git a/server/models/job/job-interface.ts b/server/models/job/job-interface.ts
deleted file mode 100644
index 3cfc0fbed..000000000
--- a/server/models/job/job-interface.ts
+++ /dev/null
@@ -1,33 +0,0 @@
1import * as Bluebird from 'bluebird'
2import * as Sequelize from 'sequelize'
3import { Job as FormattedJob, JobCategory, JobState } from '../../../shared/models/job.model'
4import { ResultList } from '../../../shared/models/result-list.model'
5
6export namespace JobMethods {
7 export type ListWithLimitByCategory = (limit: number, state: JobState, category: JobCategory) => Bluebird<JobInstance[]>
8 export type ListForApi = (start: number, count: number, sort: string) => Bluebird< ResultList<JobInstance> >
9
10 export type ToFormattedJSON = (this: JobInstance) => FormattedJob
11}
12
13export interface JobClass {
14 listWithLimitByCategory: JobMethods.ListWithLimitByCategory
15 listForApi: JobMethods.ListForApi,
16}
17
18export interface JobAttributes {
19 state: JobState
20 category: JobCategory
21 handlerName: string
22 handlerInputData: any
23}
24
25export interface JobInstance extends JobClass, JobAttributes, Sequelize.Instance<JobAttributes> {
26 id: number
27 createdAt: Date
28 updatedAt: Date
29
30 toFormattedJSON: JobMethods.ToFormattedJSON
31}
32
33export interface JobModel extends JobClass, Sequelize.Model<JobInstance, JobAttributes> {}