chore: Plugin registration (#6623)
* first pass * test * test * priority * Reduce boilerplate further * Update server/utils/PluginManager.ts Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com> * fix: matchesNode error in destroyed editor transaction * fix: Individual imported files do not display source correctly in 'Insights' * chore: Add sleep before Slack notification * docs * fix: Error logged about missing plugin.json * Remove email template glob --------- Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>
This commit is contained in:
20
plugins/slack/server/index.ts
Normal file
20
plugins/slack/server/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { PluginManager, PluginType } from "@server/utils/PluginManager";
|
||||
import config from "../plugin.json";
|
||||
import hooks from "./api/hooks";
|
||||
import router from "./auth/slack";
|
||||
import env from "./env";
|
||||
import SlackProcessor from "./processors/SlackProcessor";
|
||||
|
||||
const enabled = !!env.SLACK_CLIENT_ID && !!env.SLACK_CLIENT_SECRET;
|
||||
|
||||
PluginManager.register(PluginType.AuthProvider, router, {
|
||||
...config,
|
||||
enabled,
|
||||
});
|
||||
|
||||
PluginManager.register(PluginType.API, hooks, {
|
||||
...config,
|
||||
enabled,
|
||||
});
|
||||
|
||||
PluginManager.registerProcessor(SlackProcessor, { enabled });
|
||||
Reference in New Issue
Block a user