Multi target build (checkpoint before futher refactor)

This commit is contained in:
Joseph Garrone
2024-05-12 19:16:59 +02:00
parent d4f5a1fff4
commit 385cb85309
11 changed files with 170 additions and 47 deletions

View File

@ -0,0 +1,37 @@
import { assert, type Equals } from "tsafe/assert";
import type { KeycloakAccountV1Versions, KeycloakThemeAdditionalInfoExtensionVersions } from "./extensionVersions";
export function getKeycloakVersionRangeForJar(params: {
doImplementAccountTheme: boolean;
keycloakAccountV1Version: KeycloakAccountV1Versions;
keycloakThemeAdditionalInfoExtensionVersion: KeycloakThemeAdditionalInfoExtensionVersions;
}): string | undefined {
const { keycloakAccountV1Version, keycloakThemeAdditionalInfoExtensionVersion, doImplementAccountTheme } = params;
switch (keycloakAccountV1Version) {
case null:
switch (keycloakThemeAdditionalInfoExtensionVersion) {
case null:
return doImplementAccountTheme ? "21-and-below" : "21-and-below";
case "0.1":
return doImplementAccountTheme ? undefined : "22-and-above";
}
assert<Equals<typeof keycloakThemeAdditionalInfoExtensionVersion, never>>(false);
case "0.3":
switch (keycloakThemeAdditionalInfoExtensionVersion) {
case null:
return doImplementAccountTheme ? undefined : undefined;
case "0.1":
return doImplementAccountTheme ? "23" : undefined;
}
assert<Equals<typeof keycloakThemeAdditionalInfoExtensionVersion, never>>(false);
case "0.4":
switch (keycloakThemeAdditionalInfoExtensionVersion) {
case null:
return doImplementAccountTheme ? undefined : undefined;
case "0.1":
return doImplementAccountTheme ? "24-and-above" : undefined;
}
assert<Equals<typeof keycloakThemeAdditionalInfoExtensionVersion, never>>(false);
}
}