mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
23 lines
553 B
TypeScript
23 lines
553 B
TypeScript
import { Hook, PluginManager } from "@server/utils/PluginManager";
|
|
import { Minute } from "@shared/utils/time";
|
|
import config from "../plugin.json";
|
|
import router from "./api/linear";
|
|
import env from "./env";
|
|
import { Linear } from "./linear";
|
|
|
|
const enabled = !!env.LINEAR_CLIENT_ID && !!env.LINEAR_CLIENT_SECRET;
|
|
|
|
if (enabled) {
|
|
PluginManager.add([
|
|
{
|
|
...config,
|
|
type: Hook.API,
|
|
value: router,
|
|
},
|
|
{
|
|
type: Hook.UnfurlProvider,
|
|
value: { unfurl: Linear.unfurl, cacheExpiry: 5 * Minute.seconds },
|
|
},
|
|
]);
|
|
}
|