aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-11 17:35:32 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-11 17:35:32 +0200
commit127944aacb52721877449a1f202dc0add866ef39 (patch)
tree73ac935c7dfc73dca92d15ed52266e40ba9af57a
parent294f80f21e8a77d25f6fb5f0f26887fb4618ee2e (diff)
downloadPeerTube-127944aacb52721877449a1f202dc0add866ef39.tar.gz
PeerTube-127944aacb52721877449a1f202dc0add866ef39.tar.zst
PeerTube-127944aacb52721877449a1f202dc0add866ef39.zip
Better models define typing
-rw-r--r--server/models/application.ts2
-rw-r--r--server/models/author.ts2
-rw-r--r--server/models/job.ts2
-rw-r--r--server/models/oauth-client.ts4
-rw-r--r--server/models/oauth-token.ts4
-rw-r--r--server/models/pod.ts4
-rw-r--r--server/models/request-to-pod.ts4
-rw-r--r--server/models/request-video-event.ts4
-rw-r--r--server/models/request-video-qadu.ts4
-rw-r--r--server/models/request.ts4
-rw-r--r--server/models/tag.ts4
-rw-r--r--server/models/user-video-rate.ts4
-rw-r--r--server/models/user.ts4
-rw-r--r--server/models/video-abuse.ts4
-rw-r--r--server/models/video-blacklist.ts4
-rw-r--r--server/models/video-tag.ts4
-rw-r--r--server/models/video.ts4
17 files changed, 31 insertions, 31 deletions
diff --git a/server/models/application.ts b/server/models/application.ts
index 14b87777a..55bb40d84 100644
--- a/server/models/application.ts
+++ b/server/models/application.ts
@@ -13,7 +13,7 @@ let Application: Sequelize.Model<ApplicationInstance, ApplicationAttributes>
13let loadMigrationVersion: ApplicationMethods.LoadMigrationVersion 13let loadMigrationVersion: ApplicationMethods.LoadMigrationVersion
14let updateMigrationVersion: ApplicationMethods.UpdateMigrationVersion 14let updateMigrationVersion: ApplicationMethods.UpdateMigrationVersion
15 15
16export default function defineApplication (sequelize: Sequelize.Sequelize, DataTypes) { 16export default function defineApplication (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
17 Application = sequelize.define<ApplicationInstance, ApplicationAttributes>('Application', 17 Application = sequelize.define<ApplicationInstance, ApplicationAttributes>('Application',
18 { 18 {
19 migrationVersion: { 19 migrationVersion: {
diff --git a/server/models/author.ts b/server/models/author.ts
index 3264d3a88..e0fb250f9 100644
--- a/server/models/author.ts
+++ b/server/models/author.ts
@@ -14,7 +14,7 @@ import {
14let Author: Sequelize.Model<AuthorInstance, AuthorAttributes> 14let Author: Sequelize.Model<AuthorInstance, AuthorAttributes>
15let findOrCreateAuthor: AuthorMethods.FindOrCreateAuthor 15let findOrCreateAuthor: AuthorMethods.FindOrCreateAuthor
16 16
17export default function defineAuthor (sequelize: Sequelize.Sequelize, DataTypes) { 17export default function defineAuthor (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
18 Author = sequelize.define<AuthorInstance, AuthorAttributes>('Author', 18 Author = sequelize.define<AuthorInstance, AuthorAttributes>('Author',
19 { 19 {
20 name: { 20 name: {
diff --git a/server/models/job.ts b/server/models/job.ts
index 1afae8f08..d4380a575 100644
--- a/server/models/job.ts
+++ b/server/models/job.ts
@@ -15,7 +15,7 @@ import {
15let Job: Sequelize.Model<JobInstance, JobAttributes> 15let Job: Sequelize.Model<JobInstance, JobAttributes>
16let listWithLimit: JobMethods.ListWithLimit 16let listWithLimit: JobMethods.ListWithLimit
17 17
18export default function defineJob (sequelize: Sequelize.Sequelize, DataTypes) { 18export default function defineJob (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
19 Job = sequelize.define<JobInstance, JobAttributes>('Job', 19 Job = sequelize.define<JobInstance, JobAttributes>('Job',
20 { 20 {
21 state: { 21 state: {
diff --git a/server/models/oauth-client.ts b/server/models/oauth-client.ts
index 22fae2842..a5438f45a 100644
--- a/server/models/oauth-client.ts
+++ b/server/models/oauth-client.ts
@@ -14,8 +14,8 @@ let countTotal: OAuthClientMethods.CountTotal
14let loadFirstClient: OAuthClientMethods.LoadFirstClient 14let loadFirstClient: OAuthClientMethods.LoadFirstClient
15let getByIdAndSecret: OAuthClientMethods.GetByIdAndSecret 15let getByIdAndSecret: OAuthClientMethods.GetByIdAndSecret
16 16
17export default function (sequelize, DataTypes) { 17export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
18 OAuthClient = sequelize.define('OAuthClient', 18 OAuthClient = sequelize.define<OAuthClientInstance, OAuthClientAttributes>('OAuthClient',
19 { 19 {
20 clientId: { 20 clientId: {
21 type: DataTypes.STRING, 21 type: DataTypes.STRING,
diff --git a/server/models/oauth-token.ts b/server/models/oauth-token.ts
index d70bd2bce..91cef11dd 100644
--- a/server/models/oauth-token.ts
+++ b/server/models/oauth-token.ts
@@ -18,8 +18,8 @@ let getByTokenAndPopulateUser: OAuthTokenMethods.GetByTokenAndPopulateUser
18let getByRefreshTokenAndPopulateUser: OAuthTokenMethods.GetByRefreshTokenAndPopulateUser 18let getByRefreshTokenAndPopulateUser: OAuthTokenMethods.GetByRefreshTokenAndPopulateUser
19let removeByUserId: OAuthTokenMethods.RemoveByUserId 19let removeByUserId: OAuthTokenMethods.RemoveByUserId
20 20
21export default function (sequelize, DataTypes) { 21export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
22 OAuthToken = sequelize.define('OAuthToken', 22 OAuthToken = sequelize.define<OAuthTokenInstance, OAuthTokenAttributes>('OAuthToken',
23 { 23 {
24 accessToken: { 24 accessToken: {
25 type: DataTypes.STRING, 25 type: DataTypes.STRING,
diff --git a/server/models/pod.ts b/server/models/pod.ts
index 107744c43..fef9d4da6 100644
--- a/server/models/pod.ts
+++ b/server/models/pod.ts
@@ -27,8 +27,8 @@ let loadByHost: PodMethods.LoadByHost
27let removeAll: PodMethods.RemoveAll 27let removeAll: PodMethods.RemoveAll
28let updatePodsScore: PodMethods.UpdatePodsScore 28let updatePodsScore: PodMethods.UpdatePodsScore
29 29
30export default function (sequelize, DataTypes) { 30export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
31 Pod = sequelize.define('Pod', 31 Pod = sequelize.define<PodInstance, PodAttributes>('Pod',
32 { 32 {
33 host: { 33 host: {
34 type: DataTypes.STRING, 34 type: DataTypes.STRING,
diff --git a/server/models/request-to-pod.ts b/server/models/request-to-pod.ts
index 3562069cc..d2f31463c 100644
--- a/server/models/request-to-pod.ts
+++ b/server/models/request-to-pod.ts
@@ -12,8 +12,8 @@ import {
12let RequestToPod: Sequelize.Model<RequestToPodInstance, RequestToPodAttributes> 12let RequestToPod: Sequelize.Model<RequestToPodInstance, RequestToPodAttributes>
13let removeByRequestIdsAndPod: RequestToPodMethods.RemoveByRequestIdsAndPod 13let removeByRequestIdsAndPod: RequestToPodMethods.RemoveByRequestIdsAndPod
14 14
15export default function (sequelize, DataTypes) { 15export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
16 RequestToPod = sequelize.define('RequestToPod', {}, { 16 RequestToPod = sequelize.define<RequestToPodInstance, RequestToPodAttributes>('RequestToPod', {}, {
17 indexes: [ 17 indexes: [
18 { 18 {
19 fields: [ 'requestId' ] 19 fields: [ 'requestId' ]
diff --git a/server/models/request-video-event.ts b/server/models/request-video-event.ts
index e422649af..32438b581 100644
--- a/server/models/request-video-event.ts
+++ b/server/models/request-video-event.ts
@@ -24,8 +24,8 @@ let listWithLimitAndRandom: RequestVideoEventMethods.ListWithLimitAndRandom
24let removeByRequestIdsAndPod: RequestVideoEventMethods.RemoveByRequestIdsAndPod 24let removeByRequestIdsAndPod: RequestVideoEventMethods.RemoveByRequestIdsAndPod
25let removeAll: RequestVideoEventMethods.RemoveAll 25let removeAll: RequestVideoEventMethods.RemoveAll
26 26
27export default function (sequelize, DataTypes) { 27export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
28 RequestVideoEvent = sequelize.define('RequestVideoEvent', 28 RequestVideoEvent = sequelize.define<RequestVideoEventInstance, RequestVideoEventAttributes>('RequestVideoEvent',
29 { 29 {
30 type: { 30 type: {
31 type: DataTypes.ENUM(values(REQUEST_VIDEO_EVENT_TYPES)), 31 type: DataTypes.ENUM(values(REQUEST_VIDEO_EVENT_TYPES)),
diff --git a/server/models/request-video-qadu.ts b/server/models/request-video-qadu.ts
index 38627ad55..27ce0ff29 100644
--- a/server/models/request-video-qadu.ts
+++ b/server/models/request-video-qadu.ts
@@ -29,8 +29,8 @@ let listWithLimitAndRandom: RequestVideoQaduMethods.ListWithLimitAndRandom
29let removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod 29let removeByRequestIdsAndPod: RequestVideoQaduMethods.RemoveByRequestIdsAndPod
30let removeAll: RequestVideoQaduMethods.RemoveAll 30let removeAll: RequestVideoQaduMethods.RemoveAll
31 31
32export default function (sequelize, DataTypes) { 32export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
33 RequestVideoQadu = sequelize.define('RequestVideoQadu', 33 RequestVideoQadu = sequelize.define<RequestVideoQaduInstance, RequestVideoQaduAttributes>('RequestVideoQadu',
34 { 34 {
35 type: { 35 type: {
36 type: DataTypes.ENUM(values(REQUEST_VIDEO_QADU_TYPES)), 36 type: DataTypes.ENUM(values(REQUEST_VIDEO_QADU_TYPES)),
diff --git a/server/models/request.ts b/server/models/request.ts
index 71f81ae66..e6c367f28 100644
--- a/server/models/request.ts
+++ b/server/models/request.ts
@@ -19,8 +19,8 @@ let listWithLimitAndRandom: RequestMethods.ListWithLimitAndRandom
19let removeWithEmptyTo: RequestMethods.RemoveWithEmptyTo 19let removeWithEmptyTo: RequestMethods.RemoveWithEmptyTo
20let removeAll: RequestMethods.RemoveAll 20let removeAll: RequestMethods.RemoveAll
21 21
22export default function (sequelize, DataTypes) { 22export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
23 Request = sequelize.define('Request', 23 Request = sequelize.define<RequestInstance, RequestAttributes>('Request',
24 { 24 {
25 request: { 25 request: {
26 type: DataTypes.JSON, 26 type: DataTypes.JSON,
diff --git a/server/models/tag.ts b/server/models/tag.ts
index c4402e83c..54a5f79e5 100644
--- a/server/models/tag.ts
+++ b/server/models/tag.ts
@@ -13,8 +13,8 @@ import {
13let Tag: Sequelize.Model<TagInstance, TagAttributes> 13let Tag: Sequelize.Model<TagInstance, TagAttributes>
14let findOrCreateTags: TagMethods.FindOrCreateTags 14let findOrCreateTags: TagMethods.FindOrCreateTags
15 15
16export default function (sequelize, DataTypes) { 16export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
17 Tag = sequelize.define('Tag', 17 Tag = sequelize.define<TagInstance, TagAttributes>('Tag',
18 { 18 {
19 name: { 19 name: {
20 type: DataTypes.STRING, 20 type: DataTypes.STRING,
diff --git a/server/models/user-video-rate.ts b/server/models/user-video-rate.ts
index 6b71e8412..0326e1796 100644
--- a/server/models/user-video-rate.ts
+++ b/server/models/user-video-rate.ts
@@ -19,8 +19,8 @@ import {
19let UserVideoRate: Sequelize.Model<UserVideoRateInstance, UserVideoRateAttributes> 19let UserVideoRate: Sequelize.Model<UserVideoRateInstance, UserVideoRateAttributes>
20let load: UserVideoRateMethods.Load 20let load: UserVideoRateMethods.Load
21 21
22export default function (sequelize, DataTypes) { 22export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
23 UserVideoRate = sequelize.define('UserVideoRate', 23 UserVideoRate = sequelize.define<UserVideoRateInstance, UserVideoRateAttributes>('UserVideoRate',
24 { 24 {
25 type: { 25 type: {
26 type: DataTypes.ENUM(values(VIDEO_RATE_TYPES)), 26 type: DataTypes.ENUM(values(VIDEO_RATE_TYPES)),
diff --git a/server/models/user.ts b/server/models/user.ts
index cd383a16a..1a56a6dc3 100644
--- a/server/models/user.ts
+++ b/server/models/user.ts
@@ -32,8 +32,8 @@ let loadById: UserMethods.LoadById
32let loadByUsername: UserMethods.LoadByUsername 32let loadByUsername: UserMethods.LoadByUsername
33let loadByUsernameOrEmail: UserMethods.LoadByUsernameOrEmail 33let loadByUsernameOrEmail: UserMethods.LoadByUsernameOrEmail
34 34
35export default function (sequelize, DataTypes) { 35export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
36 User = sequelize.define('User', 36 User = sequelize.define<UserInstance, UserAttributes>('User',
37 { 37 {
38 password: { 38 password: {
39 type: DataTypes.STRING, 39 type: DataTypes.STRING,
diff --git a/server/models/video-abuse.ts b/server/models/video-abuse.ts
index 92168439c..5602ef968 100644
--- a/server/models/video-abuse.ts
+++ b/server/models/video-abuse.ts
@@ -15,8 +15,8 @@ import {
15let VideoAbuse: Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes> 15let VideoAbuse: Sequelize.Model<VideoAbuseInstance, VideoAbuseAttributes>
16let listForApi: VideoAbuseMethods.ListForApi 16let listForApi: VideoAbuseMethods.ListForApi
17 17
18export default function (sequelize, DataTypes) { 18export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
19 VideoAbuse = sequelize.define('VideoAbuse', 19 VideoAbuse = sequelize.define<VideoAbuseInstance, VideoAbuseAttributes>('VideoAbuse',
20 { 20 {
21 reporterUsername: { 21 reporterUsername: {
22 type: DataTypes.STRING, 22 type: DataTypes.STRING,
diff --git a/server/models/video-blacklist.ts b/server/models/video-blacklist.ts
index f36756085..040ed03d7 100644
--- a/server/models/video-blacklist.ts
+++ b/server/models/video-blacklist.ts
@@ -17,8 +17,8 @@ let listForApi: BlacklistedVideoMethods.ListForApi
17let loadById: BlacklistedVideoMethods.LoadById 17let loadById: BlacklistedVideoMethods.LoadById
18let loadByVideoId: BlacklistedVideoMethods.LoadByVideoId 18let loadByVideoId: BlacklistedVideoMethods.LoadByVideoId
19 19
20export default function (sequelize, DataTypes) { 20export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
21 BlacklistedVideo = sequelize.define('BlacklistedVideo', 21 BlacklistedVideo = sequelize.define<BlacklistedVideoInstance, BlacklistedVideoAttributes>('BlacklistedVideo',
22 {}, 22 {},
23 { 23 {
24 indexes: [ 24 indexes: [
diff --git a/server/models/video-tag.ts b/server/models/video-tag.ts
index 2ccaf820d..514eede25 100644
--- a/server/models/video-tag.ts
+++ b/server/models/video-tag.ts
@@ -11,8 +11,8 @@ import {
11 11
12let VideoTag: Sequelize.Model<VideoTagInstance, VideoTagAttributes> 12let VideoTag: Sequelize.Model<VideoTagInstance, VideoTagAttributes>
13 13
14export default function (sequelize, DataTypes) { 14export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
15 VideoTag = sequelize.define('VideoTag', {}, { 15 VideoTag = sequelize.define<VideoTagInstance, VideoTagAttributes>('VideoTag', {}, {
16 indexes: [ 16 indexes: [
17 { 17 {
18 fields: [ 'videoId' ] 18 fields: [ 'videoId' ]
diff --git a/server/models/video.ts b/server/models/video.ts
index 2234664f4..78119f516 100644
--- a/server/models/video.ts
+++ b/server/models/video.ts
@@ -68,8 +68,8 @@ let loadAndPopulateAuthor: VideoMethods.LoadAndPopulateAuthor
68let loadAndPopulateAuthorAndPodAndTags: VideoMethods.LoadAndPopulateAuthorAndPodAndTags 68let loadAndPopulateAuthorAndPodAndTags: VideoMethods.LoadAndPopulateAuthorAndPodAndTags
69let searchAndPopulateAuthorAndPodAndTags: VideoMethods.SearchAndPopulateAuthorAndPodAndTags 69let searchAndPopulateAuthorAndPodAndTags: VideoMethods.SearchAndPopulateAuthorAndPodAndTags
70 70
71export default function (sequelize, DataTypes) { 71export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
72 Video = sequelize.define('Video', 72 Video = sequelize.define<VideoInstance, VideoAttributes>('Video',
73 { 73 {
74 id: { 74 id: {
75 type: DataTypes.UUID, 75 type: DataTypes.UUID,