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}", "saveTable": "/do/saveTable", "preLoginUser": "/do/preLoginUser", "groupsTable": "/groupsTable", "doRemoveUser": "/do/doRemoveUser", "usersEditTable": "/get/usersEditTable", "doUnserialize": "/do/unserialize", "financeIncomeTable": "/finance/income/table", "serviceDeliveryParseExcel": "/service-delivery/parse-excel", "serviceDeliveryImportExcel": "/service-delivery/import-excel", "serviceDeliveryImportModal": "/service-delivery/import", "servicesMaterialRow": "/services/materials-row", "testConductPurchase": "/test/conduct-purchase", "testConductWriteOff": "/test/conduct-writeoff", "testCleanup": "/test/cleanup" }; 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; } };