import { I18nextConfig } from '@genesislcap/foundation-i18n'; import { ZeroButtonAppearance } from '@genesislcap/foundation-zero'; import { ElementStyles } from '@microsoft/fast-element'; import { Container } from '@microsoft/fast-foundation'; /** * @public */ export declare const defaultOrganisation: string; /** * @public */ export declare const defaultUser: string; /** * @public */ export declare const defaultPassword: string; /** * @public */ export declare const defaultApiHost: string; /** * @public */ export declare const defaultSocketExt: string; /** * @public */ export declare const hostEnv: string; /** * @public */ export declare const hostUrl: string; /** * @public */ export declare const Routes: { readonly login: "login"; readonly 'request-account': "request-account"; readonly 'reset-password': "reset-password"; readonly 'forgot-password': "forgot-password"; readonly verify: "verify"; readonly 'mfa-mail-sent': "mfa-mail-sent"; readonly protected: "protected"; readonly 'not-found': "not-found"; }; /** * @public */ export type Routes = (typeof Routes)[keyof typeof Routes]; /** * A utility to check if a pathname is a route of this micro frontend. * * @param pathname - A pathname string to check, typically location.pathname, which is used when a value is omitted. * * @public * @privateRemarks * I've just put this util in for now given there's some app level direction code in place which needs review. */ export declare function isMFRoute(pathname?: string): boolean; /** * @public * Could be expanded to allow field ViewTemplates. */ export type FieldConfig = { label: string; /** * @privateRemarks * Added for now to apply defaults, but I'm not convinced we should do this. Could be made reactive after upgrade. */ value?: any; /** * @remarks * We expect fields to be required by default, but you can override to make them optional. Organisation for example. */ required?: boolean; /** * @remarks * A regular expression the control's value should match. Please note the email field has its own built in pattern. */ pattern?: string; /** * @remarks * Used in conjunction with the pattern to explain the conditions. */ title?: string; }; /** * @public * @privateRemarks * Using null to exclude the organisation field rather than boolean, as it affords cleaner value lookups in the templates. */ export type FieldConfigMap = { organisation: FieldConfig | null; username: FieldConfig; email: FieldConfig; password: FieldConfig; }; /** * @public * * If you don't provide SSOConfig on the login config then SSO is disabled completely. * * @remarks * `toggled` - Optionally toggle the SSO journey on/off by default. * If `toggled` is set to `true`, the SSO option is presented as enabled to the user (e.g., the SSO checkbox is checked, or SSO providers are immediately displayed). * If `toggled` is set to `false` (or if the parameter is omitted entirely), the SSO option starts as disabled. The user would then need to explicitly enable it (e.g., by checking a checkbox) to initiate the SSO flow. * * `identityProvidersPath` - The identity providers path under the current host. This is a *required* string parameter. * It specifies the URL path where the application can fetch the list of available Identity Providers (IDPs) for SSO. This path is relative to the `API_HOST` or the `host` you are setting in the parent component. * The login component will make a request to this endpoint to retrieve the IDPs. The response from this endpoint is expected to be in a format that the component can understand (as defined by the `IDP` and `IDPResponse` types in your code). The response is expected to be a JSON object containing an array of identity providers. * Example: If your `API_HOST` is `https://example.com/gwf` and `identityProvidersPath` is set to `'sso/list'`, the component will fetch the IDP list from `https://example.com/gwf/sso/list`. This endpoint should be implemented on your backend to return the available SSO providers. * * @example * ```ts * const config: SSOConfig = { * toggled: true, * identityProvidersPath: 'sso/list', * } * ``` */ export type SSOConfig = { toggled?: boolean; identityProvidersPath: string; }; /** * @public */ export type MessageDelayKey = 'forgotPassword' | 'resetPassword' | 'base'; /** * @public */ export type MessageDelays = Partial>; /** * LoginConfig DI interface. * * @public */ export interface LoginConfig { /** * Connect automatically or require user to click a connect button. */ autoConnect: boolean; /** * Login automatically or require user to click a login button after a connection is established. * * @remarks * Needs to manually be enabled in the NavigationContributor (see [2] in the example in the {@link Login} class). */ autoAuth: boolean; /** * Logo styles. * * @remarks * Providing `null` will hide the logo. Use content: url(...); to set source. * * @example Setting a custom logo * ```ts * logo: css` * content: url(${customLogoImport}); * `, * ``` */ logo: ElementStyles | null; /** * Logo alt text. */ logoAltText: string; /** * Background styles. * * @remarks * See {@link https://developer.mozilla.org/en-US/docs/Web/CSS/background} for more information. * * @example Setting a custom background image * ```ts * background: css` * :host { * background-image: url(${customBGImport}); * } * `, * ``` */ background: ElementStyles; /** * Omit any of the internal routes except 'login' and 'not-found'. * * @remarks * Routes specified here will not be configured nor will any internal cross-links to them be displayed. * * @example * ```ts * omitRoutes: ['request-account'], * ``` */ omitRoutes: Exclude[]; /** * Map of configuration for each of the primary form fields. * * @remarks * Use to drive inclusion / exclusion, tailor labels etc. */ fields: FieldConfigMap; /** * Show or hide the connection status indicator. */ showConnectionIndicator: boolean; /** * The `path` of the micro frontend as defined in the parent / host route. * * @remarks * Used to help resolve internal route links. Defaults to an empty string. */ hostPath: string; /** * The default URL to route the user to after a successful login. * * @remarks * Session.returnUrl set via Session.captureReturnUrl() trumps this value. */ defaultRedirectUrl: string; /** * Handler that allows external apps own router to navigate after successful login * */ redirectHandler?: (url: string) => void; /** * Omit certain return urls which the session service may have captured. * * @example * ```ts * omitRedirectUrls: ['/not-found'], * ``` */ omitRedirectUrls: string[]; /** * SSO configuration. * * @remarks * Providing `null` excludes the SSO journey option completely. */ sso: SSOConfig | null; /** * Display arbitrary version information. * * @remarks * Applications may choose to set this to display their Application release version on the login form. * * @example * ```ts * versionInformation: 'Version 3.0.0', * ``` */ versionInformation?: string; /** * I18n resources. * * @remarks * This property holds the localization resources needed for internationalization of the application. * It should follow the structure defined by the I18nextConfig interface, which includes * translations grouped by locale and namespace. Each locale can contain multiple namespaces, and each * namespace includes key-value pairs for translation strings. * * @example * ```ts * resources: { * en: { * translation: { * key: 'Hello World' * } * }, * es: { * translation: { * key: 'Hola Mundo' * } * } * } * ``` */ localizationResources?: I18nextConfig['resources']; /** * Delay configurations for various message-related actions. * * @remarks * This property holds numeric values representing delays (in milliseconds) for specific message-related actions * within the application. Each key in this object corresponds to a particular message action. * * @example * ```ts * messageDelays: { * forgotPassword: 1000, // Delay of 1000ms before processing forgot password action * resetPassword: 2000, // Delay of 2000ms for reset password action * base: 500 // Base delay used for generic message processing * } * ``` */ messageDelays?: MessageDelays; /** * Custom appearance for submit buttons in `foundation-login`. * * @remarks * This property holds a string representing the desired appearance for submit buttons in `foundation-login`. * The value should be a valid `appearance` attribute of a Foundation button component. * * @example * ```ts * submitButtonAppearance: 'stealth' * ``` */ submitButtonAppearance?: ZeroButtonAppearance; /** * Show or hide the environment indicator. */ showEnvironmentIndicator?: boolean; } /** * Default LoginConfig DI implementation. * @public */ export declare const defaultLoginConfig: LoginConfig; /** * LoginConfig DI key. * * @internal * @privateRemarks * Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name. */ export declare const LoginConfig: import("@microsoft/fast-foundation").InterfaceSymbol; /** * Configure the login micro frontend settings. * * @remarks * This is primarily for general settings, rather than re-defining the element, static templating / style changes. * * @param container - DI container. * @param config - A partial LoginConfig. * * @example Configuring login on lazy load * ```ts * name: 'login', * path: 'login', * title: 'Login', * element: async () => { * const { configure, define, defaultLoginConfig } = await import('@genesislcap/foundation-login'); * configure(this.container, { * autoConnect: true, * omitRoutes: ['request-account'], * fields: { * ...defaultLoginConfig.fields, * organisation: { * label: 'CompID', * }, * }, * hostPath: 'login', * defaultRedirectUrl: 'dashboard', * logo: loginLogo, * background: loginBG, * }); * // You can import and return `Login` directly here or re-define it completely via `define`. * return define({ * name: `nexus-login`, * }); * }, * layout: loginLayout, * settings: { public: true }, * childRouters: true, * ``` * * @public * @privateRemarks * We can tailor the spreading logic after we put it to use. Keeping it simple for now. * * @deprecated - Please use foundation-auth instead. */ export declare function configure(container: Container, config: Partial): void; //# sourceMappingURL=config.d.ts.map