mirror of
https://github.com/outline/outline.git
synced 2026-11-20 21:23:06 +03:00
* chore: Move plugin-specific integration code into plugins Core no longer imports from or names the settings of individual plugins. Plugins now register mention providers, issue status icons, instance URLs, settings keys, settings and import schemas, and OAuth clients through hooks. * fix: Recompute embed instance URLs after plugins load and match legacy issue icons by URL * fix: Skip logo upload jobs queued without a settings path * chore: Choose issue status icons from the unfurl state
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import { IntegrationService } from "@shared/types";
|
|
import { Minute } from "@shared/utils/time";
|
|
import { PluginManager, Hook } from "@server/utils/PluginManager";
|
|
import config from "../plugin.json";
|
|
import { GitLabUtils } from "../shared/GitLabUtils";
|
|
import { GitLabIssueProvider } from "./GitLabIssueProvider";
|
|
import router from "./api/gitlab";
|
|
import { GitLabSettingsSchema } from "./api/schema";
|
|
import { GitLab } from "./gitlab";
|
|
import GitLabWebhookTask from "./tasks/GitLabWebhookTask";
|
|
|
|
PluginManager.add([
|
|
{
|
|
type: Hook.IntegrationSettings,
|
|
value: {
|
|
service: IntegrationService.GitLab,
|
|
keys: ["gitlab"],
|
|
schema: GitLabSettingsSchema,
|
|
},
|
|
},
|
|
{
|
|
...config,
|
|
type: Hook.API,
|
|
value: router,
|
|
},
|
|
{
|
|
type: Hook.IssueProvider,
|
|
value: new GitLabIssueProvider(),
|
|
},
|
|
{
|
|
type: Hook.UnfurlProvider,
|
|
name: "GitLab",
|
|
value: { unfurl: GitLab.unfurl, cacheExpiry: Minute.seconds },
|
|
},
|
|
{
|
|
// Only the public host is recognized here, a self-hosted instance is not
|
|
// known without the settings of a connected integration.
|
|
type: Hook.MentionProvider,
|
|
value: (url: URL) => GitLabUtils.mentionType(url),
|
|
},
|
|
{
|
|
type: Hook.Task,
|
|
value: GitLabWebhookTask,
|
|
},
|
|
]);
|