feat(api): Put the correct lysand version everywhere, add a new lysand_version field in the instance metadata endpoints

This commit is contained in:
Jesse Wierzbinski 2024-04-25 15:57:57 -10:00
parent 03750d5e86
commit 50ea9461e2
No known key found for this signature in database
4 changed files with 8 additions and 4 deletions

View file

@ -116,6 +116,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => {
streaming_api: "", streaming_api: "",
}, },
version: "4.3.0-alpha.3+glitch", version: "4.3.0-alpha.3+glitch",
lysand_version: version,
pleroma: { pleroma: {
metadata: { metadata: {
account_activation_required: false, account_activation_required: false,
@ -188,6 +189,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => {
contact_account: contactAccount?.toAPI() || undefined, contact_account: contactAccount?.toAPI() || undefined,
} satisfies APIInstance & { } satisfies APIInstance & {
banner: string; banner: string;
lysand_version: string;
pleroma: object; pleroma: object;
}); });
}); });

View file

@ -53,6 +53,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => {
domain: new URL(config.http.base_url).hostname, domain: new URL(config.http.base_url).hostname,
title: config.instance.name, title: config.instance.name,
version: "4.3.0-alpha.3+glitch", version: "4.3.0-alpha.3+glitch",
lysand_version: version,
source_url: "https://github.com/lysand-org/lysand", source_url: "https://github.com/lysand-org/lysand",
description: config.instance.description, description: config.instance.description,
usage: { usage: {

View file

@ -2,7 +2,7 @@ import { apiRoute, applyConfig } from "@api";
import { urlToContentFormat } from "@content_types"; import { urlToContentFormat } from "@content_types";
import { jsonResponse } from "@response"; import { jsonResponse } from "@response";
import type * as Lysand from "lysand-types"; import type * as Lysand from "lysand-types";
import pkg from "../../../package.json"; import pkg from "~package.json";
export const meta = applyConfig({ export const meta = applyConfig({
allowedMethods: ["GET"], allowedMethods: ["GET"],

View file

@ -1,5 +1,6 @@
import { apiRoute, applyConfig } from "@api"; import { apiRoute, applyConfig } from "@api";
import { jsonResponse } from "@response"; import { jsonResponse } from "@response";
import manifest from "~package.json";
export const meta = applyConfig({ export const meta = applyConfig({
allowedMethods: ["GET"], allowedMethods: ["GET"],
@ -10,7 +11,7 @@ export const meta = applyConfig({
duration: 60, duration: 60,
max: 500, max: 500,
}, },
route: "/nodeinfo/2.0", route: "/.well-known/nodeinfo/2.0",
}); });
/** /**
@ -20,8 +21,8 @@ export default apiRoute(() => {
// TODO: Implement this // TODO: Implement this
return jsonResponse({ return jsonResponse({
version: "2.0", version: "2.0",
software: { name: "lysand", version: "0.0.1" }, software: { name: "lysand", version: manifest.version },
protocols: ["activitypub"], protocols: ["lysand"],
services: { outbound: [], inbound: [] }, services: { outbound: [], inbound: [] },
usage: { usage: {
users: { total: 0, activeMonth: 0, activeHalfyear: 0 }, users: { total: 0, activeMonth: 0, activeHalfyear: 0 },