supertokens-node
Version:
NodeJS driver for SuperTokens core
31 lines (30 loc) • 1.27 kB
TypeScript
// @ts-nocheck
import error from "../../error";
import type { BaseRequest, BaseResponse } from "../../framework";
import normalisedURLPath from "../../normalisedURLPath";
import RecipeModule from "../../recipeModule";
import { APIHandled, HTTPMethod, NormalisedAppinfo, RecipeListFunction } from "../../types";
import { RecipeInterface, TypeInput, TypeNormalisedInput } from "./types";
export default class Recipe extends RecipeModule {
static RECIPE_ID: "usermetadata";
private static instance;
config: TypeNormalisedInput;
recipeInterfaceImpl: RecipeInterface;
isInServerlessEnv: boolean;
constructor(recipeId: string, appInfo: NormalisedAppinfo, isInServerlessEnv: boolean, config?: TypeInput);
static getInstanceOrThrowError(): Recipe;
static init(config?: TypeInput): RecipeListFunction;
static reset(): void;
getAPIsHandled(): APIHandled[];
handleAPIRequest: (
_: string,
_tenantId: string | undefined,
__: BaseRequest,
___: BaseResponse,
____: normalisedURLPath,
_____: HTTPMethod
) => Promise<boolean>;
handleError(error: error, _: BaseRequest, __: BaseResponse): Promise<void>;
getAllCORSHeaders(): string[];
isErrorFromThisRecipe(err: any): err is error;
}