aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-repl.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tools/peertube-repl.ts')
-rw-r--r--server/tools/peertube-repl.ts45
1 files changed, 29 insertions, 16 deletions
diff --git a/server/tools/peertube-repl.ts b/server/tools/peertube-repl.ts
index ab6e215d9..a5c35e9ea 100644
--- a/server/tools/peertube-repl.ts
+++ b/server/tools/peertube-repl.ts
@@ -4,14 +4,10 @@ registerTSPaths()
4import * as repl from 'repl' 4import * as repl from 'repl'
5import * as path from 'path' 5import * as path from 'path'
6import * as _ from 'lodash' 6import * as _ from 'lodash'
7import * as uuidv1 from 'uuid/v1' 7import { uuidv1, uuidv3, uuidv4, uuidv5 } from 'uuid'
8import * as uuidv3 from 'uuid/v3'
9import * as uuidv4 from 'uuid/v4'
10import * as uuidv5 from 'uuid/v5'
11import * as Sequelize from 'sequelize' 8import * as Sequelize from 'sequelize'
12import * as YoutubeDL from 'youtube-dl' 9import * as YoutubeDL from 'youtube-dl'
13 10import { initDatabaseModels, sequelizeTypescript } from '../initializers/database'
14import { initDatabaseModels, sequelizeTypescript } from '../initializers'
15import * as cli from '../tools/cli' 11import * as cli from '../tools/cli'
16import { logger } from '../helpers/logger' 12import { logger } from '../helpers/logger'
17import * as constants from '../initializers/constants' 13import * as constants from '../initializers/constants'
@@ -31,22 +27,39 @@ const start = async () => {
31 const initContext = (replServer) => { 27 const initContext = (replServer) => {
32 return (context) => { 28 return (context) => {
33 const properties = { 29 const properties = {
34 context, repl: replServer, env: process.env, 30 context,
35 lodash: _, path, 31 repl: replServer,
36 uuidv1, uuidv3, uuidv4, uuidv5, 32 env: process.env,
37 cli, logger, constants, 33 lodash: _,
38 Sequelize, sequelizeTypescript, modelsUtils, 34 path,
39 models: sequelizeTypescript.models, transaction: sequelizeTypescript.transaction, 35 uuidv1,
40 query: sequelizeTypescript.query, queryInterface: sequelizeTypescript.getQueryInterface(), 36 uuidv3,
37 uuidv4,
38 uuidv5,
39 cli,
40 logger,
41 constants,
42 Sequelize,
43 sequelizeTypescript,
44 modelsUtils,
45 models: sequelizeTypescript.models,
46 transaction: sequelizeTypescript.transaction,
47 query: sequelizeTypescript.query,
48 queryInterface: sequelizeTypescript.getQueryInterface(),
41 YoutubeDL, 49 YoutubeDL,
42 coreUtils, ffmpegUtils, peertubeCryptoUtils, signupUtils, utils, YoutubeDLUtils 50 coreUtils,
51 ffmpegUtils,
52 peertubeCryptoUtils,
53 signupUtils,
54 utils,
55 YoutubeDLUtils
43 } 56 }
44 57
45 for (let prop in properties) { 58 for (const prop in properties) {
46 Object.defineProperty(context, prop, { 59 Object.defineProperty(context, prop, {
47 configurable: false, 60 configurable: false,
48 enumerable: true, 61 enumerable: true,
49 value: properties[ prop ] 62 value: properties[prop]
50 }) 63 })
51 } 64 }
52 } 65 }