X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-repl.ts;h=63f7667a16632c8c4df6d82a71c98056633d2963;hb=3b54e5902a54c99c2968383e967370ae17bbba03;hp=fbdec16132ad0580ae500a9b15be6cdf47eae3b3;hpb=1a12f66d631d28a5a58ebbcd274426f2e6e5d203;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-repl.ts b/server/tools/peertube-repl.ts index fbdec1613..63f7667a1 100644 --- a/server/tools/peertube-repl.ts +++ b/server/tools/peertube-repl.ts @@ -1,14 +1,13 @@ +import { registerTSPaths } from '../helpers/register-ts-paths' +registerTSPaths() + import * as repl from 'repl' import * as path from 'path' import * as _ from 'lodash' -import * as uuidv1 from 'uuid/v1' -import * as uuidv3 from 'uuid/v3' -import * as uuidv4 from 'uuid/v4' -import * as uuidv5 from 'uuid/v5' +import { uuidv1, uuidv3, uuidv4, uuidv5 } from 'uuid' import * as Sequelize from 'sequelize' import * as YoutubeDL from 'youtube-dl' - -import { initDatabaseModels, sequelizeTypescript } from '../initializers' +import { initDatabaseModels, sequelizeTypescript } from '../initializers/database' import * as cli from '../tools/cli' import { logger } from '../helpers/logger' import * as constants from '../initializers/constants' @@ -16,7 +15,6 @@ import * as modelsUtils from '../models/utils' import * as coreUtils from '../helpers/core-utils' import * as ffmpegUtils from '../helpers/ffmpeg-utils' import * as peertubeCryptoUtils from '../helpers/peertube-crypto' -import * as signupUtils from '../helpers/signup' import * as utils from '../helpers/utils' import * as YoutubeDLUtils from '../helpers/youtube-dl' @@ -28,22 +26,38 @@ const start = async () => { const initContext = (replServer) => { return (context) => { const properties = { - context, repl: replServer, env: process.env, - lodash: _, path, - uuidv1, uuidv3, uuidv4, uuidv5, - cli, logger, constants, - Sequelize, sequelizeTypescript, modelsUtils, - models: sequelizeTypescript.models, transaction: sequelizeTypescript.transaction, - query: sequelizeTypescript.query, queryInterface: sequelizeTypescript.getQueryInterface(), + context, + repl: replServer, + env: process.env, + lodash: _, + path, + uuidv1, + uuidv3, + uuidv4, + uuidv5, + cli, + logger, + constants, + Sequelize, + sequelizeTypescript, + modelsUtils, + models: sequelizeTypescript.models, + transaction: sequelizeTypescript.transaction, + query: sequelizeTypescript.query, + queryInterface: sequelizeTypescript.getQueryInterface(), YoutubeDL, - coreUtils, ffmpegUtils, peertubeCryptoUtils, signupUtils, utils, YoutubeDLUtils + coreUtils, + ffmpegUtils, + peertubeCryptoUtils, + utils, + YoutubeDLUtils } - for (let prop in properties) { + for (const prop in properties) { Object.defineProperty(context, prop, { configurable: false, enumerable: true, - value: properties[ prop ] + value: properties[prop] }) } } @@ -66,7 +80,6 @@ const start = async () => { } replServer.defineCommand('reset', resetCommand) replServer.defineCommand('r', resetCommand) - } start()