From 154898b0b7bc1af41fc5a94974e338a3590c90f3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 17 Jun 2017 11:28:11 +0200 Subject: Share models between server and client --- shared/models/client-local.model.ts | 4 ++++ shared/models/index.ts | 2 ++ shared/models/server-config.model.ts | 5 +++++ shared/models/user-video-rate.model.ts | 6 ++++++ shared/models/video-abuse.model.ts | 2 +- 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 shared/models/client-local.model.ts create mode 100644 shared/models/server-config.model.ts (limited to 'shared') diff --git a/shared/models/client-local.model.ts b/shared/models/client-local.model.ts new file mode 100644 index 000000000..c27963e88 --- /dev/null +++ b/shared/models/client-local.model.ts @@ -0,0 +1,4 @@ +export interface ClientLocal { + client_id: string + client_secret: string +} diff --git a/shared/models/index.ts b/shared/models/index.ts index 1ddc8545f..fffac795e 100644 --- a/shared/models/index.ts +++ b/shared/models/index.ts @@ -1,3 +1,4 @@ +export * from './client-local.model' export * from './job.model' export * from './pod.model' export * from './request-scheduler.model' @@ -6,3 +7,4 @@ export * from './user.model' export * from './video-abuse.model' export * from './video-blacklist.model' export * from './video.model' +export * from './server-config.model' diff --git a/shared/models/server-config.model.ts b/shared/models/server-config.model.ts new file mode 100644 index 000000000..a39156963 --- /dev/null +++ b/shared/models/server-config.model.ts @@ -0,0 +1,5 @@ +export interface ServerConfig { + signup: { + enabled: boolean + } +} diff --git a/shared/models/user-video-rate.model.ts b/shared/models/user-video-rate.model.ts index d48774a4b..b770f4073 100644 --- a/shared/models/user-video-rate.model.ts +++ b/shared/models/user-video-rate.model.ts @@ -1 +1,7 @@ export type VideoRateType = 'like' | 'dislike' +export type UserVideoRateType = 'like' | 'dislike' | 'none' + +export interface UserVideoRate { + videoId: string + rating: UserVideoRateType +} diff --git a/shared/models/video-abuse.model.ts b/shared/models/video-abuse.model.ts index e005a1fd5..72e32cbc7 100644 --- a/shared/models/video-abuse.model.ts +++ b/shared/models/video-abuse.model.ts @@ -3,6 +3,6 @@ export interface VideoAbuse { reporterPodHost: string reason: string reporterUsername: string - videoId: number + videoId: string createdAt: Date } -- cgit v1.2.3