mirror of
https://github.com/outline/outline.git
synced 2026-11-26 15:43:48 +03:00
24 lines
569 B
TypeScript
24 lines
569 B
TypeScript
import { Hook, PluginManager } from "@server/utils/PluginManager";
|
|
import config from "../plugin.json";
|
|
import router from "./api/figma";
|
|
import env from "./env";
|
|
import { Figma } from "./figma";
|
|
import { Minute } from "@shared/utils/time";
|
|
|
|
const enabled = !!env.FIGMA_CLIENT_ID && !!env.FIGMA_CLIENT_SECRET;
|
|
|
|
if (enabled) {
|
|
PluginManager.add([
|
|
{
|
|
...config,
|
|
type: Hook.API,
|
|
value: router,
|
|
},
|
|
{
|
|
type: Hook.UnfurlProvider,
|
|
name: "Figma",
|
|
value: { unfurl: Figma.unfurl, cacheExpiry: 10 * Minute.seconds },
|
|
},
|
|
]);
|
|
}
|