import { ftlValuesGlobalName } from "../bin/build-keycloak-theme/ftlValuesGlobalName"; import type { generateFtlFilesCodeFactory } from "../bin/build-keycloak-theme/generateFtl"; import { id } from "evt/tools/typeSafety/id"; //import type { LanguageLabel } from "./i18n/getLanguageLabel"; import type { AvailableLanguages } from "./i18n/useKeycloakLanguage"; export type KeycloakFtlValues = { pageBasename: Parameters["generateFtlFilesCode"]>[0]["pageBasename"]; url: { loginAction: string; resourcesPath: string; resourcesCommonPath: string; loginRestartFlowUrl: string; loginResetCredentialsUrl: string; registrationUrl: string; }; realm: { displayName?: string; displayNameHtml?: string; internationalizationEnabled: boolean; password: boolean; loginWithEmailAllowed: boolean; registrationEmailAsUsername: boolean; rememberMe: boolean; resetPasswordAllowed: boolean; }; /** Undefined if !realm.internationalizationEnabled */ locale?: { supported: { //url: string; languageTag: AvailableLanguages; /** Is determined by languageTag. Ex: languageTag === "en" => label === "English" * or getLanguageLabel(languageTag) === label */ //label: LanguageLabel; }[]; //NOTE: We do not expose this because the language is managed //client side. We use this value however to set the default. //current: LanguageLabel; }, auth?: { showUsername: boolean; showResetCredentials: boolean; showTryAnotherWayLink: boolean; attemptedUsername?: boolean; selectedCredential?: string; }; scripts: string[]; message?: { type: "success" | "warning" | "error" | "info"; summary: string; }; isAppInitiatedAction: boolean; social: { displayInfo: boolean; providers?: { loginUrl: string; alias: string; providerId: string; displayName: string; }[] }; usernameEditDisabled: boolean; login: { username?: string; rememberMe: boolean; }; registrationDisabled: boolean; }; export const { keycloakPagesContext } = { [ftlValuesGlobalName]: id((window as any)[ftlValuesGlobalName]) }; ;