diff --git a/src/api/endpoints/app/create.ts b/src/api/endpoints/app/create.ts index 320163ebd9..71633f7def 100644 --- a/src/api/endpoints/app/create.ts +++ b/src/api/endpoints/app/create.ts @@ -4,8 +4,7 @@ import rndstr from 'rndstr'; import $ from 'cafy'; import App from '../../models/app'; -import { isValidNameId } from '../../models/app'; -import { pack } from '../../models/app'; +import { isValidNameId }, { pack } from '../../models/app'; /** * @swagger diff --git a/src/api/endpoints/app/show.ts b/src/api/endpoints/app/show.ts index a3ef24717d..8bc3dda42c 100644 --- a/src/api/endpoints/app/show.ts +++ b/src/api/endpoints/app/show.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import App from '../../models/app'; -import { pack } from '../../models/app'; +import App, { pack } from '../../models/app'; /** * @swagger diff --git a/src/api/endpoints/auth/session/show.ts b/src/api/endpoints/auth/session/show.ts index 1fe3b873fe..73ac3185f6 100644 --- a/src/api/endpoints/auth/session/show.ts +++ b/src/api/endpoints/auth/session/show.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import AuthSess from '../../../models/auth-session'; -import { pack } from '../../../models/auth-session'; +import AuthSess, { pack } from '../../../models/auth-session'; /** * @swagger diff --git a/src/api/endpoints/channels.ts b/src/api/endpoints/channels.ts index 92dcee83db..b9a7d1b788 100644 --- a/src/api/endpoints/channels.ts +++ b/src/api/endpoints/channels.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import Channel from '../models/channel'; -import { pack } from '../models/channel'; +import Channel, { pack } from '../models/channel'; /** * Get all channels diff --git a/src/api/endpoints/channels/posts.ts b/src/api/endpoints/channels/posts.ts index 3feee51f76..d722589c20 100644 --- a/src/api/endpoints/channels/posts.ts +++ b/src/api/endpoints/channels/posts.ts @@ -3,8 +3,7 @@ */ import $ from 'cafy'; import { default as Channel, IChannel } from '../../models/channel'; -import Post from '../../models/post'; -import { pack } from '../../models/post'; +import Post, { pack } from '../../models/post'; /** * Show a posts of a channel diff --git a/src/api/endpoints/channels/show.ts b/src/api/endpoints/channels/show.ts index 89c48379a4..3238616fa5 100644 --- a/src/api/endpoints/channels/show.ts +++ b/src/api/endpoints/channels/show.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import { default as Channel, IChannel } from '../../models/channel'; -import { pack } from '../../models/channel'; +import { default as Channel, IChannel }, { pack } from '../../models/channel'; /** * Show a channel diff --git a/src/api/endpoints/drive/files.ts b/src/api/endpoints/drive/files.ts index 3bd80e7282..89915331ea 100644 --- a/src/api/endpoints/drive/files.ts +++ b/src/api/endpoints/drive/files.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import DriveFile from '../../models/drive-file'; -import { pack } from '../../models/drive-file'; +import DriveFile, { pack } from '../../models/drive-file'; /** * Get drive files diff --git a/src/api/endpoints/drive/files/create.ts b/src/api/endpoints/drive/files/create.ts index 6fa76d7e95..7b424f3f5a 100644 --- a/src/api/endpoints/drive/files/create.ts +++ b/src/api/endpoints/drive/files/create.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import { validateFileName } from '../../../models/drive-file'; -import { pack } from '../../../models/drive-file'; +import { validateFileName }, { pack } from '../../../models/drive-file'; import create from '../../../common/add-file-to-drive'; /** diff --git a/src/api/endpoints/drive/files/find.ts b/src/api/endpoints/drive/files/find.ts index 571aba81f4..e026afe936 100644 --- a/src/api/endpoints/drive/files/find.ts +++ b/src/api/endpoints/drive/files/find.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import DriveFile from '../../../models/drive-file'; -import { pack } from '../../../models/drive-file'; +import DriveFile, { pack } from '../../../models/drive-file'; /** * Find a file(s) diff --git a/src/api/endpoints/drive/files/show.ts b/src/api/endpoints/drive/files/show.ts index 00f69f1415..21664f7ba4 100644 --- a/src/api/endpoints/drive/files/show.ts +++ b/src/api/endpoints/drive/files/show.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import DriveFile from '../../../models/drive-file'; -import { pack } from '../../../models/drive-file'; +import DriveFile, { pack } from '../../../models/drive-file'; /** * Show a file diff --git a/src/api/endpoints/drive/files/update.ts b/src/api/endpoints/drive/files/update.ts index 9ef8215b1a..ff65a48f71 100644 --- a/src/api/endpoints/drive/files/update.ts +++ b/src/api/endpoints/drive/files/update.ts @@ -4,8 +4,7 @@ import $ from 'cafy'; import DriveFolder from '../../../models/drive-folder'; import DriveFile from '../../../models/drive-file'; -import { validateFileName } from '../../../models/drive-file'; -import { pack } from '../../../models/drive-file'; +import { validateFileName }, { pack } from '../../../models/drive-file'; import { publishDriveStream } from '../../../event'; /** diff --git a/src/api/endpoints/drive/files/upload_from_url.ts b/src/api/endpoints/drive/files/upload_from_url.ts index f0398bfc5d..009f06aaaf 100644 --- a/src/api/endpoints/drive/files/upload_from_url.ts +++ b/src/api/endpoints/drive/files/upload_from_url.ts @@ -3,8 +3,7 @@ */ import * as URL from 'url'; import $ from 'cafy'; -import { validateFileName } from '../../../models/drive-file'; -import { pack } from '../../../models/drive-file'; +import { validateFileName }, { pack } from '../../../models/drive-file'; import create from '../../../common/add-file-to-drive'; import * as debug from 'debug'; import * as tmp from 'tmp'; diff --git a/src/api/endpoints/drive/folders.ts b/src/api/endpoints/drive/folders.ts index e650fb74aa..428bde3507 100644 --- a/src/api/endpoints/drive/folders.ts +++ b/src/api/endpoints/drive/folders.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import DriveFolder from '../../models/drive-folder'; -import { pack } from '../../models/drive-folder'; +import DriveFolder, { pack } from '../../models/drive-folder'; /** * Get drive folders diff --git a/src/api/endpoints/drive/folders/create.ts b/src/api/endpoints/drive/folders/create.ts index 1953c09ee0..6543b11274 100644 --- a/src/api/endpoints/drive/folders/create.ts +++ b/src/api/endpoints/drive/folders/create.ts @@ -3,8 +3,7 @@ */ import $ from 'cafy'; import DriveFolder from '../../../models/drive-folder'; -import { isValidFolderName } from '../../../models/drive-folder'; -import { pack } from '../../../models/drive-folder'; +import { isValidFolderName }, { pack } from '../../../models/drive-folder'; import { publishDriveStream } from '../../../event'; /** diff --git a/src/api/endpoints/drive/folders/find.ts b/src/api/endpoints/drive/folders/find.ts index caad45d740..fc84766bc8 100644 --- a/src/api/endpoints/drive/folders/find.ts +++ b/src/api/endpoints/drive/folders/find.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import DriveFolder from '../../../models/drive-folder'; -import { pack } from '../../../models/drive-folder'; +import DriveFolder, { pack } from '../../../models/drive-folder'; /** * Find a folder(s) diff --git a/src/api/endpoints/drive/folders/show.ts b/src/api/endpoints/drive/folders/show.ts index fd3061ca54..e07d14d20d 100644 --- a/src/api/endpoints/drive/folders/show.ts +++ b/src/api/endpoints/drive/folders/show.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import DriveFolder from '../../../models/drive-folder'; -import { pack } from '../../../models/drive-folder'; +import DriveFolder, { pack } from '../../../models/drive-folder'; /** * Show a folder diff --git a/src/api/endpoints/drive/folders/update.ts b/src/api/endpoints/drive/folders/update.ts index 8f50a9d009..2adcadcb08 100644 --- a/src/api/endpoints/drive/folders/update.ts +++ b/src/api/endpoints/drive/folders/update.ts @@ -3,8 +3,7 @@ */ import $ from 'cafy'; import DriveFolder from '../../../models/drive-folder'; -import { isValidFolderName } from '../../../models/drive-folder'; -import { pack } from '../../../models/drive-folder'; +import { isValidFolderName }, { pack } from '../../../models/drive-folder'; import { publishDriveStream } from '../../../event'; /** diff --git a/src/api/endpoints/drive/stream.ts b/src/api/endpoints/drive/stream.ts index 3527d70500..8352c7dd4c 100644 --- a/src/api/endpoints/drive/stream.ts +++ b/src/api/endpoints/drive/stream.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import DriveFile from '../../models/drive-file'; -import { pack } from '../../models/drive-file'; +import DriveFile, { pack } from '../../models/drive-file'; /** * Get drive stream diff --git a/src/api/endpoints/i.ts b/src/api/endpoints/i.ts index 1b6c1e58de..7efdbcd7c9 100644 --- a/src/api/endpoints/i.ts +++ b/src/api/endpoints/i.ts @@ -1,8 +1,7 @@ /** * Module dependencies */ -import User from '../models/user'; -import { pack } from '../models/user'; +import User, { pack } from '../models/user'; /** * Show myself diff --git a/src/api/endpoints/i/signin_history.ts b/src/api/endpoints/i/signin_history.ts index 3ab59b694d..859e81653d 100644 --- a/src/api/endpoints/i/signin_history.ts +++ b/src/api/endpoints/i/signin_history.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import Signin from '../../models/signin'; -import { pack } from '../../models/signin'; +import Signin, { pack } from '../../models/signin'; /** * Get signin history of my account diff --git a/src/api/endpoints/i/update.ts b/src/api/endpoints/i/update.ts index a138832e54..cd4b1a13f5 100644 --- a/src/api/endpoints/i/update.ts +++ b/src/api/endpoints/i/update.ts @@ -3,8 +3,7 @@ */ import $ from 'cafy'; import User from '../../models/user'; -import { isValidName, isValidDescription, isValidLocation, isValidBirthday } from '../../models/user'; -import { pack } from '../../models/user'; +import { isValidName, isValidDescription, isValidLocation, isValidBirthday }, { pack } from '../../models/user'; import event from '../../event'; import config from '../../../conf'; diff --git a/src/api/endpoints/my/apps.ts b/src/api/endpoints/my/apps.ts index fe583db86a..b236190506 100644 --- a/src/api/endpoints/my/apps.ts +++ b/src/api/endpoints/my/apps.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import App from '../../models/app'; -import { pack } from '../../models/app'; +import App, { pack } from '../../models/app'; /** * Get my apps diff --git a/src/api/endpoints/posts.ts b/src/api/endpoints/posts.ts index d10c6ab408..3b29425927 100644 --- a/src/api/endpoints/posts.ts +++ b/src/api/endpoints/posts.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import Post from '../models/post'; -import { pack } from '../models/post'; +import Post, { pack } from '../models/post'; /** * Lists all posts diff --git a/src/api/endpoints/posts/context.ts b/src/api/endpoints/posts/context.ts index 3051e7af17..5ba3758975 100644 --- a/src/api/endpoints/posts/context.ts +++ b/src/api/endpoints/posts/context.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import Post from '../../models/post'; -import { pack } from '../../models/post'; +import Post, { pack } from '../../models/post'; /** * Show a context of a post diff --git a/src/api/endpoints/posts/polls/recommendation.ts b/src/api/endpoints/posts/polls/recommendation.ts index 5ccb754496..4a3fa3f55e 100644 --- a/src/api/endpoints/posts/polls/recommendation.ts +++ b/src/api/endpoints/posts/polls/recommendation.ts @@ -3,8 +3,7 @@ */ import $ from 'cafy'; import Vote from '../../../models/poll-vote'; -import Post from '../../../models/post'; -import { pack } from '../../../models/post'; +import Post, { pack } from '../../../models/post'; /** * Get recommended polls diff --git a/src/api/endpoints/posts/reactions.ts b/src/api/endpoints/posts/reactions.ts index f60334df8a..feb140ab41 100644 --- a/src/api/endpoints/posts/reactions.ts +++ b/src/api/endpoints/posts/reactions.ts @@ -3,8 +3,7 @@ */ import $ from 'cafy'; import Post from '../../models/post'; -import Reaction from '../../models/post-reaction'; -import { pack } from '../../models/post-reaction'; +import Reaction, { pack } from '../../models/post-reaction'; /** * Show reactions of a post diff --git a/src/api/endpoints/posts/replies.ts b/src/api/endpoints/posts/replies.ts index 1442b8a4c5..613c4fa24c 100644 --- a/src/api/endpoints/posts/replies.ts +++ b/src/api/endpoints/posts/replies.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import Post from '../../models/post'; -import { pack } from '../../models/post'; +import Post, { pack } from '../../models/post'; /** * Show a replies of a post diff --git a/src/api/endpoints/posts/reposts.ts b/src/api/endpoints/posts/reposts.ts index 0fbb0687b9..89ab0e3d55 100644 --- a/src/api/endpoints/posts/reposts.ts +++ b/src/api/endpoints/posts/reposts.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import Post from '../../models/post'; -import { pack } from '../../models/post'; +import Post, { pack } from '../../models/post'; /** * Show a reposts of a post diff --git a/src/api/endpoints/posts/show.ts b/src/api/endpoints/posts/show.ts index c312449710..3839490597 100644 --- a/src/api/endpoints/posts/show.ts +++ b/src/api/endpoints/posts/show.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import Post from '../../models/post'; -import { pack } from '../../models/post'; +import Post, { pack } from '../../models/post'; /** * Show a post diff --git a/src/api/endpoints/posts/trend.ts b/src/api/endpoints/posts/trend.ts index b2b1d327a8..caded92bf5 100644 --- a/src/api/endpoints/posts/trend.ts +++ b/src/api/endpoints/posts/trend.ts @@ -3,8 +3,7 @@ */ const ms = require('ms'); import $ from 'cafy'; -import Post from '../../models/post'; -import { pack } from '../../models/post'; +import Post, { pack } from '../../models/post'; /** * Get trend posts diff --git a/src/api/endpoints/users.ts b/src/api/endpoints/users.ts index ba33b1aeb7..095b9fe40d 100644 --- a/src/api/endpoints/users.ts +++ b/src/api/endpoints/users.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import User from '../models/user'; -import { pack } from '../models/user'; +import User, { pack } from '../models/user'; /** * Lists all users diff --git a/src/api/endpoints/users/get_frequently_replied_users.ts b/src/api/endpoints/users/get_frequently_replied_users.ts index 3cbc761322..87f4f77a5b 100644 --- a/src/api/endpoints/users/get_frequently_replied_users.ts +++ b/src/api/endpoints/users/get_frequently_replied_users.ts @@ -3,8 +3,7 @@ */ import $ from 'cafy'; import Post from '../../models/post'; -import User from '../../models/user'; -import { pack } from '../../models/user'; +import User, { pack } from '../../models/user'; module.exports = (params, me) => new Promise(async (res, rej) => { // Get 'user_id' parameter diff --git a/src/api/endpoints/users/posts.ts b/src/api/endpoints/users/posts.ts index 1f3db3cf79..285e5bc46c 100644 --- a/src/api/endpoints/users/posts.ts +++ b/src/api/endpoints/users/posts.ts @@ -3,8 +3,7 @@ */ import $ from 'cafy'; import Post from '../../models/post'; -import User from '../../models/user'; -import { pack } from '../../models/post'; +import User, { pack } from '../../models/user'; /** * Get posts of a user diff --git a/src/api/endpoints/users/recommendation.ts b/src/api/endpoints/users/recommendation.ts index b80fd63ce7..736233b340 100644 --- a/src/api/endpoints/users/recommendation.ts +++ b/src/api/endpoints/users/recommendation.ts @@ -3,8 +3,7 @@ */ const ms = require('ms'); import $ from 'cafy'; -import User from '../../models/user'; -import { pack } from '../../models/user'; +import User, { pack } from '../../models/user'; import getFriends from '../../common/get-friends'; /** diff --git a/src/api/endpoints/users/search.ts b/src/api/endpoints/users/search.ts index 213038403b..1142db9e9b 100644 --- a/src/api/endpoints/users/search.ts +++ b/src/api/endpoints/users/search.ts @@ -3,8 +3,7 @@ */ import * as mongo from 'mongodb'; import $ from 'cafy'; -import User from '../../models/user'; -import { pack } from '../../models/user'; +import User, { pack } from '../../models/user'; import config from '../../../conf'; const escapeRegexp = require('escape-regexp'); diff --git a/src/api/endpoints/users/search_by_username.ts b/src/api/endpoints/users/search_by_username.ts index 63e206b1f2..9c5e1905aa 100644 --- a/src/api/endpoints/users/search_by_username.ts +++ b/src/api/endpoints/users/search_by_username.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import User from '../../models/user'; -import { pack } from '../../models/user'; +import User, { pack } from '../../models/user'; /** * Search a user by username diff --git a/src/api/endpoints/users/show.ts b/src/api/endpoints/users/show.ts index a51cb619d4..7aea59296a 100644 --- a/src/api/endpoints/users/show.ts +++ b/src/api/endpoints/users/show.ts @@ -2,8 +2,7 @@ * Module dependencies */ import $ from 'cafy'; -import User from '../../models/user'; -import { pack } from '../../models/user'; +import User, { pack } from '../../models/user'; /** * Show a user diff --git a/src/api/private/signin.ts b/src/api/private/signin.ts index ab6e93562c..b49d25d99a 100644 --- a/src/api/private/signin.ts +++ b/src/api/private/signin.ts @@ -2,8 +2,7 @@ import * as express from 'express'; import * as bcrypt from 'bcryptjs'; import * as speakeasy from 'speakeasy'; import { default as User, IUser } from '../models/user'; -import Signin from '../models/signin'; -import { pack } from '../models/signin'; +import Signin, { pack } from '../models/signin'; import event from '../event'; import signin from '../common/signin'; import config from '../../conf'; diff --git a/src/api/private/signup.ts b/src/api/private/signup.ts index 105fe319a5..392f3b1fc7 100644 --- a/src/api/private/signup.ts +++ b/src/api/private/signup.ts @@ -3,8 +3,7 @@ import * as express from 'express'; import * as bcrypt from 'bcryptjs'; import recaptcha = require('recaptcha-promise'); import { default as User, IUser } from '../models/user'; -import { validateUsername, validatePassword } from '../models/user'; -import { pack } from '../models/user'; +import { validateUsername, validatePassword }, { pack } from '../models/user'; import generateUserToken from '../common/generate-native-user-token'; import config from '../../conf'; diff --git a/src/api/service/twitter.ts b/src/api/service/twitter.ts index ca4f8abcca..7d4964eba6 100644 --- a/src/api/service/twitter.ts +++ b/src/api/service/twitter.ts @@ -5,8 +5,7 @@ import * as uuid from 'uuid'; // const Twitter = require('twitter'); import autwh from 'autwh'; import redis from '../../db/redis'; -import User from '../models/user'; -import { pack } from '../models/user'; +import User, { pack } from '../models/user'; import event from '../event'; import config from '../../conf'; import signin from '../common/signin';