refactor: migrate custom fields to transactions

refactor: extract functions to api domain

refactor: strict custom field parsing

refactor: remove rundown cache utilities

refactor: directory restructure
This commit is contained in:
Carlos Valente
2025-06-06 21:08:30 +02:00
committed by arc-alex
parent f3b4ea0155
commit 2498e59156
75 changed files with 2060 additions and 2480 deletions
+10 -1
View File
@@ -114,7 +114,7 @@ export async function dockerSafeRename(oldPath: PathLike, newPath: PathLike) {
* finds potential file index number in our (*) format and increments
* the number section (*) must be separated from the name by a space
* @example incrementProjectNumber('test(1).json') -> 'test(1).json'
* @example incrementProjectNumber('test (1).json') -> 'test(2).json'
* @example incrementProjectNumber('test (1).json') -> 'test(2).json'
*/
export function incrementProjectNumber(path: string): string {
const { dir, name, ext } = parse(path);
@@ -129,3 +129,12 @@ export function incrementProjectNumber(path: string): string {
return join(dir, `${name.slice(0, openingParenIndex)} (${maybeNumber + 1})${ext}`);
}
/**
* @description Delete file from system
*/
export const deleteFile = async (filePath: string) => {
return await unlink(filePath).catch((error) => {
console.error('Could not delete file:', error);
});
};