refactor: remove unused files

This commit is contained in:
Mauricio Siu
2024-10-07 00:49:54 -06:00
parent c4cf545d85
commit 9b6ea99eea
74 changed files with 8 additions and 3928 deletions

View File

@@ -2,10 +2,6 @@ import { randomBytes } from "node:crypto";
import { readFile } from "node:fs/promises";
import { join } from "node:path";
import type { Domain } from "@/server/services/domain";
// import { IS_CLOUD } from "@/server/constants";
import { TRPCError } from "@trpc/server";
import { templates } from "../templates";
import type { TemplatesKeys } from "../types/templates-data.type";
export interface Schema {
serverIp: string;
@@ -48,21 +44,6 @@ export const generateBase64 = (bytes = 32): string => {
return randomBytes(bytes).toString("base64");
};
export const loadTemplateModule = async (
id: TemplatesKeys,
): Promise<(schema: Schema) => Template> => {
const templateLoader = templates.find((t) => t.id === id);
if (!templateLoader) {
throw new TRPCError({
code: "BAD_REQUEST",
message: `Template ${id} not found or not implemented yet`,
});
}
const generate = await templateLoader.load();
return generate;
};
export const readTemplateComposeFile = async (id: string) => {
const cwd = process.cwd();
const composeFile = await readFile(