aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--package.json2
-rw-r--r--server.ts13
-rw-r--r--server/controllers/api/clients.ts2
-rw-r--r--server/controllers/api/config.ts2
-rw-r--r--server/controllers/api/index.ts2
-rw-r--r--server/controllers/api/pods.ts2
-rw-r--r--server/controllers/api/remote/index.ts2
-rw-r--r--server/controllers/api/remote/pods.ts2
-rw-r--r--server/controllers/api/remote/videos.ts2
-rw-r--r--server/controllers/api/requests.ts2
-rw-r--r--server/controllers/api/users.ts2
-rw-r--r--server/controllers/api/videos/abuse.ts4
-rw-r--r--server/controllers/api/videos/blacklist.ts2
-rw-r--r--server/controllers/api/videos/index.ts8
-rw-r--r--server/controllers/api/videos/rate.ts2
-rw-r--r--server/controllers/client.ts8
-rw-r--r--server/controllers/static.ts4
-rw-r--r--server/helpers/custom-validators/pods.ts4
-rw-r--r--server/helpers/custom-validators/users.ts4
-rw-r--r--server/helpers/custom-validators/videos.ts4
-rw-r--r--server/helpers/database-utils.ts2
-rw-r--r--server/helpers/logger.ts6
-rw-r--r--server/helpers/peertube-crypto.ts8
-rw-r--r--server/helpers/requests.ts4
-rw-r--r--server/initializers/checker.ts2
-rw-r--r--server/initializers/constants.ts2
-rw-r--r--server/initializers/database.ts4
-rw-r--r--server/initializers/installer.ts6
-rw-r--r--server/initializers/migrator.ts4
-rw-r--r--server/lib/friends.ts2
-rw-r--r--server/middlewares/oauth.ts2
-rw-r--r--server/models/video.ts12
-rw-r--r--yarn.lock6
33 files changed, 66 insertions, 67 deletions
diff --git a/package.json b/package.json
index 118a0aef6..e7d0c39a4 100644
--- a/package.json
+++ b/package.json
@@ -71,6 +71,7 @@
71 "scripty": "^1.5.0", 71 "scripty": "^1.5.0",
72 "sequelize": "4.0.0-2", 72 "sequelize": "4.0.0-2",
73 "typescript": "~2.2.0", 73 "typescript": "~2.2.0",
74 "validator": "^7.0.0",
74 "winston": "^2.1.1", 75 "winston": "^2.1.1",
75 "ws": "^2.0.0" 76 "ws": "^2.0.0"
76 }, 77 },
@@ -86,6 +87,7 @@
86 "@types/node": "^7.0.18", 87 "@types/node": "^7.0.18",
87 "@types/request": "^0.0.43", 88 "@types/request": "^0.0.43",
88 "@types/sequelize": "^4.0.55", 89 "@types/sequelize": "^4.0.55",
90 "@types/validator": "^6.2.0",
89 "@types/winston": "^2.3.2", 91 "@types/winston": "^2.3.2",
90 "@types/ws": "^0.0.41", 92 "@types/ws": "^0.0.41",
91 "chai": "^3.3.0", 93 "chai": "^3.3.0",
diff --git a/server.ts b/server.ts
index f5413b8e3..b27a83860 100644
--- a/server.ts
+++ b/server.ts
@@ -3,13 +3,14 @@ if ([ 'dev', 'test'].indexOf(process.env.NODE_ENV) !== -1) {
3} 3}
4 4
5// ----------- Node modules ----------- 5// ----------- Node modules -----------
6import bodyParser = require('body-parser') 6import * as bodyParser from 'body-parser'
7import express = require('express') 7import * as express from 'express'
8// FIXME: cannot import express-validator
8const expressValidator = require('express-validator') 9const expressValidator = require('express-validator')
9import http = require('http') 10import * as http from 'http'
10import morgan = require('morgan') 11import * as morgan from 'morgan'
11import path = require('path') 12import * as path from 'path'
12import bittorrentTracker = require('bittorrent-tracker') 13import * as bittorrentTracker from 'bittorrent-tracker'
13import { Server as WebSocketServer } from 'ws' 14import { Server as WebSocketServer } from 'ws'
14 15
15const TrackerServer = bittorrentTracker.Server 16const TrackerServer = bittorrentTracker.Server
diff --git a/server/controllers/api/clients.ts b/server/controllers/api/clients.ts
index 614163c83..f6499556a 100644
--- a/server/controllers/api/clients.ts
+++ b/server/controllers/api/clients.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2 2
3import { CONFIG } from '../../initializers'; 3import { CONFIG } from '../../initializers';
4import { logger } from '../../helpers' 4import { logger } from '../../helpers'
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index 8bdde61b3..57c9398ec 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2 2
3import { CONFIG } from '../../initializers' 3import { CONFIG } from '../../initializers'
4 4
diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts
index 18bef2d3d..98004544d 100644
--- a/server/controllers/api/index.ts
+++ b/server/controllers/api/index.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2 2
3import { badRequest } from '../../helpers' 3import { badRequest } from '../../helpers'
4 4
diff --git a/server/controllers/api/pods.ts b/server/controllers/api/pods.ts
index 4ff1f5d9f..a028c4ab9 100644
--- a/server/controllers/api/pods.ts
+++ b/server/controllers/api/pods.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2import { waterfall } from 'async' 2import { waterfall } from 'async'
3 3
4import { database as db } from '../../initializers/database' 4import { database as db } from '../../initializers/database'
diff --git a/server/controllers/api/remote/index.ts b/server/controllers/api/remote/index.ts
index b11439204..d3522772b 100644
--- a/server/controllers/api/remote/index.ts
+++ b/server/controllers/api/remote/index.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2 2
3import { badRequest } from '../../../helpers' 3import { badRequest } from '../../../helpers'
4 4
diff --git a/server/controllers/api/remote/pods.ts b/server/controllers/api/remote/pods.ts
index 7a9a0c4f0..9c9d2164d 100644
--- a/server/controllers/api/remote/pods.ts
+++ b/server/controllers/api/remote/pods.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2import * as waterfall from 'async/waterfall' 2import * as waterfall from 'async/waterfall'
3 3
4import { database as db } from '../../../initializers/database' 4import { database as db } from '../../../initializers/database'
diff --git a/server/controllers/api/remote/videos.ts b/server/controllers/api/remote/videos.ts
index 178a21e7c..d97a3db31 100644
--- a/server/controllers/api/remote/videos.ts
+++ b/server/controllers/api/remote/videos.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2import { eachSeries, waterfall } from 'async' 2import { eachSeries, waterfall } from 'async'
3 3
4import { database as db } from '../../../initializers/database' 4import { database as db } from '../../../initializers/database'
diff --git a/server/controllers/api/requests.ts b/server/controllers/api/requests.ts
index 304499a4f..ff4b4ac1a 100644
--- a/server/controllers/api/requests.ts
+++ b/server/controllers/api/requests.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2import { parallel } from 'async' 2import { parallel } from 'async'
3 3
4import { 4import {
diff --git a/server/controllers/api/users.ts b/server/controllers/api/users.ts
index 97a744f54..44c5ec13c 100644
--- a/server/controllers/api/users.ts
+++ b/server/controllers/api/users.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2import { waterfall } from 'async' 2import { waterfall } from 'async'
3 3
4import { database as db } from '../../initializers/database' 4import { database as db } from '../../initializers/database'
diff --git a/server/controllers/api/videos/abuse.ts b/server/controllers/api/videos/abuse.ts
index 3dd884354..68db025b7 100644
--- a/server/controllers/api/videos/abuse.ts
+++ b/server/controllers/api/videos/abuse.ts
@@ -1,8 +1,8 @@
1import express = require('express') 1import * as express from 'express'
2import { waterfall } from 'async' 2import { waterfall } from 'async'
3 3
4import { database as db } from '../../../initializers/database' 4import { database as db } from '../../../initializers/database'
5import friends = require('../../../lib/friends') 5import * as friends from '../../../lib/friends'
6import { 6import {
7 logger, 7 logger,
8 getFormatedObjects, 8 getFormatedObjects,
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts
index fb4d57d7b..58960798b 100644
--- a/server/controllers/api/videos/blacklist.ts
+++ b/server/controllers/api/videos/blacklist.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2 2
3import { database as db } from '../../../initializers/database' 3import { database as db } from '../../../initializers/database'
4import { logger } from '../../../helpers' 4import { logger } from '../../../helpers'
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 6eda7159b..b82b0936f 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -1,7 +1,7 @@
1import express = require('express') 1import * as express from 'express'
2import fs = require('fs') 2import * as fs from 'fs'
3import multer = require('multer') 3import * as multer from 'multer'
4import path = require('path') 4import * as path from 'path'
5import { waterfall } from 'async' 5import { waterfall } from 'async'
6 6
7import { database as db } from '../../../initializers/database' 7import { database as db } from '../../../initializers/database'
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts
index 571ff68e3..1bc575675 100644
--- a/server/controllers/api/videos/rate.ts
+++ b/server/controllers/api/videos/rate.ts
@@ -1,4 +1,4 @@
1import express = require('express') 1import * as express from 'express'
2import { waterfall } from 'async' 2import { waterfall } from 'async'
3 3
4import { database as db } from '../../../initializers/database' 4import { database as db } from '../../../initializers/database'
diff --git a/server/controllers/client.ts b/server/controllers/client.ts
index ce5608c9b..c3d28245c 100644
--- a/server/controllers/client.ts
+++ b/server/controllers/client.ts
@@ -1,10 +1,8 @@
1import { parallel } from 'async' 1import { parallel } from 'async'
2import express = require('express') 2import * as express from 'express'
3import fs = require('fs') 3import * as fs from 'fs'
4import { join } from 'path' 4import { join } from 'path'
5import expressValidator = require('express-validator') 5import * as validator from 'validator'
6// TODO: use .validator when express-validator typing will have validator field
7const validator = expressValidator['validator']
8 6
9import { database as db } from '../initializers/database' 7import { database as db } from '../initializers/database'
10import { 8import {
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index 51f75c57e..e65282339 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -1,5 +1,5 @@
1import express = require('express') 1import * as express from 'express'
2import cors = require('cors') 2import * as cors from 'cors'
3 3
4import { 4import {
5 CONFIG, 5 CONFIG,
diff --git a/server/helpers/custom-validators/pods.ts b/server/helpers/custom-validators/pods.ts
index e4c827feb..ee939ad04 100644
--- a/server/helpers/custom-validators/pods.ts
+++ b/server/helpers/custom-validators/pods.ts
@@ -1,6 +1,4 @@
1import expressValidator = require('express-validator') 1import * as validator from 'validator'
2// TODO: use .validator when express-validator typing will have validator field
3const validator = expressValidator['validator']
4 2
5import { isArray } from './misc' 3import { isArray } from './misc'
6 4
diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts
index 8fd2dac4f..f303ab8db 100644
--- a/server/helpers/custom-validators/users.ts
+++ b/server/helpers/custom-validators/users.ts
@@ -1,7 +1,5 @@
1import { values } from 'lodash' 1import { values } from 'lodash'
2import expressValidator = require('express-validator') 2import * as validator from 'validator'
3// TODO: use .validator when express-validator typing will have validator field
4const validator = expressValidator['validator']
5 3
6import { CONSTRAINTS_FIELDS, USER_ROLES } from '../../initializers' 4import { CONSTRAINTS_FIELDS, USER_ROLES } from '../../initializers'
7const USERS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.USERS 5const USERS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.USERS
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts
index 2b2370be4..6389998e1 100644
--- a/server/helpers/custom-validators/videos.ts
+++ b/server/helpers/custom-validators/videos.ts
@@ -1,7 +1,5 @@
1import { values } from 'lodash' 1import { values } from 'lodash'
2import expressValidator = require('express-validator') 2import * as validator from 'validator'
3// TODO: use .validator when express-validator typing will have validator field
4const validator = expressValidator['validator']
5 3
6import { 4import {
7 CONSTRAINTS_FIELDS, 5 CONSTRAINTS_FIELDS,
diff --git a/server/helpers/database-utils.ts b/server/helpers/database-utils.ts
index 7d6ce4ec8..4f49c5825 100644
--- a/server/helpers/database-utils.ts
+++ b/server/helpers/database-utils.ts
@@ -1,5 +1,5 @@
1// TODO: import from ES6 when retry typing file will include errorFilter function 1// TODO: import from ES6 when retry typing file will include errorFilter function
2import retry = require('async/retry') 2import * as retry from 'async/retry'
3 3
4import { database as db } from '../initializers/database' 4import { database as db } from '../initializers/database'
5import { logger } from './logger' 5import { logger } from './logger'
diff --git a/server/helpers/logger.ts b/server/helpers/logger.ts
index 7c99db55f..d8f2f687c 100644
--- a/server/helpers/logger.ts
+++ b/server/helpers/logger.ts
@@ -1,7 +1,7 @@
1// Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/ 1// Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/
2import mkdirp = require('mkdirp') 2import * as mkdirp from 'mkdirp'
3import path = require('path') 3import * as path from 'path'
4import winston = require('winston') 4import * as winston from 'winston'
5 5
6// Do not use barrel (dependencies issues) 6// Do not use barrel (dependencies issues)
7import { CONFIG } from '../initializers/constants' 7import { CONFIG } from '../initializers/constants'
diff --git a/server/helpers/peertube-crypto.ts b/server/helpers/peertube-crypto.ts
index a4e9672e6..feb32a4cd 100644
--- a/server/helpers/peertube-crypto.ts
+++ b/server/helpers/peertube-crypto.ts
@@ -1,7 +1,7 @@
1import crypto = require('crypto') 1import * as crypto from 'crypto'
2import bcrypt = require('bcrypt') 2import * as bcrypt from 'bcrypt'
3import fs = require('fs') 3import * as fs from 'fs'
4import openssl = require('openssl-wrapper') 4import * as openssl from 'openssl-wrapper'
5import { join } from 'path' 5import { join } from 'path'
6 6
7import { 7import {
diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts
index 8ded52972..48b1fd703 100644
--- a/server/helpers/requests.ts
+++ b/server/helpers/requests.ts
@@ -1,5 +1,5 @@
1import replay = require('request-replay') 1import * as replay from 'request-replay'
2import request = require('request') 2import * as request from 'request'
3 3
4import { 4import {
5 RETRY_REQUESTS, 5 RETRY_REQUESTS,
diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts
index 0ee01b0e3..8c3d64b60 100644
--- a/server/initializers/checker.ts
+++ b/server/initializers/checker.ts
@@ -1,4 +1,4 @@
1import config = require('config') 1import * as config from 'config'
2 2
3import { database as db } from './database' 3import { database as db } from './database'
4import { CONFIG } from './constants' 4import { CONFIG } from './constants'
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 1072d0de0..7ab019f44 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -1,4 +1,4 @@
1import config = require('config') 1import * as config from 'config'
2import { join } from 'path' 2import { join } from 'path'
3 3
4// Do not use barrels, remain constants as independent as possible 4// Do not use barrels, remain constants as independent as possible
diff --git a/server/initializers/database.ts b/server/initializers/database.ts
index c89a8b23c..b0f47876e 100644
--- a/server/initializers/database.ts
+++ b/server/initializers/database.ts
@@ -1,6 +1,6 @@
1import fs = require('fs') 1import * as fs from 'fs'
2import { join } from 'path' 2import { join } from 'path'
3import Sequelize = require('sequelize') 3import * as Sequelize from 'sequelize'
4 4
5import { CONFIG } from './constants' 5import { CONFIG } from './constants'
6// Do not use barrel, we need to load database first 6// Do not use barrel, we need to load database first
diff --git a/server/initializers/installer.ts b/server/initializers/installer.ts
index 467164107..2f9b58991 100644
--- a/server/initializers/installer.ts
+++ b/server/initializers/installer.ts
@@ -1,8 +1,8 @@
1import { join } from 'path' 1import { join } from 'path'
2import config = require('config') 2import * as config from 'config'
3import { each, series } from 'async' 3import { each, series } from 'async'
4import mkdirp = require('mkdirp') 4import * as mkdirp from 'mkdirp'
5import passwordGenerator = require('password-generator') 5import * as passwordGenerator from 'password-generator'
6 6
7import { database as db } from './database' 7import { database as db } from './database'
8import { USER_ROLES, CONFIG, LAST_MIGRATION_VERSION } from './constants' 8import { USER_ROLES, CONFIG, LAST_MIGRATION_VERSION } from './constants'
diff --git a/server/initializers/migrator.ts b/server/initializers/migrator.ts
index d42cb3ccc..379d43af5 100644
--- a/server/initializers/migrator.ts
+++ b/server/initializers/migrator.ts
@@ -1,6 +1,6 @@
1import { waterfall, eachSeries } from 'async' 1import { waterfall, eachSeries } from 'async'
2import fs = require('fs') 2import * as fs from 'fs'
3import path = require('path') 3import * as path from 'path'
4import * as Sequelize from 'sequelize' 4import * as Sequelize from 'sequelize'
5 5
6import { database as db } from './database' 6import { database as db } from './database'
diff --git a/server/lib/friends.ts b/server/lib/friends.ts
index 08b776e83..6b0fbd2bf 100644
--- a/server/lib/friends.ts
+++ b/server/lib/friends.ts
@@ -1,5 +1,5 @@
1import { each, eachLimit, eachSeries, series, waterfall } from 'async' 1import { each, eachLimit, eachSeries, series, waterfall } from 'async'
2import request = require('request') 2import * as request from 'request'
3 3
4import { database as db } from '../initializers/database' 4import { database as db } from '../initializers/database'
5import { 5import {
diff --git a/server/middlewares/oauth.ts b/server/middlewares/oauth.ts
index 07bbded57..468e41810 100644
--- a/server/middlewares/oauth.ts
+++ b/server/middlewares/oauth.ts
@@ -1,4 +1,4 @@
1import OAuthServer = require('express-oauth-server') 1import * as OAuthServer from 'express-oauth-server'
2 2
3import { OAUTH_LIFETIME } from '../initializers' 3import { OAUTH_LIFETIME } from '../initializers'
4import { logger } from '../helpers' 4import { logger } from '../helpers'
diff --git a/server/models/video.ts b/server/models/video.ts
index 9284dfeba..5558a7c3b 100644
--- a/server/models/video.ts
+++ b/server/models/video.ts
@@ -1,12 +1,12 @@
1import safeBuffer = require('safe-buffer') 1import * as safeBuffer from 'safe-buffer'
2const Buffer = safeBuffer.Buffer 2const Buffer = safeBuffer.Buffer
3import createTorrent = require('create-torrent') 3import * as createTorrent from 'create-torrent'
4import ffmpeg = require('fluent-ffmpeg') 4import * as ffmpeg from 'fluent-ffmpeg'
5import fs = require('fs') 5import * as fs from 'fs'
6import magnetUtil = require('magnet-uri') 6import * as magnetUtil from 'magnet-uri'
7import { map, values } from 'lodash' 7import { map, values } from 'lodash'
8import { parallel, series } from 'async' 8import { parallel, series } from 'async'
9import parseTorrent = require('parse-torrent') 9import * as parseTorrent from 'parse-torrent'
10import { join } from 'path' 10import { join } from 'path'
11import * as Sequelize from 'sequelize' 11import * as Sequelize from 'sequelize'
12 12
diff --git a/yarn.lock b/yarn.lock
index 857aa92e6..28d33fa97 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -92,7 +92,7 @@
92 "@types/express-serve-static-core" "*" 92 "@types/express-serve-static-core" "*"
93 "@types/mime" "*" 93 "@types/mime" "*"
94 94
95"@types/validator@*": 95"@types/validator@*", "@types/validator@^6.2.0":
96 version "6.2.0" 96 version "6.2.0"
97 resolved "https://registry.yarnpkg.com/@types/validator/-/validator-6.2.0.tgz#020322fe1929f69889eb675a1bdb5a98394b71f0" 97 resolved "https://registry.yarnpkg.com/@types/validator/-/validator-6.2.0.tgz#020322fe1929f69889eb675a1bdb5a98394b71f0"
98 98
@@ -3382,6 +3382,10 @@ validator@^5.6.0:
3382 version "5.7.0" 3382 version "5.7.0"
3383 resolved "https://registry.yarnpkg.com/validator/-/validator-5.7.0.tgz#7a87a58146b695ac486071141c0c49d67da05e5c" 3383 resolved "https://registry.yarnpkg.com/validator/-/validator-5.7.0.tgz#7a87a58146b695ac486071141c0c49d67da05e5c"
3384 3384
3385validator@^7.0.0:
3386 version "7.0.0"
3387 resolved "https://registry.yarnpkg.com/validator/-/validator-7.0.0.tgz#c74deb8063512fac35547938e6f0b1504a282fd2"
3388
3385validator@~6.2.0: 3389validator@~6.2.0:
3386 version "6.2.1" 3390 version "6.2.1"
3387 resolved "https://registry.yarnpkg.com/validator/-/validator-6.2.1.tgz#bc575b78d15beb2e338a665ba9530c7f409ef667" 3391 resolved "https://registry.yarnpkg.com/validator/-/validator-6.2.1.tgz#bc575b78d15beb2e338a665ba9530c7f409ef667"