|
@@ -15,6 +15,7 @@ import loggerFactory from '~/utils/logger';
|
|
|
import { projectRoot } from '~/utils/project-dir-utils';
|
|
import { projectRoot } from '~/utils/project-dir-utils';
|
|
|
|
|
|
|
|
import Activity from '../models/activity';
|
|
import Activity from '../models/activity';
|
|
|
|
|
+import GrowiPlugin from '../models/growi-plugin';
|
|
|
import PageRedirect from '../models/page-redirect';
|
|
import PageRedirect from '../models/page-redirect';
|
|
|
import Tag from '../models/tag';
|
|
import Tag from '../models/tag';
|
|
|
import UserGroup from '../models/user-group';
|
|
import UserGroup from '../models/user-group';
|
|
@@ -26,6 +27,8 @@ import { InstallerService } from '../service/installer';
|
|
|
import PageService from '../service/page';
|
|
import PageService from '../service/page';
|
|
|
import PageGrantService from '../service/page-grant';
|
|
import PageGrantService from '../service/page-grant';
|
|
|
import PageOperationService from '../service/page-operation';
|
|
import PageOperationService from '../service/page-operation';
|
|
|
|
|
+// eslint-disable-next-line import/no-cycle
|
|
|
|
|
+import { PluginService } from '../service/plugin';
|
|
|
import SearchService from '../service/search';
|
|
import SearchService from '../service/search';
|
|
|
import { SlackIntegrationService } from '../service/slack-integration';
|
|
import { SlackIntegrationService } from '../service/slack-integration';
|
|
|
import { UserNotificationService } from '../service/user-notification';
|
|
import { UserNotificationService } from '../service/user-notification';
|
|
@@ -65,6 +68,7 @@ function Crowi() {
|
|
|
this.growiBridgeService = null;
|
|
this.growiBridgeService = null;
|
|
|
this.exportService = null;
|
|
this.exportService = null;
|
|
|
this.importService = null;
|
|
this.importService = null;
|
|
|
|
|
+ this.pluginService = null;
|
|
|
this.searchService = null;
|
|
this.searchService = null;
|
|
|
this.socketIoService = null;
|
|
this.socketIoService = null;
|
|
|
this.pageService = null;
|
|
this.pageService = null;
|
|
@@ -119,6 +123,7 @@ Crowi.prototype.init = async function() {
|
|
|
this.scanRuntimeVersions(),
|
|
this.scanRuntimeVersions(),
|
|
|
this.setupPassport(),
|
|
this.setupPassport(),
|
|
|
this.setupSearcher(),
|
|
this.setupSearcher(),
|
|
|
|
|
+ this.setupPluginer(),
|
|
|
this.setupMailer(),
|
|
this.setupMailer(),
|
|
|
this.setupSlackIntegrationService(),
|
|
this.setupSlackIntegrationService(),
|
|
|
this.setUpFileUpload(),
|
|
this.setUpFileUpload(),
|
|
@@ -130,6 +135,7 @@ Crowi.prototype.init = async function() {
|
|
|
this.setupUserGroupService(),
|
|
this.setupUserGroupService(),
|
|
|
this.setupExport(),
|
|
this.setupExport(),
|
|
|
this.setupImport(),
|
|
this.setupImport(),
|
|
|
|
|
+ this.setupPluginService(),
|
|
|
this.setupPageService(),
|
|
this.setupPageService(),
|
|
|
this.setupInAppNotificationService(),
|
|
this.setupInAppNotificationService(),
|
|
|
this.setupActivityService(),
|
|
this.setupActivityService(),
|
|
@@ -291,6 +297,7 @@ Crowi.prototype.setupModels = async function() {
|
|
|
allModels.Tag = Tag;
|
|
allModels.Tag = Tag;
|
|
|
allModels.UserGroup = UserGroup;
|
|
allModels.UserGroup = UserGroup;
|
|
|
allModels.PageRedirect = PageRedirect;
|
|
allModels.PageRedirect = PageRedirect;
|
|
|
|
|
+ allModels.growiPlugin = GrowiPlugin;
|
|
|
|
|
|
|
|
Object.keys(allModels).forEach((key) => {
|
|
Object.keys(allModels).forEach((key) => {
|
|
|
return this.model(key, models[key](this));
|
|
return this.model(key, models[key](this));
|
|
@@ -368,6 +375,13 @@ Crowi.prototype.setupSearcher = async function() {
|
|
|
this.searchService = new SearchService(this);
|
|
this.searchService = new SearchService(this);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * setup PluginService
|
|
|
|
|
+ */
|
|
|
|
|
+Crowi.prototype.setupPluginer = async function() {
|
|
|
|
|
+ this.pluginService = new PluginService(this);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
Crowi.prototype.setupMailer = async function() {
|
|
Crowi.prototype.setupMailer = async function() {
|
|
|
const MailService = require('~/server/service/mail');
|
|
const MailService = require('~/server/service/mail');
|
|
|
this.mailService = new MailService(this);
|
|
this.mailService = new MailService(this);
|
|
@@ -684,6 +698,13 @@ Crowi.prototype.setupImport = async function() {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+Crowi.prototype.setupPluginService = async function() {
|
|
|
|
|
+ const { PluginService } = require('../service/plugin');
|
|
|
|
|
+ if (this.pluginService == null) {
|
|
|
|
|
+ this.pluginService = new PluginService(this);
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
Crowi.prototype.setupPageService = async function() {
|
|
Crowi.prototype.setupPageService = async function() {
|
|
|
if (this.pageService == null) {
|
|
if (this.pageService == null) {
|
|
|
this.pageService = new PageService(this);
|
|
this.pageService = new PageService(this);
|