diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-12 17:53:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-13 16:50:33 +0100 |
commit | 3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch) | |
tree | e5ca358287fca6ecacce83defcf23af1e8e9f419 /server/models/job/job-interface.ts | |
parent | c893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff) | |
download | PeerTube-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.ts | 33 |
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 @@ | |||
1 | import * as Bluebird from 'bluebird' | ||
2 | import * as Sequelize from 'sequelize' | ||
3 | import { Job as FormattedJob, JobCategory, JobState } from '../../../shared/models/job.model' | ||
4 | import { ResultList } from '../../../shared/models/result-list.model' | ||
5 | |||
6 | export 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 | |||
13 | export interface JobClass { | ||
14 | listWithLimitByCategory: JobMethods.ListWithLimitByCategory | ||
15 | listForApi: JobMethods.ListForApi, | ||
16 | } | ||
17 | |||
18 | export interface JobAttributes { | ||
19 | state: JobState | ||
20 | category: JobCategory | ||
21 | handlerName: string | ||
22 | handlerInputData: any | ||
23 | } | ||
24 | |||
25 | export interface JobInstance extends JobClass, JobAttributes, Sequelize.Instance<JobAttributes> { | ||
26 | id: number | ||
27 | createdAt: Date | ||
28 | updatedAt: Date | ||
29 | |||
30 | toFormattedJSON: JobMethods.ToFormattedJSON | ||
31 | } | ||
32 | |||
33 | export interface JobModel extends JobClass, Sequelize.Model<JobInstance, JobAttributes> {} | ||