mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
* feat: add installation.info endpoint using DockerHub API * feat: UI use an server-side API to show version info * fix: review fixes * test: installation.info endpoint * feat: filtering pre-releases in installation.info endpoint * fix: change fetch to ApiClient usage for getting version info * Undo translation change --------- Co-authored-by: Tom Moor <tom.moor@gmail.com>
25 lines
602 B
TypeScript
25 lines
602 B
TypeScript
import Router from "koa-router";
|
|
import auth from "@server/middlewares/authentication";
|
|
import { APIContext } from "@server/types";
|
|
import { getVersion, getVersionInfo } from "@server/utils/getInstallationInfo";
|
|
|
|
const router = new Router();
|
|
|
|
router.post("installation.info", auth(), async (ctx: APIContext) => {
|
|
const currentVersion = getVersion();
|
|
const { latestVersion, versionsBehind } = await getVersionInfo(
|
|
currentVersion
|
|
);
|
|
|
|
ctx.body = {
|
|
data: {
|
|
version: currentVersion,
|
|
latestVersion,
|
|
versionsBehind,
|
|
},
|
|
policies: [],
|
|
};
|
|
});
|
|
|
|
export default router;
|