Repatriate keycloak v24 scripts

This commit is contained in:
Joseph Garrone 2024-09-08 14:41:45 +02:00
parent 359e93a1ba
commit 785ed095bc
2 changed files with 32 additions and 1 deletions

View File

@ -68,6 +68,27 @@ export async function createPublicDotKeycloakifyDir() {
WELL_KNOWN_DIRECTORY_BASE_NAME.RESOURCES_COMMON
)
});
copy_v24_js: {
if (themeType !== "login") {
break copy_v24_js;
}
const { extractedDirPath } = await downloadKeycloakDefaultTheme({
keycloakVersionId: "LAST_24"
});
transformCodebase({
srcDirPath: pathJoin(
extractedDirPath,
"base",
"login",
"resources",
"js"
),
destDirPath: pathJoin(destDirPath, "js", "v24")
});
}
})
);
}

View File

@ -7,7 +7,8 @@ import { assert, type Equals } from "tsafe/assert";
const KEYCLOAK_VERSION = {
FOR_LOGIN_THEME: "25.0.4",
FOR_ACCOUNT_MULTI_PAGE: "21.1.2"
FOR_ACCOUNT_MULTI_PAGE: "21.1.2",
LAST_24: "24.0.4"
} as const;
export async function downloadKeycloakDefaultTheme(params: {
@ -72,6 +73,15 @@ export async function downloadKeycloakDefaultTheme(params: {
return;
}
break;
case KEYCLOAK_VERSION.LAST_24:
if (
!fileRelativePath.startsWith(
pathJoin("base", "login", "resources", "js")
)
) {
return;
}
break;
default:
assert<Equals<typeof keycloakVersion, never>>(false);