From 79c3b61c812fea16596646eb59ddfebdf9c71b13 Mon Sep 17 00:00:00 2001 From: "Jorge Caballero (DataDrivenMD)" <116459476+DataDrivenMD@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:31:45 -0800 Subject: [PATCH] Reverting breaking change to `getVersion()` --- config/versions.ts | 4 ++++ functions/api/v2/instance.ts | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/versions.ts b/config/versions.ts index 66cb01f..f578bf3 100644 --- a/config/versions.ts +++ b/config/versions.ts @@ -4,3 +4,7 @@ import * as packagejson from '../package.json' export const MASTODON_API_VERSION = '4.0.2' export const WILDEBEEST_VERSION = packagejson.version + +export function getVersion(): string { + return `${MASTODON_API_VERSION} (compatible; Wildebeest ${WILDEBEEST_VERSION})` +} \ No newline at end of file diff --git a/functions/api/v2/instance.ts b/functions/api/v2/instance.ts index 884e315..adc34b2 100644 --- a/functions/api/v2/instance.ts +++ b/functions/api/v2/instance.ts @@ -2,7 +2,7 @@ import type { Env } from 'wildebeest/backend/src/types/env' import { cors } from 'wildebeest/backend/src/utils/cors' import { DEFAULT_THUMBNAIL } from 'wildebeest/backend/src/config' import type { InstanceConfigV2 } from 'wildebeest/backend/src/types/configs' -import { getFederationUA } from 'wildebeest/config/ua' +import { getVersion } from 'wildebeest/config/versions' import { type Database, getDatabase } from 'wildebeest/backend/src/database' export const onRequest: PagesFunction = async ({ env, request }) => { @@ -19,7 +19,7 @@ export async function handleRequest(domain: string, db: Database, env: Env) { const res: InstanceConfigV2 = { domain, title: env.INSTANCE_TITLE, - version: getFederationUA(domain), + version: getVersion(), source_url: 'https://github.com/cloudflare/wildebeest', description: env.INSTANCE_DESCR, thumbnail: {