supertokens-node
Version:
NodeJS driver for SuperTokens core
24 lines (23 loc) • 1.38 kB
TypeScript
import RecipeModule from "../../recipeModule";
import { TypeInput, TypeNormalisedInput } from "./types";
import { NormalisedAppinfo, APIHandled, RecipeListFunction, HTTPMethod } from "../../types";
import * as express from "express";
import STError from "./error";
import NormalisedURLPath from "../../normalisedURLPath";
export default class Recipe extends RecipeModule {
private static instance;
static RECIPE_ID: string;
config: TypeNormalisedInput;
constructor(recipeId: string, appInfo: NormalisedAppinfo, isInServerlessEnv: boolean, config: TypeInput);
static getInstanceOrThrowError(): Recipe;
static init(config: TypeInput): RecipeListFunction;
static reset(): void;
getAPIsHandled: () => APIHandled[];
handleAPIRequest: (id: string, req: express.Request, res: express.Response, next: express.NextFunction, _: NormalisedURLPath, __: HTTPMethod) => Promise<void>;
handleError: (err: STError, _: express.Request, response: express.Response, next: express.NextFunction) => void;
getAllCORSHeaders: () => string[];
isErrorFromThisOrChildRecipeBasedOnInstance: (err: any) => err is STError;
createEmailVerificationToken: (userId: string, email: string) => Promise<string>;
verifyEmailUsingToken: (token: string) => Promise<import("./types").User>;
isEmailVerified: (userId: string, email: string) => Promise<boolean>;
}