window.Redirect = class { static routes = { "dash": "/dash", "consoleAuthorization": "consoleAuthorization", "cliLogin": "cliLogin", "doLogin": "/do/login", "logout": "/logout", "login": "/door", "404": "/404", "routes": "/routes.js", "install": "/install", "initializeDb": "/do/initializeDb", "test_universal": "test_universal", "test_init_db": "test_init_db", "test_menu_debug": "test_menu_debug", "testExcelParser": "test-excel-parser", "getScript": "/script/${idFile}.js", "getFile": "/file/${token}/${size}", "saveTable": "/do/saveTable", "preLoginUser": "/do/preLoginUser", "dbCacheRebuild": "dbCacheRebuild", "dbCacheClear": "dbCacheClear", "groupsTable": "/groupsTable", "doRemoveUser": "/do/doRemoveUser", "usersEditTable": "/get/usersEditTable", "doUnserialize": "/do/unserialize", "clearCache": "clearCache", "testFastApi": "/testFastApi" }; static route(name, parameters = {}) { if (!this.routes[name]) { console.error(`Route "${name}" not found.`); return null; } let path = this.routes[name]; for (const [key, value] of Object.entries(parameters)) { path = path.replace(new RegExp(`\\$\\{${key}\\}`, "g"), value); } return path; } };