diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 10:36:18 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 10:36:18 +0200 |
commit | ee9e7b61f59a427208386738057c8eff48fba599 (patch) | |
tree | 9097de886128e15f21f0b5920a2076d16a087467 /shared | |
parent | 70c065d64c330196d371941d9294a55da6e3aa37 (diff) | |
download | PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.tar.gz PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.tar.zst PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.zip |
Create types for model enums
Diffstat (limited to 'shared')
-rw-r--r-- | shared/models/index.ts | 3 | ||||
-rw-r--r-- | shared/models/job.model.ts | 1 | ||||
-rw-r--r-- | shared/models/request-scheduler.model.ts | 19 | ||||
-rw-r--r-- | shared/models/user-video-rate.model.ts | 1 | ||||
-rw-r--r-- | shared/models/user.model.ts | 4 |
5 files changed, 27 insertions, 1 deletions
diff --git a/shared/models/index.ts b/shared/models/index.ts index b498d620a..1ddc8545f 100644 --- a/shared/models/index.ts +++ b/shared/models/index.ts | |||
@@ -1,4 +1,7 @@ | |||
1 | export * from './job.model' | ||
1 | export * from './pod.model' | 2 | export * from './pod.model' |
3 | export * from './request-scheduler.model' | ||
4 | export * from './user-video-rate.model' | ||
2 | export * from './user.model' | 5 | export * from './user.model' |
3 | export * from './video-abuse.model' | 6 | export * from './video-abuse.model' |
4 | export * from './video-blacklist.model' | 7 | export * from './video-blacklist.model' |
diff --git a/shared/models/job.model.ts b/shared/models/job.model.ts new file mode 100644 index 000000000..411c91482 --- /dev/null +++ b/shared/models/job.model.ts | |||
@@ -0,0 +1 @@ | |||
export type JobState = 'pending' | 'processing' | 'error' | 'success' | |||
diff --git a/shared/models/request-scheduler.model.ts b/shared/models/request-scheduler.model.ts new file mode 100644 index 000000000..f94ccfcab --- /dev/null +++ b/shared/models/request-scheduler.model.ts | |||
@@ -0,0 +1,19 @@ | |||
1 | export type RequestEndpoint = 'videos' | ||
2 | |||
3 | export type RequestVideoQaduType = 'likes' | 'dislikes' | 'views' | ||
4 | |||
5 | export type RequestVideoEventType = 'likes' | 'dislikes' | 'views' | ||
6 | |||
7 | export type RequestSchedulerAttributes = { | ||
8 | totalRequests: number | ||
9 | requestsLimitPods: number | ||
10 | requestsLimitPerPod: number | ||
11 | remainingMilliSeconds: number | ||
12 | milliSecondsInterval: number | ||
13 | } | ||
14 | |||
15 | export interface RequestScheduler { | ||
16 | requestScheduler: RequestSchedulerAttributes | ||
17 | requestVideoQaduScheduler: RequestSchedulerAttributes | ||
18 | requestVideoEventScheduler: RequestSchedulerAttributes | ||
19 | } | ||
diff --git a/shared/models/user-video-rate.model.ts b/shared/models/user-video-rate.model.ts new file mode 100644 index 000000000..d48774a4b --- /dev/null +++ b/shared/models/user-video-rate.model.ts | |||
@@ -0,0 +1 @@ | |||
export type VideoRateType = 'like' | 'dislike' | |||
diff --git a/shared/models/user.model.ts b/shared/models/user.model.ts index a6be359d3..92dc73ec2 100644 --- a/shared/models/user.model.ts +++ b/shared/models/user.model.ts | |||
@@ -1,8 +1,10 @@ | |||
1 | export type UserRole = 'admin' | 'user' | ||
2 | |||
1 | export interface User { | 3 | export interface User { |
2 | id: number | 4 | id: number |
3 | username: string | 5 | username: string |
4 | email: string | 6 | email: string |
5 | displayNSFW: boolean | 7 | displayNSFW: boolean |
6 | role: string | 8 | role: UserRole |
7 | createdAt: Date | 9 | createdAt: Date |
8 | } | 10 | } |