aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-16 10:36:18 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-16 10:36:18 +0200
commitee9e7b61f59a427208386738057c8eff48fba599 (patch)
tree9097de886128e15f21f0b5920a2076d16a087467 /shared/models
parent70c065d64c330196d371941d9294a55da6e3aa37 (diff)
downloadPeerTube-ee9e7b61f59a427208386738057c8eff48fba599.tar.gz
PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.tar.zst
PeerTube-ee9e7b61f59a427208386738057c8eff48fba599.zip
Create types for model enums
Diffstat (limited to 'shared/models')
-rw-r--r--shared/models/index.ts3
-rw-r--r--shared/models/job.model.ts1
-rw-r--r--shared/models/request-scheduler.model.ts19
-rw-r--r--shared/models/user-video-rate.model.ts1
-rw-r--r--shared/models/user.model.ts4
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 @@
1export * from './job.model'
1export * from './pod.model' 2export * from './pod.model'
3export * from './request-scheduler.model'
4export * from './user-video-rate.model'
2export * from './user.model' 5export * from './user.model'
3export * from './video-abuse.model' 6export * from './video-abuse.model'
4export * from './video-blacklist.model' 7export * 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 @@
1export type RequestEndpoint = 'videos'
2
3export type RequestVideoQaduType = 'likes' | 'dislikes' | 'views'
4
5export type RequestVideoEventType = 'likes' | 'dislikes' | 'views'
6
7export type RequestSchedulerAttributes = {
8 totalRequests: number
9 requestsLimitPods: number
10 requestsLimitPerPod: number
11 remainingMilliSeconds: number
12 milliSecondsInterval: number
13}
14
15export 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 @@
1export type UserRole = 'admin' | 'user'
2
1export interface User { 3export 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}