diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-05 21:53:49 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-05 21:53:49 +0200 |
commit | 4d4e5cd4dca78480ec7f40e747f424cd107376a4 (patch) | |
tree | 1b132aab503751ae0f4c8ee6c7595ad2d65f3a50 /server | |
parent | e02643f32e4c97ca307f8fc5b69be79c40d70a3b (diff) | |
download | PeerTube-4d4e5cd4dca78480ec7f40e747f424cd107376a4.tar.gz PeerTube-4d4e5cd4dca78480ec7f40e747f424cd107376a4.tar.zst PeerTube-4d4e5cd4dca78480ec7f40e747f424cd107376a4.zip |
require -> import
Diffstat (limited to 'server')
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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | 2 | ||
3 | import { CONFIG } from '../../initializers'; | 3 | import { CONFIG } from '../../initializers'; |
4 | import { logger } from '../../helpers' | 4 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | 2 | ||
3 | import { CONFIG } from '../../initializers' | 3 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | 2 | ||
3 | import { badRequest } from '../../helpers' | 3 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | import { waterfall } from 'async' | 2 | import { waterfall } from 'async' |
3 | 3 | ||
4 | import { database as db } from '../../initializers/database' | 4 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | 2 | ||
3 | import { badRequest } from '../../../helpers' | 3 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | import * as waterfall from 'async/waterfall' | 2 | import * as waterfall from 'async/waterfall' |
3 | 3 | ||
4 | import { database as db } from '../../../initializers/database' | 4 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | import { eachSeries, waterfall } from 'async' | 2 | import { eachSeries, waterfall } from 'async' |
3 | 3 | ||
4 | import { database as db } from '../../../initializers/database' | 4 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | import { parallel } from 'async' | 2 | import { parallel } from 'async' |
3 | 3 | ||
4 | import { | 4 | import { |
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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | import { waterfall } from 'async' | 2 | import { waterfall } from 'async' |
3 | 3 | ||
4 | import { database as db } from '../../initializers/database' | 4 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | import { waterfall } from 'async' | 2 | import { waterfall } from 'async' |
3 | 3 | ||
4 | import { database as db } from '../../../initializers/database' | 4 | import { database as db } from '../../../initializers/database' |
5 | import friends = require('../../../lib/friends') | 5 | import * as friends from '../../../lib/friends' |
6 | import { | 6 | import { |
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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | 2 | ||
3 | import { database as db } from '../../../initializers/database' | 3 | import { database as db } from '../../../initializers/database' |
4 | import { logger } from '../../../helpers' | 4 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | import fs = require('fs') | 2 | import * as fs from 'fs' |
3 | import multer = require('multer') | 3 | import * as multer from 'multer' |
4 | import path = require('path') | 4 | import * as path from 'path' |
5 | import { waterfall } from 'async' | 5 | import { waterfall } from 'async' |
6 | 6 | ||
7 | import { database as db } from '../../../initializers/database' | 7 | import { 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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | import { waterfall } from 'async' | 2 | import { waterfall } from 'async' |
3 | 3 | ||
4 | import { database as db } from '../../../initializers/database' | 4 | import { 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 @@ | |||
1 | import { parallel } from 'async' | 1 | import { parallel } from 'async' |
2 | import express = require('express') | 2 | import * as express from 'express' |
3 | import fs = require('fs') | 3 | import * as fs from 'fs' |
4 | import { join } from 'path' | 4 | import { join } from 'path' |
5 | import expressValidator = require('express-validator') | 5 | import * as validator from 'validator' |
6 | // TODO: use .validator when express-validator typing will have validator field | ||
7 | const validator = expressValidator['validator'] | ||
8 | 6 | ||
9 | import { database as db } from '../initializers/database' | 7 | import { database as db } from '../initializers/database' |
10 | import { | 8 | import { |
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 @@ | |||
1 | import express = require('express') | 1 | import * as express from 'express' |
2 | import cors = require('cors') | 2 | import * as cors from 'cors' |
3 | 3 | ||
4 | import { | 4 | import { |
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 @@ | |||
1 | import expressValidator = require('express-validator') | 1 | import * as validator from 'validator' |
2 | // TODO: use .validator when express-validator typing will have validator field | ||
3 | const validator = expressValidator['validator'] | ||
4 | 2 | ||
5 | import { isArray } from './misc' | 3 | import { 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 @@ | |||
1 | import { values } from 'lodash' | 1 | import { values } from 'lodash' |
2 | import expressValidator = require('express-validator') | 2 | import * as validator from 'validator' |
3 | // TODO: use .validator when express-validator typing will have validator field | ||
4 | const validator = expressValidator['validator'] | ||
5 | 3 | ||
6 | import { CONSTRAINTS_FIELDS, USER_ROLES } from '../../initializers' | 4 | import { CONSTRAINTS_FIELDS, USER_ROLES } from '../../initializers' |
7 | const USERS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.USERS | 5 | const 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 @@ | |||
1 | import { values } from 'lodash' | 1 | import { values } from 'lodash' |
2 | import expressValidator = require('express-validator') | 2 | import * as validator from 'validator' |
3 | // TODO: use .validator when express-validator typing will have validator field | ||
4 | const validator = expressValidator['validator'] | ||
5 | 3 | ||
6 | import { | 4 | import { |
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 |
2 | import retry = require('async/retry') | 2 | import * as retry from 'async/retry' |
3 | 3 | ||
4 | import { database as db } from '../initializers/database' | 4 | import { database as db } from '../initializers/database' |
5 | import { logger } from './logger' | 5 | import { 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/ |
2 | import mkdirp = require('mkdirp') | 2 | import * as mkdirp from 'mkdirp' |
3 | import path = require('path') | 3 | import * as path from 'path' |
4 | import winston = require('winston') | 4 | import * as winston from 'winston' |
5 | 5 | ||
6 | // Do not use barrel (dependencies issues) | 6 | // Do not use barrel (dependencies issues) |
7 | import { CONFIG } from '../initializers/constants' | 7 | import { 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 @@ | |||
1 | import crypto = require('crypto') | 1 | import * as crypto from 'crypto' |
2 | import bcrypt = require('bcrypt') | 2 | import * as bcrypt from 'bcrypt' |
3 | import fs = require('fs') | 3 | import * as fs from 'fs' |
4 | import openssl = require('openssl-wrapper') | 4 | import * as openssl from 'openssl-wrapper' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | 6 | ||
7 | import { | 7 | import { |
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 @@ | |||
1 | import replay = require('request-replay') | 1 | import * as replay from 'request-replay' |
2 | import request = require('request') | 2 | import * as request from 'request' |
3 | 3 | ||
4 | import { | 4 | import { |
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 @@ | |||
1 | import config = require('config') | 1 | import * as config from 'config' |
2 | 2 | ||
3 | import { database as db } from './database' | 3 | import { database as db } from './database' |
4 | import { CONFIG } from './constants' | 4 | import { 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 @@ | |||
1 | import config = require('config') | 1 | import * as config from 'config' |
2 | import { join } from 'path' | 2 | import { 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 @@ | |||
1 | import fs = require('fs') | 1 | import * as fs from 'fs' |
2 | import { join } from 'path' | 2 | import { join } from 'path' |
3 | import Sequelize = require('sequelize') | 3 | import * as Sequelize from 'sequelize' |
4 | 4 | ||
5 | import { CONFIG } from './constants' | 5 | import { 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 @@ | |||
1 | import { join } from 'path' | 1 | import { join } from 'path' |
2 | import config = require('config') | 2 | import * as config from 'config' |
3 | import { each, series } from 'async' | 3 | import { each, series } from 'async' |
4 | import mkdirp = require('mkdirp') | 4 | import * as mkdirp from 'mkdirp' |
5 | import passwordGenerator = require('password-generator') | 5 | import * as passwordGenerator from 'password-generator' |
6 | 6 | ||
7 | import { database as db } from './database' | 7 | import { database as db } from './database' |
8 | import { USER_ROLES, CONFIG, LAST_MIGRATION_VERSION } from './constants' | 8 | import { 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 @@ | |||
1 | import { waterfall, eachSeries } from 'async' | 1 | import { waterfall, eachSeries } from 'async' |
2 | import fs = require('fs') | 2 | import * as fs from 'fs' |
3 | import path = require('path') | 3 | import * as path from 'path' |
4 | import * as Sequelize from 'sequelize' | 4 | import * as Sequelize from 'sequelize' |
5 | 5 | ||
6 | import { database as db } from './database' | 6 | import { 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 @@ | |||
1 | import { each, eachLimit, eachSeries, series, waterfall } from 'async' | 1 | import { each, eachLimit, eachSeries, series, waterfall } from 'async' |
2 | import request = require('request') | 2 | import * as request from 'request' |
3 | 3 | ||
4 | import { database as db } from '../initializers/database' | 4 | import { database as db } from '../initializers/database' |
5 | import { | 5 | import { |
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 @@ | |||
1 | import OAuthServer = require('express-oauth-server') | 1 | import * as OAuthServer from 'express-oauth-server' |
2 | 2 | ||
3 | import { OAUTH_LIFETIME } from '../initializers' | 3 | import { OAUTH_LIFETIME } from '../initializers' |
4 | import { logger } from '../helpers' | 4 | import { 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 @@ | |||
1 | import safeBuffer = require('safe-buffer') | 1 | import * as safeBuffer from 'safe-buffer' |
2 | const Buffer = safeBuffer.Buffer | 2 | const Buffer = safeBuffer.Buffer |
3 | import createTorrent = require('create-torrent') | 3 | import * as createTorrent from 'create-torrent' |
4 | import ffmpeg = require('fluent-ffmpeg') | 4 | import * as ffmpeg from 'fluent-ffmpeg' |
5 | import fs = require('fs') | 5 | import * as fs from 'fs' |
6 | import magnetUtil = require('magnet-uri') | 6 | import * as magnetUtil from 'magnet-uri' |
7 | import { map, values } from 'lodash' | 7 | import { map, values } from 'lodash' |
8 | import { parallel, series } from 'async' | 8 | import { parallel, series } from 'async' |
9 | import parseTorrent = require('parse-torrent') | 9 | import * as parseTorrent from 'parse-torrent' |
10 | import { join } from 'path' | 10 | import { join } from 'path' |
11 | import * as Sequelize from 'sequelize' | 11 | import * as Sequelize from 'sequelize' |
12 | 12 | ||