@keycloakify/keycloak-account-ui
Version:
<p align="center"> <img src="https://github.com/user-attachments/assets/e31c4910-7205-441c-9a35-e134b806b3a8"> </p> <p align="center"> <i>Repackaged Keycloak Account UI</i> <br> <br> <a href="https://github.com/keycloakify/keycloak-a
33 lines (32 loc) • 1.63 kB
TypeScript
import { UserProfileAttributeMetadata } from "@keycloak/keycloak-admin-client/lib/defs/userProfileMetadata";
import UserRepresentation from "@keycloak/keycloak-admin-client/lib/defs/userRepresentation";
import { TFunction } from "i18next";
import { FieldPath } from "react-hook-form";
export type KeyValueType = {
key: string;
value: string;
};
export type UserFormFields = Omit<UserRepresentation, "attributes" | "userProfileMetadata"> & {
attributes?: KeyValueType[] | Record<string, string | string[]>;
};
type FieldError = {
field: string;
errorMessage: string;
params?: string[];
};
type ErrorArray = {
errors?: FieldError[];
};
export type UserProfileError = {
responseData: ErrorArray | FieldError;
};
export declare const label: (t: TFunction, text: string | undefined, fallback?: string) => string | undefined;
export declare const labelAttribute: (t: TFunction, attribute: UserProfileAttributeMetadata) => string | undefined;
export declare const isRootAttribute: (attr?: string) => boolean | "" | undefined;
export declare const fieldName: (name?: string) => FieldPath<UserFormFields>;
export declare const beerify: <T extends string>(name: T) => string;
export declare const debeerify: <T extends string>(name: T) => string;
export declare function setUserProfileServerError<T>(error: UserProfileError, setError: (field: keyof T, params: object) => void, t: TFunction): void;
export declare function isRequiredAttribute({ required, validators, }: UserProfileAttributeMetadata): boolean;
export declare function isUserProfileError(error: unknown): error is UserProfileError;
export {};