mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import type { Operation } from '../../../ldp/operations/Operation';
|
|
import type { Interaction, InteractionHandlerResult } from '../email-password/handler/InteractionHandler';
|
|
|
|
export type TemplatedInteractionResult = InteractionHandlerResult & {
|
|
templateFiles: Record<string, string>;
|
|
};
|
|
|
|
/**
|
|
* Handles the routing behaviour for IDP handlers.
|
|
*/
|
|
export interface InteractionRoute {
|
|
/**
|
|
* Returns the control fields that should be added to response objects.
|
|
* Keys are control names, values are relative URL paths.
|
|
*/
|
|
getControls: () => Record<string, string>;
|
|
|
|
/**
|
|
* If this route supports the given path.
|
|
* @param path - Relative URL path.
|
|
* @param prompt - Session prompt if there is one.
|
|
*/
|
|
supportsPath: (path: string, prompt?: string) => boolean;
|
|
|
|
/**
|
|
* Handles the given operation.
|
|
* @param operation - Operation to handle.
|
|
* @param oidcInteraction - Interaction if there is one.
|
|
*
|
|
* @returns InteractionHandlerResult appended with relevant template files.
|
|
*/
|
|
handleOperation: (operation: Operation, oidcInteraction?: Interaction) => Promise<TemplatedInteractionResult>;
|
|
}
|