feat: versioning

This commit is contained in:
Jefferson Mantovani
2025-11-06 10:28:14 -03:00
parent fece86e305
commit 38201bb254
7 changed files with 421 additions and 117 deletions

24
src/utils/versions.ts Normal file
View File

@@ -0,0 +1,24 @@
import type { AppVersion } from "@/model/AppVersion";
export const appVersions: AppVersion[] = [
{
tag: "1.0.0",
ipfsHash: "bafybeiagfqnxnb5zdrks6dicfm7kxjdtzzzzm2ouluxgdseg2hrrotayzi",
releaseDate: "2023-01-28",
description: "Initial release"
},
];
export function getLatestVersion(): AppVersion | null {
return appVersions.length > 0 ? appVersions[0] : null;
}
export function getVersionByTag(tag: string): AppVersion | null {
return appVersions.find((v) => v.tag === tag) || null;
}
export function getIpfsUrl(ipfsHash: string): string {
return `https://${ipfsHash}.ipfs.dweb.link`;
}