aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-05 21:53:49 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-05 21:53:49 +0200
commit4d4e5cd4dca78480ec7f40e747f424cd107376a4 (patch)
tree1b132aab503751ae0f4c8ee6c7595ad2d65f3a50 /server
parente02643f32e4c97ca307f8fc5b69be79c40d70a3b (diff)
downloadPeerTube-4d4e5cd4dca78480ec7f40e747f424cd107376a4.tar.gz
PeerTube-4d4e5cd4dca78480ec7f40e747f424cd107376a4.tar.zst
PeerTube-4d4e5cd4dca78480ec7f40e747f424cd107376a4.zip
require -> import
Diffstat (limited to 'server')
-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
30 files changed, 52 insertions, 60 deletions
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