diff options
Diffstat (limited to 'server/lib/plugins/plugin-helpers.ts')
-rw-r--r-- | server/lib/plugins/plugin-helpers.ts | 20 |
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 @@ | |||
1 | import { PluginModel } from '@server/models/server/plugin' | ||
2 | import { PeerTubeHelpers } from '@server/typings/plugins' | 1 | import { PeerTubeHelpers } from '@server/typings/plugins' |
2 | import { sequelizeTypescript } from '@server/initializers/database' | ||
3 | import { buildLogger } from '@server/helpers/logger' | ||
3 | 4 | ||
4 | function buildPluginHelpers (npmName: string, plugin: PluginModel): PeerTubeHelpers { | 5 | function 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 | ||
18 | function buildLogger (npmName: string) { | 22 | function buildPluginLogger (npmName: string) { |
19 | return buildLogger(npmName) | 23 | return buildLogger(npmName) |
20 | } | 24 | } |
25 | |||
26 | function buildDatabaseHelpers () { | ||
27 | return { | ||
28 | query: sequelizeTypescript.query.bind(sequelizeTypescript) | ||
29 | } | ||
30 | } | ||