UNPKG

@fedify/fedify

Version:

An ActivityPub server framework

63 lines (62 loc) 2.08 kB
/// <reference lib="esnext.temporal" /> import { $ as ActorAliasMapper, St as WebFingerLinksDispatcher, et as ActorDispatcher, l as RequestContext, tt as ActorHandleMapper } from "./context-BU-1O90h.js"; import { Span, Tracer } from "@opentelemetry/api"; //#region src/federation/webfinger.d.ts /** * Parameters for {@link handleWebFinger}. */ interface WebFingerHandlerParameters<TContextData> { /** * The request context. */ context: RequestContext<TContextData>; /** * The canonical hostname of the server, if it's explicitly configured. * @since 1.5.0 */ host?: string; /** * The callback for dispatching the actor. */ actorDispatcher?: ActorDispatcher<TContextData>; /** * The callback for mapping a WebFinger username to the corresponding actor's * internal identifier, or `null` if the username is not found. * @since 0.15.0 */ actorHandleMapper?: ActorHandleMapper<TContextData>; /** * The callback for mapping a WebFinger query to the corresponding actor's * internal identifier or username, or `null` if the query is not found. * @since 1.4.0 */ actorAliasMapper?: ActorAliasMapper<TContextData>; /** * The callback for dispatching the Links of webFinger. */ webFingerLinksDispatcher?: WebFingerLinksDispatcher<TContextData>; /** * The function to call when the actor is not found. */ onNotFound(request: Request): Response | Promise<Response>; /** * The OpenTelemetry tracer. * @since 1.3.0 */ tracer?: Tracer; /** * The span for the request. * @since 1.3.0 */ span?: Span; } /** * Handles a WebFinger request. You would not typically call this function * directly, but instead use {@link Federation.fetch} method. * @param request The WebFinger request to handle. * @param parameters The parameters for handling the request. * @returns The response to the request. */ declare function handleWebFinger<TContextData>(request: Request, options: WebFingerHandlerParameters<TContextData>): Promise<Response>; //#endregion export { handleWebFinger as n, WebFingerHandlerParameters as t };