import { InjectionToken, OptionalFactoryDependency, ModuleMetadata, Type, ExecutionContext, } from '@nestjs/common' import { VerifySessionOptions, getSession, } from 'supertokens-node/recipe/session' import { FastifyAdapter } from '@nestjs/platform-fastify' import { TypeInput } from 'supertokens-node/types' import { ExecutionContextHost } from '@nestjs/core/helpers/execution-context-host' export type SuperTokensModuleOptions = TypeInput & { framework: 'express' | 'fastify' fastifyAdapter?: FastifyAdapter } export interface SuperTokensModuleOptionsFactory { createSuperTokensModuleOptions(): | Promise | SuperTokensModuleOptions } export interface SuperTokensModuleAsyncOptions extends Pick { global?: boolean useExisting?: Type useClass?: Type useFactory?: ( ...args: any[] ) => Promise | SuperTokensModuleOptions inject?: (InjectionToken | OptionalFactoryDependency)[] } export type SuperTokensSession = Awaited> export type VerifySessionDecoratorOptions = { options?: VerifySessionOptions roles?: string[] permissions?: string[] requireEmailVerification?: boolean requireMFA?: boolean } export type ContextDataExtractor = (ctx: ExecutionContext) => { request: any response: any }