A worker answers /release.json from the Gitea API (Gitea sends no CORS headers, so the page cannot ask it directly). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 lines
462 B
TypeScript
11 lines
462 B
TypeScript
// Gitea redirects this to the newest release.
|
|
export const RELEASES = "https://git.zacharyzhang.com/ZacharyZhang-NY/ElyOffice/releases/latest";
|
|
|
|
/** The newest release's version, from the worker. */
|
|
export async function latest(): Promise<string> {
|
|
const res = await fetch("/release.json");
|
|
if (!res.ok) throw new Error(`release.json: ${res.status} ${await res.text()}`);
|
|
const { version } = (await res.json()) as { version: string };
|
|
return version;
|
|
}
|