Verified Commit 41fb13c3 authored by Chocobozzz's avatar Chocobozzz
Browse files

esModuleInterop to true

parent 40e7ed07
......@@ -8,7 +8,7 @@ import { HLS_STREAMING_PLAYLIST_DIRECTORY, STATIC_PATHS, WEBSERVER } from '@serv
import { pathExists, stat, writeFile } from 'fs-extra'
import { createTorrentPromise } from '@server/helpers/webtorrent'
import { CONFIG } from '@server/initializers/config'
import * as parseTorrent from 'parse-torrent'
import parseTorrent from 'parse-torrent'
import { logger } from '@server/helpers/logger'
run()
......
......@@ -2,7 +2,7 @@ import { registerTSPaths } from '../server/helpers/register-ts-paths'
registerTSPaths()
import { program } from 'commander'
import * as ffmpeg from 'fluent-ffmpeg'
import ffmpeg from 'fluent-ffmpeg'
import { buildx264VODCommand, runCommand, TranscodeOptions } from '@server/helpers/ffmpeg-utils'
import { exit } from 'process'
import { VideoTranscodingProfilesManager } from '@server/lib/transcoding/video-transcoding-profiles'
......
import { registerTSPaths } from '../server/helpers/register-ts-paths'
registerTSPaths()
import * as prompt from 'prompt'
import { start, get } from 'prompt'
import { join, basename } from 'path'
import { CONFIG } from '../server/initializers/config'
import { VideoModel } from '../server/models/video/video'
import { initDatabaseModels } from '../server/initializers/database'
import { readdir, remove, stat } from 'fs-extra'
import { VideoRedundancyModel } from '../server/models/redundancy/video-redundancy'
import * as Bluebird from 'bluebird'
import { map } from 'bluebird'
import { getUUIDFromFilename } from '../server/helpers/utils'
import { ThumbnailModel } from '../server/models/video/thumbnail'
import { ActorImageModel } from '../server/models/actor/actor-image'
......@@ -78,7 +78,7 @@ async function pruneDirectory (directory: string, existFun: ExistFun) {
const files = await readdir(directory)
const toDelete: string[] = []
await Bluebird.map(files, async file => {
await map(files, async file => {
const filePath = join(directory, file)
if (await existFun(filePath) !== true) {
......@@ -141,7 +141,7 @@ async function doesRedundancyExist (filePath: string) {
async function askConfirmation () {
return new Promise((res, rej) => {
prompt.start()
start()
const schema = {
properties: {
confirm: {
......@@ -154,7 +154,7 @@ async function askConfirmation () {
}
}
}
prompt.get(schema, function (err, result) {
get(schema, function (err, result) {
if (err) return rej(err)
return res(result.confirm?.match(/y/) !== null)
......
import { registerTSPaths } from '../server/helpers/register-ts-paths'
registerTSPaths()
import * as Bluebird from 'bluebird'
import { map } from 'bluebird'
import { program } from 'commander'
import { pathExists, remove } from 'fs-extra'
import { generateImageFilename, processImage } from '@server/helpers/image-utils'
......@@ -23,7 +23,7 @@ async function run () {
const videos = await VideoModel.listLocal()
await Bluebird.map(videos, v => {
await map(videos, v => {
return processVideo(v)
.catch(err => console.error('Cannot process video %s.', v.url, err))
}, { concurrency: 20 })
......
......@@ -7,13 +7,13 @@ if (isTestInstance()) {
}
// ----------- Node modules -----------
import * as express from 'express'
import * as morgan from 'morgan'
import * as cors from 'cors'
import * as cookieParser from 'cookie-parser'
import * as helmet from 'helmet'
import * as useragent from 'useragent'
import * as anonymize from 'ip-anonymize'
import express from 'express'
import morgan, { token } from 'morgan'
import cors from 'cors'
import cookieParser from 'cookie-parser'
import { frameguard } from 'helmet'
import { parse } from 'useragent'
import anonymize from 'ip-anonymize'
import { program as cli } from 'commander'
process.title = 'peertube'
......@@ -61,7 +61,7 @@ if (CONFIG.CSP.ENABLED) {
}
if (CONFIG.SECURITY.FRAMEGUARD.ENABLED) {
app.use(helmet.frameguard({
app.use(frameguard({
action: 'deny' // we only allow it for /videos/embed, see server/controllers/client.ts
}))
}
......@@ -148,16 +148,16 @@ if (isTestInstance()) {
}
// For the logger
morgan.token('remote-addr', (req: express.Request) => {
token('remote-addr', (req: express.Request) => {
if (CONFIG.LOG.ANONYMIZE_IP === true || req.get('DNT') === '1') {
return anonymize(req.ip, 16, 16)
}
return req.ip
})
morgan.token('user-agent', (req: express.Request) => {
token('user-agent', (req: express.Request) => {
if (req.get('DNT') === '1') {
return useragent.parse(req.get('user-agent')).family
return parse(req.get('user-agent')).family
}
return req.get('user-agent')
......
import * as cors from 'cors'
import * as express from 'express'
import cors from 'cors'
import express from 'express'
import { getServerActor } from '@server/models/application/application'
import { MAccountId, MActorId, MChannelId, MVideoId } from '@server/types/models'
import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos'
......
import * as express from 'express'
import express from 'express'
import { InboxManager } from '@server/lib/activitypub/inbox-manager'
import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '../../../shared'
import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
......
import * as express from 'express'
import express from 'express'
import { activityPubClientRouter } from './client'
import { inboxRouter } from './inbox'
import { outboxRouter } from './outbox'
......
import * as express from 'express'
import express from 'express'
import { Activity } from '../../../shared/models/activitypub/activity'
import { VideoPrivacy } from '../../../shared/models/videos'
import { activityPubCollectionPagination, activityPubContextify } from '../../helpers/activitypub'
......
import * as express from 'express'
import express from 'express'
function activityPubResponse (data: any, res: express.Response) {
return res.type('application/activity+json; charset=utf-8')
......
import * as express from 'express'
import express from 'express'
import { logger } from '@server/helpers/logger'
import { createAccountAbuse, createVideoAbuse, createVideoCommentAbuse } from '@server/lib/moderation'
import { Notifier } from '@server/lib/notifier'
......
import * as express from 'express'
import express from 'express'
import { pickCommonVideoQuery } from '@server/helpers/query'
import { getServerActor } from '@server/models/application/application'
import { buildNSFWFilter, getCountVideos, isUserAbleToSearchRemoteURI } from '../../helpers/express-utils'
......
import * as express from 'express'
import express from 'express'
import { removeComment } from '@server/lib/video-comment'
import { bulkRemoveCommentsOfValidator } from '@server/middlewares/validators/bulk'
import { VideoCommentModel } from '@server/models/video/video-comment'
......
import * as express from 'express'
import express from 'express'
import { remove, writeJSON } from 'fs-extra'
import { snakeCase } from 'lodash'
import validator from 'validator'
......
import * as express from 'express'
import express from 'express'
import { ServerConfigManager } from '@server/lib/server-config-manager'
import { ActorCustomPageModel } from '@server/models/account/actor-custom-page'
import { HttpStatusCode, UserRight } from '@shared/models'
......
import * as cors from 'cors'
import * as express from 'express'
import * as RateLimit from 'express-rate-limit'
import cors from 'cors'
import express from 'express'
import RateLimit from 'express-rate-limit'
import { HttpStatusCode } from '../../../shared/models'
import { badRequest } from '../../helpers/express-utils'
import { CONFIG } from '../../initializers/config'
......
import * as express from 'express'
import express from 'express'
import { ResultList } from '../../../shared'
import { Job, JobState, JobType } from '../../../shared/models'
import { UserRight } from '../../../shared/models/users'
......
import * as express from 'express'
import express from 'express'
import { OAuthClientLocal } from '../../../shared'
import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
import { logger } from '../../helpers/logger'
......
import * as express from 'express'
import * as memoizee from 'memoizee'
import express from 'express'
import memoizee from 'memoizee'
import { logger } from '@server/helpers/logger'
import { Hooks } from '@server/lib/plugins/hooks'
import { VideoModel } from '@server/models/video/video'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment