///
export function IKUIInit(config: {
tenantId?: string;
applicationId?: string;
baseUri?: string;
localeConfig?: LocaleConfigType | null;
}): void;
type DataTokenResponseType = {
"@type": string;
token: string;
refresh_token: string;
token_type: string;
expiration_time: number;
expires_in: number;
};
type renderLogin = (props: {
renderElementSelector: string;
onSuccessLogin: (arg0: DataTokenResponseType) => void;
redirectUri?: string;
registrationPath?: string;
forgotPasswordPath?: string;
labels?: {
username?: string;
password?: string;
loginButton?: string;
registerButton?: string;
forgotPasswordButton?: string;
orOtherOptions?: string;
};
}) => void;
type renderRegister = (props: {
renderElementSelector: string;
onSuccessRegistration: (arg0: DataTokenResponseType) => void;
redirectUri?: string;
termsAgreementSectionContent?: string;
validatePassword?: (arg0: string) => boolean;
labels?: {
username?: string;
password?: string;
confirmPassword?: string;
registerButton?: string;
alreadyHaveAnAccountButton?: string;
orOtherOptions?: string;
};
/**
* This is a temporary configuration only. Keep on mind that this property will be removed in the future.
*/
userInputNote?: string;
/**
* This is a temporary configuration only. Keep on mind that this property will be removed in the future.
*/
passwordInputNote?: string;
/**
* This is a temporary configuration only. Keep on mind that this property will be removed in the future.
*/
passwordCheckInputNote?: string;
}) => void;
type renderForgotPasswordForm = (props: {
renderElementSelector: string;
loginPath?: string;
labels?: {
username?: string;
submitButton?: string;
backToLogin?: string;
};
}) => void;
type renderSetNewPasswordForm = (props: {
token: string;
renderElementSelector: string;
validatePassword?: (arg0: string) => boolean;
labels?: {
newPassword?: string;
confirmNewPassword?: string;
submitButton?: string;
};
}) => void;
interface IKUICore {
renderLogin: renderLogin;
renderRegister: renderRegister;
renderForgotPasswordForm: renderForgotPasswordForm;
renderSetNewPasswordForm: renderSetNewPasswordForm;
}
export const IKUICore: IKUICore;
type ErrorObjectType = {
code: string;
label?: string;
msg: string;
extensions: Record;
};
export type ErrorResponseType = {
type: string;
"~error": ErrorObjectType;
};
export type SetupOptsType = {
"~ord": number;
"@type": string;
"@id": string;
prv?: string;
fields?: Array>;
opts?: Array>;
};
export type LoginSetupDataType = {
"@type": string;
op?: string;
prv?: string;
url?: string;
opts?: Array;
"~thread": {
thid: string;
};
};
type logoutCurrentUser = () => Promise;
type logoutUser = (userId?: string) => Promise;
type logoutAllUsers = () => Promise<{ [userId: string]: boolean }>;
type login = (
email: string,
password: string,
setupData: LoginSetupDataType,
) => Promise;
type isAuthenticated = (userId?: string) => Promise;
type getValidAccessToken = (options?: {
refreshToken?: string;
userId?: string;
}) => Promise;
type register = (email: string, password: string) => Promise;
type sendResetPasswordEmail = (email: string) => Promise<{ "@type": string }>;
type sendNewPassword = (
referenceId: string,
newPassword: string,
) => Promise;
type loginSetup = () => Promise;
type registerSetup = () => Promise;
interface IKUIUserAPI {
isAuthenticated: isAuthenticated;
logoutAllUsers: logoutAllUsers;
/**
@deprecated
*/
logoutCurrentUser: logoutCurrentUser;
logoutUser: logoutUser;
login: login;
getValidAccessToken: getValidAccessToken;
register: register;
sendResetPasswordEmail: sendResetPasswordEmail;
sendNewPassword: sendNewPassword;
loginSetup: loginSetup;
registerSetup: registerSetup;
}
export const IKUIUserAPI: IKUIUserAPI;
type oidcSetup = (
id?: string | null,
redirectUri?: string | null,
threadId?: string | null,
) => void;
type singleOidcSetupInput = {
"~thread": {
thid: string;
};
url: string;
};
type singleOidcSetup = (singleOidcSetupInput) => void;
type oidcCallback = () => Promise;
type handleOidcOriginalParamsAndRedirect = () => void;
type initOidcAuthorizationRequest = (
oauth2Host: string,
queryParams: Record,
) => void;
type handleOauth2Callback = () => void;
interface IKUIOidc {
oidcSetup: oidcSetup;
singleOidcSetup: singleOidcSetup;
oidcCallback: oidcCallback;
handleOidcOriginalParamsAndRedirect: handleOidcOriginalParamsAndRedirect;
initOidcAuthorizationRequest: initOidcAuthorizationRequest;
handleOauth2Callback: handleOauth2Callback;
}
export const IKUIOidc: IKUIOidc;