aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-helpers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/plugins/plugin-helpers.ts')
-rw-r--r--server/lib/plugins/plugin-helpers.ts20
1 files changed, 15 insertions, 5 deletions
diff --git a/server/lib/plugins/plugin-helpers.ts b/server/lib/plugins/plugin-helpers.ts
index 36d08d84a..a1493c7df 100644
--- a/server/lib/plugins/plugin-helpers.ts
+++ b/server/lib/plugins/plugin-helpers.ts
@@ -1,11 +1,15 @@
1import { PluginModel } from '@server/models/server/plugin'
2import { PeerTubeHelpers } from '@server/typings/plugins' 1import { PeerTubeHelpers } from '@server/typings/plugins'
2import { sequelizeTypescript } from '@server/initializers/database'
3import { buildLogger } from '@server/helpers/logger'
3 4
4function buildPluginHelpers (npmName: string, plugin: PluginModel): PeerTubeHelpers { 5function buildPluginHelpers (npmName: string): PeerTubeHelpers {
5 const logger = buildLogger(npmName) 6 const logger = buildPluginLogger(npmName)
7
8 const database = buildDatabaseHelpers()
6 9
7 return { 10 return {
8 logger 11 logger,
12 database
9 } 13 }
10} 14}
11 15
@@ -15,6 +19,12 @@ export {
15 19
16// --------------------------------------------------------------------------- 20// ---------------------------------------------------------------------------
17 21
18function buildLogger (npmName: string) { 22function buildPluginLogger (npmName: string) {
19 return buildLogger(npmName) 23 return buildLogger(npmName)
20} 24}
25
26function buildDatabaseHelpers () {
27 return {
28 query: sequelizeTypescript.query.bind(sequelizeTypescript)
29 }
30}