feat: invoice generator

This commit is contained in:
Vasily Zubarev
2025-05-07 14:53:13 +02:00
parent 287abbb219
commit 8b5a2e8056
59 changed files with 2606 additions and 124 deletions

27
app/(app)/apps/common.ts Normal file
View File

@@ -0,0 +1,27 @@
import fs from "fs/promises"
import path from "path"
export type AppManifest = {
name: string
description: string
icon: string
}
export async function getApps(): Promise<{ id: string; manifest: AppManifest }[]> {
const appsDir = path.join(process.cwd(), "app/(app)/apps")
const items = await fs.readdir(appsDir, { withFileTypes: true })
const apps = await Promise.all(
items
.filter((item) => item.isDirectory() && item.name !== "apps")
.map(async (item) => {
const manifestModule = await import(`./${item.name}/manifest`)
return {
id: item.name,
manifest: manifestModule.manifest as AppManifest,
}
})
)
return apps
}