import { HostEventHandler } from "@mfreydl/toyhauler-api-framework/apiCore/host-event-manager"; import { IPlugin, IMiddlewarePlugin } from "@mfreydl/toyhauler-api-framework/apiCore"; import { FluentEndpointSetConfigurator } from "@mfreydl/toyhauler-api-framework/apiCore/fluent-endpoint-set-configurator"; import { classDef } from "toyhauler-common"; import "toyhauler-auth-contracts"; /** Embues the api with AuthenticationMiddleware * for honoring jwt tokens in api requests, * and adds authentication endpoints (via api extension method api.addAuthEndpoints()) * for logging in, registering, and password retrieval. */ export declare class AuthenticationPlugin implements IPlugin { constructor(); name: string; middleware: classDef[] | undefined; beforeDefineEndpoints: HostEventHandler | undefined; afterDefineEndpoints: HostEventHandler | undefined; beforeBootstrap: HostEventHandler | undefined; afterBootstrap: HostEventHandler | undefined; } export declare class AuthConstants { /** The url segments prepended to all the auth endpoint routes. */ readonly ROUTE_PREFIX = "auth"; /** The default route for the login endpoint (unprefixed). */ readonly ROUTE_SUBPATH_LOGIN = "login"; /** The default route for the tenant registration endpoint (unprefixed). */ readonly ROUTE_SUBPATH_TENANT_REGISTER = "tenants"; /** The default route for the switch tenant endpoint (unprefixed). */ readonly ROUTE_SUBPATH_SWITCH_TENANT = "switch"; /** The default route for the token refresh endpoint (unprefixed). */ readonly ROUTE_SUBPATH_TOKEN_REFRESH = "refresh"; /** The operationIds for the endpoints added by this plugin */ readonly ENDPOINT_IDS: { authTenantRegistration: string; authLogin: string; authTokenRefresh: string; authSwitchTenant: string; }; } declare module "@mfreydl/toyhauler-api-framework/apiCore/apiDef" { interface apiDef { /** Adds user login and register endpoints to this api definition. * These endpoints use the auth service client for processing. */ addAuthEndpoints(): Promise; } interface ApiConstants { /** Constants from the AuthenticationPlugin. */ auth: AuthConstants; } }