Add Info page, refactor

This commit is contained in:
Joseph Garrone
2021-03-06 14:42:56 +01:00
parent f3fb360ce0
commit 25d9d3dc26
13 changed files with 478 additions and 374 deletions

View File

@ -4,9 +4,18 @@ import type { generateFtlFilesCodeFactory } from "../bin/build-keycloak-theme/ge
import { id } from "evt/tools/typeSafety/id";
import type { KcLanguageTag } from "./i18n/KcLanguageTag";
import { doExtends } from "evt/tools/typeSafety/doExtends";
import type { MessageKey } from "./i18n/useKcTranslation";
export type KcContext = KcContext.Login | KcContext.Register;
type ExtractAfterStartingWith<Prefix extends string, StrEnum> =
StrEnum extends `${Prefix}${infer U}` ? U : never;
const x: "33" | "44" = null as any;;
const y: `foo.${typeof x}` = `foo.${x}` as const;
y;
export type KcContext = KcContext.Login | KcContext.Register | KcContext.Info;
export declare namespace KcContext {
export type Template = {
@ -117,6 +126,18 @@ export declare namespace KcContext {
recaptchaSiteKey?: string;
};
export type Info = Template & {
pageBasename: "info.ftl";
messageHeader?: string;
requiredActions?: ExtractAfterStartingWith<"requiredAction.",MessageKey>[];
skipLink: boolean;
pageRedirectUri?: string;
actionUri?: string;
client: {
baseUrl?: string;
}
};
}
{