supertokens-node
Version:
NodeJS driver for SuperTokens core
25 lines (24 loc) • 1.3 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";
import type SuperTokens from "../../supertokens";
export default class Recipe extends RecipeModule {
static RECIPE_ID: "usermetadata";
private static instance;
config: TypeNormalisedInput;
recipeInterfaceImpl: RecipeInterface;
isInServerlessEnv: boolean;
constructor(stInstance: SuperTokens, 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;
}