supertokens-node
Version:
NodeJS driver for SuperTokens core
79 lines (78 loc) • 2.7 kB
TypeScript
// @ts-nocheck
import Recipe from "./recipe";
import SuperTokensError from "./error";
import { RecipeInterface, APIInterface, APIOptions, TypeProvider } from "./types";
import { SessionContainerInterface } from "../session/types";
import { User } from "../../types";
import RecipeUserId from "../../recipeUserId";
export default class Wrapper {
static init: typeof Recipe.init;
static Error: typeof SuperTokensError;
static getProvider(
tenantId: string,
thirdPartyId: string,
clientType: string | undefined,
userContext?: Record<string, any>
): Promise<TypeProvider | undefined>;
static manuallyCreateOrUpdateUser(
tenantId: string,
thirdPartyId: string,
thirdPartyUserId: string,
email: string,
isVerified: boolean,
session?: undefined,
userContext?: Record<string, any>
): Promise<
| {
status: "OK";
createdNewRecipeUser: boolean;
user: User;
recipeUserId: RecipeUserId;
}
| {
status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR";
reason: string;
}
| {
status: "SIGN_IN_UP_NOT_ALLOWED";
reason: string;
}
>;
static manuallyCreateOrUpdateUser(
tenantId: string,
thirdPartyId: string,
thirdPartyUserId: string,
email: string,
isVerified: boolean,
session: SessionContainerInterface,
userContext?: Record<string, any>
): Promise<
| {
status: "OK";
createdNewRecipeUser: boolean;
user: User;
recipeUserId: RecipeUserId;
}
| {
status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR";
reason: string;
}
| {
status: "SIGN_IN_UP_NOT_ALLOWED";
reason: string;
}
| {
status: "LINKING_TO_SESSION_USER_FAILED";
reason:
| "EMAIL_VERIFICATION_REQUIRED"
| "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
| "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
| "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
}
>;
}
export declare let init: typeof Recipe.init;
export declare let Error: typeof SuperTokensError;
export declare let getProvider: typeof Wrapper.getProvider;
export declare let manuallyCreateOrUpdateUser: typeof Wrapper.manuallyCreateOrUpdateUser;
export type { RecipeInterface, APIInterface, APIOptions, TypeProvider };