From 8b2aa24c0066f16616b94ac7d4e8c56483ab4fab Mon Sep 17 00:00:00 2001 From: Mayank Thakur Date: Mon, 13 Nov 2023 15:29:59 +0530 Subject: [PATCH 1/4] feat: added `networkInterceptor` hook (#738) * feat: added network_interceptor hook this hook can be used to capture all requests sent to the core * updated changelog and bumped version * updated changelog * fix: made userContext last argument * adds missing user context * refactor: make userContext last param in all functions * refactor: make userContext last param in all functions --------- Co-authored-by: rishabhpoddar --- CHANGELOG.md | 6 + lib/build/framework/fastify/index.d.ts | 11 +- lib/build/framework/utils.d.ts | 2 +- lib/build/index.d.ts | 8 +- lib/build/index.js | 24 +-- lib/build/querier.d.ts | 17 +- lib/build/querier.js | 100 +++++++++- .../accountlinking/recipeImplementation.js | 67 ++++--- lib/build/recipe/dashboard/api/analytics.d.ts | 7 +- lib/build/recipe/dashboard/api/analytics.js | 4 +- .../recipe/dashboard/api/search/tagsGet.d.ts | 2 +- .../recipe/dashboard/api/search/tagsGet.js | 8 +- lib/build/recipe/dashboard/api/signIn.d.ts | 2 +- lib/build/recipe/dashboard/api/signIn.js | 14 +- lib/build/recipe/dashboard/api/signOut.d.ts | 2 +- lib/build/recipe/dashboard/api/signOut.js | 5 +- .../recipe/dashboard/recipeImplementation.js | 3 +- .../emailpassword/recipeImplementation.js | 19 +- .../emailverification/recipeImplementation.js | 37 ++-- lib/build/recipe/jwt/recipeImplementation.js | 25 ++- .../multitenancy/recipeImplementation.js | 40 ++-- .../passwordless/recipeImplementation.js | 30 ++- .../recipe/session/recipeImplementation.js | 48 +++-- .../recipe/session/sessionFunctions.d.ts | 38 ++-- lib/build/recipe/session/sessionFunctions.js | 94 +++++---- .../recipe/thirdparty/recipeImplementation.js | 3 +- .../usermetadata/recipeImplementation.js | 34 ++-- .../recipe/userroles/recipeImplementation.js | 70 ++++--- lib/build/supertokens.d.ts | 10 +- lib/build/supertokens.js | 55 ++++-- lib/build/types.d.ts | 11 ++ lib/build/version.d.ts | 2 +- lib/build/version.js | 2 +- lib/ts/index.ts | 19 +- lib/ts/querier.ts | 109 +++++++++- .../accountlinking/recipeImplementation.ts | 100 +++++++--- lib/ts/recipe/dashboard/api/analytics.ts | 4 +- lib/ts/recipe/dashboard/api/search/tagsGet.ts | 4 +- lib/ts/recipe/dashboard/api/signIn.ts | 5 +- lib/ts/recipe/dashboard/api/signOut.ts | 10 +- .../recipe/dashboard/recipeImplementation.ts | 3 +- .../emailpassword/recipeImplementation.ts | 19 +- .../emailverification/recipeImplementation.ts | 39 ++-- lib/ts/recipe/jwt/recipeImplementation.ts | 25 ++- .../multitenancy/recipeImplementation.ts | 59 ++++-- .../passwordless/recipeImplementation.ts | 30 ++- lib/ts/recipe/session/recipeImplementation.ts | 68 +++++-- lib/ts/recipe/session/sessionFunctions.ts | 135 +++++++++---- .../recipe/thirdparty/recipeImplementation.ts | 14 +- .../usermetadata/recipeImplementation.ts | 30 +-- .../recipe/userroles/recipeImplementation.ts | 58 +++--- lib/ts/supertokens.ts | 68 ++++--- lib/ts/types.ts | 11 ++ lib/ts/version.ts | 2 +- package-lock.json | 4 +- package.json | 2 +- test/interceptor.test.js | 187 ++++++++++++++++++ 57 files changed, 1330 insertions(+), 475 deletions(-) create mode 100644 test/interceptor.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 227c47f9f..7dc9739ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) +## [16.5.0] - 2023-11-10 + +- Added `networkInterceptor` to the `TypeInput` config. + - This can be used to capture/modify all the HTTP requests sent to the core. + - Closes the issue - https://github.com/supertokens/supertokens-core/issues/865 + ## [16.4.0] - 2023-10-26 - Added `debug` property to `TypeInput`. When set to `true`, it will enable debug logs. diff --git a/lib/build/framework/fastify/index.d.ts b/lib/build/framework/fastify/index.d.ts index 3cca3a1a2..fb2d3fe21 100644 --- a/lib/build/framework/fastify/index.d.ts +++ b/lib/build/framework/fastify/index.d.ts @@ -1,18 +1,21 @@ // @ts-nocheck /// export type { SessionRequest } from "./framework"; -export declare const plugin: import("fastify").FastifyPluginCallback, import("http").Server>; +export declare const plugin: import("fastify").FastifyPluginCallback< + Record, + import("fastify").RawServerDefault +>; export declare const errorHandler: () => ( err: any, req: import("fastify").FastifyRequest< import("fastify/types/route").RouteGenericInterface, - import("http").Server, + import("fastify").RawServerDefault, import("http").IncomingMessage >, res: import("fastify").FastifyReply< - import("http").Server, + import("fastify").RawServerDefault, import("http").IncomingMessage, - import("http").ServerResponse, + import("http").ServerResponse, import("fastify/types/route").RouteGenericInterface, unknown > diff --git a/lib/build/framework/utils.d.ts b/lib/build/framework/utils.d.ts index 636a97724..123ddf23c 100644 --- a/lib/build/framework/utils.d.ts +++ b/lib/build/framework/utils.d.ts @@ -45,7 +45,7 @@ export declare function setCookieForServerResponse( expires: number, path: string, sameSite: "strict" | "lax" | "none" -): ServerResponse; +): ServerResponse; export declare function getCookieValueToSetInHeader( prev: string | string[] | undefined, val: string | string[], diff --git a/lib/build/index.d.ts b/lib/build/index.d.ts index 4c093b659..179c163ce 100644 --- a/lib/build/index.d.ts +++ b/lib/build/index.d.ts @@ -11,7 +11,7 @@ export default class SuperTokensWrapper { static RecipeUserId: typeof RecipeUserId; static User: typeof User; static getAllCORSHeaders(): string[]; - static getUserCount(includeRecipeIds?: string[], tenantId?: string): Promise; + static getUserCount(includeRecipeIds?: string[], tenantId?: string, userContext?: any): Promise; static getUsersOldestFirst(input: { tenantId: string; limit?: number; @@ -20,6 +20,7 @@ export default class SuperTokensWrapper { query?: { [key: string]: string; }; + userContext?: any; }): Promise<{ users: UserType[]; nextPaginationToken?: string; @@ -32,6 +33,7 @@ export default class SuperTokensWrapper { query?: { [key: string]: string; }; + userContext?: any; }): Promise<{ users: UserType[]; nextPaginationToken?: string; @@ -41,6 +43,7 @@ export default class SuperTokensWrapper { externalUserId: string; externalUserIdInfo?: string; force?: boolean; + userContext?: any; }): Promise< | { status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR"; @@ -54,6 +57,7 @@ export default class SuperTokensWrapper { static getUserIdMapping(input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; + userContext?: any; }): Promise< | { status: "OK"; @@ -69,6 +73,7 @@ export default class SuperTokensWrapper { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; force?: boolean; + userContext?: any; }): Promise<{ status: "OK"; didMappingExist: boolean; @@ -77,6 +82,7 @@ export default class SuperTokensWrapper { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; externalUserIdInfo?: string; + userContext?: any; }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR"; }>; diff --git a/lib/build/index.js b/lib/build/index.js index 520f598a1..4d4d88e22 100644 --- a/lib/build/index.js +++ b/lib/build/index.js @@ -30,22 +30,22 @@ class SuperTokensWrapper { static getAllCORSHeaders() { return supertokens_1.default.getInstanceOrThrowError().getAllCORSHeaders(); } - static getUserCount(includeRecipeIds, tenantId) { - return supertokens_1.default.getInstanceOrThrowError().getUserCount(includeRecipeIds, tenantId); + static getUserCount(includeRecipeIds, tenantId, userContext) { + return supertokens_1.default.getInstanceOrThrowError().getUserCount(includeRecipeIds, tenantId, userContext); } static getUsersOldestFirst(input) { - return recipe_1.default - .getInstance() - .recipeInterfaceImpl.getUsers( - Object.assign(Object.assign({ timeJoinedOrder: "ASC" }, input), { userContext: undefined }) - ); + return recipe_1.default.getInstance().recipeInterfaceImpl.getUsers( + Object.assign(Object.assign({ timeJoinedOrder: "ASC" }, input), { + userContext: input.userContext === undefined ? {} : input.userContext, + }) + ); } static getUsersNewestFirst(input) { - return recipe_1.default - .getInstance() - .recipeInterfaceImpl.getUsers( - Object.assign(Object.assign({ timeJoinedOrder: "DESC" }, input), { userContext: undefined }) - ); + return recipe_1.default.getInstance().recipeInterfaceImpl.getUsers( + Object.assign(Object.assign({ timeJoinedOrder: "DESC" }, input), { + userContext: input.userContext === undefined ? {} : input.userContext, + }) + ); } static createUserIdMapping(input) { return supertokens_1.default.getInstanceOrThrowError().createUserIdMapping(input); diff --git a/lib/build/querier.d.ts b/lib/build/querier.d.ts index ebbac9669..51ab36d5f 100644 --- a/lib/build/querier.d.ts +++ b/lib/build/querier.d.ts @@ -1,6 +1,7 @@ // @ts-nocheck import NormalisedURLDomain from "./normalisedURLDomain"; import NormalisedURLPath from "./normalisedURLPath"; +import { NetworkInterceptor } from "./types"; export declare class Querier { private static initCalled; private static hosts; @@ -8,6 +9,7 @@ export declare class Querier { private static apiVersion; private static lastTriedIndex; private static hostsAliveForTesting; + private static networkInterceptor; private __hosts; private rIdToCore; private constructor(); @@ -20,22 +22,25 @@ export declare class Querier { domain: NormalisedURLDomain; basePath: NormalisedURLPath; }[], - apiKey?: string + apiKey?: string, + networkInterceptor?: NetworkInterceptor ): void; - sendPostRequest: (path: NormalisedURLPath, body: any) => Promise; - sendDeleteRequest: (path: NormalisedURLPath, body: any, params?: any) => Promise; + sendPostRequest: (path: NormalisedURLPath, body: any, userContext: any) => Promise; + sendDeleteRequest: (path: NormalisedURLPath, body: any, params: any, userContext: any) => Promise; sendGetRequest: ( path: NormalisedURLPath, - params: Record + params: Record, + userContext: any ) => Promise; sendGetRequestWithResponseHeaders: ( path: NormalisedURLPath, - params: Record + params: Record, + userContext: any ) => Promise<{ body: any; headers: Headers; }>; - sendPutRequest: (path: NormalisedURLPath, body: any) => Promise; + sendPutRequest: (path: NormalisedURLPath, body: any, userContext: any) => Promise; getAllCoreUrlsForPath(path: string): string[]; private sendRequestHelper; } diff --git a/lib/build/querier.js b/lib/build/querier.js index 9daa21bb8..78e4e9fc4 100644 --- a/lib/build/querier.js +++ b/lib/build/querier.js @@ -25,6 +25,7 @@ const version_1 = require("./version"); const normalisedURLPath_1 = __importDefault(require("./normalisedURLPath")); const processState_1 = require("./processState"); const constants_1 = require("./constants"); +const logger_1 = require("./logger"); class Querier { // we have rIdToCore so that recipes can force change the rId sent to core. This is a hack until the core is able // to support multiple rIds per API @@ -75,7 +76,7 @@ class Querier { return Querier.hostsAliveForTesting; }; // path should start with "/" - this.sendPostRequest = async (path, body) => { + this.sendPostRequest = async (path, body, userContext) => { var _a; const { body: respBody } = await this.sendRequestHelper( path, @@ -92,6 +93,22 @@ class Querier { if (path.isARecipePath() && this.rIdToCore !== undefined) { headers = Object.assign(Object.assign({}, headers), { rid: this.rIdToCore }); } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "post", + headers: headers, + body: body, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.body !== undefined) { + body = request.body; + } + } return utils_1.doFetch(url, { method: "POST", body: body !== undefined ? JSON.stringify(body) : undefined, @@ -103,7 +120,7 @@ class Querier { return respBody; }; // path should start with "/" - this.sendDeleteRequest = async (path, body, params) => { + this.sendDeleteRequest = async (path, body, params, userContext) => { var _a; const { body: respBody } = await this.sendRequestHelper( path, @@ -117,6 +134,26 @@ class Querier { if (path.isARecipePath() && this.rIdToCore !== undefined) { headers = Object.assign(Object.assign({}, headers), { rid: this.rIdToCore }); } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "delete", + headers: headers, + params: params, + body: body, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.body !== undefined) { + body = request.body; + } + if (request.params !== undefined) { + params = request.params; + } + } const finalURL = new URL(url); const searchParams = new URLSearchParams(params); finalURL.search = searchParams.toString(); @@ -131,7 +168,7 @@ class Querier { return respBody; }; // path should start with "/" - this.sendGetRequest = async (path, params) => { + this.sendGetRequest = async (path, params, userContext) => { var _a; const { body: respBody } = await this.sendRequestHelper( path, @@ -145,6 +182,22 @@ class Querier { if (path.isARecipePath() && this.rIdToCore !== undefined) { headers = Object.assign(Object.assign({}, headers), { rid: this.rIdToCore }); } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "get", + headers: headers, + params: params, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.params !== undefined) { + params = request.params; + } + } const finalURL = new URL(url); const searchParams = new URLSearchParams( Object.entries(params).filter(([_, value]) => value !== undefined) @@ -159,7 +212,7 @@ class Querier { ); return respBody; }; - this.sendGetRequestWithResponseHeaders = async (path, params) => { + this.sendGetRequestWithResponseHeaders = async (path, params, userContext) => { var _a; return await this.sendRequestHelper( path, @@ -173,6 +226,22 @@ class Querier { if (path.isARecipePath() && this.rIdToCore !== undefined) { headers = Object.assign(Object.assign({}, headers), { rid: this.rIdToCore }); } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "get", + headers: headers, + params: params, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.params !== undefined) { + params = request.params; + } + } const finalURL = new URL(url); const searchParams = new URLSearchParams( Object.entries(params).filter(([_, value]) => value !== undefined) @@ -187,7 +256,7 @@ class Querier { ); }; // path should start with "/" - this.sendPutRequest = async (path, body) => { + this.sendPutRequest = async (path, body, userContext) => { var _a; const { body: respBody } = await this.sendRequestHelper( path, @@ -201,6 +270,22 @@ class Querier { if (path.isARecipePath() && this.rIdToCore !== undefined) { headers = Object.assign(Object.assign({}, headers), { rid: this.rIdToCore }); } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "put", + headers: headers, + body: body, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.body !== undefined) { + body = request.body; + } + } return utils_1.doFetch(url, { method: "PUT", body: body !== undefined ? JSON.stringify(body) : undefined, @@ -302,14 +387,16 @@ class Querier { } return new Querier(Querier.hosts, rIdToCore); } - static init(hosts, apiKey) { + static init(hosts, apiKey, networkInterceptor) { if (!Querier.initCalled) { + logger_1.logDebugMessage("querier initialized"); Querier.initCalled = true; Querier.hosts = hosts; Querier.apiKey = apiKey; Querier.apiVersion = undefined; Querier.lastTriedIndex = 0; Querier.hostsAliveForTesting = new Set(); + Querier.networkInterceptor = networkInterceptor; } } getAllCoreUrlsForPath(path) { @@ -331,3 +418,4 @@ Querier.apiKey = undefined; Querier.apiVersion = undefined; Querier.lastTriedIndex = 0; Querier.hostsAliveForTesting = new Set(); +Querier.networkInterceptor = undefined; diff --git a/lib/build/recipe/accountlinking/recipeImplementation.js b/lib/build/recipe/accountlinking/recipeImplementation.js index 16c7fb2f8..55774660f 100644 --- a/lib/build/recipe/accountlinking/recipeImplementation.js +++ b/lib/build/recipe/accountlinking/recipeImplementation.js @@ -23,7 +23,15 @@ const normalisedURLPath_1 = __importDefault(require("../../normalisedURLPath")); const user_1 = require("../../user"); function getRecipeImplementation(querier, config, recipeInstance) { return { - getUsers: async function ({ tenantId, timeJoinedOrder, limit, paginationToken, includeRecipeIds, query }) { + getUsers: async function ({ + tenantId, + timeJoinedOrder, + limit, + paginationToken, + includeRecipeIds, + query, + userContext, + }) { let includeRecipeIdsStr = undefined; if (includeRecipeIds !== undefined) { includeRecipeIdsStr = includeRecipeIds.join(","); @@ -40,40 +48,44 @@ function getRecipeImplementation(querier, config, recipeInstance) { paginationToken: paginationToken, }, query - ) + ), + userContext ); return { users: response.users.map((u) => new user_1.User(u)), nextPaginationToken: response.nextPaginationToken, }; }, - canCreatePrimaryUser: async function ({ recipeUserId }) { + canCreatePrimaryUser: async function ({ recipeUserId, userContext }) { return await querier.sendGetRequest( new normalisedURLPath_1.default("/recipe/accountlinking/user/primary/check"), { recipeUserId: recipeUserId.getAsString(), - } + }, + userContext ); }, - createPrimaryUser: async function ({ recipeUserId }) { + createPrimaryUser: async function ({ recipeUserId, userContext }) { let response = await querier.sendPostRequest( new normalisedURLPath_1.default("/recipe/accountlinking/user/primary"), { recipeUserId: recipeUserId.getAsString(), - } + }, + userContext ); if (response.status === "OK") { response.user = new user_1.User(response.user); } return response; }, - canLinkAccounts: async function ({ recipeUserId, primaryUserId }) { + canLinkAccounts: async function ({ recipeUserId, primaryUserId, userContext }) { let result = await querier.sendGetRequest( new normalisedURLPath_1.default("/recipe/accountlinking/user/link/check"), { recipeUserId: recipeUserId.getAsString(), primaryUserId, - } + }, + userContext ); return result; }, @@ -83,7 +95,8 @@ function getRecipeImplementation(querier, config, recipeInstance) { { recipeUserId: recipeUserId.getAsString(), primaryUserId, - } + }, + userContext ); if ( ["OK", "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"].includes( @@ -120,25 +133,30 @@ function getRecipeImplementation(querier, config, recipeInstance) { } return accountsLinkingResult; }, - unlinkAccount: async function ({ recipeUserId }) { + unlinkAccount: async function ({ recipeUserId, userContext }) { let accountsUnlinkingResult = await querier.sendPostRequest( new normalisedURLPath_1.default("/recipe/accountlinking/user/unlink"), { recipeUserId: recipeUserId.getAsString(), - } + }, + userContext ); return accountsUnlinkingResult; }, - getUser: async function ({ userId }) { - let result = await querier.sendGetRequest(new normalisedURLPath_1.default("/user/id"), { - userId, - }); + getUser: async function ({ userId, userContext }) { + let result = await querier.sendGetRequest( + new normalisedURLPath_1.default("/user/id"), + { + userId, + }, + userContext + ); if (result.status === "OK") { return new user_1.User(result.user); } return undefined; }, - listUsersByAccountInfo: async function ({ tenantId, accountInfo, doUnionOfAccountInfo }) { + listUsersByAccountInfo: async function ({ tenantId, accountInfo, doUnionOfAccountInfo, userContext }) { var _a, _b; let result = await querier.sendGetRequest( new normalisedURLPath_1.default( @@ -150,15 +168,20 @@ function getRecipeImplementation(querier, config, recipeInstance) { thirdPartyId: (_a = accountInfo.thirdParty) === null || _a === void 0 ? void 0 : _a.id, thirdPartyUserId: (_b = accountInfo.thirdParty) === null || _b === void 0 ? void 0 : _b.userId, doUnionOfAccountInfo, - } + }, + userContext ); return result.users.map((u) => new user_1.User(u)); }, - deleteUser: async function ({ userId, removeAllLinkedAccounts }) { - return await querier.sendPostRequest(new normalisedURLPath_1.default("/user/remove"), { - userId, - removeAllLinkedAccounts, - }); + deleteUser: async function ({ userId, removeAllLinkedAccounts, userContext }) { + return await querier.sendPostRequest( + new normalisedURLPath_1.default("/user/remove"), + { + userId, + removeAllLinkedAccounts, + }, + userContext + ); }, }; } diff --git a/lib/build/recipe/dashboard/api/analytics.d.ts b/lib/build/recipe/dashboard/api/analytics.d.ts index 80f1121b8..0c7cca8f9 100644 --- a/lib/build/recipe/dashboard/api/analytics.d.ts +++ b/lib/build/recipe/dashboard/api/analytics.d.ts @@ -3,4 +3,9 @@ import { APIInterface, APIOptions } from "../types"; export declare type Response = { status: "OK"; }; -export default function analyticsPost(_: APIInterface, ___: string, options: APIOptions, __: any): Promise; +export default function analyticsPost( + _: APIInterface, + ___: string, + options: APIOptions, + userContext: any +): Promise; diff --git a/lib/build/recipe/dashboard/api/analytics.js b/lib/build/recipe/dashboard/api/analytics.js index 1a4dba3db..2a3652198 100644 --- a/lib/build/recipe/dashboard/api/analytics.js +++ b/lib/build/recipe/dashboard/api/analytics.js @@ -25,7 +25,7 @@ const normalisedURLPath_1 = __importDefault(require("../../../normalisedURLPath" const version_1 = require("../../../version"); const error_1 = __importDefault(require("../../../error")); const utils_1 = require("../../../utils"); -async function analyticsPost(_, ___, options, __) { +async function analyticsPost(_, ___, options, userContext) { // If telemetry is disabled, dont send any event if (!supertokens_1.default.getInstanceOrThrowError().telemetryEnabled) { return { @@ -49,7 +49,7 @@ async function analyticsPost(_, ___, options, __) { let numberOfUsers; try { let querier = querier_1.Querier.getNewInstanceOrThrowError(options.recipeId); - let response = await querier.sendGetRequest(new normalisedURLPath_1.default("/telemetry"), {}); + let response = await querier.sendGetRequest(new normalisedURLPath_1.default("/telemetry"), {}, userContext); if (response.exists) { telemetryId = response.telemetryId; } diff --git a/lib/build/recipe/dashboard/api/search/tagsGet.d.ts b/lib/build/recipe/dashboard/api/search/tagsGet.d.ts index 537d69be1..1e12e1107 100644 --- a/lib/build/recipe/dashboard/api/search/tagsGet.d.ts +++ b/lib/build/recipe/dashboard/api/search/tagsGet.d.ts @@ -8,6 +8,6 @@ export declare const getSearchTags: ( _: APIInterface, ___: string, options: APIOptions, - __: any + userContext: any ) => Promise; export {}; diff --git a/lib/build/recipe/dashboard/api/search/tagsGet.js b/lib/build/recipe/dashboard/api/search/tagsGet.js index 977f7dc11..06c87156f 100644 --- a/lib/build/recipe/dashboard/api/search/tagsGet.js +++ b/lib/build/recipe/dashboard/api/search/tagsGet.js @@ -22,9 +22,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.getSearchTags = void 0; const querier_1 = require("../../../../querier"); const normalisedURLPath_1 = __importDefault(require("../../../../normalisedURLPath")); -const getSearchTags = async (_, ___, options, __) => { +const getSearchTags = async (_, ___, options, userContext) => { let querier = querier_1.Querier.getNewInstanceOrThrowError(options.recipeId); - let tagsResponse = await querier.sendGetRequest(new normalisedURLPath_1.default("/user/search/tags"), {}); + let tagsResponse = await querier.sendGetRequest( + new normalisedURLPath_1.default("/user/search/tags"), + {}, + userContext + ); return tagsResponse; }; exports.getSearchTags = getSearchTags; diff --git a/lib/build/recipe/dashboard/api/signIn.d.ts b/lib/build/recipe/dashboard/api/signIn.d.ts index a83e52a9b..7bf92bacc 100644 --- a/lib/build/recipe/dashboard/api/signIn.d.ts +++ b/lib/build/recipe/dashboard/api/signIn.d.ts @@ -1,3 +1,3 @@ // @ts-nocheck import { APIInterface, APIOptions } from "../types"; -export default function signIn(_: APIInterface, options: APIOptions, __: any): Promise; +export default function signIn(_: APIInterface, options: APIOptions, userContext: any): Promise; diff --git a/lib/build/recipe/dashboard/api/signIn.js b/lib/build/recipe/dashboard/api/signIn.js index 9f5e59bde..5f52060a2 100644 --- a/lib/build/recipe/dashboard/api/signIn.js +++ b/lib/build/recipe/dashboard/api/signIn.js @@ -23,7 +23,7 @@ const utils_1 = require("../../../utils"); const error_1 = __importDefault(require("../../../error")); const querier_1 = require("../../../querier"); const normalisedURLPath_1 = __importDefault(require("../../../normalisedURLPath")); -async function signIn(_, options, __) { +async function signIn(_, options, userContext) { const { email, password } = await options.req.getJSONBody(); if (email === undefined) { throw new error_1.default({ @@ -38,10 +38,14 @@ async function signIn(_, options, __) { }); } let querier = querier_1.Querier.getNewInstanceOrThrowError(undefined); - const signInResponse = await querier.sendPostRequest(new normalisedURLPath_1.default("/recipe/dashboard/signin"), { - email, - password, - }); + const signInResponse = await querier.sendPostRequest( + new normalisedURLPath_1.default("/recipe/dashboard/signin"), + { + email, + password, + }, + userContext + ); utils_1.send200Response(options.res, signInResponse); return true; } diff --git a/lib/build/recipe/dashboard/api/signOut.d.ts b/lib/build/recipe/dashboard/api/signOut.d.ts index 860f728b6..9e17486be 100644 --- a/lib/build/recipe/dashboard/api/signOut.d.ts +++ b/lib/build/recipe/dashboard/api/signOut.d.ts @@ -1,3 +1,3 @@ // @ts-nocheck import { APIInterface, APIOptions } from "../types"; -export default function signOut(_: APIInterface, ___: string, options: APIOptions, __: any): Promise; +export default function signOut(_: APIInterface, ___: string, options: APIOptions, userContext: any): Promise; diff --git a/lib/build/recipe/dashboard/api/signOut.js b/lib/build/recipe/dashboard/api/signOut.js index 0ae152417..48e0d22fa 100644 --- a/lib/build/recipe/dashboard/api/signOut.js +++ b/lib/build/recipe/dashboard/api/signOut.js @@ -22,7 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("../../../utils"); const querier_1 = require("../../../querier"); const normalisedURLPath_1 = __importDefault(require("../../../normalisedURLPath")); -async function signOut(_, ___, options, __) { +async function signOut(_, ___, options, userContext) { var _a; if (options.config.authMode === "api-key") { utils_1.send200Response(options.res, { status: "OK" }); @@ -33,7 +33,8 @@ async function signOut(_, ___, options, __) { const sessionDeleteResponse = await querier.sendDeleteRequest( new normalisedURLPath_1.default("/recipe/dashboard/session"), {}, - { sessionId: sessionIdFormAuthHeader } + { sessionId: sessionIdFormAuthHeader }, + userContext ); utils_1.send200Response(options.res, sessionDeleteResponse); } diff --git a/lib/build/recipe/dashboard/recipeImplementation.js b/lib/build/recipe/dashboard/recipeImplementation.js index d31e33aa2..9ad3fa57c 100644 --- a/lib/build/recipe/dashboard/recipeImplementation.js +++ b/lib/build/recipe/dashboard/recipeImplementation.js @@ -46,7 +46,8 @@ function getRecipeImplementation() { new normalisedURLPath_1.default("/recipe/dashboard/session/verify"), { sessionId: authHeaderValue, - } + }, + input.userContext ); if (sessionVerificationResponse.status !== "OK") { return false; diff --git a/lib/build/recipe/emailpassword/recipeImplementation.js b/lib/build/recipe/emailpassword/recipeImplementation.js index f42372b28..b01a7474b 100644 --- a/lib/build/recipe/emailpassword/recipeImplementation.js +++ b/lib/build/recipe/emailpassword/recipeImplementation.js @@ -43,7 +43,8 @@ function getRecipeInterface(querier, getEmailPasswordConfig) { { email: input.email, password: input.password, - } + }, + input.userContext ); if (resp.status === "OK") { resp.user = new user_1.User(resp.user); @@ -61,7 +62,8 @@ function getRecipeInterface(querier, getEmailPasswordConfig) { { email, password, - } + }, + userContext ); if (response.status === "OK") { response.user = new user_1.User(response.user); @@ -91,7 +93,7 @@ function getRecipeInterface(querier, getEmailPasswordConfig) { } return response; }, - createResetPasswordToken: async function ({ userId, email, tenantId }) { + createResetPasswordToken: async function ({ userId, email, tenantId, userContext }) { // the input user ID can be a recipe or a primary user ID. return await querier.sendPostRequest( new normalisedURLPath_1.default( @@ -102,10 +104,11 @@ function getRecipeInterface(querier, getEmailPasswordConfig) { { userId, email, - } + }, + userContext ); }, - consumePasswordResetToken: async function ({ token, tenantId }) { + consumePasswordResetToken: async function ({ token, tenantId, userContext }) { return await querier.sendPostRequest( new normalisedURLPath_1.default( `/${ @@ -115,7 +118,8 @@ function getRecipeInterface(querier, getEmailPasswordConfig) { { method: "token", token, - } + }, + userContext ); }, updateEmailOrPassword: async function (input) { @@ -144,7 +148,8 @@ function getRecipeInterface(querier, getEmailPasswordConfig) { recipeUserId: input.recipeUserId.getAsString(), email: input.email, password: input.password, - } + }, + input.userContext ); if (response.status === "OK") { const user = await __1.getUser(input.recipeUserId.getAsString(), input.userContext); diff --git a/lib/build/recipe/emailverification/recipeImplementation.js b/lib/build/recipe/emailverification/recipeImplementation.js index 55beaa84f..6722a17ab 100644 --- a/lib/build/recipe/emailverification/recipeImplementation.js +++ b/lib/build/recipe/emailverification/recipeImplementation.js @@ -10,13 +10,14 @@ const recipeUserId_1 = __importDefault(require("../../recipeUserId")); const __1 = require("../.."); function getRecipeInterface(querier, getEmailForRecipeUserId) { return { - createEmailVerificationToken: async function ({ recipeUserId, email, tenantId }) { + createEmailVerificationToken: async function ({ recipeUserId, email, tenantId, userContext }) { let response = await querier.sendPostRequest( new normalisedURLPath_1.default(`/${tenantId}/recipe/user/email/verify/token`), { userId: recipeUserId.getAsString(), email, - } + }, + userContext ); if (response.status === "OK") { return { @@ -35,7 +36,8 @@ function getRecipeInterface(querier, getEmailForRecipeUserId) { { method: "token", token, - } + }, + userContext ); if (response.status === "OK") { const recipeUserId = new recipeUserId_1.default(response.userId); @@ -73,11 +75,15 @@ function getRecipeInterface(querier, getEmailForRecipeUserId) { }; } }, - isEmailVerified: async function ({ recipeUserId, email }) { - let response = await querier.sendGetRequest(new normalisedURLPath_1.default("/recipe/user/email/verify"), { - userId: recipeUserId.getAsString(), - email, - }); + isEmailVerified: async function ({ recipeUserId, email, userContext }) { + let response = await querier.sendGetRequest( + new normalisedURLPath_1.default("/recipe/user/email/verify"), + { + userId: recipeUserId.getAsString(), + email, + }, + userContext + ); return response.isVerified; }, revokeEmailVerificationTokens: async function (input) { @@ -86,15 +92,20 @@ function getRecipeInterface(querier, getEmailForRecipeUserId) { { userId: input.recipeUserId.getAsString(), email: input.email, - } + }, + input.userContext ); return { status: "OK" }; }, unverifyEmail: async function (input) { - await querier.sendPostRequest(new normalisedURLPath_1.default("/recipe/user/email/verify/remove"), { - userId: input.recipeUserId.getAsString(), - email: input.email, - }); + await querier.sendPostRequest( + new normalisedURLPath_1.default("/recipe/user/email/verify/remove"), + { + userId: input.recipeUserId.getAsString(), + email: input.email, + }, + input.userContext + ); return { status: "OK" }; }, }; diff --git a/lib/build/recipe/jwt/recipeImplementation.js b/lib/build/recipe/jwt/recipeImplementation.js index 033ed8467..ef0f75a4f 100644 --- a/lib/build/recipe/jwt/recipeImplementation.js +++ b/lib/build/recipe/jwt/recipeImplementation.js @@ -23,18 +23,22 @@ const normalisedURLPath_1 = __importDefault(require("../../normalisedURLPath")); const defaultJWKSMaxAge = 60; // This corresponds to the dynamicSigningKeyOverlapMS in the core function getRecipeInterface(querier, config, appInfo) { return { - createJWT: async function ({ payload, validitySeconds, useStaticSigningKey }) { + createJWT: async function ({ payload, validitySeconds, useStaticSigningKey, userContext }) { if (validitySeconds === undefined) { // If the user does not provide a validity to this function and the config validity is also undefined, use 100 years (in seconds) validitySeconds = config.jwtValiditySeconds; } - let response = await querier.sendPostRequest(new normalisedURLPath_1.default("/recipe/jwt"), { - payload: payload !== null && payload !== void 0 ? payload : {}, - validity: validitySeconds, - useStaticSigningKey: useStaticSigningKey !== false, - algorithm: "RS256", - jwksDomain: appInfo.apiDomain.getAsStringDangerous(), - }); + let response = await querier.sendPostRequest( + new normalisedURLPath_1.default("/recipe/jwt"), + { + payload: payload !== null && payload !== void 0 ? payload : {}, + validity: validitySeconds, + useStaticSigningKey: useStaticSigningKey !== false, + algorithm: "RS256", + jwksDomain: appInfo.apiDomain.getAsStringDangerous(), + }, + userContext + ); if (response.status === "OK") { return { status: "OK", @@ -46,10 +50,11 @@ function getRecipeInterface(querier, config, appInfo) { }; } }, - getJWKS: async function () { + getJWKS: async function (userContext) { const { body, headers } = await querier.sendGetRequestWithResponseHeaders( new normalisedURLPath_1.default("/.well-known/jwks.json"), - {} + {}, + userContext ); let validityInSeconds = defaultJWKSMaxAge; const cacheControl = headers.get("Cache-Control"); diff --git a/lib/build/recipe/multitenancy/recipeImplementation.js b/lib/build/recipe/multitenancy/recipeImplementation.js index f070db1b2..cee1af3c8 100644 --- a/lib/build/recipe/multitenancy/recipeImplementation.js +++ b/lib/build/recipe/multitenancy/recipeImplementation.js @@ -12,42 +12,46 @@ function getRecipeInterface(querier) { getTenantId: async function ({ tenantIdFromFrontend }) { return tenantIdFromFrontend; }, - createOrUpdateTenant: async function ({ tenantId, config }) { + createOrUpdateTenant: async function ({ tenantId, config, userContext }) { let response = await querier.sendPutRequest( new normalisedURLPath_1.default(`/recipe/multitenancy/tenant`), - Object.assign({ tenantId }, config) + Object.assign({ tenantId }, config), + userContext ); return response; }, - deleteTenant: async function ({ tenantId }) { + deleteTenant: async function ({ tenantId, userContext }) { let response = await querier.sendPostRequest( new normalisedURLPath_1.default(`/recipe/multitenancy/tenant/remove`), { tenantId, - } + }, + userContext ); return response; }, - getTenant: async function ({ tenantId }) { + getTenant: async function ({ tenantId, userContext }) { let response = await querier.sendGetRequest( new normalisedURLPath_1.default( `/${tenantId === undefined ? constants_1.DEFAULT_TENANT_ID : tenantId}/recipe/multitenancy/tenant` ), - {} + {}, + userContext ); if (response.status === "TENANT_NOT_FOUND_ERROR") { return undefined; } return response; }, - listAllTenants: async function () { + listAllTenants: async function ({ userContext }) { let response = await querier.sendGetRequest( new normalisedURLPath_1.default(`/recipe/multitenancy/tenant/list`), - {} + {}, + userContext ); return response; }, - createOrUpdateThirdPartyConfig: async function ({ tenantId, config, skipValidation }) { + createOrUpdateThirdPartyConfig: async function ({ tenantId, config, skipValidation, userContext }) { let response = await querier.sendPutRequest( new normalisedURLPath_1.default( `/${ @@ -57,11 +61,12 @@ function getRecipeInterface(querier) { { config, skipValidation, - } + }, + userContext ); return response; }, - deleteThirdPartyConfig: async function ({ tenantId, thirdPartyId }) { + deleteThirdPartyConfig: async function ({ tenantId, thirdPartyId, userContext }) { let response = await querier.sendPostRequest( new normalisedURLPath_1.default( `/${ @@ -70,11 +75,12 @@ function getRecipeInterface(querier) { ), { thirdPartyId, - } + }, + userContext ); return response; }, - associateUserToTenant: async function ({ tenantId, recipeUserId }) { + associateUserToTenant: async function ({ tenantId, recipeUserId, userContext }) { let response = await querier.sendPostRequest( new normalisedURLPath_1.default( `/${ @@ -83,11 +89,12 @@ function getRecipeInterface(querier) { ), { recipeUserId: recipeUserId.getAsString(), - } + }, + userContext ); return response; }, - disassociateUserFromTenant: async function ({ tenantId, recipeUserId }) { + disassociateUserFromTenant: async function ({ tenantId, recipeUserId, userContext }) { let response = await querier.sendPostRequest( new normalisedURLPath_1.default( `/${ @@ -96,7 +103,8 @@ function getRecipeInterface(querier) { ), { recipeUserId: recipeUserId.getAsString(), - } + }, + userContext ); return response; }, diff --git a/lib/build/recipe/passwordless/recipeImplementation.js b/lib/build/recipe/passwordless/recipeImplementation.js index 85ca9c5b3..b0f7c4082 100644 --- a/lib/build/recipe/passwordless/recipeImplementation.js +++ b/lib/build/recipe/passwordless/recipeImplementation.js @@ -25,7 +25,8 @@ function getRecipeInterface(querier) { consumeCode: async function (input) { let response = await querier.sendPostRequest( new normalisedURLPath_1.default(`/${input.tenantId}/recipe/signinup/code/consume`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); if (response.status !== "OK") { return response; @@ -74,49 +75,56 @@ function getRecipeInterface(querier) { createCode: async function (input) { let response = await querier.sendPostRequest( new normalisedURLPath_1.default(`/${input.tenantId}/recipe/signinup/code`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response; }, createNewCodeForDevice: async function (input) { let response = await querier.sendPostRequest( new normalisedURLPath_1.default(`/${input.tenantId}/recipe/signinup/code`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response; }, listCodesByDeviceId: async function (input) { let response = await querier.sendGetRequest( new normalisedURLPath_1.default(`/${input.tenantId}/recipe/signinup/codes`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response.devices.length === 1 ? response.devices[0] : undefined; }, listCodesByEmail: async function (input) { let response = await querier.sendGetRequest( new normalisedURLPath_1.default(`/${input.tenantId}/recipe/signinup/codes`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response.devices; }, listCodesByPhoneNumber: async function (input) { let response = await querier.sendGetRequest( new normalisedURLPath_1.default(`/${input.tenantId}/recipe/signinup/codes`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response.devices; }, listCodesByPreAuthSessionId: async function (input) { let response = await querier.sendGetRequest( new normalisedURLPath_1.default(`/${input.tenantId}/recipe/signinup/codes`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response.devices.length === 1 ? response.devices[0] : undefined; }, revokeAllCodes: async function (input) { await querier.sendPostRequest( new normalisedURLPath_1.default(`/${input.tenantId}/recipe/signinup/codes/remove`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return { status: "OK", @@ -125,14 +133,16 @@ function getRecipeInterface(querier) { revokeCode: async function (input) { await querier.sendPostRequest( new normalisedURLPath_1.default(`/${input.tenantId}/recipe/signinup/code/remove`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return { status: "OK" }; }, updateUser: async function (input) { let response = await querier.sendPutRequest( new normalisedURLPath_1.default(`/recipe/user`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); if (response.status !== "OK") { return response; diff --git a/lib/build/recipe/session/recipeImplementation.js b/lib/build/recipe/session/recipeImplementation.js index 827ecd859..11ae5f42f 100644 --- a/lib/build/recipe/session/recipeImplementation.js +++ b/lib/build/recipe/session/recipeImplementation.js @@ -92,6 +92,7 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride sessionDataInDatabase = {}, disableAntiCsrf, tenantId, + userContext, }) { logger_1.logDebugMessage("createNewSession: Started"); let response = await SessionFunctions.createNewSession( @@ -100,7 +101,8 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride recipeUserId, disableAntiCsrf === true, accessTokenPayload, - sessionDataInDatabase + sessionDataInDatabase, + userContext ); logger_1.logDebugMessage("createNewSession: Finished"); const payload = jwt_1.parseJWTWithoutSignatureVerification(response.accessToken.token).payload; @@ -122,7 +124,7 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride getGlobalClaimValidators: async function (input) { return input.claimValidatorsAddedByOtherRecipes; }, - getSession: async function ({ accessToken: accessTokenString, antiCsrfToken, options }) { + getSession: async function ({ accessToken: accessTokenString, antiCsrfToken, options, userContext }) { if ( (options === null || options === void 0 ? void 0 : options.antiCsrfCheck) !== false && typeof config.antiCsrfFunctionOrString === "string" && @@ -179,7 +181,8 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride accessToken, antiCsrfToken, (options === null || options === void 0 ? void 0 : options.antiCsrfCheck) !== false, - (options === null || options === void 0 ? void 0 : options.checkDatabase) === true + (options === null || options === void 0 ? void 0 : options.checkDatabase) === true, + userContext ); logger_1.logDebugMessage("getSession: Success!"); const payload = @@ -247,10 +250,10 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride accessTokenPayloadUpdate, }; }, - getSessionInformation: async function ({ sessionHandle }) { - return SessionFunctions.getSessionInformation(helpers, sessionHandle); + getSessionInformation: async function ({ sessionHandle, userContext }) { + return SessionFunctions.getSessionInformation(helpers, sessionHandle, userContext); }, - refreshSession: async function ({ refreshToken, antiCsrfToken, disableAntiCsrf }) { + refreshSession: async function ({ refreshToken, antiCsrfToken, disableAntiCsrf, userContext }) { if ( disableAntiCsrf !== true && typeof config.antiCsrfFunctionOrString === "string" && @@ -265,7 +268,8 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride helpers, refreshToken, antiCsrfToken, - disableAntiCsrf + disableAntiCsrf, + userContext ); logger_1.logDebugMessage("refreshSession: Success!"); const payload = jwt_1.parseJWTWithoutSignatureVerification(response.accessToken.token).payload; @@ -294,7 +298,8 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride { accessToken: input.accessToken, userDataInJWT: newAccessTokenPayload, - } + }, + input.userContext ); if (response.status === "UNAUTHORISED") { return undefined; @@ -316,13 +321,15 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride tenantId, revokeAcrossAllTenants, revokeSessionsForLinkedAccounts, + userContext, }) { return SessionFunctions.revokeAllSessionsForUser( helpers, userId, revokeSessionsForLinkedAccounts, tenantId, - revokeAcrossAllTenants + revokeAcrossAllTenants, + userContext ); }, getAllSessionHandlesForUser: function ({ @@ -330,23 +337,25 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride fetchSessionsForAllLinkedAccounts, tenantId, fetchAcrossAllTenants, + userContext, }) { return SessionFunctions.getAllSessionHandlesForUser( helpers, userId, fetchSessionsForAllLinkedAccounts, tenantId, - fetchAcrossAllTenants + fetchAcrossAllTenants, + userContext ); }, - revokeSession: function ({ sessionHandle }) { - return SessionFunctions.revokeSession(helpers, sessionHandle); + revokeSession: function ({ sessionHandle, userContext }) { + return SessionFunctions.revokeSession(helpers, sessionHandle, userContext); }, - revokeMultipleSessions: function ({ sessionHandles }) { - return SessionFunctions.revokeMultipleSessions(helpers, sessionHandles); + revokeMultipleSessions: function ({ sessionHandles, userContext }) { + return SessionFunctions.revokeMultipleSessions(helpers, sessionHandles, userContext); }, - updateSessionDataInDatabase: function ({ sessionHandle, newSessionData }) { - return SessionFunctions.updateSessionDataInDatabase(helpers, sessionHandle, newSessionData); + updateSessionDataInDatabase: function ({ sessionHandle, newSessionData, userContext }) { + return SessionFunctions.updateSessionDataInDatabase(helpers, sessionHandle, newSessionData, userContext); }, mergeIntoAccessTokenPayload: async function ({ sessionHandle, accessTokenPayloadUpdate, userContext }) { const sessionInfo = await this.getSessionInformation({ sessionHandle, userContext }); @@ -363,7 +372,12 @@ function getRecipeInterface(querier, config, appInfo, getRecipeImplAfterOverride delete newAccessTokenPayload[key]; } } - return SessionFunctions.updateAccessTokenPayload(helpers, sessionHandle, newAccessTokenPayload); + return SessionFunctions.updateAccessTokenPayload( + helpers, + sessionHandle, + newAccessTokenPayload, + userContext + ); }, fetchAndSetClaim: async function (input) { const sessionInfo = await this.getSessionInformation({ diff --git a/lib/build/recipe/session/sessionFunctions.d.ts b/lib/build/recipe/session/sessionFunctions.d.ts index 89848d130..39e156bf6 100644 --- a/lib/build/recipe/session/sessionFunctions.d.ts +++ b/lib/build/recipe/session/sessionFunctions.d.ts @@ -11,8 +11,9 @@ export declare function createNewSession( tenantId: string, recipeUserId: RecipeUserId, disableAntiCsrf: boolean, - accessTokenPayload?: any, - sessionDataInDatabase?: any + accessTokenPayload: any, + sessionDataInDatabase: any, + userContext: any ): Promise; /** * @description authenticates a session. To be used in APIs that require authentication @@ -22,7 +23,8 @@ export declare function getSession( parsedAccessToken: ParsedJWTInfo, antiCsrfToken: string | undefined, doAntiCsrfCheck: boolean, - alwaysCheckCore: boolean + alwaysCheckCore: boolean, + userContext: any ): Promise<{ session: { handle: string; @@ -44,7 +46,8 @@ export declare function getSession( */ export declare function getSessionInformation( helpers: Helpers, - sessionHandle: string + sessionHandle: string, + userContext: any ): Promise; /** * @description generates new access and refresh tokens for a given refresh token. Called when client's access token has expired. @@ -54,7 +57,8 @@ export declare function refreshSession( helpers: Helpers, refreshToken: string, antiCsrfToken: string | undefined, - disableAntiCsrf: boolean + disableAntiCsrf: boolean, + userContext: any ): Promise; /** * @description deletes session info of a user from db. This only invalidates the refresh token. Not the access token. @@ -64,8 +68,9 @@ export declare function revokeAllSessionsForUser( helpers: Helpers, userId: string, revokeSessionsForLinkedAccounts: boolean, - tenantId?: string, - revokeAcrossAllTenants?: boolean + tenantId: string | undefined, + revokeAcrossAllTenants: boolean | undefined, + userContext: any ): Promise; /** * @description gets all session handles for current user. Please do not call this unless this user is authenticated. @@ -74,29 +79,36 @@ export declare function getAllSessionHandlesForUser( helpers: Helpers, userId: string, fetchSessionsForAllLinkedAccounts: boolean, - tenantId?: string, - fetchAcrossAllTenants?: boolean + tenantId: string | undefined, + fetchAcrossAllTenants: boolean | undefined, + userContext: any ): Promise; /** * @description call to destroy one session * @returns true if session was deleted from db. Else false in case there was nothing to delete */ -export declare function revokeSession(helpers: Helpers, sessionHandle: string): Promise; +export declare function revokeSession(helpers: Helpers, sessionHandle: string, userContext: any): Promise; /** * @description call to destroy multiple sessions * @returns list of sessions revoked */ -export declare function revokeMultipleSessions(helpers: Helpers, sessionHandles: string[]): Promise; +export declare function revokeMultipleSessions( + helpers: Helpers, + sessionHandles: string[], + userContext: any +): Promise; /** * @description: It provides no locking mechanism in case other processes are updating session data for this session as well. */ export declare function updateSessionDataInDatabase( helpers: Helpers, sessionHandle: string, - newSessionData: any + newSessionData: any, + userContext: any ): Promise; export declare function updateAccessTokenPayload( helpers: Helpers, sessionHandle: string, - newAccessTokenPayload: any + newAccessTokenPayload: any, + userContext: any ): Promise; diff --git a/lib/build/recipe/session/sessionFunctions.js b/lib/build/recipe/session/sessionFunctions.js index 7e1f31adf..9f7a8d0c3 100644 --- a/lib/build/recipe/session/sessionFunctions.js +++ b/lib/build/recipe/session/sessionFunctions.js @@ -37,8 +37,9 @@ async function createNewSession( tenantId, recipeUserId, disableAntiCsrf, - accessTokenPayload = {}, - sessionDataInDatabase = {} + accessTokenPayload, + sessionDataInDatabase, + userContext ) { accessTokenPayload = accessTokenPayload === null || accessTokenPayload === undefined ? {} : accessTokenPayload; sessionDataInDatabase = @@ -53,7 +54,8 @@ async function createNewSession( }; let response = await helpers.querier.sendPostRequest( new normalisedURLPath_1.default(`/${tenantId}/recipe/session`), - requestBody + requestBody, + userContext ); return { session: { @@ -80,7 +82,7 @@ exports.createNewSession = createNewSession; /** * @description authenticates a session. To be used in APIs that require authentication */ -async function getSession(helpers, parsedAccessToken, antiCsrfToken, doAntiCsrfCheck, alwaysCheckCore) { +async function getSession(helpers, parsedAccessToken, antiCsrfToken, doAntiCsrfCheck, alwaysCheckCore, userContext) { var _a, _b; let accessTokenInfo; try { @@ -211,7 +213,8 @@ async function getSession(helpers, parsedAccessToken, antiCsrfToken, doAntiCsrfC }; let response = await helpers.querier.sendPostRequest( new normalisedURLPath_1.default("/recipe/session/verify"), - requestBody + requestBody, + userContext ); if (response.status === "OK") { delete response.status; @@ -250,14 +253,18 @@ exports.getSession = getSession; * @description Retrieves session information from storage for a given session handle * @returns session data stored in the database, including userData and access token payload, or undefined if sessionHandle is invalid */ -async function getSessionInformation(helpers, sessionHandle) { +async function getSessionInformation(helpers, sessionHandle, userContext) { let apiVersion = await helpers.querier.getAPIVersion(); if (utils_1.maxVersion(apiVersion, "2.7") === "2.7") { throw new Error("Please use core version >= 3.5 to call this function."); } - let response = await helpers.querier.sendGetRequest(new normalisedURLPath_1.default(`/recipe/session`), { - sessionHandle, - }); + let response = await helpers.querier.sendGetRequest( + new normalisedURLPath_1.default(`/recipe/session`), + { + sessionHandle, + }, + userContext + ); if (response.status === "OK") { // Change keys to make them more readable return { @@ -279,7 +286,7 @@ exports.getSessionInformation = getSessionInformation; * @description generates new access and refresh tokens for a given refresh token. Called when client's access token has expired. * @sideEffects calls onTokenTheftDetection if token theft is detected. */ -async function refreshSession(helpers, refreshToken, antiCsrfToken, disableAntiCsrf) { +async function refreshSession(helpers, refreshToken, antiCsrfToken, disableAntiCsrf, userContext) { let requestBody = { refreshToken, antiCsrfToken, @@ -296,7 +303,8 @@ async function refreshSession(helpers, refreshToken, antiCsrfToken, disableAntiC } let response = await helpers.querier.sendPostRequest( new normalisedURLPath_1.default("/recipe/session/refresh"), - requestBody + requestBody, + userContext ); if (response.status === "OK") { return { @@ -348,7 +356,8 @@ async function revokeAllSessionsForUser( userId, revokeSessionsForLinkedAccounts, tenantId, - revokeAcrossAllTenants + revokeAcrossAllTenants, + userContext ) { if (tenantId === undefined) { tenantId = constants_1.DEFAULT_TENANT_ID; @@ -359,7 +368,8 @@ async function revokeAllSessionsForUser( userId, revokeSessionsForLinkedAccounts, revokeAcrossAllTenants, - } + }, + userContext ); return response.sessionHandlesRevoked; } @@ -372,7 +382,8 @@ async function getAllSessionHandlesForUser( userId, fetchSessionsForAllLinkedAccounts, tenantId, - fetchAcrossAllTenants + fetchAcrossAllTenants, + userContext ) { if (tenantId === undefined) { tenantId = constants_1.DEFAULT_TENANT_ID; @@ -383,7 +394,8 @@ async function getAllSessionHandlesForUser( userId, fetchSessionsForAllLinkedAccounts, fetchAcrossAllTenants, - } + }, + userContext ); return response.sessionHandles; } @@ -392,10 +404,14 @@ exports.getAllSessionHandlesForUser = getAllSessionHandlesForUser; * @description call to destroy one session * @returns true if session was deleted from db. Else false in case there was nothing to delete */ -async function revokeSession(helpers, sessionHandle) { - let response = await helpers.querier.sendPostRequest(new normalisedURLPath_1.default("/recipe/session/remove"), { - sessionHandles: [sessionHandle], - }); +async function revokeSession(helpers, sessionHandle, userContext) { + let response = await helpers.querier.sendPostRequest( + new normalisedURLPath_1.default("/recipe/session/remove"), + { + sessionHandles: [sessionHandle], + }, + userContext + ); return response.sessionHandlesRevoked.length === 1; } exports.revokeSession = revokeSession; @@ -403,35 +419,47 @@ exports.revokeSession = revokeSession; * @description call to destroy multiple sessions * @returns list of sessions revoked */ -async function revokeMultipleSessions(helpers, sessionHandles) { - let response = await helpers.querier.sendPostRequest(new normalisedURLPath_1.default(`/recipe/session/remove`), { - sessionHandles, - }); +async function revokeMultipleSessions(helpers, sessionHandles, userContext) { + let response = await helpers.querier.sendPostRequest( + new normalisedURLPath_1.default(`/recipe/session/remove`), + { + sessionHandles, + }, + userContext + ); return response.sessionHandlesRevoked; } exports.revokeMultipleSessions = revokeMultipleSessions; /** * @description: It provides no locking mechanism in case other processes are updating session data for this session as well. */ -async function updateSessionDataInDatabase(helpers, sessionHandle, newSessionData) { +async function updateSessionDataInDatabase(helpers, sessionHandle, newSessionData, userContext) { newSessionData = newSessionData === null || newSessionData === undefined ? {} : newSessionData; - let response = await helpers.querier.sendPutRequest(new normalisedURLPath_1.default(`/recipe/session/data`), { - sessionHandle, - userDataInDatabase: newSessionData, - }); + let response = await helpers.querier.sendPutRequest( + new normalisedURLPath_1.default(`/recipe/session/data`), + { + sessionHandle, + userDataInDatabase: newSessionData, + }, + userContext + ); if (response.status === "UNAUTHORISED") { return false; } return true; } exports.updateSessionDataInDatabase = updateSessionDataInDatabase; -async function updateAccessTokenPayload(helpers, sessionHandle, newAccessTokenPayload) { +async function updateAccessTokenPayload(helpers, sessionHandle, newAccessTokenPayload, userContext) { newAccessTokenPayload = newAccessTokenPayload === null || newAccessTokenPayload === undefined ? {} : newAccessTokenPayload; - let response = await helpers.querier.sendPutRequest(new normalisedURLPath_1.default("/recipe/jwt/data"), { - sessionHandle, - userDataInJWT: newAccessTokenPayload, - }); + let response = await helpers.querier.sendPutRequest( + new normalisedURLPath_1.default("/recipe/jwt/data"), + { + sessionHandle, + userDataInJWT: newAccessTokenPayload, + }, + userContext + ); if (response.status === "UNAUTHORISED") { return false; } diff --git a/lib/build/recipe/thirdparty/recipeImplementation.js b/lib/build/recipe/thirdparty/recipeImplementation.js index 36b701e3f..bca62f9c7 100644 --- a/lib/build/recipe/thirdparty/recipeImplementation.js +++ b/lib/build/recipe/thirdparty/recipeImplementation.js @@ -28,7 +28,8 @@ function getRecipeImplementation(querier, providers) { thirdPartyId, thirdPartyUserId, email: { id: email, isVerified }, - } + }, + userContext ); if (response.status !== "OK") { return response; diff --git a/lib/build/recipe/usermetadata/recipeImplementation.js b/lib/build/recipe/usermetadata/recipeImplementation.js index 1f9653e83..e3aa25a5f 100644 --- a/lib/build/recipe/usermetadata/recipeImplementation.js +++ b/lib/build/recipe/usermetadata/recipeImplementation.js @@ -22,19 +22,31 @@ Object.defineProperty(exports, "__esModule", { value: true }); const normalisedURLPath_1 = __importDefault(require("../../normalisedURLPath")); function getRecipeInterface(querier) { return { - getUserMetadata: function ({ userId }) { - return querier.sendGetRequest(new normalisedURLPath_1.default("/recipe/user/metadata"), { userId }); + getUserMetadata: function ({ userId, userContext }) { + return querier.sendGetRequest( + new normalisedURLPath_1.default("/recipe/user/metadata"), + { userId }, + userContext + ); }, - updateUserMetadata: function ({ userId, metadataUpdate }) { - return querier.sendPutRequest(new normalisedURLPath_1.default("/recipe/user/metadata"), { - userId, - metadataUpdate, - }); + updateUserMetadata: function ({ userId, metadataUpdate, userContext }) { + return querier.sendPutRequest( + new normalisedURLPath_1.default("/recipe/user/metadata"), + { + userId, + metadataUpdate, + }, + userContext + ); }, - clearUserMetadata: function ({ userId }) { - return querier.sendPostRequest(new normalisedURLPath_1.default("/recipe/user/metadata/remove"), { - userId, - }); + clearUserMetadata: function ({ userId, userContext }) { + return querier.sendPostRequest( + new normalisedURLPath_1.default("/recipe/user/metadata/remove"), + { + userId, + }, + userContext + ); }, }; } diff --git a/lib/build/recipe/userroles/recipeImplementation.js b/lib/build/recipe/userroles/recipeImplementation.js index 5092eed93..f9e762eaf 100644 --- a/lib/build/recipe/userroles/recipeImplementation.js +++ b/lib/build/recipe/userroles/recipeImplementation.js @@ -23,58 +23,82 @@ const normalisedURLPath_1 = __importDefault(require("../../normalisedURLPath")); const constants_1 = require("../multitenancy/constants"); function getRecipeInterface(querier) { return { - addRoleToUser: function ({ userId, role, tenantId }) { + addRoleToUser: function ({ userId, role, tenantId, userContext }) { return querier.sendPutRequest( new normalisedURLPath_1.default( `/${tenantId === undefined ? constants_1.DEFAULT_TENANT_ID : tenantId}/recipe/user/role` ), - { userId, role } + { userId, role }, + userContext ); }, - removeUserRole: function ({ userId, role, tenantId }) { + removeUserRole: function ({ userId, role, tenantId, userContext }) { return querier.sendPostRequest( new normalisedURLPath_1.default( `/${tenantId === undefined ? constants_1.DEFAULT_TENANT_ID : tenantId}/recipe/user/role/remove` ), - { userId, role } + { userId, role }, + userContext ); }, - getRolesForUser: function ({ userId, tenantId }) { + getRolesForUser: function ({ userId, tenantId, userContext }) { return querier.sendGetRequest( new normalisedURLPath_1.default( `/${tenantId === undefined ? constants_1.DEFAULT_TENANT_ID : tenantId}/recipe/user/roles` ), - { userId } + { userId }, + userContext ); }, - getUsersThatHaveRole: function ({ role, tenantId }) { + getUsersThatHaveRole: function ({ role, tenantId, userContext }) { return querier.sendGetRequest( new normalisedURLPath_1.default( `/${tenantId === undefined ? constants_1.DEFAULT_TENANT_ID : tenantId}/recipe/role/users` ), - { role } + { role }, + userContext ); }, - createNewRoleOrAddPermissions: function ({ role, permissions }) { - return querier.sendPutRequest(new normalisedURLPath_1.default("/recipe/role"), { role, permissions }); + createNewRoleOrAddPermissions: function ({ role, permissions, userContext }) { + return querier.sendPutRequest( + new normalisedURLPath_1.default("/recipe/role"), + { role, permissions }, + userContext + ); }, - getPermissionsForRole: function ({ role }) { - return querier.sendGetRequest(new normalisedURLPath_1.default("/recipe/role/permissions"), { role }); + getPermissionsForRole: function ({ role, userContext }) { + return querier.sendGetRequest( + new normalisedURLPath_1.default("/recipe/role/permissions"), + { role }, + userContext + ); }, - removePermissionsFromRole: function ({ role, permissions }) { - return querier.sendPostRequest(new normalisedURLPath_1.default("/recipe/role/permissions/remove"), { - role, - permissions, - }); + removePermissionsFromRole: function ({ role, permissions, userContext }) { + return querier.sendPostRequest( + new normalisedURLPath_1.default("/recipe/role/permissions/remove"), + { + role, + permissions, + }, + userContext + ); }, - getRolesThatHavePermission: function ({ permission }) { - return querier.sendGetRequest(new normalisedURLPath_1.default("/recipe/permission/roles"), { permission }); + getRolesThatHavePermission: function ({ permission, userContext }) { + return querier.sendGetRequest( + new normalisedURLPath_1.default("/recipe/permission/roles"), + { permission }, + userContext + ); }, - deleteRole: function ({ role }) { - return querier.sendPostRequest(new normalisedURLPath_1.default("/recipe/role/remove"), { role }); + deleteRole: function ({ role, userContext }) { + return querier.sendPostRequest( + new normalisedURLPath_1.default("/recipe/role/remove"), + { role }, + userContext + ); }, - getAllRoles: function () { - return querier.sendGetRequest(new normalisedURLPath_1.default("/recipe/roles"), {}); + getAllRoles: function (userContext) { + return querier.sendGetRequest(new normalisedURLPath_1.default("/recipe/roles"), {}, userContext); }, }; } diff --git a/lib/build/supertokens.d.ts b/lib/build/supertokens.d.ts index 2e7ace14e..4845b8412 100644 --- a/lib/build/supertokens.d.ts +++ b/lib/build/supertokens.d.ts @@ -27,12 +27,17 @@ export default class SuperTokens { userContext: any ) => Promise; getAllCORSHeaders: () => string[]; - getUserCount: (includeRecipeIds?: string[] | undefined, tenantId?: string | undefined) => Promise; + getUserCount: ( + includeRecipeIds?: string[] | undefined, + tenantId?: string | undefined, + userContext?: any + ) => Promise; createUserIdMapping: (input: { superTokensUserId: string; externalUserId: string; externalUserIdInfo?: string; force?: boolean; + userContext?: any; }) => Promise< | { status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR"; @@ -46,6 +51,7 @@ export default class SuperTokens { getUserIdMapping: (input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; + userContext?: any; }) => Promise< | { status: "OK"; @@ -61,6 +67,7 @@ export default class SuperTokens { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; force?: boolean; + userContext?: any; }) => Promise<{ status: "OK"; didMappingExist: boolean; @@ -69,6 +76,7 @@ export default class SuperTokens { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; externalUserIdInfo?: string; + userContext?: any; }) => Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR"; }>; diff --git a/lib/build/supertokens.js b/lib/build/supertokens.js index da8cfc3b3..16b8df516 100644 --- a/lib/build/supertokens.js +++ b/lib/build/supertokens.js @@ -30,7 +30,7 @@ const postSuperTokensInitCallbacks_1 = require("./postSuperTokensInitCallbacks") const constants_2 = require("./recipe/multitenancy/constants"); class SuperTokens { constructor(config) { - var _a, _b; + var _a, _b, _c; this.handleAPI = async (matchedRecipe, id, tenantId, request, response, path, method, userContext) => { return await matchedRecipe.handleAPIRequest(id, tenantId, request, response, path, method, userContext); }; @@ -46,7 +46,7 @@ class SuperTokens { }); return Array.from(headerSet); }; - this.getUserCount = async (includeRecipeIds, tenantId) => { + this.getUserCount = async (includeRecipeIds, tenantId, userContext) => { let querier = querier_1.Querier.getNewInstanceOrThrowError(undefined); let apiVersion = await querier.getAPIVersion(); if (utils_1.maxVersion(apiVersion, "2.7") === "2.7") { @@ -65,7 +65,8 @@ class SuperTokens { { includeRecipeIds: includeRecipeIdsStr, includeAllTenants: tenantId === undefined, - } + }, + userContext === undefined ? {} : userContext ); return Number(response.count); }; @@ -74,12 +75,16 @@ class SuperTokens { let cdiVersion = await querier.getAPIVersion(); if (utils_1.maxVersion("2.15", cdiVersion) === cdiVersion) { // create userId mapping is only available >= CDI 2.15 - return await querier.sendPostRequest(new normalisedURLPath_1.default("/recipe/userid/map"), { - superTokensUserId: input.superTokensUserId, - externalUserId: input.externalUserId, - externalUserIdInfo: input.externalUserIdInfo, - force: input.force, - }); + return await querier.sendPostRequest( + new normalisedURLPath_1.default("/recipe/userid/map"), + { + superTokensUserId: input.superTokensUserId, + externalUserId: input.externalUserId, + externalUserIdInfo: input.externalUserIdInfo, + force: input.force, + }, + input.userContext === undefined ? {} : input.userContext + ); } else { throw new global.Error("Please upgrade the SuperTokens core to >= 3.15.0"); } @@ -89,10 +94,14 @@ class SuperTokens { let cdiVersion = await querier.getAPIVersion(); if (utils_1.maxVersion("2.15", cdiVersion) === cdiVersion) { // create userId mapping is only available >= CDI 2.15 - let response = await querier.sendGetRequest(new normalisedURLPath_1.default("/recipe/userid/map"), { - userId: input.userId, - userIdType: input.userIdType, - }); + let response = await querier.sendGetRequest( + new normalisedURLPath_1.default("/recipe/userid/map"), + { + userId: input.userId, + userIdType: input.userIdType, + }, + input.userContext === undefined ? {} : input.userContext + ); return response; } else { throw new global.Error("Please upgrade the SuperTokens core to >= 3.15.0"); @@ -102,11 +111,15 @@ class SuperTokens { let querier = querier_1.Querier.getNewInstanceOrThrowError(undefined); let cdiVersion = await querier.getAPIVersion(); if (utils_1.maxVersion("2.15", cdiVersion) === cdiVersion) { - return await querier.sendPostRequest(new normalisedURLPath_1.default("/recipe/userid/map/remove"), { - userId: input.userId, - userIdType: input.userIdType, - force: input.force, - }); + return await querier.sendPostRequest( + new normalisedURLPath_1.default("/recipe/userid/map/remove"), + { + userId: input.userId, + userIdType: input.userIdType, + force: input.force, + }, + input.userContext === undefined ? {} : input.userContext + ); } else { throw new global.Error("Please upgrade the SuperTokens core to >= 3.15.0"); } @@ -121,7 +134,8 @@ class SuperTokens { userId: input.userId, userIdType: input.userIdType, externalUserIdInfo: input.externalUserIdInfo, - } + }, + input.userContext === undefined ? {} : input.userContext ); } else { throw new global.Error("Please upgrade the SuperTokens core to >= 3.15.0"); @@ -291,7 +305,8 @@ class SuperTokens { basePath: new normalisedURLPath_1.default(h.trim()), }; }), - (_b = config.supertokens) === null || _b === void 0 ? void 0 : _b.apiKey + (_b = config.supertokens) === null || _b === void 0 ? void 0 : _b.apiKey, + (_c = config.supertokens) === null || _c === void 0 ? void 0 : _c.networkInterceptor ); if (config.recipeList === undefined || config.recipeList.length === 0) { throw new Error("Please provide at least one recipe to the supertokens.init function call"); diff --git a/lib/build/types.d.ts b/lib/build/types.d.ts index b57c40ce9..6b3e0e34b 100644 --- a/lib/build/types.d.ts +++ b/lib/build/types.d.ts @@ -27,6 +27,7 @@ export declare type NormalisedAppinfo = { export declare type SuperTokensInfo = { connectionURI: string; apiKey?: string; + networkInterceptor?: NetworkInterceptor; }; export declare type TypeInput = { supertokens?: SuperTokensInfo; @@ -37,6 +38,16 @@ export declare type TypeInput = { isInServerlessEnv?: boolean; debug?: boolean; }; +export declare type NetworkInterceptor = (request: HttpRequest, userContext: any) => HttpRequest; +export interface HttpRequest { + url: string; + method: HTTPMethod; + headers: { + [key: string]: string | number | string[]; + }; + params?: Record; + body?: any; +} export declare type RecipeListFunction = (appInfo: NormalisedAppinfo, isInServerlessEnv: boolean) => RecipeModule; export declare type APIHandled = { pathWithoutApiBasePath: NormalisedURLPath; diff --git a/lib/build/version.d.ts b/lib/build/version.d.ts index c2f527945..9c86e7472 100644 --- a/lib/build/version.d.ts +++ b/lib/build/version.d.ts @@ -1,4 +1,4 @@ // @ts-nocheck -export declare const version = "16.4.0"; +export declare const version = "16.5.0"; export declare const cdiSupported: string[]; export declare const dashboardVersion = "0.8"; diff --git a/lib/build/version.js b/lib/build/version.js index 925ef0a22..67e3fb401 100644 --- a/lib/build/version.js +++ b/lib/build/version.js @@ -15,7 +15,7 @@ exports.dashboardVersion = exports.cdiSupported = exports.version = void 0; * License for the specific language governing permissions and limitations * under the License. */ -exports.version = "16.4.0"; +exports.version = "16.5.0"; exports.cdiSupported = ["4.0"]; // Note: The actual script import for dashboard uses v{DASHBOARD_VERSION} exports.dashboardVersion = "0.8"; diff --git a/lib/ts/index.ts b/lib/ts/index.ts index b93303ebc..9a1795923 100644 --- a/lib/ts/index.ts +++ b/lib/ts/index.ts @@ -33,8 +33,8 @@ export default class SuperTokensWrapper { return SuperTokens.getInstanceOrThrowError().getAllCORSHeaders(); } - static getUserCount(includeRecipeIds?: string[], tenantId?: string) { - return SuperTokens.getInstanceOrThrowError().getUserCount(includeRecipeIds, tenantId); + static getUserCount(includeRecipeIds?: string[], tenantId?: string, userContext?: any) { + return SuperTokens.getInstanceOrThrowError().getUserCount(includeRecipeIds, tenantId, userContext); } static getUsersOldestFirst(input: { @@ -43,6 +43,7 @@ export default class SuperTokensWrapper { paginationToken?: string; includeRecipeIds?: string[]; query?: { [key: string]: string }; + userContext?: any; }): Promise<{ users: UserType[]; nextPaginationToken?: string; @@ -50,7 +51,7 @@ export default class SuperTokensWrapper { return AccountLinking.getInstance().recipeInterfaceImpl.getUsers({ timeJoinedOrder: "ASC", ...input, - userContext: undefined, + userContext: input.userContext === undefined ? {} : input.userContext, }); } @@ -60,6 +61,7 @@ export default class SuperTokensWrapper { paginationToken?: string; includeRecipeIds?: string[]; query?: { [key: string]: string }; + userContext?: any; }): Promise<{ users: UserType[]; nextPaginationToken?: string; @@ -67,7 +69,7 @@ export default class SuperTokensWrapper { return AccountLinking.getInstance().recipeInterfaceImpl.getUsers({ timeJoinedOrder: "DESC", ...input, - userContext: undefined, + userContext: input.userContext === undefined ? {} : input.userContext, }); } @@ -76,11 +78,16 @@ export default class SuperTokensWrapper { externalUserId: string; externalUserIdInfo?: string; force?: boolean; + userContext?: any; }) { return SuperTokens.getInstanceOrThrowError().createUserIdMapping(input); } - static getUserIdMapping(input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }) { + static getUserIdMapping(input: { + userId: string; + userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; + userContext?: any; + }) { return SuperTokens.getInstanceOrThrowError().getUserIdMapping(input); } @@ -88,6 +95,7 @@ export default class SuperTokensWrapper { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; force?: boolean; + userContext?: any; }) { return SuperTokens.getInstanceOrThrowError().deleteUserIdMapping(input); } @@ -96,6 +104,7 @@ export default class SuperTokensWrapper { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; externalUserIdInfo?: string; + userContext?: any; }) { return SuperTokens.getInstanceOrThrowError().updateOrDeleteUserIdMappingInfo(input); } diff --git a/lib/ts/querier.ts b/lib/ts/querier.ts index 59ed5f95e..023863cb3 100644 --- a/lib/ts/querier.ts +++ b/lib/ts/querier.ts @@ -18,6 +18,8 @@ import NormalisedURLDomain from "./normalisedURLDomain"; import NormalisedURLPath from "./normalisedURLPath"; import { PROCESS_STATE, ProcessState } from "./processState"; import { RATE_LIMIT_STATUS_CODE } from "./constants"; +import { NetworkInterceptor } from "./types"; +import { logDebugMessage } from "./logger"; export class Querier { private static initCalled = false; @@ -28,6 +30,8 @@ export class Querier { private static lastTriedIndex = 0; private static hostsAliveForTesting: Set = new Set(); + private static networkInterceptor: NetworkInterceptor | undefined = undefined; + private __hosts: { domain: NormalisedURLDomain; basePath: NormalisedURLPath }[] | undefined; private rIdToCore: string | undefined; @@ -96,19 +100,25 @@ export class Querier { return new Querier(Querier.hosts, rIdToCore); } - static init(hosts?: { domain: NormalisedURLDomain; basePath: NormalisedURLPath }[], apiKey?: string) { + static init( + hosts?: { domain: NormalisedURLDomain; basePath: NormalisedURLPath }[], + apiKey?: string, + networkInterceptor?: NetworkInterceptor + ) { if (!Querier.initCalled) { + logDebugMessage("querier initialized"); Querier.initCalled = true; Querier.hosts = hosts; Querier.apiKey = apiKey; Querier.apiVersion = undefined; Querier.lastTriedIndex = 0; Querier.hostsAliveForTesting = new Set(); + Querier.networkInterceptor = networkInterceptor; } } // path should start with "/" - sendPostRequest = async (path: NormalisedURLPath, body: any): Promise => { + sendPostRequest = async (path: NormalisedURLPath, body: any, userContext: any): Promise => { const { body: respBody } = await this.sendRequestHelper( path, "POST", @@ -130,6 +140,22 @@ export class Querier { rid: this.rIdToCore, }; } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "post", + headers: headers, + body: body, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.body !== undefined) { + body = request.body; + } + } return doFetch(url, { method: "POST", body: body !== undefined ? JSON.stringify(body) : undefined, @@ -142,7 +168,7 @@ export class Querier { }; // path should start with "/" - sendDeleteRequest = async (path: NormalisedURLPath, body: any, params?: any): Promise => { + sendDeleteRequest = async (path: NormalisedURLPath, body: any, params: any, userContext: any): Promise => { const { body: respBody } = await this.sendRequestHelper( path, "DELETE", @@ -161,6 +187,27 @@ export class Querier { rid: this.rIdToCore, }; } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "delete", + headers: headers, + params: params, + body: body, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.body !== undefined) { + body = request.body; + } + if (request.params !== undefined) { + params = request.params; + } + } + const finalURL = new URL(url); const searchParams = new URLSearchParams(params); finalURL.search = searchParams.toString(); @@ -179,7 +226,8 @@ export class Querier { // path should start with "/" sendGetRequest = async ( path: NormalisedURLPath, - params: Record + params: Record, + userContext: any ): Promise => { const { body: respBody } = await this.sendRequestHelper( path, @@ -199,6 +247,22 @@ export class Querier { rid: this.rIdToCore, }; } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "get", + headers: headers, + params: params, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.params !== undefined) { + params = request.params; + } + } const finalURL = new URL(url); const searchParams = new URLSearchParams( Object.entries(params).filter(([_, value]) => value !== undefined) as string[][] @@ -216,7 +280,8 @@ export class Querier { sendGetRequestWithResponseHeaders = async ( path: NormalisedURLPath, - params: Record + params: Record, + userContext: any ): Promise<{ body: any; headers: Headers }> => { return await this.sendRequestHelper( path, @@ -236,6 +301,22 @@ export class Querier { rid: this.rIdToCore, }; } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "get", + headers: headers, + params: params, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.params !== undefined) { + params = request.params; + } + } const finalURL = new URL(url); const searchParams = new URLSearchParams( Object.entries(params).filter(([_, value]) => value !== undefined) as string[][] @@ -251,7 +332,7 @@ export class Querier { }; // path should start with "/" - sendPutRequest = async (path: NormalisedURLPath, body: any): Promise => { + sendPutRequest = async (path: NormalisedURLPath, body: any, userContext: any): Promise => { const { body: respBody } = await this.sendRequestHelper( path, "PUT", @@ -270,6 +351,22 @@ export class Querier { rid: this.rIdToCore, }; } + if (Querier.networkInterceptor !== undefined) { + let request = Querier.networkInterceptor( + { + url: url, + method: "put", + headers: headers, + body: body, + }, + userContext + ); + url = request.url; + headers = request.headers; + if (request.body !== undefined) { + body = request.body; + } + } return doFetch(url, { method: "PUT", diff --git a/lib/ts/recipe/accountlinking/recipeImplementation.ts b/lib/ts/recipe/accountlinking/recipeImplementation.ts index 4c8655921..26c6a1d62 100644 --- a/lib/ts/recipe/accountlinking/recipeImplementation.ts +++ b/lib/ts/recipe/accountlinking/recipeImplementation.ts @@ -36,6 +36,7 @@ export default function getRecipeImplementation( paginationToken, includeRecipeIds, query, + userContext, }: { tenantId: string; timeJoinedOrder: "ASC" | "DESC"; @@ -43,6 +44,7 @@ export default function getRecipeImplementation( paginationToken?: string; includeRecipeIds?: string[]; query?: { [key: string]: string }; + userContext: any; } ): Promise<{ users: UserType[]; @@ -52,13 +54,17 @@ export default function getRecipeImplementation( if (includeRecipeIds !== undefined) { includeRecipeIdsStr = includeRecipeIds.join(","); } - let response = await querier.sendGetRequest(new NormalisedURLPath(`${tenantId ?? "public"}/users`), { - includeRecipeIds: includeRecipeIdsStr, - timeJoinedOrder: timeJoinedOrder, - limit: limit, - paginationToken: paginationToken, - ...query, - }); + let response = await querier.sendGetRequest( + new NormalisedURLPath(`${tenantId ?? "public"}/users`), + { + includeRecipeIds: includeRecipeIdsStr, + timeJoinedOrder: timeJoinedOrder, + limit: limit, + paginationToken: paginationToken, + ...query, + }, + userContext + ); return { users: response.users.map((u: any) => new User(u)), nextPaginationToken: response.nextPaginationToken, @@ -68,8 +74,10 @@ export default function getRecipeImplementation( this: RecipeInterface, { recipeUserId, + userContext, }: { recipeUserId: RecipeUserId; + userContext: any; } ): Promise< | { @@ -84,15 +92,20 @@ export default function getRecipeImplementation( description: string; } > { - return await querier.sendGetRequest(new NormalisedURLPath("/recipe/accountlinking/user/primary/check"), { - recipeUserId: recipeUserId.getAsString(), - }); + return await querier.sendGetRequest( + new NormalisedURLPath("/recipe/accountlinking/user/primary/check"), + { + recipeUserId: recipeUserId.getAsString(), + }, + userContext + ); }, createPrimaryUser: async function ( this: RecipeInterface, { recipeUserId, + userContext, }: { recipeUserId: RecipeUserId; userContext: any; @@ -113,9 +126,13 @@ export default function getRecipeImplementation( description: string; } > { - let response = await querier.sendPostRequest(new NormalisedURLPath("/recipe/accountlinking/user/primary"), { - recipeUserId: recipeUserId.getAsString(), - }); + let response = await querier.sendPostRequest( + new NormalisedURLPath("/recipe/accountlinking/user/primary"), + { + recipeUserId: recipeUserId.getAsString(), + }, + userContext + ); if (response.status === "OK") { response.user = new User(response.user); } @@ -127,9 +144,11 @@ export default function getRecipeImplementation( { recipeUserId, primaryUserId, + userContext, }: { recipeUserId: RecipeUserId; primaryUserId: string; + userContext: any; } ): Promise< | { @@ -150,10 +169,14 @@ export default function getRecipeImplementation( status: "INPUT_USER_IS_NOT_A_PRIMARY_USER"; } > { - let result = await querier.sendGetRequest(new NormalisedURLPath("/recipe/accountlinking/user/link/check"), { - recipeUserId: recipeUserId.getAsString(), - primaryUserId, - }); + let result = await querier.sendGetRequest( + new NormalisedURLPath("/recipe/accountlinking/user/link/check"), + { + recipeUserId: recipeUserId.getAsString(), + primaryUserId, + }, + userContext + ); return result; }, @@ -194,7 +217,8 @@ export default function getRecipeImplementation( { recipeUserId: recipeUserId.getAsString(), primaryUserId, - } + }, + userContext ); if ( @@ -241,8 +265,10 @@ export default function getRecipeImplementation( this: RecipeInterface, { recipeUserId, + userContext, }: { recipeUserId: RecipeUserId; + userContext: any; } ): Promise<{ status: "OK"; @@ -253,15 +279,23 @@ export default function getRecipeImplementation( new NormalisedURLPath("/recipe/accountlinking/user/unlink"), { recipeUserId: recipeUserId.getAsString(), - } + }, + userContext ); return accountsUnlinkingResult; }, - getUser: async function (this: RecipeInterface, { userId }: { userId: string }): Promise { - let result = await querier.sendGetRequest(new NormalisedURLPath("/user/id"), { - userId, - }); + getUser: async function ( + this: RecipeInterface, + { userId, userContext }: { userId: string; userContext: any } + ): Promise { + let result = await querier.sendGetRequest( + new NormalisedURLPath("/user/id"), + { + userId, + }, + userContext + ); if (result.status === "OK") { return new User(result.user); } @@ -274,7 +308,8 @@ export default function getRecipeImplementation( tenantId, accountInfo, doUnionOfAccountInfo, - }: { tenantId: string; accountInfo: AccountInfo; doUnionOfAccountInfo: boolean } + userContext, + }: { tenantId: string; accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; userContext: any } ): Promise { let result = await querier.sendGetRequest( new NormalisedURLPath(`${tenantId ?? "public"}/users/by-accountinfo`), @@ -284,7 +319,8 @@ export default function getRecipeImplementation( thirdPartyId: accountInfo.thirdParty?.id, thirdPartyUserId: accountInfo.thirdParty?.userId, doUnionOfAccountInfo, - } + }, + userContext ); return result.users.map((u: any) => new User(u)); }, @@ -294,17 +330,23 @@ export default function getRecipeImplementation( { userId, removeAllLinkedAccounts, + userContext, }: { userId: string; removeAllLinkedAccounts: boolean; + userContext: any; } ): Promise<{ status: "OK"; }> { - return await querier.sendPostRequest(new NormalisedURLPath("/user/remove"), { - userId, - removeAllLinkedAccounts, - }); + return await querier.sendPostRequest( + new NormalisedURLPath("/user/remove"), + { + userId, + removeAllLinkedAccounts, + }, + userContext + ); }, }; } diff --git a/lib/ts/recipe/dashboard/api/analytics.ts b/lib/ts/recipe/dashboard/api/analytics.ts index 720ba8783..76c83bbdc 100644 --- a/lib/ts/recipe/dashboard/api/analytics.ts +++ b/lib/ts/recipe/dashboard/api/analytics.ts @@ -29,7 +29,7 @@ export default async function analyticsPost( _: APIInterface, ___: string, options: APIOptions, - __: any + userContext: any ): Promise { // If telemetry is disabled, dont send any event if (!SuperTokens.getInstanceOrThrowError().telemetryEnabled) { @@ -58,7 +58,7 @@ export default async function analyticsPost( let numberOfUsers: number; try { let querier = Querier.getNewInstanceOrThrowError(options.recipeId); - let response = await querier.sendGetRequest(new NormalisedURLPath("/telemetry"), {}); + let response = await querier.sendGetRequest(new NormalisedURLPath("/telemetry"), {}, userContext); if (response.exists) { telemetryId = response.telemetryId; } diff --git a/lib/ts/recipe/dashboard/api/search/tagsGet.ts b/lib/ts/recipe/dashboard/api/search/tagsGet.ts index c16f48012..a34b9e092 100644 --- a/lib/ts/recipe/dashboard/api/search/tagsGet.ts +++ b/lib/ts/recipe/dashboard/api/search/tagsGet.ts @@ -23,9 +23,9 @@ export const getSearchTags = async ( _: APIInterface, ___: string, options: APIOptions, - __: any + userContext: any ): Promise => { let querier = Querier.getNewInstanceOrThrowError(options.recipeId); - let tagsResponse = await querier.sendGetRequest(new NormalisedURLPath("/user/search/tags"), {}); + let tagsResponse = await querier.sendGetRequest(new NormalisedURLPath("/user/search/tags"), {}, userContext); return tagsResponse; }; diff --git a/lib/ts/recipe/dashboard/api/signIn.ts b/lib/ts/recipe/dashboard/api/signIn.ts index e5c74231a..1a0686ba9 100644 --- a/lib/ts/recipe/dashboard/api/signIn.ts +++ b/lib/ts/recipe/dashboard/api/signIn.ts @@ -24,7 +24,7 @@ type SignInResponse = | { status: "INVALID_CREDENTIALS_ERROR" } | { status: "USER_SUSPENDED_ERROR" }; -export default async function signIn(_: APIInterface, options: APIOptions, __: any): Promise { +export default async function signIn(_: APIInterface, options: APIOptions, userContext: any): Promise { const { email, password } = await options.req.getJSONBody(); if (email === undefined) { @@ -47,7 +47,8 @@ export default async function signIn(_: APIInterface, options: APIOptions, __: a { email, password, - } + }, + userContext ); send200Response(options.res, signInResponse); diff --git a/lib/ts/recipe/dashboard/api/signOut.ts b/lib/ts/recipe/dashboard/api/signOut.ts index b6e92ec87..3d82f9761 100644 --- a/lib/ts/recipe/dashboard/api/signOut.ts +++ b/lib/ts/recipe/dashboard/api/signOut.ts @@ -18,7 +18,12 @@ import { send200Response } from "../../../utils"; import { Querier } from "../../../querier"; import NormalisedURLPath from "../../../normalisedURLPath"; -export default async function signOut(_: APIInterface, ___: string, options: APIOptions, __: any): Promise { +export default async function signOut( + _: APIInterface, + ___: string, + options: APIOptions, + userContext: any +): Promise { if (options.config.authMode === "api-key") { send200Response(options.res, { status: "OK" }); } else { @@ -27,7 +32,8 @@ export default async function signOut(_: APIInterface, ___: string, options: API const sessionDeleteResponse = await querier.sendDeleteRequest( new NormalisedURLPath("/recipe/dashboard/session"), {}, - { sessionId: sessionIdFormAuthHeader } + { sessionId: sessionIdFormAuthHeader }, + userContext ); send200Response(options.res, sessionDeleteResponse); } diff --git a/lib/ts/recipe/dashboard/recipeImplementation.ts b/lib/ts/recipe/dashboard/recipeImplementation.ts index 9432c8a70..446c2047c 100644 --- a/lib/ts/recipe/dashboard/recipeImplementation.ts +++ b/lib/ts/recipe/dashboard/recipeImplementation.ts @@ -38,7 +38,8 @@ export default function getRecipeImplementation(): RecipeInterface { new NormalisedURLPath("/recipe/dashboard/session/verify"), { sessionId: authHeaderValue, - } + }, + input.userContext ); if (sessionVerificationResponse.status !== "OK") { diff --git a/lib/ts/recipe/emailpassword/recipeImplementation.ts b/lib/ts/recipe/emailpassword/recipeImplementation.ts index 3b4bdaf3c..04987e378 100644 --- a/lib/ts/recipe/emailpassword/recipeImplementation.ts +++ b/lib/ts/recipe/emailpassword/recipeImplementation.ts @@ -73,7 +73,8 @@ export default function getRecipeInterface( { email: input.email, password: input.password, - } + }, + input.userContext ); if (resp.status === "OK") { resp.user = new User(resp.user); @@ -103,7 +104,8 @@ export default function getRecipeInterface( { email, password, - } + }, + userContext ); if (response.status === "OK") { @@ -144,10 +146,12 @@ export default function getRecipeInterface( userId, email, tenantId, + userContext, }: { userId: string; email: string; tenantId: string; + userContext: any; }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }> { // the input user ID can be a recipe or a primary user ID. return await querier.sendPostRequest( @@ -157,16 +161,19 @@ export default function getRecipeInterface( { userId, email, - } + }, + userContext ); }, consumePasswordResetToken: async function ({ token, tenantId, + userContext, }: { token: string; tenantId: string; + userContext: any; }): Promise< | { status: "OK"; @@ -182,7 +189,8 @@ export default function getRecipeInterface( { method: "token", token, - } + }, + userContext ); }, @@ -230,7 +238,8 @@ export default function getRecipeInterface( recipeUserId: input.recipeUserId.getAsString(), email: input.email, password: input.password, - } + }, + input.userContext ); if (response.status === "OK") { diff --git a/lib/ts/recipe/emailverification/recipeImplementation.ts b/lib/ts/recipe/emailverification/recipeImplementation.ts index 5736645b6..db97f8788 100644 --- a/lib/ts/recipe/emailverification/recipeImplementation.ts +++ b/lib/ts/recipe/emailverification/recipeImplementation.ts @@ -15,10 +15,12 @@ export default function getRecipeInterface( recipeUserId, email, tenantId, + userContext, }: { recipeUserId: RecipeUserId; email: string; tenantId: string; + userContext: any; }): Promise< | { status: "OK"; @@ -31,7 +33,8 @@ export default function getRecipeInterface( { userId: recipeUserId.getAsString(), email, - } + }, + userContext ); if (response.status === "OK") { return { @@ -61,7 +64,8 @@ export default function getRecipeInterface( { method: "token", token, - } + }, + userContext ); if (response.status === "OK") { const recipeUserId = new RecipeUserId(response.userId); @@ -105,14 +109,20 @@ export default function getRecipeInterface( isEmailVerified: async function ({ recipeUserId, email, + userContext, }: { recipeUserId: RecipeUserId; email: string; + userContext: any; }): Promise { - let response = await querier.sendGetRequest(new NormalisedURLPath("/recipe/user/email/verify"), { - userId: recipeUserId.getAsString(), - email, - }); + let response = await querier.sendGetRequest( + new NormalisedURLPath("/recipe/user/email/verify"), + { + userId: recipeUserId.getAsString(), + email, + }, + userContext + ); return response.isVerified; }, @@ -120,13 +130,15 @@ export default function getRecipeInterface( recipeUserId: RecipeUserId; email: string; tenantId: string; + userContext: any; }): Promise<{ status: "OK" }> { await querier.sendPostRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/user/email/verify/token/remove`), { userId: input.recipeUserId.getAsString(), email: input.email, - } + }, + input.userContext ); return { status: "OK" }; }, @@ -134,11 +146,16 @@ export default function getRecipeInterface( unverifyEmail: async function (input: { recipeUserId: RecipeUserId; email: string; + userContext: any; }): Promise<{ status: "OK" }> { - await querier.sendPostRequest(new NormalisedURLPath("/recipe/user/email/verify/remove"), { - userId: input.recipeUserId.getAsString(), - email: input.email, - }); + await querier.sendPostRequest( + new NormalisedURLPath("/recipe/user/email/verify/remove"), + { + userId: input.recipeUserId.getAsString(), + email: input.email, + }, + input.userContext + ); return { status: "OK" }; }, }; diff --git a/lib/ts/recipe/jwt/recipeImplementation.ts b/lib/ts/recipe/jwt/recipeImplementation.ts index 51f97f5c7..97eebf111 100644 --- a/lib/ts/recipe/jwt/recipeImplementation.ts +++ b/lib/ts/recipe/jwt/recipeImplementation.ts @@ -30,10 +30,12 @@ export default function getRecipeInterface( payload, validitySeconds, useStaticSigningKey, + userContext, }: { payload?: any; useStaticSigningKey?: boolean; validitySeconds?: number; + userContext: any; }): Promise< | { status: "OK"; @@ -48,13 +50,17 @@ export default function getRecipeInterface( validitySeconds = config.jwtValiditySeconds; } - let response = await querier.sendPostRequest(new NormalisedURLPath("/recipe/jwt"), { - payload: payload ?? {}, - validity: validitySeconds, - useStaticSigningKey: useStaticSigningKey !== false, - algorithm: "RS256", - jwksDomain: appInfo.apiDomain.getAsStringDangerous(), - }); + let response = await querier.sendPostRequest( + new NormalisedURLPath("/recipe/jwt"), + { + payload: payload ?? {}, + validity: validitySeconds, + useStaticSigningKey: useStaticSigningKey !== false, + algorithm: "RS256", + jwksDomain: appInfo.apiDomain.getAsStringDangerous(), + }, + userContext + ); if (response.status === "OK") { return { @@ -68,10 +74,11 @@ export default function getRecipeInterface( } }, - getJWKS: async function (): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }> { + getJWKS: async function (userContext: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }> { const { body, headers } = await querier.sendGetRequestWithResponseHeaders( new NormalisedURLPath("/.well-known/jwks.json"), - {} + {}, + userContext ); let validityInSeconds = defaultJWKSMaxAge; const cacheControl = headers.get("Cache-Control"); diff --git a/lib/ts/recipe/multitenancy/recipeImplementation.ts b/lib/ts/recipe/multitenancy/recipeImplementation.ts index 8a7a7738f..c6a655b84 100644 --- a/lib/ts/recipe/multitenancy/recipeImplementation.ts +++ b/lib/ts/recipe/multitenancy/recipeImplementation.ts @@ -9,29 +9,38 @@ export default function getRecipeInterface(querier: Querier): RecipeInterface { return tenantIdFromFrontend; }, - createOrUpdateTenant: async function ({ tenantId, config }) { - let response = await querier.sendPutRequest(new NormalisedURLPath(`/recipe/multitenancy/tenant`), { - tenantId, - ...config, - }); + createOrUpdateTenant: async function ({ tenantId, config, userContext }) { + let response = await querier.sendPutRequest( + new NormalisedURLPath(`/recipe/multitenancy/tenant`), + { + tenantId, + ...config, + }, + userContext + ); return response; }, - deleteTenant: async function ({ tenantId }) { - let response = await querier.sendPostRequest(new NormalisedURLPath(`/recipe/multitenancy/tenant/remove`), { - tenantId, - }); + deleteTenant: async function ({ tenantId, userContext }) { + let response = await querier.sendPostRequest( + new NormalisedURLPath(`/recipe/multitenancy/tenant/remove`), + { + tenantId, + }, + userContext + ); return response; }, - getTenant: async function ({ tenantId }) { + getTenant: async function ({ tenantId, userContext }) { let response = await querier.sendGetRequest( new NormalisedURLPath( `/${tenantId === undefined ? DEFAULT_TENANT_ID : tenantId}/recipe/multitenancy/tenant` ), - {} + {}, + userContext ); if (response.status === "TENANT_NOT_FOUND_ERROR") { @@ -41,12 +50,16 @@ export default function getRecipeInterface(querier: Querier): RecipeInterface { return response; }, - listAllTenants: async function () { - let response = await querier.sendGetRequest(new NormalisedURLPath(`/recipe/multitenancy/tenant/list`), {}); + listAllTenants: async function ({ userContext }) { + let response = await querier.sendGetRequest( + new NormalisedURLPath(`/recipe/multitenancy/tenant/list`), + {}, + userContext + ); return response; }, - createOrUpdateThirdPartyConfig: async function ({ tenantId, config, skipValidation }) { + createOrUpdateThirdPartyConfig: async function ({ tenantId, config, skipValidation, userContext }) { let response = await querier.sendPutRequest( new NormalisedURLPath( `/${tenantId === undefined ? DEFAULT_TENANT_ID : tenantId}/recipe/multitenancy/config/thirdparty` @@ -54,12 +67,13 @@ export default function getRecipeInterface(querier: Querier): RecipeInterface { { config, skipValidation, - } + }, + userContext ); return response; }, - deleteThirdPartyConfig: async function ({ tenantId, thirdPartyId }) { + deleteThirdPartyConfig: async function ({ tenantId, thirdPartyId, userContext }) { let response = await querier.sendPostRequest( new NormalisedURLPath( `/${ @@ -68,31 +82,34 @@ export default function getRecipeInterface(querier: Querier): RecipeInterface { ), { thirdPartyId, - } + }, + userContext ); return response; }, - associateUserToTenant: async function ({ tenantId, recipeUserId }) { + associateUserToTenant: async function ({ tenantId, recipeUserId, userContext }) { let response = await querier.sendPostRequest( new NormalisedURLPath( `/${tenantId === undefined ? DEFAULT_TENANT_ID : tenantId}/recipe/multitenancy/tenant/user` ), { recipeUserId: recipeUserId.getAsString(), - } + }, + userContext ); return response; }, - disassociateUserFromTenant: async function ({ tenantId, recipeUserId }) { + disassociateUserFromTenant: async function ({ tenantId, recipeUserId, userContext }) { let response = await querier.sendPostRequest( new NormalisedURLPath( `/${tenantId === undefined ? DEFAULT_TENANT_ID : tenantId}/recipe/multitenancy/tenant/user/remove` ), { recipeUserId: recipeUserId.getAsString(), - } + }, + userContext ); return response; }, diff --git a/lib/ts/recipe/passwordless/recipeImplementation.ts b/lib/ts/recipe/passwordless/recipeImplementation.ts index 2ea91a25c..c8708e4a9 100644 --- a/lib/ts/recipe/passwordless/recipeImplementation.ts +++ b/lib/ts/recipe/passwordless/recipeImplementation.ts @@ -24,7 +24,8 @@ export default function getRecipeInterface(querier: Querier): RecipeInterface { consumeCode: async function (this: RecipeInterface, input) { let response = await querier.sendPostRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/signinup/code/consume`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); if (response.status !== "OK") { @@ -79,49 +80,56 @@ export default function getRecipeInterface(querier: Querier): RecipeInterface { createCode: async function (input) { let response = await querier.sendPostRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/signinup/code`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response; }, createNewCodeForDevice: async function (input) { let response = await querier.sendPostRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/signinup/code`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response; }, listCodesByDeviceId: async function (input) { let response = await querier.sendGetRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/signinup/codes`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response.devices.length === 1 ? response.devices[0] : undefined; }, listCodesByEmail: async function (input) { let response = await querier.sendGetRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/signinup/codes`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response.devices; }, listCodesByPhoneNumber: async function (input) { let response = await querier.sendGetRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/signinup/codes`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response.devices; }, listCodesByPreAuthSessionId: async function (input) { let response = await querier.sendGetRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/signinup/codes`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return response.devices.length === 1 ? response.devices[0] : undefined; }, revokeAllCodes: async function (input) { await querier.sendPostRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/signinup/codes/remove`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return { status: "OK", @@ -130,14 +138,16 @@ export default function getRecipeInterface(querier: Querier): RecipeInterface { revokeCode: async function (input) { await querier.sendPostRequest( new NormalisedURLPath(`/${input.tenantId}/recipe/signinup/code/remove`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); return { status: "OK" }; }, updateUser: async function (input) { let response = await querier.sendPutRequest( new NormalisedURLPath(`/recipe/user`), - copyAndRemoveUserContextAndTenantId(input) + copyAndRemoveUserContextAndTenantId(input), + input.userContext ); if (response.status !== "OK") { return response; diff --git a/lib/ts/recipe/session/recipeImplementation.ts b/lib/ts/recipe/session/recipeImplementation.ts index 0344b6ec5..a2dbaa981 100644 --- a/lib/ts/recipe/session/recipeImplementation.ts +++ b/lib/ts/recipe/session/recipeImplementation.ts @@ -79,6 +79,7 @@ export default function getRecipeInterface( sessionDataInDatabase = {}, disableAntiCsrf, tenantId, + userContext, }: { userId: string; recipeUserId: RecipeUserId; @@ -96,7 +97,8 @@ export default function getRecipeInterface( recipeUserId, disableAntiCsrf === true, accessTokenPayload, - sessionDataInDatabase + sessionDataInDatabase, + userContext ); logDebugMessage("createNewSession: Finished"); @@ -127,6 +129,7 @@ export default function getRecipeInterface( accessToken: accessTokenString, antiCsrfToken, options, + userContext, }: { accessToken: string; antiCsrfToken?: string; @@ -192,7 +195,8 @@ export default function getRecipeInterface( accessToken, antiCsrfToken, options?.antiCsrfCheck !== false, - options?.checkDatabase === true + options?.checkDatabase === true, + userContext ); logDebugMessage("getSession: Success!"); @@ -282,10 +286,12 @@ export default function getRecipeInterface( getSessionInformation: async function ({ sessionHandle, + userContext, }: { sessionHandle: string; + userContext: any; }): Promise { - return SessionFunctions.getSessionInformation(helpers, sessionHandle); + return SessionFunctions.getSessionInformation(helpers, sessionHandle, userContext); }, refreshSession: async function ( @@ -294,6 +300,7 @@ export default function getRecipeInterface( refreshToken, antiCsrfToken, disableAntiCsrf, + userContext, }: { refreshToken: string; antiCsrfToken?: string; disableAntiCsrf: boolean; userContext: any } ): Promise { if ( @@ -311,7 +318,8 @@ export default function getRecipeInterface( helpers, refreshToken, antiCsrfToken, - disableAntiCsrf + disableAntiCsrf, + userContext ); logDebugMessage("refreshSession: Success!"); @@ -363,10 +371,14 @@ export default function getRecipeInterface( ? {} : input.newAccessTokenPayload; - let response = await querier.sendPostRequest(new NormalisedURLPath("/recipe/session/regenerate"), { - accessToken: input.accessToken, - userDataInJWT: newAccessTokenPayload, - }); + let response = await querier.sendPostRequest( + new NormalisedURLPath("/recipe/session/regenerate"), + { + accessToken: input.accessToken, + userDataInJWT: newAccessTokenPayload, + }, + input.userContext + ); if (response.status === "UNAUTHORISED") { return undefined; } @@ -388,18 +400,21 @@ export default function getRecipeInterface( tenantId, revokeAcrossAllTenants, revokeSessionsForLinkedAccounts, + userContext, }: { userId: string; revokeSessionsForLinkedAccounts: boolean; tenantId?: string; revokeAcrossAllTenants?: boolean; + userContext: any; }) { return SessionFunctions.revokeAllSessionsForUser( helpers, userId, revokeSessionsForLinkedAccounts, tenantId, - revokeAcrossAllTenants + revokeAcrossAllTenants, + userContext ); }, @@ -408,6 +423,7 @@ export default function getRecipeInterface( fetchSessionsForAllLinkedAccounts, tenantId, fetchAcrossAllTenants, + userContext, }: { userId: string; fetchSessionsForAllLinkedAccounts: boolean; @@ -420,26 +436,41 @@ export default function getRecipeInterface( userId, fetchSessionsForAllLinkedAccounts, tenantId, - fetchAcrossAllTenants + fetchAcrossAllTenants, + userContext ); }, - revokeSession: function ({ sessionHandle }: { sessionHandle: string }): Promise { - return SessionFunctions.revokeSession(helpers, sessionHandle); + revokeSession: function ({ + sessionHandle, + userContext, + }: { + sessionHandle: string; + userContext: any; + }): Promise { + return SessionFunctions.revokeSession(helpers, sessionHandle, userContext); }, - revokeMultipleSessions: function ({ sessionHandles }: { sessionHandles: string[] }) { - return SessionFunctions.revokeMultipleSessions(helpers, sessionHandles); + revokeMultipleSessions: function ({ + sessionHandles, + userContext, + }: { + sessionHandles: string[]; + userContext: any; + }) { + return SessionFunctions.revokeMultipleSessions(helpers, sessionHandles, userContext); }, updateSessionDataInDatabase: function ({ sessionHandle, newSessionData, + userContext, }: { sessionHandle: string; newSessionData: any; + userContext: any; }): Promise { - return SessionFunctions.updateSessionDataInDatabase(helpers, sessionHandle, newSessionData); + return SessionFunctions.updateSessionDataInDatabase(helpers, sessionHandle, newSessionData, userContext); }, mergeIntoAccessTokenPayload: async function ( @@ -470,7 +501,12 @@ export default function getRecipeInterface( } } - return SessionFunctions.updateAccessTokenPayload(helpers, sessionHandle, newAccessTokenPayload); + return SessionFunctions.updateAccessTokenPayload( + helpers, + sessionHandle, + newAccessTokenPayload, + userContext + ); }, fetchAndSetClaim: async function ( diff --git a/lib/ts/recipe/session/sessionFunctions.ts b/lib/ts/recipe/session/sessionFunctions.ts index f1752dfa8..4864d6e87 100644 --- a/lib/ts/recipe/session/sessionFunctions.ts +++ b/lib/ts/recipe/session/sessionFunctions.ts @@ -33,8 +33,9 @@ export async function createNewSession( tenantId: string, recipeUserId: RecipeUserId, disableAntiCsrf: boolean, - accessTokenPayload: any = {}, - sessionDataInDatabase: any = {} + accessTokenPayload: any, + sessionDataInDatabase: any, + userContext: any ): Promise { accessTokenPayload = accessTokenPayload === null || accessTokenPayload === undefined ? {} : accessTokenPayload; sessionDataInDatabase = @@ -50,7 +51,8 @@ export async function createNewSession( }; let response = await helpers.querier.sendPostRequest( new NormalisedURLPath(`/${tenantId}/recipe/session`), - requestBody + requestBody, + userContext ); return { @@ -83,7 +85,8 @@ export async function getSession( parsedAccessToken: ParsedJWTInfo, antiCsrfToken: string | undefined, doAntiCsrfCheck: boolean, - alwaysCheckCore: boolean + alwaysCheckCore: boolean, + userContext: any ): Promise<{ session: { handle: string; @@ -236,7 +239,11 @@ export async function getSession( checkDatabase: alwaysCheckCore, }; - let response = await helpers.querier.sendPostRequest(new NormalisedURLPath("/recipe/session/verify"), requestBody); + let response = await helpers.querier.sendPostRequest( + new NormalisedURLPath("/recipe/session/verify"), + requestBody, + userContext + ); if (response.status === "OK") { delete response.status; @@ -275,16 +282,21 @@ export async function getSession( */ export async function getSessionInformation( helpers: Helpers, - sessionHandle: string + sessionHandle: string, + userContext: any ): Promise { let apiVersion = await helpers.querier.getAPIVersion(); if (maxVersion(apiVersion, "2.7") === "2.7") { throw new Error("Please use core version >= 3.5 to call this function."); } - let response = await helpers.querier.sendGetRequest(new NormalisedURLPath(`/recipe/session`), { - sessionHandle, - }); + let response = await helpers.querier.sendGetRequest( + new NormalisedURLPath(`/recipe/session`), + { + sessionHandle, + }, + userContext + ); if (response.status === "OK") { // Change keys to make them more readable @@ -311,7 +323,8 @@ export async function refreshSession( helpers: Helpers, refreshToken: string, antiCsrfToken: string | undefined, - disableAntiCsrf: boolean + disableAntiCsrf: boolean, + userContext: any ): Promise { let requestBody: { refreshToken: string; @@ -333,7 +346,11 @@ export async function refreshSession( throw new Error("Please either use VIA_TOKEN, NONE or call with doAntiCsrfCheck false"); } - let response = await helpers.querier.sendPostRequest(new NormalisedURLPath("/recipe/session/refresh"), requestBody); + let response = await helpers.querier.sendPostRequest( + new NormalisedURLPath("/recipe/session/refresh"), + requestBody, + userContext + ); if (response.status === "OK") { return { @@ -384,17 +401,22 @@ export async function revokeAllSessionsForUser( helpers: Helpers, userId: string, revokeSessionsForLinkedAccounts: boolean, - tenantId?: string, - revokeAcrossAllTenants?: boolean + tenantId: string | undefined, + revokeAcrossAllTenants: boolean | undefined, + userContext: any ): Promise { if (tenantId === undefined) { tenantId = DEFAULT_TENANT_ID; } - let response = await helpers.querier.sendPostRequest(new NormalisedURLPath(`/${tenantId}/recipe/session/remove`), { - userId, - revokeSessionsForLinkedAccounts, - revokeAcrossAllTenants, - }); + let response = await helpers.querier.sendPostRequest( + new NormalisedURLPath(`/${tenantId}/recipe/session/remove`), + { + userId, + revokeSessionsForLinkedAccounts, + revokeAcrossAllTenants, + }, + userContext + ); return response.sessionHandlesRevoked; } @@ -405,17 +427,22 @@ export async function getAllSessionHandlesForUser( helpers: Helpers, userId: string, fetchSessionsForAllLinkedAccounts: boolean, - tenantId?: string, - fetchAcrossAllTenants?: boolean + tenantId: string | undefined, + fetchAcrossAllTenants: boolean | undefined, + userContext: any ): Promise { if (tenantId === undefined) { tenantId = DEFAULT_TENANT_ID; } - let response = await helpers.querier.sendGetRequest(new NormalisedURLPath(`/${tenantId}/recipe/session/user`), { - userId, - fetchSessionsForAllLinkedAccounts, - fetchAcrossAllTenants, - }); + let response = await helpers.querier.sendGetRequest( + new NormalisedURLPath(`/${tenantId}/recipe/session/user`), + { + userId, + fetchSessionsForAllLinkedAccounts, + fetchAcrossAllTenants, + }, + userContext + ); return response.sessionHandles; } @@ -423,10 +450,14 @@ export async function getAllSessionHandlesForUser( * @description call to destroy one session * @returns true if session was deleted from db. Else false in case there was nothing to delete */ -export async function revokeSession(helpers: Helpers, sessionHandle: string): Promise { - let response = await helpers.querier.sendPostRequest(new NormalisedURLPath("/recipe/session/remove"), { - sessionHandles: [sessionHandle], - }); +export async function revokeSession(helpers: Helpers, sessionHandle: string, userContext: any): Promise { + let response = await helpers.querier.sendPostRequest( + new NormalisedURLPath("/recipe/session/remove"), + { + sessionHandles: [sessionHandle], + }, + userContext + ); return response.sessionHandlesRevoked.length === 1; } @@ -434,10 +465,18 @@ export async function revokeSession(helpers: Helpers, sessionHandle: string): Pr * @description call to destroy multiple sessions * @returns list of sessions revoked */ -export async function revokeMultipleSessions(helpers: Helpers, sessionHandles: string[]): Promise { - let response = await helpers.querier.sendPostRequest(new NormalisedURLPath(`/recipe/session/remove`), { - sessionHandles, - }); +export async function revokeMultipleSessions( + helpers: Helpers, + sessionHandles: string[], + userContext: any +): Promise { + let response = await helpers.querier.sendPostRequest( + new NormalisedURLPath(`/recipe/session/remove`), + { + sessionHandles, + }, + userContext + ); return response.sessionHandlesRevoked; } @@ -447,13 +486,18 @@ export async function revokeMultipleSessions(helpers: Helpers, sessionHandles: s export async function updateSessionDataInDatabase( helpers: Helpers, sessionHandle: string, - newSessionData: any + newSessionData: any, + userContext: any ): Promise { newSessionData = newSessionData === null || newSessionData === undefined ? {} : newSessionData; - let response = await helpers.querier.sendPutRequest(new NormalisedURLPath(`/recipe/session/data`), { - sessionHandle, - userDataInDatabase: newSessionData, - }); + let response = await helpers.querier.sendPutRequest( + new NormalisedURLPath(`/recipe/session/data`), + { + sessionHandle, + userDataInDatabase: newSessionData, + }, + userContext + ); if (response.status === "UNAUTHORISED") { return false; } @@ -463,14 +507,19 @@ export async function updateSessionDataInDatabase( export async function updateAccessTokenPayload( helpers: Helpers, sessionHandle: string, - newAccessTokenPayload: any + newAccessTokenPayload: any, + userContext: any ): Promise { newAccessTokenPayload = newAccessTokenPayload === null || newAccessTokenPayload === undefined ? {} : newAccessTokenPayload; - let response = await helpers.querier.sendPutRequest(new NormalisedURLPath("/recipe/jwt/data"), { - sessionHandle, - userDataInJWT: newAccessTokenPayload, - }); + let response = await helpers.querier.sendPutRequest( + new NormalisedURLPath("/recipe/jwt/data"), + { + sessionHandle, + userDataInJWT: newAccessTokenPayload, + }, + userContext + ); if (response.status === "UNAUTHORISED") { return false; } diff --git a/lib/ts/recipe/thirdparty/recipeImplementation.ts b/lib/ts/recipe/thirdparty/recipeImplementation.ts index 760680231..8d32cbd39 100644 --- a/lib/ts/recipe/thirdparty/recipeImplementation.ts +++ b/lib/ts/recipe/thirdparty/recipeImplementation.ts @@ -39,11 +39,15 @@ export default function getRecipeImplementation(querier: Querier, providers: Pro reason: string; } > { - let response = await querier.sendPostRequest(new NormalisedURLPath(`/${tenantId}/recipe/signinup`), { - thirdPartyId, - thirdPartyUserId, - email: { id: email, isVerified }, - }); + let response = await querier.sendPostRequest( + new NormalisedURLPath(`/${tenantId}/recipe/signinup`), + { + thirdPartyId, + thirdPartyUserId, + email: { id: email, isVerified }, + }, + userContext + ); if (response.status !== "OK") { return response; diff --git a/lib/ts/recipe/usermetadata/recipeImplementation.ts b/lib/ts/recipe/usermetadata/recipeImplementation.ts index 34ff4c26c..51ab77ea5 100644 --- a/lib/ts/recipe/usermetadata/recipeImplementation.ts +++ b/lib/ts/recipe/usermetadata/recipeImplementation.ts @@ -19,21 +19,29 @@ import { Querier } from "../../querier"; export default function getRecipeInterface(querier: Querier): RecipeInterface { return { - getUserMetadata: function ({ userId }) { - return querier.sendGetRequest(new NormalisedURLPath("/recipe/user/metadata"), { userId }); + getUserMetadata: function ({ userId, userContext }) { + return querier.sendGetRequest(new NormalisedURLPath("/recipe/user/metadata"), { userId }, userContext); }, - updateUserMetadata: function ({ userId, metadataUpdate }) { - return querier.sendPutRequest(new NormalisedURLPath("/recipe/user/metadata"), { - userId, - metadataUpdate, - }); + updateUserMetadata: function ({ userId, metadataUpdate, userContext }) { + return querier.sendPutRequest( + new NormalisedURLPath("/recipe/user/metadata"), + { + userId, + metadataUpdate, + }, + userContext + ); }, - clearUserMetadata: function ({ userId }) { - return querier.sendPostRequest(new NormalisedURLPath("/recipe/user/metadata/remove"), { - userId, - }); + clearUserMetadata: function ({ userId, userContext }) { + return querier.sendPostRequest( + new NormalisedURLPath("/recipe/user/metadata/remove"), + { + userId, + }, + userContext + ); }, }; } diff --git a/lib/ts/recipe/userroles/recipeImplementation.ts b/lib/ts/recipe/userroles/recipeImplementation.ts index b78c7d3d2..60e9f8590 100644 --- a/lib/ts/recipe/userroles/recipeImplementation.ts +++ b/lib/ts/recipe/userroles/recipeImplementation.ts @@ -20,61 +20,73 @@ import { DEFAULT_TENANT_ID } from "../multitenancy/constants"; export default function getRecipeInterface(querier: Querier): RecipeInterface { return { - addRoleToUser: function ({ userId, role, tenantId }) { + addRoleToUser: function ({ userId, role, tenantId, userContext }) { return querier.sendPutRequest( new NormalisedURLPath(`/${tenantId === undefined ? DEFAULT_TENANT_ID : tenantId}/recipe/user/role`), - { userId, role } + { userId, role }, + userContext ); }, - removeUserRole: function ({ userId, role, tenantId }) { + removeUserRole: function ({ userId, role, tenantId, userContext }) { return querier.sendPostRequest( new NormalisedURLPath( `/${tenantId === undefined ? DEFAULT_TENANT_ID : tenantId}/recipe/user/role/remove` ), - { userId, role } + { userId, role }, + userContext ); }, - getRolesForUser: function ({ userId, tenantId }) { + getRolesForUser: function ({ userId, tenantId, userContext }) { return querier.sendGetRequest( new NormalisedURLPath(`/${tenantId === undefined ? DEFAULT_TENANT_ID : tenantId}/recipe/user/roles`), - { userId } + { userId }, + userContext ); }, - getUsersThatHaveRole: function ({ role, tenantId }) { + getUsersThatHaveRole: function ({ role, tenantId, userContext }) { return querier.sendGetRequest( new NormalisedURLPath(`/${tenantId === undefined ? DEFAULT_TENANT_ID : tenantId}/recipe/role/users`), - { role } + { role }, + userContext ); }, - createNewRoleOrAddPermissions: function ({ role, permissions }) { - return querier.sendPutRequest(new NormalisedURLPath("/recipe/role"), { role, permissions }); + createNewRoleOrAddPermissions: function ({ role, permissions, userContext }) { + return querier.sendPutRequest(new NormalisedURLPath("/recipe/role"), { role, permissions }, userContext); }, - getPermissionsForRole: function ({ role }) { - return querier.sendGetRequest(new NormalisedURLPath("/recipe/role/permissions"), { role }); + getPermissionsForRole: function ({ role, userContext }) { + return querier.sendGetRequest(new NormalisedURLPath("/recipe/role/permissions"), { role }, userContext); }, - removePermissionsFromRole: function ({ role, permissions }) { - return querier.sendPostRequest(new NormalisedURLPath("/recipe/role/permissions/remove"), { - role, - permissions, - }); + removePermissionsFromRole: function ({ role, permissions, userContext }) { + return querier.sendPostRequest( + new NormalisedURLPath("/recipe/role/permissions/remove"), + { + role, + permissions, + }, + userContext + ); }, - getRolesThatHavePermission: function ({ permission }) { - return querier.sendGetRequest(new NormalisedURLPath("/recipe/permission/roles"), { permission }); + getRolesThatHavePermission: function ({ permission, userContext }) { + return querier.sendGetRequest( + new NormalisedURLPath("/recipe/permission/roles"), + { permission }, + userContext + ); }, - deleteRole: function ({ role }) { - return querier.sendPostRequest(new NormalisedURLPath("/recipe/role/remove"), { role }); + deleteRole: function ({ role, userContext }) { + return querier.sendPostRequest(new NormalisedURLPath("/recipe/role/remove"), { role }, userContext); }, - getAllRoles: function () { - return querier.sendGetRequest(new NormalisedURLPath("/recipe/roles"), {}); + getAllRoles: function (userContext) { + return querier.sendGetRequest(new NormalisedURLPath("/recipe/roles"), {}, userContext); }, }; } diff --git a/lib/ts/supertokens.ts b/lib/ts/supertokens.ts index 5b3e44369..dc92bef97 100644 --- a/lib/ts/supertokens.ts +++ b/lib/ts/supertokens.ts @@ -83,7 +83,8 @@ export default class SuperTokens { basePath: new NormalisedURLPath(h.trim()), }; }), - config.supertokens?.apiKey + config.supertokens?.apiKey, + config.supertokens?.networkInterceptor ); if (config.recipeList === undefined || config.recipeList.length === 0) { throw new Error("Please provide at least one recipe to the supertokens.init function call"); @@ -165,7 +166,7 @@ export default class SuperTokens { return Array.from(headerSet); }; - getUserCount = async (includeRecipeIds?: string[], tenantId?: string): Promise => { + getUserCount = async (includeRecipeIds?: string[], tenantId?: string, userContext?: any): Promise => { let querier = Querier.getNewInstanceOrThrowError(undefined); let apiVersion = await querier.getAPIVersion(); if (maxVersion(apiVersion, "2.7") === "2.7") { @@ -183,7 +184,8 @@ export default class SuperTokens { { includeRecipeIds: includeRecipeIdsStr, includeAllTenants: tenantId === undefined, - } + }, + userContext === undefined ? {} : userContext ); return Number(response.count); }; @@ -193,6 +195,7 @@ export default class SuperTokens { externalUserId: string; externalUserIdInfo?: string; force?: boolean; + userContext?: any; }): Promise< | { status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR"; @@ -207,12 +210,16 @@ export default class SuperTokens { let cdiVersion = await querier.getAPIVersion(); if (maxVersion("2.15", cdiVersion) === cdiVersion) { // create userId mapping is only available >= CDI 2.15 - return await querier.sendPostRequest(new NormalisedURLPath("/recipe/userid/map"), { - superTokensUserId: input.superTokensUserId, - externalUserId: input.externalUserId, - externalUserIdInfo: input.externalUserIdInfo, - force: input.force, - }); + return await querier.sendPostRequest( + new NormalisedURLPath("/recipe/userid/map"), + { + superTokensUserId: input.superTokensUserId, + externalUserId: input.externalUserId, + externalUserIdInfo: input.externalUserIdInfo, + force: input.force, + }, + input.userContext === undefined ? {} : input.userContext + ); } else { throw new global.Error("Please upgrade the SuperTokens core to >= 3.15.0"); } @@ -221,6 +228,7 @@ export default class SuperTokens { getUserIdMapping = async function (input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; + userContext?: any; }): Promise< | { status: "OK"; @@ -236,10 +244,14 @@ export default class SuperTokens { let cdiVersion = await querier.getAPIVersion(); if (maxVersion("2.15", cdiVersion) === cdiVersion) { // create userId mapping is only available >= CDI 2.15 - let response = await querier.sendGetRequest(new NormalisedURLPath("/recipe/userid/map"), { - userId: input.userId, - userIdType: input.userIdType, - }); + let response = await querier.sendGetRequest( + new NormalisedURLPath("/recipe/userid/map"), + { + userId: input.userId, + userIdType: input.userIdType, + }, + input.userContext === undefined ? {} : input.userContext + ); return response; } else { throw new global.Error("Please upgrade the SuperTokens core to >= 3.15.0"); @@ -250,6 +262,7 @@ export default class SuperTokens { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; force?: boolean; + userContext?: any; }): Promise<{ status: "OK"; didMappingExist: boolean; @@ -257,11 +270,15 @@ export default class SuperTokens { let querier = Querier.getNewInstanceOrThrowError(undefined); let cdiVersion = await querier.getAPIVersion(); if (maxVersion("2.15", cdiVersion) === cdiVersion) { - return await querier.sendPostRequest(new NormalisedURLPath("/recipe/userid/map/remove"), { - userId: input.userId, - userIdType: input.userIdType, - force: input.force, - }); + return await querier.sendPostRequest( + new NormalisedURLPath("/recipe/userid/map/remove"), + { + userId: input.userId, + userIdType: input.userIdType, + force: input.force, + }, + input.userContext === undefined ? {} : input.userContext + ); } else { throw new global.Error("Please upgrade the SuperTokens core to >= 3.15.0"); } @@ -271,17 +288,22 @@ export default class SuperTokens { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"; externalUserIdInfo?: string; + userContext?: any; }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR"; }> { let querier = Querier.getNewInstanceOrThrowError(undefined); let cdiVersion = await querier.getAPIVersion(); if (maxVersion("2.15", cdiVersion) === cdiVersion) { - return await querier.sendPutRequest(new NormalisedURLPath("/recipe/userid/external-user-id-info"), { - userId: input.userId, - userIdType: input.userIdType, - externalUserIdInfo: input.externalUserIdInfo, - }); + return await querier.sendPutRequest( + new NormalisedURLPath("/recipe/userid/external-user-id-info"), + { + userId: input.userId, + userIdType: input.userIdType, + externalUserIdInfo: input.externalUserIdInfo, + }, + input.userContext === undefined ? {} : input.userContext + ); } else { throw new global.Error("Please upgrade the SuperTokens core to >= 3.15.0"); } diff --git a/lib/ts/types.ts b/lib/ts/types.ts index a72063d4e..4fc906b82 100644 --- a/lib/ts/types.ts +++ b/lib/ts/types.ts @@ -44,6 +44,7 @@ export type NormalisedAppinfo = { export type SuperTokensInfo = { connectionURI: string; apiKey?: string; + networkInterceptor?: NetworkInterceptor; }; export type TypeInput = { @@ -56,6 +57,16 @@ export type TypeInput = { debug?: boolean; }; +export type NetworkInterceptor = (request: HttpRequest, userContext: any) => HttpRequest; + +export interface HttpRequest { + url: string; + method: HTTPMethod; + headers: { [key: string]: string | number | string[] }; + params?: Record; + body?: any; +} + export type RecipeListFunction = (appInfo: NormalisedAppinfo, isInServerlessEnv: boolean) => RecipeModule; export type APIHandled = { diff --git a/lib/ts/version.ts b/lib/ts/version.ts index f2edf5e77..03327ca39 100644 --- a/lib/ts/version.ts +++ b/lib/ts/version.ts @@ -12,7 +12,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -export const version = "16.4.0"; +export const version = "16.5.0"; export const cdiSupported = ["4.0"]; diff --git a/package-lock.json b/package-lock.json index 7925f91ad..8333775c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "supertokens-node", - "version": "16.4.0", + "version": "16.5.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "supertokens-node", - "version": "16.4.0", + "version": "16.5.0", "license": "Apache-2.0", "dependencies": { "content-type": "^1.0.5", diff --git a/package.json b/package.json index dd797894b..d4fd72b1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supertokens-node", - "version": "16.4.0", + "version": "16.5.0", "description": "NodeJS driver for SuperTokens core", "main": "index.js", "scripts": { diff --git a/test/interceptor.test.js b/test/interceptor.test.js new file mode 100644 index 000000000..f6f505c20 --- /dev/null +++ b/test/interceptor.test.js @@ -0,0 +1,187 @@ +const { + printPath, + setupST, + startST, + killAllST, + cleanST, + extractInfoFromResponse, + setKeyValueInConfig, + killAllSTCoresOnly, + mockResponse, + mockRequest, + signUPRequest, + assertJSONEquals, +} = require("./utils"); +let { ProcessState } = require("../lib/build/processState"); + +let SuperTokens = require("../"); +let Session = require("../recipe/session"); +let EmailPassword = require("../recipe/emailpassword"); +let UserRoles = require("../recipe/userroles"); + +let assert = require("assert"); +const express = require("express"); +let { middleware, errorHandler } = require("../framework/express"); + +describe(`interceptor: ${printPath("[test/interceptor.test.js]")}`, function () { + beforeEach(async function () { + await killAllST(); + await setupST(); + ProcessState.getInstance().reset(); + }); + + after(async function () { + await killAllST(); + await cleanST(); + }); + + it("network interceptor sanity", async function () { + let isNetworkIntercepted = false; + const connectionURI = await startST(); + SuperTokens.init({ + supertokens: { + connectionURI, + networkInterceptor: (request, __) => { + isNetworkIntercepted = true; + return request; + }, + }, + appInfo: { + apiDomain: "api.supertokens.io", + appName: "SuperTokens", + websiteDomain: "supertokens.io", + }, + recipeList: [ + EmailPassword.init(), + Session.init({ getTokenTransferMethod: () => "cookie", antiCsrf: "VIA_TOKEN" }), + ], + }); + + const app = express(); + + app.use(middleware()); + + app.use(errorHandler()); + + let response = await signUPRequest(app, "random@gmail.com", "validpass123"); + + assert(JSON.parse(response.text).status === "OK"); + assert(response.status === 200); + assert(isNetworkIntercepted === true); + }); + + it("network interceptor - incorrect core url", async function () { + let isNetworkIntercepted = false; + const connectionURI = await startST(); + SuperTokens.init({ + supertokens: { + connectionURI, + networkInterceptor: (request, __) => { + isNetworkIntercepted = true; + newRequest = request; + newRequest.url = newRequest.url + "/incorrect/path"; + return newRequest; + }, + }, + appInfo: { + apiDomain: "api.supertokens.io", + appName: "SuperTokens", + websiteDomain: "supertokens.io", + }, + recipeList: [ + EmailPassword.init(), + Session.init({ getTokenTransferMethod: () => "cookie", antiCsrf: "VIA_TOKEN" }), + ], + }); + + const app = express(); + + app.use(middleware()); + + app.use(errorHandler()); + + let response = await signUPRequest(app, "random@gmail.com", "validpass123"); + + assert(isNetworkIntercepted === true); + assert(response.text.includes("status code: 404")); + }); + + it("network interceptor - incorrect query params", async function () { + let isNetworkIntercepted = false; + const connectionURI = await startST(); + SuperTokens.init({ + supertokens: { + connectionURI, + networkInterceptor: (request, __) => { + isNetworkIntercepted = true; + newRequest = request; + newRequest.params = { incorrect: "param" }; + return newRequest; + }, + }, + appInfo: { + apiDomain: "api.supertokens.io", + appName: "SuperTokens", + websiteDomain: "supertokens.io", + }, + recipeList: [ + EmailPassword.init(), + UserRoles.init(), + Session.init({ getTokenTransferMethod: () => "cookie", antiCsrf: "VIA_TOKEN" }), + ], + }); + + const app = express(); + + app.use(middleware()); + + app.use(errorHandler()); + + let isErr = false; + try { + await UserRoles.getRolesForUser("public", "someUserID"); + } catch (err) { + isErr = true; + assert(err.message.includes("status code: 400")); + } + + assert(isNetworkIntercepted === true); + assert(isErr === true); + }); + + it("network interceptor - incorrect request body", async function () { + let isNetworkIntercepted = false; + const connectionURI = await startST(); + SuperTokens.init({ + supertokens: { + connectionURI, + networkInterceptor: (request, __) => { + isNetworkIntercepted = true; + newRequest = request; + newRequest.body = { incorrect: "body" }; + return newRequest; + }, + }, + appInfo: { + apiDomain: "api.supertokens.io", + appName: "SuperTokens", + websiteDomain: "supertokens.io", + }, + recipeList: [ + EmailPassword.init(), + Session.init({ getTokenTransferMethod: () => "cookie", antiCsrf: "VIA_TOKEN" }), + ], + }); + + const app = express(); + + app.use(middleware()); + + app.use(errorHandler()); + + let response = await signUPRequest(app, "random@gmail.com", "validpass123"); + + assert(isNetworkIntercepted === true); + assert(response.text.includes("status code: 400")); + }); +}); From 9fcdc8fbfd8b41f047bb5979acd19c387e292f95 Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Mon, 13 Nov 2023 15:30:22 +0530 Subject: [PATCH 2/4] adding dev-v16.5.0 tag to this commit to ensure building --- docs/classes/framework.BaseRequest.html | 2 +- docs/classes/framework.BaseResponse.html | 2 +- docs/classes/framework_custom.CollectingResponse.html | 2 +- docs/classes/framework_custom.PreParsedRequest.html | 2 +- docs/classes/index.RecipeUserId.html | 2 +- docs/classes/index.User.html | 2 +- docs/classes/index.default.html | 2 +- docs/classes/ingredients_emaildelivery.default.html | 2 +- docs/classes/ingredients_smsdelivery.default.html | 2 +- docs/classes/recipe_accountlinking.default.html | 6 +++--- docs/classes/recipe_dashboard.default.html | 2 +- docs/classes/recipe_emailpassword.default.html | 4 ++-- docs/classes/recipe_emailverification.default.html | 2 +- docs/classes/recipe_jwt.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 2 +- docs/classes/recipe_openid.default.html | 2 +- docs/classes/recipe_passwordless.default.html | 2 +- docs/classes/recipe_session.default.html | 4 ++-- docs/classes/recipe_thirdparty.default.html | 2 +- .../recipe_thirdpartyemailpassword.default.html | 2 +- .../recipe_thirdpartypasswordless.default.html | 2 +- docs/classes/recipe_usermetadata.default.html | 2 +- docs/classes/recipe_userroles.default.html | 2 +- docs/interfaces/framework_awsLambda.SessionEvent.html | 2 +- .../framework_awsLambda.SessionEventV2.html | 2 +- docs/interfaces/framework_express.SessionRequest.html | 2 +- docs/interfaces/framework_fastify.SessionRequest.html | 2 +- docs/interfaces/framework_hapi.SessionRequest.html | 2 +- docs/interfaces/framework_koa.SessionContext.html | 2 +- .../interfaces/framework_loopback.SessionContext.html | 2 +- docs/interfaces/recipe_session.SessionContainer.html | 2 +- .../recipe_session.VerifySessionOptions.html | 2 +- docs/modules/framework.html | 2 +- docs/modules/framework_awsLambda.html | 2 +- docs/modules/framework_custom.html | 2 +- docs/modules/framework_express.html | 2 +- docs/modules/framework_fastify.html | 2 +- docs/modules/framework_hapi.html | 2 +- docs/modules/framework_koa.html | 2 +- docs/modules/framework_loopback.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_accountlinking.html | 2 +- docs/modules/recipe_dashboard.html | 2 +- docs/modules/recipe_emailpassword.html | 4 ++-- docs/modules/recipe_emailverification.html | 2 +- docs/modules/recipe_jwt.html | 2 +- docs/modules/recipe_multitenancy.html | 2 +- docs/modules/recipe_openid.html | 2 +- docs/modules/recipe_passwordless.html | 2 +- docs/modules/recipe_session.html | 8 ++++---- docs/modules/recipe_thirdparty.html | 2 +- docs/modules/recipe_thirdpartyemailpassword.html | 2 +- docs/modules/recipe_thirdpartypasswordless.html | 2 +- docs/modules/recipe_usermetadata.html | 4 ++-- docs/modules/recipe_userroles.html | 2 +- lib/build/framework/fastify/index.d.ts | 11 ++++------- lib/build/framework/utils.d.ts | 2 +- 57 files changed, 69 insertions(+), 72 deletions(-) diff --git a/docs/classes/framework.BaseRequest.html b/docs/classes/framework.BaseRequest.html index 4fbff54af..001498370 100644 --- a/docs/classes/framework.BaseRequest.html +++ b/docs/classes/framework.BaseRequest.html @@ -1 +1 @@ -BaseRequest | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

getCookieValue: (key_: string) => undefined | string

Type declaration

    • (key_: string): undefined | string
    • Parameters

      • key_: string

      Returns undefined | string

getFormData: () => Promise<any>

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

getHeaderValue: (key: string) => undefined | string

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getJSONBody: () => Promise<any>

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

getKeyValueFromQuery: (key: string) => undefined | string

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getMethod: () => HTTPMethod

Type declaration

    • (): HTTPMethod
    • Returns HTTPMethod

getOriginalURL: () => string

Type declaration

    • (): string
    • Returns string

original: any
wrapperUsed: boolean

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +BaseRequest | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

getCookieValue: (key_: string) => undefined | string

Type declaration

    • (key_: string): undefined | string
    • Parameters

      • key_: string

      Returns undefined | string

getFormData: () => Promise<any>

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

getHeaderValue: (key: string) => undefined | string

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getJSONBody: () => Promise<any>

Type declaration

    • (): Promise<any>
    • Returns Promise<any>

getKeyValueFromQuery: (key: string) => undefined | string

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getMethod: () => HTTPMethod

Type declaration

    • (): HTTPMethod
    • Returns HTTPMethod

getOriginalURL: () => string

Type declaration

    • (): string
    • Returns string

original: any
wrapperUsed: boolean

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/framework.BaseResponse.html b/docs/classes/framework.BaseResponse.html index b62d218ee..2a3f68838 100644 --- a/docs/classes/framework.BaseResponse.html +++ b/docs/classes/framework.BaseResponse.html @@ -1 +1 @@ -BaseResponse | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

original: any
removeHeader: (key: string) => void

Type declaration

    • (key: string): void
    • Parameters

      • key: string

      Returns void

sendHTMLResponse: (html: string) => void

Type declaration

    • (html: string): void
    • Parameters

      • html: string

      Returns void

sendJSONResponse: (content: any) => void

Type declaration

    • (content: any): void
    • Parameters

      • content: any

      Returns void

setCookie: (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none") => void

Type declaration

    • (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
    • Parameters

      • key: string
      • value: string
      • domain: undefined | string
      • secure: boolean
      • httpOnly: boolean
      • expires: number
      • path: string
      • sameSite: "strict" | "lax" | "none"

      Returns void

setHeader: (key: string, value: string, allowDuplicateKey: boolean) => void

Type declaration

    • (key: string, value: string, allowDuplicateKey: boolean): void
    • Parameters

      • key: string
      • value: string
      • allowDuplicateKey: boolean

      Returns void

setStatusCode: (statusCode: number) => void

Type declaration

    • (statusCode: number): void
    • Parameters

      • statusCode: number

      Returns void

wrapperUsed: boolean

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +BaseResponse | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

original: any
removeHeader: (key: string) => void

Type declaration

    • (key: string): void
    • Parameters

      • key: string

      Returns void

sendHTMLResponse: (html: string) => void

Type declaration

    • (html: string): void
    • Parameters

      • html: string

      Returns void

sendJSONResponse: (content: any) => void

Type declaration

    • (content: any): void
    • Parameters

      • content: any

      Returns void

setCookie: (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none") => void

Type declaration

    • (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
    • Parameters

      • key: string
      • value: string
      • domain: undefined | string
      • secure: boolean
      • httpOnly: boolean
      • expires: number
      • path: string
      • sameSite: "strict" | "lax" | "none"

      Returns void

setHeader: (key: string, value: string, allowDuplicateKey: boolean) => void

Type declaration

    • (key: string, value: string, allowDuplicateKey: boolean): void
    • Parameters

      • key: string
      • value: string
      • allowDuplicateKey: boolean

      Returns void

setStatusCode: (statusCode: number) => void

Type declaration

    • (statusCode: number): void
    • Parameters

      • statusCode: number

      Returns void

wrapperUsed: boolean

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/framework_custom.CollectingResponse.html b/docs/classes/framework_custom.CollectingResponse.html index cc5f20512..d226adee5 100644 --- a/docs/classes/framework_custom.CollectingResponse.html +++ b/docs/classes/framework_custom.CollectingResponse.html @@ -1,2 +1,2 @@ -CollectingResponse | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

body?: string
cookies: CookieInfo[]
headers: Headers
original: any
statusCode: number
wrapperUsed: boolean

Methods

  • removeHeader(key: string): void
  • sendHTMLResponse(html: string): void
  • sendJSONResponse(content: any): void
  • setCookie(key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
  • Parameters

    • key: string
    • value: string
    • domain: undefined | string
    • secure: boolean
    • httpOnly: boolean
    • expires: number
    • path: string
    • sameSite: "strict" | "lax" | "none"

    Returns void

  • setHeader(key: string, value: string, allowDuplicateKey: boolean): void
  • setStatusCode(statusCode: number): void
  • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
  • Parameters

    • tenantId: string
    • token: string
    • newPassword: string
    • Optional userContext: any

    Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

  • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
  • signIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
  • signUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
  • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
  • Parameters

    • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
      • Optional applyPasswordPolicy?: boolean
      • Optional email?: string
      • Optional password?: string
      • recipeUserId: RecipeUserId
      • Optional tenantIdForPasswordPolicy?: string
      • Optional userContext?: any

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailverification.default.html b/docs/classes/recipe_emailverification.default.html index 5c57c73c0..cc9cebc90 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationClaim
Error: typeof default = SuperTokensError
init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
  • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
  • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
  • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationClaim
Error: typeof default = SuperTokensError
init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
  • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
  • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
  • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_jwt.default.html b/docs/classes/recipe_jwt.default.html index df7a9b7bb..42ddb2ecd 100644 --- a/docs/classes/recipe_jwt.default.html +++ b/docs/classes/recipe_jwt.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Methods

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • Optional userContext: any

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Methods

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • Optional userContext: any

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index fa56690a0..087edbbb3 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
  • Parameters

    • tenantId: string
    • recipeUserId: RecipeUserId
    • Optional userContext: any

    Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

  • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
  • Parameters

    • tenantId: string
    • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
      • Optional coreConfig?: {}
        • [key: string]: any
      • Optional emailPasswordEnabled?: boolean
      • Optional passwordlessEnabled?: boolean
      • Optional thirdPartyEnabled?: boolean
    • Optional userContext: any

    Returns Promise<{ createdNew: boolean; status: "OK" }>

  • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
  • Parameters

    • tenantId: string
    • config: ProviderConfig
    • Optional skipValidation: boolean
    • Optional userContext: any

    Returns Promise<{ createdNew: boolean; status: "OK" }>

  • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
  • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
  • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
  • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
  • Parameters

    • tenantId: string
    • Optional userContext: any

    Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

  • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
  • Parameters

    • Optional userContext: any

    Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
  • Parameters

    • tenantId: string
    • recipeUserId: RecipeUserId
    • Optional userContext: any

    Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

  • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
  • Parameters

    • tenantId: string
    • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
      • Optional coreConfig?: {}
        • [key: string]: any
      • Optional emailPasswordEnabled?: boolean
      • Optional passwordlessEnabled?: boolean
      • Optional thirdPartyEnabled?: boolean
    • Optional userContext: any

    Returns Promise<{ createdNew: boolean; status: "OK" }>

  • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
  • Parameters

    • tenantId: string
    • config: ProviderConfig
    • Optional skipValidation: boolean
    • Optional userContext: any

    Returns Promise<{ createdNew: boolean; status: "OK" }>

  • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
  • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
  • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
  • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
  • Parameters

    • tenantId: string
    • Optional userContext: any

    Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

  • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
  • Parameters

    • Optional userContext: any

    Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_openid.default.html b/docs/classes/recipe_openid.default.html index 1bd5922a2..027cdf8af 100644 --- a/docs/classes/recipe_openid.default.html +++ b/docs/classes/recipe_openid.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = OpenIdRecipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • Optional userContext: any

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: (config?: TypeInput) => RecipeListFunction = OpenIdRecipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • Optional userContext: any

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index e7705c0e4..5fd719f41 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

    Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<string>

  • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • tenantId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { deviceId: string; tenantId: string; userContext?: any }
      • deviceId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any }
      • email: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<DeviceType[]>

  • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
  • Parameters

    • input: { phoneNumber: string; tenantId: string; userContext?: any }
      • phoneNumber: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<DeviceType[]>

  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
      • preAuthSessionId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<{ status: "OK" }>

  • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
  • Parameters

    • input: { codeId: string; tenantId: string; userContext?: any }
      • codeId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<{ status: "OK" }>

  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

  • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • recipeUserId: RecipeUserId
      • Optional userContext?: any

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

    Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<string>

  • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • tenantId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { deviceId: string; tenantId: string; userContext?: any }
      • deviceId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any }
      • email: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<DeviceType[]>

  • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
  • Parameters

    • input: { phoneNumber: string; tenantId: string; userContext?: any }
      • phoneNumber: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<DeviceType[]>

  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
      • preAuthSessionId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<{ status: "OK" }>

  • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
  • Parameters

    • input: { codeId: string; tenantId: string; userContext?: any }
      • codeId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<{ status: "OK" }>

  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

  • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • recipeUserId: RecipeUserId
      • Optional userContext?: any

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_session.default.html b/docs/classes/recipe_session.default.html index b8fe17169..dc65cd6cb 100644 --- a/docs/classes/recipe_session.default.html +++ b/docs/classes/recipe_session.default.html @@ -1,4 +1,4 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: (config?: TypeInput) => RecipeListFunction = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • userContext: any = {}

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • createNewSession(req: any, res: any, tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, userContext?: any): Promise<SessionContainer>
  • createNewSessionWithoutRequestResponse(tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, disableAntiCsrf?: boolean, userContext?: any): Promise<SessionContainer>
  • fetchAndSetClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
  • getAllSessionHandlesForUser(userId: string, fetchSessionsForAllLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
  • Parameters

    • userId: string
    • fetchSessionsForAllLinkedAccounts: boolean = true
    • Optional tenantId: string
    • userContext: any = {}

    Returns Promise<string[]>

  • getClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, userContext?: any): Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
  • Type parameters

    • T

    Parameters

    • sessionHandle: string
    • claim: SessionClaim<T>
    • userContext: any = {}

    Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[] }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
  • getSessionInformation(sessionHandle: string, userContext?: any): Promise<undefined | SessionInformation>
  • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string): Promise<SessionContainer>
  • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired?: true }, userContext?: any): Promise<SessionContainer>
  • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired: false }, userContext?: any): Promise<undefined | SessionContainer>
  • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions, userContext?: any): Promise<undefined | SessionContainer>
  • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
  • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
  • refreshSessionWithoutRequestResponse(refreshToken: string, disableAntiCsrf?: boolean, antiCsrfToken?: string, userContext?: any): Promise<SessionContainer>
  • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
  • revokeAllSessionsForUser(userId: string, revokeSessionsForLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
  • Parameters

    • userId: string
    • revokeSessionsForLinkedAccounts: boolean = true
    • Optional tenantId: string
    • userContext: any = {}

    Returns Promise<string[]>

  • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
  • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
  • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
  • updateSessionDataInDatabase(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static property
  • Static method
  • Interface

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Returns Promise<SessionContainer>

  • Parameters

    • accessToken: string
    • Optional antiCsrfToken: string
    • Optional options: VerifySessionOptions & { sessionRequired?: true }
    • Optional userContext: any

    Returns Promise<SessionContainer>

  • Parameters

    • accessToken: string
    • Optional antiCsrfToken: string
    • Optional options: VerifySessionOptions & { sessionRequired: false }
    • Optional userContext: any

    Returns Promise<undefined | SessionContainer>

  • Parameters

    • accessToken: string
    • Optional antiCsrfToken: string
    • Optional options: VerifySessionOptions
    • Optional userContext: any

    Returns Promise<undefined | SessionContainer>

    • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
    • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
    • refreshSessionWithoutRequestResponse(refreshToken: string, disableAntiCsrf?: boolean, antiCsrfToken?: string, userContext?: any): Promise<SessionContainer>
    • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • revokeAllSessionsForUser(userId: string, revokeSessionsForLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
    • Parameters

      • userId: string
      • revokeSessionsForLinkedAccounts: boolean = true
      • Optional tenantId: string
      • userContext: any = {}

      Returns Promise<string[]>

    • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
    • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
    • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
    • updateSessionDataInDatabase(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_thirdparty.default.html b/docs/classes/recipe_thirdparty.default.html index 1589edc50..3b15ce590 100644 --- a/docs/classes/recipe_thirdparty.default.html +++ b/docs/classes/recipe_thirdparty.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_thirdpartyemailpassword.default.html b/docs/classes/recipe_thirdpartyemailpassword.default.html index d66d0fd1e..be61f4b8c 100644 --- a/docs/classes/recipe_thirdpartyemailpassword.default.html +++ b/docs/classes/recipe_thirdpartyemailpassword.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_thirdpartypasswordless.default.html b/docs/classes/recipe_thirdpartypasswordless.default.html index 45a02aa99..e3a8fd095 100644 --- a/docs/classes/recipe_thirdpartypasswordless.default.html +++ b/docs/classes/recipe_thirdpartypasswordless.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_usermetadata.default.html b/docs/classes/recipe_usermetadata.default.html index 4bf4d70ba..57ce03bd5 100644 --- a/docs/classes/recipe_usermetadata.default.html +++ b/docs/classes/recipe_usermetadata.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_userroles.default.html b/docs/classes/recipe_userroles.default.html index 81f154456..48647acf5 100644 --- a/docs/classes/recipe_userroles.default.html +++ b/docs/classes/recipe_userroles.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    PermissionClaim: PermissionClaimClass = PermissionClaim
    UserRoleClaim: UserRoleClaimClass = UserRoleClaim
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    PermissionClaim: PermissionClaimClass = PermissionClaim
    UserRoleClaim: UserRoleClaimClass = UserRoleClaim
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_awsLambda.SessionEvent.html b/docs/interfaces/framework_awsLambda.SessionEvent.html index fbbbbe1f6..4d7391bd9 100644 --- a/docs/interfaces/framework_awsLambda.SessionEvent.html +++ b/docs/interfaces/framework_awsLambda.SessionEvent.html @@ -1 +1 @@ -SessionEvent | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEvent
      • SessionEvent

    Index

    Properties

    body: null | string
    headers: APIGatewayProxyEventHeaders
    httpMethod: string
    isBase64Encoded: boolean
    multiValueHeaders: APIGatewayProxyEventMultiValueHeaders
    multiValueQueryStringParameters: null | APIGatewayProxyEventMultiValueQueryStringParameters
    path: string
    pathParameters: null | APIGatewayProxyEventPathParameters
    queryStringParameters: null | APIGatewayProxyEventQueryStringParameters
    requestContext: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>
    resource: string
    stageVariables: null | APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +SessionEvent | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEvent
      • SessionEvent

    Index

    Properties

    body: null | string
    headers: APIGatewayProxyEventHeaders
    httpMethod: string
    isBase64Encoded: boolean
    multiValueHeaders: APIGatewayProxyEventMultiValueHeaders
    multiValueQueryStringParameters: null | APIGatewayProxyEventMultiValueQueryStringParameters
    path: string
    pathParameters: null | APIGatewayProxyEventPathParameters
    queryStringParameters: null | APIGatewayProxyEventQueryStringParameters
    requestContext: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>
    resource: string
    stageVariables: null | APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_awsLambda.SessionEventV2.html b/docs/interfaces/framework_awsLambda.SessionEventV2.html index 97b550c4c..eab17fb77 100644 --- a/docs/interfaces/framework_awsLambda.SessionEventV2.html +++ b/docs/interfaces/framework_awsLambda.SessionEventV2.html @@ -1 +1 @@ -SessionEventV2 | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEventV2
      • SessionEventV2

    Index

    Properties

    body?: string
    cookies?: string[]
    headers: APIGatewayProxyEventHeaders
    isBase64Encoded: boolean
    pathParameters?: APIGatewayProxyEventPathParameters
    queryStringParameters?: APIGatewayProxyEventQueryStringParameters
    rawPath: string
    rawQueryString: string
    requestContext: { accountId: string; apiId: string; authorizer?: { jwt: { claims: {}; scopes: string[] } }; domainName: string; domainPrefix: string; http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }; requestId: string; routeKey: string; stage: string; time: string; timeEpoch: number }

    Type declaration

    • accountId: string
    • apiId: string
    • Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
      • jwt: { claims: {}; scopes: string[] }
        • claims: {}
          • [name: string]: string | number | boolean | string[]
        • scopes: string[]
    • domainName: string
    • domainPrefix: string
    • http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
      • method: string
      • path: string
      • protocol: string
      • sourceIp: string
      • userAgent: string
    • requestId: string
    • routeKey: string
    • stage: string
    • time: string
    • timeEpoch: number
    routeKey: string
    stageVariables?: APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
    version: string

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +SessionEventV2 | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEventV2
      • SessionEventV2

    Index

    Properties

    body?: string
    cookies?: string[]
    headers: APIGatewayProxyEventHeaders
    isBase64Encoded: boolean
    pathParameters?: APIGatewayProxyEventPathParameters
    queryStringParameters?: APIGatewayProxyEventQueryStringParameters
    rawPath: string
    rawQueryString: string
    requestContext: { accountId: string; apiId: string; authorizer?: { jwt: { claims: {}; scopes: string[] } }; domainName: string; domainPrefix: string; http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }; requestId: string; routeKey: string; stage: string; time: string; timeEpoch: number }

    Type declaration

    • accountId: string
    • apiId: string
    • Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
      • jwt: { claims: {}; scopes: string[] }
        • claims: {}
          • [name: string]: string | number | boolean | string[]
        • scopes: string[]
    • domainName: string
    • domainPrefix: string
    • http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
      • method: string
      • path: string
      • protocol: string
      • sourceIp: string
      • userAgent: string
    • requestId: string
    • routeKey: string
    • stage: string
    • time: string
    • timeEpoch: number
    routeKey: string
    stageVariables?: APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
    version: string

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_express.SessionRequest.html b/docs/interfaces/framework_express.SessionRequest.html index 2aecbc52d..d0cdcae7d 100644 --- a/docs/interfaces/framework_express.SessionRequest.html +++ b/docs/interfaces/framework_express.SessionRequest.html @@ -118,7 +118,7 @@
    route: any
    secure: boolean

    Short-hand for:

    req.protocol == 'https'

    -
    signedCookies: any
    socket: Socket
    +
    signedCookies: any
    socket: Socket

    The net.Socket object associated with the connection.

    With HTTPS support, use request.socket.getPeerCertificate() to obtain the client's authentication details.

    diff --git a/docs/interfaces/framework_fastify.SessionRequest.html b/docs/interfaces/framework_fastify.SessionRequest.html index 6e8cc5ae3..1c33becf8 100644 --- a/docs/interfaces/framework_fastify.SessionRequest.html +++ b/docs/interfaces/framework_fastify.SessionRequest.html @@ -1,4 +1,4 @@ SessionRequest | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • FastifyRequest
      • SessionRequest

    Index

    Properties

    body: unknown
    connection: Socket
    headers: IncomingHttpHeaders
    hostname: string
    id: any
    ip: string
    ips?: string[]
    is404: boolean
    log: FastifyLoggerInstance
    method: string
    params: unknown
    protocol: "http" | "https"
    query: unknown
    raw: IncomingMessage
    req: IncomingMessage
    deprecated

    Use raw property

    -
    routerMethod: string
    routerPath: string
    socket: Socket
    url: string
    validationError?: Error & { validation: any; validationContext: string }
    +
    routerMethod: string
    routerPath: string
    socket: Socket
    url: string
    validationError?: Error & { validation: any; validationContext: string }

    in order for this to be used the user should ensure they have set the attachValidation option.

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_hapi.SessionRequest.html b/docs/interfaces/framework_hapi.SessionRequest.html index 7b1282506..938181313 100644 --- a/docs/interfaces/framework_hapi.SessionRequest.html +++ b/docs/interfaces/framework_hapi.SessionRequest.html @@ -89,7 +89,7 @@
    server: Server

    Access: read only and the public server interface. The server object.

    -
    state: Dictionary<any>
    +
    state: Dictionary<any>

    An object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition.

    url: URL

    The parsed request URI.

    diff --git a/docs/interfaces/framework_koa.SessionContext.html b/docs/interfaces/framework_koa.SessionContext.html index c11f16d82..fcfba5f2d 100644 --- a/docs/interfaces/framework_koa.SessionContext.html +++ b/docs/interfaces/framework_koa.SessionContext.html @@ -81,7 +81,7 @@
    secure: boolean

    Short-hand for:

    this.protocol == 'https'

    -
    socket: Socket
    +
    socket: Socket

    Return the request socket.

    stale: boolean

    Check if the request is stale, aka diff --git a/docs/interfaces/framework_loopback.SessionContext.html b/docs/interfaces/framework_loopback.SessionContext.html index 77b267a78..f598fb919 100644 --- a/docs/interfaces/framework_loopback.SessionContext.html +++ b/docs/interfaces/framework_loopback.SessionContext.html @@ -14,7 +14,7 @@

    A flag to tell if the response is finished.

    scope: BindingScope

    Scope for binding resolution

    -
    subscriptionManager: ContextSubscriptionManager
    +
    subscriptionManager: ContextSubscriptionManager

    Manager for observer subscriptions

    tagIndexer: ContextTagIndexer

    Indexer for bindings by tag

    diff --git a/docs/interfaces/recipe_session.SessionContainer.html b/docs/interfaces/recipe_session.SessionContainer.html index edd4cad6f..f7f256ae4 100644 --- a/docs/interfaces/recipe_session.SessionContainer.html +++ b/docs/interfaces/recipe_session.SessionContainer.html @@ -1 +1 @@ -SessionContainer | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SessionContainer

    Index

    Methods

    • attachToRequestResponse(reqResInfo: ReqResInfo, userContext?: any): void | Promise<void>
    • fetchAndSetClaim<T>(claim: SessionClaim<T>, userContext?: any): Promise<void>
    • getAccessToken(userContext?: any): string
    • getAccessTokenPayload(userContext?: any): any
    • getAllSessionTokensDangerously(): { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }
    • Returns { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }

      • accessAndFrontTokenUpdated: boolean
      • accessToken: string
      • antiCsrfToken: undefined | string
      • frontToken: string
      • refreshToken: undefined | string
    • getClaimValue<T>(claim: SessionClaim<T>, userContext?: any): Promise<undefined | T>
    • getExpiry(userContext?: any): Promise<number>
    • getHandle(userContext?: any): string
    • getSessionDataFromDatabase(userContext?: any): Promise<any>
    • getTenantId(userContext?: any): string
    • getTimeCreated(userContext?: any): Promise<number>
    • getUserId(userContext?: any): string
    • mergeIntoAccessTokenPayload(accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<void>
    • removeClaim(claim: SessionClaim<any>, userContext?: any): Promise<void>
    • revokeSession(userContext?: any): Promise<void>
    • setClaimValue<T>(claim: SessionClaim<T>, value: T, userContext?: any): Promise<void>
    • updateSessionDataInDatabase(newSessionData: any, userContext?: any): Promise<any>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Method
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +SessionContainer | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SessionContainer

    Index

    Methods

    • attachToRequestResponse(reqResInfo: ReqResInfo, userContext?: any): void | Promise<void>
    • fetchAndSetClaim<T>(claim: SessionClaim<T>, userContext?: any): Promise<void>
    • getAccessToken(userContext?: any): string
    • getAccessTokenPayload(userContext?: any): any
    • getAllSessionTokensDangerously(): { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }
    • Returns { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }

      • accessAndFrontTokenUpdated: boolean
      • accessToken: string
      • antiCsrfToken: undefined | string
      • frontToken: string
      • refreshToken: undefined | string
    • getClaimValue<T>(claim: SessionClaim<T>, userContext?: any): Promise<undefined | T>
    • getExpiry(userContext?: any): Promise<number>
    • getHandle(userContext?: any): string
    • getSessionDataFromDatabase(userContext?: any): Promise<any>
    • getTenantId(userContext?: any): string
    • getTimeCreated(userContext?: any): Promise<number>
    • getUserId(userContext?: any): string
    • mergeIntoAccessTokenPayload(accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<void>
    • removeClaim(claim: SessionClaim<any>, userContext?: any): Promise<void>
    • revokeSession(userContext?: any): Promise<void>
    • setClaimValue<T>(claim: SessionClaim<T>, value: T, userContext?: any): Promise<void>
    • updateSessionDataInDatabase(newSessionData: any, userContext?: any): Promise<any>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Method
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/recipe_session.VerifySessionOptions.html b/docs/interfaces/recipe_session.VerifySessionOptions.html index 052b09b78..2655b281e 100644 --- a/docs/interfaces/recipe_session.VerifySessionOptions.html +++ b/docs/interfaces/recipe_session.VerifySessionOptions.html @@ -1 +1 @@ -VerifySessionOptions | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Method
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +VerifySessionOptions | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Method
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework.html b/docs/modules/framework.html index f29a33c02..38602c276 100644 --- a/docs/modules/framework.html +++ b/docs/modules/framework.html @@ -1 +1 @@ -framework | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Properties

    default: { awsLambda: framework/awsLambda; express: framework/express; fastify: framework/fastify; hapi: framework/hapi; koa: framework/koa; loopback: framework/loopback }

    Type declaration

    Variables

    awsLambda: framework/awsLambda = awsLambdaFramework
    express: framework/express = expressFramework
    fastify: framework/fastify = fastifyFramework
    hapi: framework/hapi = hapiFramework
    koa: framework/koa = koaFramework
    loopback: framework/loopback = loopbackFramework

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Properties

    default: { awsLambda: framework/awsLambda; express: framework/express; fastify: framework/fastify; hapi: framework/hapi; koa: framework/koa; loopback: framework/loopback }

    Type declaration

    Variables

    awsLambda: framework/awsLambda = awsLambdaFramework
    express: framework/express = expressFramework
    fastify: framework/fastify = fastifyFramework
    hapi: framework/hapi = hapiFramework
    koa: framework/koa = koaFramework
    loopback: framework/loopback = loopbackFramework

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_awsLambda.html b/docs/modules/framework_awsLambda.html index 12c7c6276..f15870926 100644 --- a/docs/modules/framework_awsLambda.html +++ b/docs/modules/framework_awsLambda.html @@ -1 +1 @@ -framework/awsLambda | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/awsLambda

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/awsLambda | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/awsLambda

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_custom.html b/docs/modules/framework_custom.html index 75946940d..fdba5deda 100644 --- a/docs/modules/framework_custom.html +++ b/docs/modules/framework_custom.html @@ -1 +1 @@ -framework/custom | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/custom

    Index

    Functions

    • middleware<OrigReqType, OrigRespType>(wrapRequest?: (req: OrigReqType) => BaseRequest, wrapResponse?: (req: OrigRespType) => BaseResponse): (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
    • Type parameters

      Parameters

      Returns (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

        • (request: OrigReqType, response: OrigRespType, next?: NextFunction): Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
        • Parameters

          • request: OrigReqType
          • response: OrigRespType
          • Optional next: NextFunction

          Returns Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/custom | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/custom

    Index

    Functions

    • middleware<OrigReqType, OrigRespType>(wrapRequest?: (req: OrigReqType) => BaseRequest, wrapResponse?: (req: OrigRespType) => BaseResponse): (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
    • Type parameters

      Parameters

      Returns (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

        • (request: OrigReqType, response: OrigRespType, next?: NextFunction): Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
        • Parameters

          • request: OrigReqType
          • response: OrigRespType
          • Optional next: NextFunction

          Returns Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_express.html b/docs/modules/framework_express.html index 682e48849..0e603adc1 100644 --- a/docs/modules/framework_express.html +++ b/docs/modules/framework_express.html @@ -1 +1 @@ -framework/express | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/express

    Index

    Functions

    • errorHandler(): (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>
    • Returns (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>

        • (err: any, req: Request, res: Response, next: NextFunction): Promise<void>
        • Parameters

          • err: any
          • req: Request
          • res: Response
          • next: NextFunction

          Returns Promise<void>

    • middleware(): (req: Request, res: Response, next: NextFunction) => Promise<void>
    • Returns (req: Request, res: Response, next: NextFunction) => Promise<void>

        • (req: Request, res: Response, next: NextFunction): Promise<void>
        • Parameters

          • req: Request
          • res: Response
          • next: NextFunction

          Returns Promise<void>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/express | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/express

    Index

    Functions

    • errorHandler(): (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>
    • Returns (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>

        • (err: any, req: Request, res: Response, next: NextFunction): Promise<void>
        • Parameters

          • err: any
          • req: Request
          • res: Response
          • next: NextFunction

          Returns Promise<void>

    • middleware(): (req: Request, res: Response, next: NextFunction) => Promise<void>
    • Returns (req: Request, res: Response, next: NextFunction) => Promise<void>

        • (req: Request, res: Response, next: NextFunction): Promise<void>
        • Parameters

          • req: Request
          • res: Response
          • next: NextFunction

          Returns Promise<void>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_fastify.html b/docs/modules/framework_fastify.html index 9d6be81b8..3ecd46f88 100644 --- a/docs/modules/framework_fastify.html +++ b/docs/modules/framework_fastify.html @@ -1 +1 @@ -framework/fastify | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/fastify

    Index

    Functions

    • errorHandler(): (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>
    • Returns (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>

        • (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>): Promise<void>
        • Parameters

          • err: any
          • req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>
          • res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

          Returns Promise<void>

    • plugin(instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>, opts: Record<never, never>, done: (err?: Error) => void): void
    • Parameters

      • instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>
      • opts: Record<never, never>
      • done: (err?: Error) => void
          • (err?: Error): void
          • Parameters

            • Optional err: Error

            Returns void

      Returns void

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/fastify | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/fastify

    Index

    Functions

    • errorHandler(): (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>
    • Returns (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>

        • (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>): Promise<void>
        • Parameters

          • err: any
          • req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>
          • res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

          Returns Promise<void>

    • plugin(instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>, opts: Record<never, never>, done: (err?: Error) => void): void
    • Parameters

      • instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>
      • opts: Record<never, never>
      • done: (err?: Error) => void
          • (err?: Error): void
          • Parameters

            • Optional err: Error

            Returns void

      Returns void

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_hapi.html b/docs/modules/framework_hapi.html index 75011362b..045024051 100644 --- a/docs/modules/framework_hapi.html +++ b/docs/modules/framework_hapi.html @@ -1 +1 @@ -framework/hapi | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/hapi

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/hapi | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/hapi

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_koa.html b/docs/modules/framework_koa.html index dba95999f..8a0dfa9c8 100644 --- a/docs/modules/framework_koa.html +++ b/docs/modules/framework_koa.html @@ -1 +1 @@ -framework/koa | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/koa

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/koa | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/koa

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_loopback.html b/docs/modules/framework_loopback.html index b2089b062..33c96ab72 100644 --- a/docs/modules/framework_loopback.html +++ b/docs/modules/framework_loopback.html @@ -1 +1 @@ -framework/loopback | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/loopback

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/loopback | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/loopback

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/index.html b/docs/modules/index.html index 9108dcbd1..2384d0170 100644 --- a/docs/modules/index.html +++ b/docs/modules/index.html @@ -1 +1 @@ -index | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Variables

    Error: typeof default = SuperTokensWrapper.Error

    Functions

    • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string }
        • externalUserId: string
        • Optional externalUserIdInfo?: string
        • Optional force?: boolean
        • superTokensUserId: string

      Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

    • deleteUser(userId: string, removeAllLinkedAccounts?: boolean, userContext?: any): Promise<{ status: "OK" }>
    • Parameters

      • userId: string
      • removeAllLinkedAccounts: boolean = true
      • Optional userContext: any

      Returns Promise<{ status: "OK" }>

    • deleteUserIdMapping(input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
    • Parameters

      • input: { force?: boolean; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional force?: boolean
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ didMappingExist: boolean; status: "OK" }>

    • getAllCORSHeaders(): string[]
    • getRequestFromUserContext(userContext: any): undefined | BaseRequest
    • getUser(userId: string, userContext?: any): Promise<undefined | User>
    • Parameters

      • userId: string
      • Optional userContext: any

      Returns Promise<undefined | User>

    • getUserCount(includeRecipeIds?: string[], tenantId?: string): Promise<number>
    • Parameters

      • Optional includeRecipeIds: string[]
      • Optional tenantId: string

      Returns Promise<number>

    • getUserIdMapping(input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
    • Parameters

      • input: { userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

    • getUsersNewestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string }): Promise<{ nextPaginationToken?: string; users: User[] }>
    • Parameters

      • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string }
        • Optional includeRecipeIds?: string[]
        • Optional limit?: number
        • Optional paginationToken?: string
        • Optional query?: {}
          • [key: string]: string
        • tenantId: string

      Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • getUsersOldestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string }): Promise<{ nextPaginationToken?: string; users: User[] }>
    • Parameters

      • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string }
        • Optional includeRecipeIds?: string[]
        • Optional limit?: number
        • Optional paginationToken?: string
        • Optional query?: {}
          • [key: string]: string
        • tenantId: string

      Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • init(config: TypeInput): void
    • listUsersByAccountInfo(tenantId: string, accountInfo: AccountInfo, doUnionOfAccountInfo?: boolean, userContext?: any): Promise<User[]>
    • Parameters

      • tenantId: string
      • accountInfo: AccountInfo
      • doUnionOfAccountInfo: boolean = false
      • Optional userContext: any

      Returns Promise<User[]>

    • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
    • Parameters

      • input: { externalUserIdInfo?: string; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional externalUserIdInfo?: string
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +index | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Variables

    Error: typeof default = SuperTokensWrapper.Error

    Functions

    • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }
        • externalUserId: string
        • Optional externalUserIdInfo?: string
        • Optional force?: boolean
        • superTokensUserId: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

    • deleteUser(userId: string, removeAllLinkedAccounts?: boolean, userContext?: any): Promise<{ status: "OK" }>
    • Parameters

      • userId: string
      • removeAllLinkedAccounts: boolean = true
      • Optional userContext: any

      Returns Promise<{ status: "OK" }>

    • deleteUserIdMapping(input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
    • Parameters

      • input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional force?: boolean
        • Optional userContext?: any
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ didMappingExist: boolean; status: "OK" }>

    • getAllCORSHeaders(): string[]
    • getRequestFromUserContext(userContext: any): undefined | BaseRequest
    • getUser(userId: string, userContext?: any): Promise<undefined | User>
    • Parameters

      • userId: string
      • Optional userContext: any

      Returns Promise<undefined | User>

    • getUserCount(includeRecipeIds?: string[], tenantId?: string, userContext?: any): Promise<number>
    • Parameters

      • Optional includeRecipeIds: string[]
      • Optional tenantId: string
      • Optional userContext: any

      Returns Promise<number>

    • getUserIdMapping(input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
    • Parameters

      • input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional userContext?: any
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

    • getUsersNewestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
    • Parameters

      • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
        • Optional includeRecipeIds?: string[]
        • Optional limit?: number
        • Optional paginationToken?: string
        • Optional query?: {}
          • [key: string]: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • getUsersOldestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
    • Parameters

      • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
        • Optional includeRecipeIds?: string[]
        • Optional limit?: number
        • Optional paginationToken?: string
        • Optional query?: {}
          • [key: string]: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • init(config: TypeInput): void
    • listUsersByAccountInfo(tenantId: string, accountInfo: AccountInfo, doUnionOfAccountInfo?: boolean, userContext?: any): Promise<User[]>
    • Parameters

      • tenantId: string
      • accountInfo: AccountInfo
      • doUnionOfAccountInfo: boolean = false
      • Optional userContext: any

      Returns Promise<User[]>

    • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
    • Parameters

      • input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional externalUserIdInfo?: string
        • Optional userContext?: any
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_accountlinking.html b/docs/modules/recipe_accountlinking.html index 52c6bdf2d..73677acb1 100644 --- a/docs/modules/recipe_accountlinking.html +++ b/docs/modules/recipe_accountlinking.html @@ -1 +1 @@ -recipe/accountlinking | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/accountlinking

    Index

    Type aliases

    RecipeInterface: { canCreatePrimaryUser: any; canLinkAccounts: any; createPrimaryUser: any; deleteUser: any; getUser: any; getUsers: any; linkAccounts: any; listUsersByAccountInfo: any; unlinkAccount: any }

    Type declaration

    • canCreatePrimaryUser:function
      • canCreatePrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
      • Parameters

        Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • canLinkAccounts:function
      • canLinkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
      • Parameters

        • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
          • primaryUserId: string
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • createPrimaryUser:function
      • createPrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
      • Parameters

        Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • deleteUser:function
      • deleteUser(input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }): Promise<{ status: "OK" }>
      • Parameters

        • input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }
          • removeAllLinkedAccounts: boolean
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK" }>

    • getUser:function
      • getUser(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUsers:function
      • getUsers(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
      • Parameters

        • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }
          • Optional includeRecipeIds?: string[]
          • Optional limit?: number
          • Optional paginationToken?: string
          • Optional query?: {}
            • [key: string]: string
          • tenantId: string
          • timeJoinedOrder: "ASC" | "DESC"
          • userContext: any

        Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • linkAccounts:function
      • linkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
      • Parameters

        • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
          • primaryUserId: string
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • listUsersByAccountInfo:function
      • listUsersByAccountInfo(input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }): Promise<User[]>
      • Parameters

        • input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }
          • accountInfo: AccountInfo
          • doUnionOfAccountInfo: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<User[]>

    • unlinkAccount:function
      • unlinkAccount(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

    Functions

    • canCreatePrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
    • Parameters

      Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • canLinkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
    • Parameters

      • recipeUserId: RecipeUserId
      • primaryUserId: string
      • userContext: any = {}

      Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • createPrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
    • Parameters

      Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • createPrimaryUserIdOrLinkAccounts(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<User>
    • getPrimaryUserThatCanBeLinkedToRecipeUserId(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<undefined | User>
    • init(config?: TypeInput): RecipeListFunction
    • isEmailChangeAllowed(recipeUserId: RecipeUserId, newEmail: string, isVerified: boolean, userContext?: any): Promise<boolean>
    • isSignInAllowed(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<boolean>
    • isSignUpAllowed(tenantId: string, newUser: AccountInfoWithRecipeId, isVerified: boolean, userContext?: any): Promise<boolean>
    • linkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
    • Parameters

      • recipeUserId: RecipeUserId
      • primaryUserId: string
      • userContext: any = {}

      Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • unlinkAccount(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/accountlinking | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/accountlinking

    Index

    Type aliases

    RecipeInterface: { canCreatePrimaryUser: any; canLinkAccounts: any; createPrimaryUser: any; deleteUser: any; getUser: any; getUsers: any; linkAccounts: any; listUsersByAccountInfo: any; unlinkAccount: any }

    Type declaration

    • canCreatePrimaryUser:function
      • canCreatePrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
      • Parameters

        Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • canLinkAccounts:function
      • canLinkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
      • Parameters

        • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
          • primaryUserId: string
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • createPrimaryUser:function
      • createPrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
      • Parameters

        Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • deleteUser:function
      • deleteUser(input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }): Promise<{ status: "OK" }>
      • Parameters

        • input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }
          • removeAllLinkedAccounts: boolean
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK" }>

    • getUser:function
      • getUser(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUsers:function
      • getUsers(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
      • Parameters

        • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }
          • Optional includeRecipeIds?: string[]
          • Optional limit?: number
          • Optional paginationToken?: string
          • Optional query?: {}
            • [key: string]: string
          • tenantId: string
          • timeJoinedOrder: "ASC" | "DESC"
          • userContext: any

        Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • linkAccounts:function
      • linkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
      • Parameters

        • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
          • primaryUserId: string
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • listUsersByAccountInfo:function
      • listUsersByAccountInfo(input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }): Promise<User[]>
      • Parameters

        • input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }
          • accountInfo: AccountInfo
          • doUnionOfAccountInfo: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<User[]>

    • unlinkAccount:function
      • unlinkAccount(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

    Functions

    • canCreatePrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
    • Parameters

      Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • canLinkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
    • Parameters

      • recipeUserId: RecipeUserId
      • primaryUserId: string
      • userContext: any = {}

      Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • createPrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
    • Parameters

      Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • createPrimaryUserIdOrLinkAccounts(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<User>
    • getPrimaryUserThatCanBeLinkedToRecipeUserId(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<undefined | User>
    • init(config?: TypeInput): RecipeListFunction
    • isEmailChangeAllowed(recipeUserId: RecipeUserId, newEmail: string, isVerified: boolean, userContext?: any): Promise<boolean>
    • isSignInAllowed(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<boolean>
    • isSignUpAllowed(tenantId: string, newUser: AccountInfoWithRecipeId, isVerified: boolean, userContext?: any): Promise<boolean>
    • linkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
    • Parameters

      • recipeUserId: RecipeUserId
      • primaryUserId: string
      • userContext: any = {}

      Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • unlinkAccount(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_dashboard.html b/docs/modules/recipe_dashboard.html index 77ab1ea52..07f400716 100644 --- a/docs/modules/recipe_dashboard.html +++ b/docs/modules/recipe_dashboard.html @@ -1 +1 @@ -recipe/dashboard | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/dashboard

    Index

    Type aliases

    APIInterface: { dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>) }

    Type declaration

    • dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    RecipeInterface: { getDashboardBundleLocation: any; shouldAllowAccess: any }

    Type declaration

    • getDashboardBundleLocation:function
      • getDashboardBundleLocation(input: { userContext: any }): Promise<string>
    • shouldAllowAccess:function
      • shouldAllowAccess(input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }): Promise<boolean>

    Functions

    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/dashboard | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/dashboard

    Index

    Type aliases

    APIInterface: { dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>) }

    Type declaration

    • dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    RecipeInterface: { getDashboardBundleLocation: any; shouldAllowAccess: any }

    Type declaration

    • getDashboardBundleLocation:function
      • getDashboardBundleLocation(input: { userContext: any }): Promise<string>
    • shouldAllowAccess:function
      • shouldAllowAccess(input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }): Promise<boolean>

    Functions

    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_emailpassword.html b/docs/modules/recipe_emailpassword.html index 112fc14c1..ead41cb9a 100644 --- a/docs/modules/recipe_emailpassword.html +++ b/docs/modules/recipe_emailpassword.html @@ -1,5 +1,5 @@ -recipe/emailpassword | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/emailpassword

    Index

    Type aliases

    APIInterface: { emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>) }

    Type declaration

    • emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
    • signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
    • signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailPasswordEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    RecipeInterface: { consumePasswordResetToken: any; createNewRecipeUser: any; createResetPasswordToken: any; signIn: any; signUp: any; updateEmailOrPassword: any }

    Type declaration

    • consumePasswordResetToken:function
      • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { tenantId: string; token: string; userContext: any }
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • createNewRecipeUser:function
      • createNewRecipeUser(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

    • createResetPasswordToken:function
      • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
      • +recipe/emailpassword | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/emailpassword

        Index

        Type aliases

        APIInterface: { emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>) }

        Type declaration

        • emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
        • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
        • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
        • signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
        • signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailPasswordEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        RecipeInterface: { consumePasswordResetToken: any; createNewRecipeUser: any; createResetPasswordToken: any; signIn: any; signUp: any; updateEmailOrPassword: any }

        Type declaration

        • consumePasswordResetToken:function
          • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
          • Parameters

            • input: { tenantId: string; token: string; userContext: any }
              • tenantId: string
              • token: string
              • userContext: any

            Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

        • createNewRecipeUser:function
          • createNewRecipeUser(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

        • createResetPasswordToken:function
          • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
          • We pass in the email as well to this function cause the input userId may not be associated with an emailpassword account. In this case, we need to know which email to use to create an emailpassword account later on.

            -

            Parameters

            • input: { email: string; tenantId: string; userContext: any; userId: string }
              • email: string
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • signIn:function
          • signIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>

        • signUp:function
          • signUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

        • updateEmailOrPassword:function
          • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
          • Parameters

            • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
              • Optional applyPasswordPolicy?: boolean
              • Optional email?: string
              • Optional password?: string
              • recipeUserId: RecipeUserId
              • tenantIdForPasswordPolicy: string
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
        • Parameters

          • tenantId: string
          • token: string
          • Optional userContext: any

          Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

        • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • email: string
          • userContext: any = {}

          Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • email: string
          • Optional userContext: any

          Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • init(config?: TypeInput): RecipeListFunction
        • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • tenantId: string
          • token: string
          • newPassword: string
          • Optional userContext: any

          Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
        • signIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
        • signUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
        • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
            • Optional applyPasswordPolicy?: boolean
            • Optional email?: string
            • Optional password?: string
            • recipeUserId: RecipeUserId
            • Optional tenantIdForPasswordPolicy?: string
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        Legend

        • Variable
        • Function
        • Function with type parameter
        • Type alias
        • Class
        • Class with type parameter
        • Interface

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +

        Parameters

        • input: { email: string; tenantId: string; userContext: any; userId: string }
          • email: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • signIn:function
      • signIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>

    • signUp:function
      • signUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

    • updateEmailOrPassword:function
      • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
      • Parameters

        • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
          • Optional applyPasswordPolicy?: boolean
          • Optional email?: string
          • Optional password?: string
          • recipeUserId: RecipeUserId
          • tenantIdForPasswordPolicy: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • Optional userContext: any

      Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • email: string
      • userContext: any = {}

      Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • email: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • init(config?: TypeInput): RecipeListFunction
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • signIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • signUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_emailverification.html b/docs/modules/recipe_emailverification.html index e64c225b7..137545ccc 100644 --- a/docs/modules/recipe_emailverification.html +++ b/docs/modules/recipe_emailverification.html @@ -1 +1 @@ -recipe/emailverification | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/emailverification

    Index

    Type aliases

    APIInterface: { generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>); isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>); verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>) }

    Type declaration

    • generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>)
    • isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>)
    • verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>
    • isInServerlessEnv: boolean
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    RecipeInterface: { createEmailVerificationToken: any; isEmailVerified: any; revokeEmailVerificationTokens: any; unverifyEmail: any; verifyEmailUsingToken: any }

    Type declaration

    • createEmailVerificationToken:function
      • createEmailVerificationToken(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • isEmailVerified:function
      • isEmailVerified(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<boolean>
    • revokeEmailVerificationTokens:function
      • revokeEmailVerificationTokens(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • unverifyEmail:function
      • unverifyEmail(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" }>
    • verifyEmailUsingToken:function
      • verifyEmailUsingToken(input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }
          • attemptAccountLinking: boolean
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    UserEmailInfo: { email: string; recipeUserId: RecipeUserId }

    Type declaration

    Variables

    EmailVerificationClaim: EmailVerificationClaimClass = ...
    Error: typeof default = Wrapper.Error

    Functions

    • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • init(config: TypeInput): RecipeListFunction
    • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
    • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/emailverification | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/emailverification

    Index

    Type aliases

    APIInterface: { generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>); isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>); verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>) }

    Type declaration

    • generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>)
    • isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>)
    • verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>
    • isInServerlessEnv: boolean
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    RecipeInterface: { createEmailVerificationToken: any; isEmailVerified: any; revokeEmailVerificationTokens: any; unverifyEmail: any; verifyEmailUsingToken: any }

    Type declaration

    • createEmailVerificationToken:function
      • createEmailVerificationToken(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • isEmailVerified:function
      • isEmailVerified(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<boolean>
    • revokeEmailVerificationTokens:function
      • revokeEmailVerificationTokens(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • unverifyEmail:function
      • unverifyEmail(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" }>
    • verifyEmailUsingToken:function
      • verifyEmailUsingToken(input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }
          • attemptAccountLinking: boolean
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    UserEmailInfo: { email: string; recipeUserId: RecipeUserId }

    Type declaration

    Variables

    EmailVerificationClaim: EmailVerificationClaimClass = ...
    Error: typeof default = Wrapper.Error

    Functions

    • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • init(config: TypeInput): RecipeListFunction
    • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
    • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_jwt.html b/docs/modules/recipe_jwt.html index d054c9102..cfd92648e 100644 --- a/docs/modules/recipe_jwt.html +++ b/docs/modules/recipe_jwt.html @@ -1 +1 @@ -recipe/jwt | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Type aliases

    APIInterface: { getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>) }

    Type declaration

    • getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>)
    APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    JsonWebKey: { alg: string; e: string; kid: string; kty: string; n: string; use: string }

    Type declaration

    • alg: string
    • e: string
    • kid: string
    • kty: string
    • n: string
    • use: string
    RecipeInterface: { createJWT: any; getJWKS: any }

    Type declaration

    • createJWT:function
      • createJWT(input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
      • Parameters

        • input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }
          • Optional payload?: any
          • Optional useStaticSigningKey?: boolean
          • userContext: any
          • Optional validitySeconds?: number

        Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS:function
      • getJWKS(input: { userContext: any }): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

    Functions

    • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/jwt | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Type aliases

    APIInterface: { getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>) }

    Type declaration

    • getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>)
    APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    JsonWebKey: { alg: string; e: string; kid: string; kty: string; n: string; use: string }

    Type declaration

    • alg: string
    • e: string
    • kid: string
    • kty: string
    • n: string
    • use: string
    RecipeInterface: { createJWT: any; getJWKS: any }

    Type declaration

    • createJWT:function
      • createJWT(input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
      • Parameters

        • input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }
          • Optional payload?: any
          • Optional useStaticSigningKey?: boolean
          • userContext: any
          • Optional validitySeconds?: number

        Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS:function
      • getJWKS(input: { userContext: any }): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

    Functions

    • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_multitenancy.html b/docs/modules/recipe_multitenancy.html index a0aa5279d..10080a56b 100644 --- a/docs/modules/recipe_multitenancy.html +++ b/docs/modules/recipe_multitenancy.html @@ -1 +1 @@ -recipe/multitenancy | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/multitenancy

    Index

    Type aliases

    APIInterface: { loginMethodsGET: any }

    Type declaration

    • loginMethodsGET:function
      • loginMethodsGET(input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>
      • Parameters

        • input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }
          • Optional clientType?: string
          • options: APIOptions
          • tenantId: string
          • userContext: any

        Returns Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>

    APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; staticThirdPartyProviders: ProviderInput[] }

    Type declaration

    RecipeInterface: { associateUserToTenant: any; createOrUpdateTenant: any; createOrUpdateThirdPartyConfig: any; deleteTenant: any; deleteThirdPartyConfig: any; disassociateUserFromTenant: any; getTenant: any; getTenantId: any; listAllTenants: any }

    Type declaration

    • associateUserToTenant:function
      • associateUserToTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }

        Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant:function
      • createOrUpdateTenant(input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
      • Parameters

        • input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }
          • Optional config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
            • Optional coreConfig?: {}
              • [key: string]: any
            • Optional emailPasswordEnabled?: boolean
            • Optional passwordlessEnabled?: boolean
            • Optional thirdPartyEnabled?: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig:function
      • createOrUpdateThirdPartyConfig(input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
      • Parameters

        • input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }
          • config: ProviderConfig
          • Optional skipValidation?: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant:function
      • deleteTenant(input: { tenantId: string; userContext: any }): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig:function
      • deleteThirdPartyConfig(input: { tenantId: string; thirdPartyId: string; userContext: any }): Promise<{ didConfigExist: boolean; status: "OK" }>
      • Parameters

        • input: { tenantId: string; thirdPartyId: string; userContext: any }
          • tenantId: string
          • thirdPartyId: string
          • userContext: any

        Returns Promise<{ didConfigExist: boolean; status: "OK" }>

    • disassociateUserFromTenant:function
      • disassociateUserFromTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant:function
      • getTenant(input: { tenantId: string; userContext: any }): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
      • Parameters

        • input: { tenantId: string; userContext: any }
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • getTenantId:function
      • getTenantId(input: { tenantIdFromFrontend: string; userContext: any }): Promise<string>
    • listAllTenants:function
      • listAllTenants(input: { userContext: any }): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
      • Parameters

        • input: { userContext: any }
          • userContext: any

        Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Variables

    AllowedDomainsClaim: AllowedDomainsClaimClass = ...

    Functions

    • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
    • Parameters

      • tenantId: string
      • recipeUserId: RecipeUserId
      • Optional userContext: any

      Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
        • Optional coreConfig?: {}
          • [key: string]: any
        • Optional emailPasswordEnabled?: boolean
        • Optional passwordlessEnabled?: boolean
        • Optional thirdPartyEnabled?: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • config: ProviderConfig
      • Optional skipValidation: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
    • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
    • Parameters

      • tenantId: string
      • Optional userContext: any

      Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • init(config?: TypeInput): RecipeListFunction
    • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
    • Parameters

      • Optional userContext: any

      Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/multitenancy | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/multitenancy

    Index

    Type aliases

    APIInterface: { loginMethodsGET: any }

    Type declaration

    • loginMethodsGET:function
      • loginMethodsGET(input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>
      • Parameters

        • input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }
          • Optional clientType?: string
          • options: APIOptions
          • tenantId: string
          • userContext: any

        Returns Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>

    APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; staticThirdPartyProviders: ProviderInput[] }

    Type declaration

    RecipeInterface: { associateUserToTenant: any; createOrUpdateTenant: any; createOrUpdateThirdPartyConfig: any; deleteTenant: any; deleteThirdPartyConfig: any; disassociateUserFromTenant: any; getTenant: any; getTenantId: any; listAllTenants: any }

    Type declaration

    • associateUserToTenant:function
      • associateUserToTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }

        Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant:function
      • createOrUpdateTenant(input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
      • Parameters

        • input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }
          • Optional config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
            • Optional coreConfig?: {}
              • [key: string]: any
            • Optional emailPasswordEnabled?: boolean
            • Optional passwordlessEnabled?: boolean
            • Optional thirdPartyEnabled?: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig:function
      • createOrUpdateThirdPartyConfig(input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
      • Parameters

        • input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }
          • config: ProviderConfig
          • Optional skipValidation?: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant:function
      • deleteTenant(input: { tenantId: string; userContext: any }): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig:function
      • deleteThirdPartyConfig(input: { tenantId: string; thirdPartyId: string; userContext: any }): Promise<{ didConfigExist: boolean; status: "OK" }>
      • Parameters

        • input: { tenantId: string; thirdPartyId: string; userContext: any }
          • tenantId: string
          • thirdPartyId: string
          • userContext: any

        Returns Promise<{ didConfigExist: boolean; status: "OK" }>

    • disassociateUserFromTenant:function
      • disassociateUserFromTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant:function
      • getTenant(input: { tenantId: string; userContext: any }): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
      • Parameters

        • input: { tenantId: string; userContext: any }
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • getTenantId:function
      • getTenantId(input: { tenantIdFromFrontend: string; userContext: any }): Promise<string>
    • listAllTenants:function
      • listAllTenants(input: { userContext: any }): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
      • Parameters

        • input: { userContext: any }
          • userContext: any

        Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Variables

    AllowedDomainsClaim: AllowedDomainsClaimClass = ...

    Functions

    • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
    • Parameters

      • tenantId: string
      • recipeUserId: RecipeUserId
      • Optional userContext: any

      Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
        • Optional coreConfig?: {}
          • [key: string]: any
        • Optional emailPasswordEnabled?: boolean
        • Optional passwordlessEnabled?: boolean
        • Optional thirdPartyEnabled?: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • config: ProviderConfig
      • Optional skipValidation: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
    • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
    • Parameters

      • tenantId: string
      • Optional userContext: any

      Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • init(config?: TypeInput): RecipeListFunction
    • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
    • Parameters

      • Optional userContext: any

      Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_openid.html b/docs/modules/recipe_openid.html index 2d8d013dd..6329e65c5 100644 --- a/docs/modules/recipe_openid.html +++ b/docs/modules/recipe_openid.html @@ -1 +1 @@ -recipe/openid | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/openid

    Index

    Functions

    • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • Optional payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/openid | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/openid

    Index

    Functions

    • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • Optional payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index ab2b4483b..d65c41425 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1 +1 @@ -recipe/passwordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/passwordless

    Index

    Type aliases

    APIInterface: { consumeCodePOST?: any; createCodePOST?: any; emailExistsGET?: any; phoneNumberExistsGET?: any; resendCodePOST?: any }

    Type declaration

    • consumeCodePOST?:function
      • consumeCodePOST(input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any })): Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any })

        Returns Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • createCodePOST?:function
      • createCodePOST(input: ({ email: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any })): Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: ({ email: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any })

        Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • emailExistsGET?:function
      • emailExistsGET(input: { email: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
    • phoneNumberExistsGET?:function
      • phoneNumberExistsGET(input: { options: APIOptions; phoneNumber: string; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
    • resendCodePOST?:function
      • resendCodePOST(input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }

        Returns Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>

    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypePasswordlessEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; smsDelivery: default<TypePasswordlessSmsDeliveryInput> }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • emailDelivery: default<TypePasswordlessEmailDeliveryInput>
    • isInServerlessEnv: boolean
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    • smsDelivery: default<TypePasswordlessSmsDeliveryInput>
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; updateUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • tenantId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any }
          • deviceId: string
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | DeviceType>

    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
      • Parameters

        • input: { phoneNumber: string; tenantId: string; userContext: any }
          • phoneNumber: string
          • tenantId: string
          • userContext: any

        Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
      • Parameters

        • input: { preAuthSessionId: string; tenantId: string; userContext: any }
          • preAuthSessionId: string
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | DeviceType>

    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
      • Parameters

        • input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }

        Returns Promise<{ status: "OK" }>

    • revokeCode:function
      • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
      • Parameters

        • input: { codeId: string; tenantId: string; userContext: any }
          • codeId: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ status: "OK" }>

    • updateUser:function
      • updateUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<string>

    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any }
        • email: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { phoneNumber: string; tenantId: string; userContext?: any }
        • phoneNumber: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ status: "OK" }>

    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { codeId: string; tenantId: string; userContext?: any }
        • codeId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" }>

    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

    • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/passwordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/passwordless

    Index

    Type aliases

    APIInterface: { consumeCodePOST?: any; createCodePOST?: any; emailExistsGET?: any; phoneNumberExistsGET?: any; resendCodePOST?: any }

    Type declaration

    • consumeCodePOST?:function
      • consumeCodePOST(input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any })): Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any })

        Returns Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • createCodePOST?:function
      • createCodePOST(input: ({ email: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any })): Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: ({ email: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any })

        Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • emailExistsGET?:function
      • emailExistsGET(input: { email: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
    • phoneNumberExistsGET?:function
      • phoneNumberExistsGET(input: { options: APIOptions; phoneNumber: string; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
    • resendCodePOST?:function
      • resendCodePOST(input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }

        Returns Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>

    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypePasswordlessEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; smsDelivery: default<TypePasswordlessSmsDeliveryInput> }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • emailDelivery: default<TypePasswordlessEmailDeliveryInput>
    • isInServerlessEnv: boolean
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    • smsDelivery: default<TypePasswordlessSmsDeliveryInput>
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; updateUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • tenantId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any }
          • deviceId: string
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | DeviceType>

    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
      • Parameters

        • input: { phoneNumber: string; tenantId: string; userContext: any }
          • phoneNumber: string
          • tenantId: string
          • userContext: any

        Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
      • Parameters

        • input: { preAuthSessionId: string; tenantId: string; userContext: any }
          • preAuthSessionId: string
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | DeviceType>

    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
      • Parameters

        • input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }

        Returns Promise<{ status: "OK" }>

    • revokeCode:function
      • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
      • Parameters

        • input: { codeId: string; tenantId: string; userContext: any }
          • codeId: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ status: "OK" }>

    • updateUser:function
      • updateUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<string>

    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any }
        • email: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { phoneNumber: string; tenantId: string; userContext?: any }
        • phoneNumber: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ status: "OK" }>

    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { codeId: string; tenantId: string; userContext?: any }
        • codeId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" }>

    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

    • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index 5a9907777..6359e2f19 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,13 +1,13 @@ -recipe/session | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/session

    Index

    Type aliases

    APIInterface: { refreshPOST: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<SessionContainer>); signOutPOST: undefined | ((input: { options: APIOptions; session: SessionContainer | undefined; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>); verifySession: any }

    Type declaration

  • mergeIntoAccessTokenPayload:function
    • mergeIntoAccessTokenPayload(input: { accessTokenPayloadUpdate: JSONObject; sessionHandle: string; userContext: any }): Promise<boolean>
  • refreshSession:function
    • refreshSession(input: { antiCsrfToken?: string; disableAntiCsrf: boolean; refreshToken: string; userContext: any }): Promise<SessionContainer>
    • Parameters

      • input: { antiCsrfToken?: string; disableAntiCsrf: boolean; refreshToken: string; userContext: any }
        • Optional antiCsrfToken?: string
        • disableAntiCsrf: boolean
        • refreshToken: string
        • userContext: any

      Returns Promise<SessionContainer>

  • regenerateAccessToken:function
    • regenerateAccessToken(input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }): Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; recipeUserId: RecipeUserId; tenantId: string; userDataInJWT: any; userId: string }; status: "OK" }>
    • Parameters

      • input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }
        • accessToken: string
        • Optional newAccessTokenPayload?: any
        • userContext: any

      Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; recipeUserId: RecipeUserId; tenantId: string; userDataInJWT: any; userId: string }; status: "OK" }>

      Returns false if the sessionHandle does not exist

      +
  • removeClaim:function
    • removeClaim(input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }): Promise<boolean>
    • Parameters

      • input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }
        • claim: SessionClaim<any>
        • sessionHandle: string
        • userContext: any

      Returns Promise<boolean>

  • revokeAllSessionsForUser:function
    • revokeAllSessionsForUser(input: { revokeAcrossAllTenants?: boolean; revokeSessionsForLinkedAccounts: boolean; tenantId: string; userContext: any; userId: string }): Promise<string[]>
    • Parameters

      • input: { revokeAcrossAllTenants?: boolean; revokeSessionsForLinkedAccounts: boolean; tenantId: string; userContext: any; userId: string }
        • Optional revokeAcrossAllTenants?: boolean
        • revokeSessionsForLinkedAccounts: boolean
        • tenantId: string
        • userContext: any
        • userId: string

      Returns Promise<string[]>

  • revokeMultipleSessions:function
    • revokeMultipleSessions(input: { sessionHandles: string[]; userContext: any }): Promise<string[]>
    • Parameters

      • input: { sessionHandles: string[]; userContext: any }
        • sessionHandles: string[]
        • userContext: any

      Returns Promise<string[]>

  • revokeSession:function
    • revokeSession(input: { sessionHandle: string; userContext: any }): Promise<boolean>
  • setClaimValue:function
    • setClaimValue<T>(input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }): Promise<boolean>
    • Type parameters

      • T

      Parameters

      • input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }
        • claim: SessionClaim<T>
        • sessionHandle: string
        • userContext: any
        • value: T

      Returns Promise<boolean>

  • updateSessionDataInDatabase:function
    • updateSessionDataInDatabase(input: { newSessionData: any; sessionHandle: string; userContext: any }): Promise<boolean>
    • Parameters

      • input: { newSessionData: any; sessionHandle: string; userContext: any }
        • newSessionData: any
        • sessionHandle: string
        • userContext: any

      Returns Promise<boolean>

  • validateClaims:function
    • validateClaims(input: { accessTokenPayload: any; claimValidators: SessionClaimValidator[]; recipeUserId: RecipeUserId; userContext: any; userId: string }): Promise<{ accessTokenPayloadUpdate?: any; invalidClaims: ClaimValidationError[] }>
  • SessionClaimValidator: ({ claim: SessionClaim<any>; shouldRefetch: any } | {}) & { id: string; validate: any }
    SessionInformation: { customClaimsInAccessTokenPayload: any; expiry: number; recipeUserId: RecipeUserId; sessionDataInDatabase: any; sessionHandle: string; tenantId: string; timeCreated: number; userId: string }

    Type declaration

    • customClaimsInAccessTokenPayload: any
    • expiry: number
    • recipeUserId: RecipeUserId
    • sessionDataInDatabase: any
    • sessionHandle: string
    • tenantId: string
    • timeCreated: number
    • userId: string

    Variables

    Error: typeof default = SessionWrapper.Error

    Functions

    • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • Optional payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • userContext: any = {}

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • createNewSession(req: any, res: any, tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, userContext?: any): Promise<SessionContainer>
    • createNewSessionWithoutRequestResponse(tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, disableAntiCsrf?: boolean, userContext?: any): Promise<SessionContainer>
    • fetchAndSetClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • getAllSessionHandlesForUser(userId: string, fetchSessionsForAllLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
    • Parameters

      • userId: string
      • fetchSessionsForAllLinkedAccounts: boolean = true
      • Optional tenantId: string
      • userContext: any = {}

      Returns Promise<string[]>

    • getClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, userContext?: any): Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
    • Type parameters

      • T

      Parameters

      • sessionHandle: string
      • claim: SessionClaim<T>
      • userContext: any = {}

      Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[] }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
    • getSessionInformation(sessionHandle: string, userContext?: any): Promise<undefined | SessionInformation>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string): Promise<SessionContainer>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired?: true }, userContext?: any): Promise<SessionContainer>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired: false }, userContext?: any): Promise<undefined | SessionContainer>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions, userContext?: any): Promise<undefined | SessionContainer>
    • init(config?: TypeInput): RecipeListFunction
    • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
    • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
    • refreshSessionWithoutRequestResponse(refreshToken: string, disableAntiCsrf?: boolean, antiCsrfToken?: string, userContext?: any): Promise<SessionContainer>
    • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • revokeAllSessionsForUser(userId: string, revokeSessionsForLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
    • Parameters

      • userId: string
      • revokeSessionsForLinkedAccounts: boolean = true
      • Optional tenantId: string
      • userContext: any = {}

      Returns Promise<string[]>

    • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
    • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
    • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
    • updateSessionDataInDatabase(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index 2d8c8b331..92d6b7813 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1 +1 @@ -recipe/thirdparty | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdparty

    Index

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: ProviderInput[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • isInServerlessEnv: boolean
    • providers: ProviderInput[]
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    RecipeInterface: { getProvider: any; manuallyCreateOrUpdateUser: any; signInUp: any }

    Type declaration

    • getProvider:function
      • getProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
      • Parameters

        • input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }
          • Optional clientType?: string
          • tenantId: string
          • thirdPartyId: string
          • userContext: any

        Returns Promise<undefined | TypeProvider>

    • manuallyCreateOrUpdateUser:function
      • manuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • signInUp:function
      • signInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    TypeProvider: { config: ProviderConfigForClientType; id: string; exchangeAuthCodeForOAuthTokens: any; getAuthorisationRedirectURL: any; getConfigForClientType: any; getUserInfo: any }

    Type declaration

    • config: ProviderConfigForClientType
    • id: string
    • exchangeAuthCodeForOAuthTokens:function
      • exchangeAuthCodeForOAuthTokens(input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }): Promise<any>
      • Parameters

        • input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }
          • redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }
            • Optional pkceCodeVerifier?: string
            • redirectURIOnProviderDashboard: string
            • redirectURIQueryParams: any
          • userContext: any

        Returns Promise<any>

    • getAuthorisationRedirectURL:function
      • getAuthorisationRedirectURL(input: { redirectURIOnProviderDashboard: string; userContext: any }): Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>
      • Parameters

        • input: { redirectURIOnProviderDashboard: string; userContext: any }
          • redirectURIOnProviderDashboard: string
          • userContext: any

        Returns Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>

    • getConfigForClientType:function
      • getConfigForClientType(input: { clientType?: string; userContext: any }): Promise<ProviderConfigForClientType>
      • Parameters

        • input: { clientType?: string; userContext: any }
          • Optional clientType?: string
          • userContext: any

        Returns Promise<ProviderConfigForClientType>

    • getUserInfo:function
      • getUserInfo(input: { oAuthTokens: any; userContext: any }): Promise<UserInfo>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • init(config?: TypeInput): RecipeListFunction
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/thirdparty | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdparty

    Index

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: ProviderInput[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • isInServerlessEnv: boolean
    • providers: ProviderInput[]
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    RecipeInterface: { getProvider: any; manuallyCreateOrUpdateUser: any; signInUp: any }

    Type declaration

    • getProvider:function
      • getProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
      • Parameters

        • input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }
          • Optional clientType?: string
          • tenantId: string
          • thirdPartyId: string
          • userContext: any

        Returns Promise<undefined | TypeProvider>

    • manuallyCreateOrUpdateUser:function
      • manuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • signInUp:function
      • signInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    TypeProvider: { config: ProviderConfigForClientType; id: string; exchangeAuthCodeForOAuthTokens: any; getAuthorisationRedirectURL: any; getConfigForClientType: any; getUserInfo: any }

    Type declaration

    • config: ProviderConfigForClientType
    • id: string
    • exchangeAuthCodeForOAuthTokens:function
      • exchangeAuthCodeForOAuthTokens(input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }): Promise<any>
      • Parameters

        • input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }
          • redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }
            • Optional pkceCodeVerifier?: string
            • redirectURIOnProviderDashboard: string
            • redirectURIQueryParams: any
          • userContext: any

        Returns Promise<any>

    • getAuthorisationRedirectURL:function
      • getAuthorisationRedirectURL(input: { redirectURIOnProviderDashboard: string; userContext: any }): Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>
      • Parameters

        • input: { redirectURIOnProviderDashboard: string; userContext: any }
          • redirectURIOnProviderDashboard: string
          • userContext: any

        Returns Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>

    • getConfigForClientType:function
      • getConfigForClientType(input: { clientType?: string; userContext: any }): Promise<ProviderConfigForClientType>
      • Parameters

        • input: { clientType?: string; userContext: any }
          • Optional clientType?: string
          • userContext: any

        Returns Promise<ProviderConfigForClientType>

    • getUserInfo:function
      • getUserInfo(input: { oAuthTokens: any; userContext: any }): Promise<UserInfo>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • init(config?: TypeInput): RecipeListFunction
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index 8df770148..98098184f 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1 +1 @@ -recipe/thirdpartyemailpassword | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartyemailpassword

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
    • emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
    • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
    • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    EmailPasswordAPIOptions: APIOptions
    RecipeInterface: { consumePasswordResetToken: any; createNewEmailPasswordRecipeUser: any; createResetPasswordToken: any; emailPasswordSignIn: any; emailPasswordSignUp: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updateEmailOrPassword: any }

    Type declaration

    • consumePasswordResetToken:function
      • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { tenantId: string; token: string; userContext: any }
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • createNewEmailPasswordRecipeUser:function
      • createNewEmailPasswordRecipeUser(input: { email: string; password: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • createResetPasswordToken:function
      • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
      • Parameters

        • input: { email: string; tenantId: string; userContext: any; userId: string }
          • email: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • emailPasswordSignIn:function
      • emailPasswordSignIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>

    • emailPasswordSignUp:function
      • emailPasswordSignUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

    • thirdPartyGetProvider:function
      • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser:function
      • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword:function
      • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
      • Parameters

        • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
          • Optional applyPasswordPolicy?: boolean
          • Optional email?: string
          • Optional password?: string
          • recipeUserId: RecipeUserId
          • tenantIdForPasswordPolicy: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    ThirdPartyAPIOptions: APIOptions

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • init(config?: TypeInput): RecipeListFunction
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/thirdpartyemailpassword | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartyemailpassword

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
    • emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
    • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
    • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    EmailPasswordAPIOptions: APIOptions
    RecipeInterface: { consumePasswordResetToken: any; createNewEmailPasswordRecipeUser: any; createResetPasswordToken: any; emailPasswordSignIn: any; emailPasswordSignUp: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updateEmailOrPassword: any }

    Type declaration

    • consumePasswordResetToken:function
      • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { tenantId: string; token: string; userContext: any }
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • createNewEmailPasswordRecipeUser:function
      • createNewEmailPasswordRecipeUser(input: { email: string; password: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • createResetPasswordToken:function
      • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
      • Parameters

        • input: { email: string; tenantId: string; userContext: any; userId: string }
          • email: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • emailPasswordSignIn:function
      • emailPasswordSignIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>

    • emailPasswordSignUp:function
      • emailPasswordSignUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

    • thirdPartyGetProvider:function
      • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser:function
      • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword:function
      • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
      • Parameters

        • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
          • Optional applyPasswordPolicy?: boolean
          • Optional email?: string
          • Optional password?: string
          • recipeUserId: RecipeUserId
          • tenantIdForPasswordPolicy: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    ThirdPartyAPIOptions: APIOptions

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • init(config?: TypeInput): RecipeListFunction
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index c61539a0b..ddd1b9c22 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1 +1 @@ -recipe/thirdpartypasswordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartypasswordless

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>); createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>); passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>)
    • createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
    • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    PasswordlessAPIOptions: APIOptions
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updatePasswordlessUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • tenantId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • revokeCode:function
      • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • thirdPartyGetProvider:function
      • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser:function
      • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser:function
      • updatePasswordlessUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    ThirdPartyAPIOptions: APIOptions

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/thirdpartypasswordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartypasswordless

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>); createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>); passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>)
    • createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
    • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    PasswordlessAPIOptions: APIOptions
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updatePasswordlessUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • tenantId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • revokeCode:function
      • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • thirdPartyGetProvider:function
      • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser:function
      • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser:function
      • updatePasswordlessUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    ThirdPartyAPIOptions: APIOptions

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_usermetadata.html b/docs/modules/recipe_usermetadata.html index 59afb7439..804f9b3c5 100644 --- a/docs/modules/recipe_usermetadata.html +++ b/docs/modules/recipe_usermetadata.html @@ -1,4 +1,4 @@ -recipe/usermetadata | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/usermetadata

    Index

    Type aliases

    RecipeInterface: { clearUserMetadata: any; getUserMetadata: any; updateUserMetadata: any }

    Type declaration

    • clearUserMetadata:function
      • clearUserMetadata(input: { userContext: any; userId: string }): Promise<{ status: "OK" }>
    • getUserMetadata:function
      • getUserMetadata(input: { userContext: any; userId: string }): Promise<{ metadata: any; status: "OK" }>
    • updateUserMetadata:function
      • updateUserMetadata(input: { metadataUpdate: JSONObject; userContext: any; userId: string }): Promise<{ metadata: JSONObject; status: "OK" }>
      • +recipe/usermetadata | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/usermetadata

        Index

        Type aliases

        RecipeInterface: { clearUserMetadata: any; getUserMetadata: any; updateUserMetadata: any }

        Type declaration

        • clearUserMetadata:function
          • clearUserMetadata(input: { userContext: any; userId: string }): Promise<{ status: "OK" }>
        • getUserMetadata:function
          • getUserMetadata(input: { userContext: any; userId: string }): Promise<{ metadata: any; status: "OK" }>
        • updateUserMetadata:function
          • updateUserMetadata(input: { metadataUpdate: JSONObject; userContext: any; userId: string }): Promise<{ metadata: JSONObject; status: "OK" }>
          • Updates the metadata object of the user by doing a shallow merge of the stored and the update JSONs and removing properties set to null on the root level of the update object. e.g.:

            @@ -7,4 +7,4 @@
          • update: { "notifications": { "sms": true }, "todos": null }
          • result: { "preferences": { "theme":"dark" }, "notifications": { "sms": true } }
          -

        Parameters

        • input: { metadataUpdate: JSONObject; userContext: any; userId: string }
          • metadataUpdate: JSONObject
          • userContext: any
          • userId: string

        Returns Promise<{ metadata: JSONObject; status: "OK" }>

    Functions

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • init(config?: TypeInput): RecipeListFunction
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    • input: { metadataUpdate: JSONObject; userContext: any; userId: string }
      • metadataUpdate: JSONObject
      • userContext: any
      • userId: string

    Returns Promise<{ metadata: JSONObject; status: "OK" }>

    Functions

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • init(config?: TypeInput): RecipeListFunction
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_userroles.html b/docs/modules/recipe_userroles.html index 3114a8814..9fabe0789 100644 --- a/docs/modules/recipe_userroles.html +++ b/docs/modules/recipe_userroles.html @@ -1 +1 @@ -recipe/userroles | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Index

    Type aliases

    RecipeInterface: { addRoleToUser: any; createNewRoleOrAddPermissions: any; deleteRole: any; getAllRoles: any; getPermissionsForRole: any; getRolesForUser: any; getRolesThatHavePermission: any; getUsersThatHaveRole: any; removePermissionsFromRole: any; removeUserRole: any }

    Type declaration

    • addRoleToUser:function
      • addRoleToUser(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any; userId: string }
          • role: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions:function
      • createNewRoleOrAddPermissions(input: { permissions: string[]; role: string; userContext: any }): Promise<{ createdNewRole: boolean; status: "OK" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ createdNewRole: boolean; status: "OK" }>

    • deleteRole:function
      • deleteRole(input: { role: string; userContext: any }): Promise<{ didRoleExist: boolean; status: "OK" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ didRoleExist: boolean; status: "OK" }>

    • getAllRoles:function
      • getAllRoles(input: { userContext: any }): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole:function
      • getPermissionsForRole(input: { role: string; userContext: any }): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser:function
      • getRolesForUser(input: { tenantId: string; userContext: any; userId: string }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { tenantId: string; userContext: any; userId: string }
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getRolesThatHavePermission:function
      • getRolesThatHavePermission(input: { permission: string; userContext: any }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { permission: string; userContext: any }
          • permission: string
          • userContext: any

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getUsersThatHaveRole:function
      • getUsersThatHaveRole(input: { role: string; tenantId: string; userContext: any }): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any }
          • role: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole:function
      • removePermissionsFromRole(input: { permissions: string[]; role: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

    • removeUserRole:function
      • removeUserRole(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any; userId: string }
          • role: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Variables

    PermissionClaim: PermissionClaimClass = ...
    UserRoleClaim: UserRoleClaimClass = ...

    Functions

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • init(config?: TypeInput): RecipeListFunction
    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/userroles | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Index

    Type aliases

    RecipeInterface: { addRoleToUser: any; createNewRoleOrAddPermissions: any; deleteRole: any; getAllRoles: any; getPermissionsForRole: any; getRolesForUser: any; getRolesThatHavePermission: any; getUsersThatHaveRole: any; removePermissionsFromRole: any; removeUserRole: any }

    Type declaration

    • addRoleToUser:function
      • addRoleToUser(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any; userId: string }
          • role: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions:function
      • createNewRoleOrAddPermissions(input: { permissions: string[]; role: string; userContext: any }): Promise<{ createdNewRole: boolean; status: "OK" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ createdNewRole: boolean; status: "OK" }>

    • deleteRole:function
      • deleteRole(input: { role: string; userContext: any }): Promise<{ didRoleExist: boolean; status: "OK" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ didRoleExist: boolean; status: "OK" }>

    • getAllRoles:function
      • getAllRoles(input: { userContext: any }): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole:function
      • getPermissionsForRole(input: { role: string; userContext: any }): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser:function
      • getRolesForUser(input: { tenantId: string; userContext: any; userId: string }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { tenantId: string; userContext: any; userId: string }
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getRolesThatHavePermission:function
      • getRolesThatHavePermission(input: { permission: string; userContext: any }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { permission: string; userContext: any }
          • permission: string
          • userContext: any

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getUsersThatHaveRole:function
      • getUsersThatHaveRole(input: { role: string; tenantId: string; userContext: any }): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any }
          • role: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole:function
      • removePermissionsFromRole(input: { permissions: string[]; role: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

    • removeUserRole:function
      • removeUserRole(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any; userId: string }
          • role: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Variables

    PermissionClaim: PermissionClaimClass = ...
    UserRoleClaim: UserRoleClaimClass = ...

    Functions

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • init(config?: TypeInput): RecipeListFunction
    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/lib/build/framework/fastify/index.d.ts b/lib/build/framework/fastify/index.d.ts index fb2d3fe21..3cca3a1a2 100644 --- a/lib/build/framework/fastify/index.d.ts +++ b/lib/build/framework/fastify/index.d.ts @@ -1,21 +1,18 @@ // @ts-nocheck /// export type { SessionRequest } from "./framework"; -export declare const plugin: import("fastify").FastifyPluginCallback< - Record, - import("fastify").RawServerDefault ->; +export declare const plugin: import("fastify").FastifyPluginCallback, import("http").Server>; export declare const errorHandler: () => ( err: any, req: import("fastify").FastifyRequest< import("fastify/types/route").RouteGenericInterface, - import("fastify").RawServerDefault, + import("http").Server, import("http").IncomingMessage >, res: import("fastify").FastifyReply< - import("fastify").RawServerDefault, + import("http").Server, import("http").IncomingMessage, - import("http").ServerResponse, + import("http").ServerResponse, import("fastify/types/route").RouteGenericInterface, unknown > diff --git a/lib/build/framework/utils.d.ts b/lib/build/framework/utils.d.ts index 123ddf23c..636a97724 100644 --- a/lib/build/framework/utils.d.ts +++ b/lib/build/framework/utils.d.ts @@ -45,7 +45,7 @@ export declare function setCookieForServerResponse( expires: number, path: string, sameSite: "strict" | "lax" | "none" -): ServerResponse; +): ServerResponse; export declare function getCookieValueToSetInHeader( prev: string | string[] | undefined, val: string | string[], From dfa9580ccf7fe7d423eea9319ea1109fd9143edf Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Wed, 15 Nov 2023 16:20:55 +0530 Subject: [PATCH 3/4] fixes arg order issue --- CHANGELOG.md | 4 ++++ lib/build/recipe/thirdpartyemailpassword/index.js | 4 ++-- lib/build/version.d.ts | 2 +- lib/build/version.js | 2 +- lib/ts/recipe/thirdpartyemailpassword/index.ts | 4 ++-- lib/ts/version.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dc9739ba..ca086feac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) +## [16.5.1] - 2023-11-15 + +- Fixes issue with `createResetPasswordLink` and `sendResetPasswordEmail` in thirdpartyemailpassword recipe. + ## [16.5.0] - 2023-11-10 - Added `networkInterceptor` to the `TypeInput` config. diff --git a/lib/build/recipe/thirdpartyemailpassword/index.js b/lib/build/recipe/thirdpartyemailpassword/index.js index 72f6ea4f8..d0d0ed1d9 100644 --- a/lib/build/recipe/thirdpartyemailpassword/index.js +++ b/lib/build/recipe/thirdpartyemailpassword/index.js @@ -109,7 +109,7 @@ class Wrapper { ); } static async createResetPasswordLink(tenantId, userId, email, userContext = {}) { - let token = await exports.createResetPasswordToken(userId, tenantId, email, userContext); + let token = await exports.createResetPasswordToken(tenantId, userId, email, userContext); if (token.status === "UNKNOWN_USER_ID_ERROR") { return token; } @@ -135,7 +135,7 @@ class Wrapper { if (!loginMethod) { return { status: "UNKNOWN_USER_ID_ERROR" }; } - let link = await exports.createResetPasswordLink(userId, tenantId, email, userContext); + let link = await exports.createResetPasswordLink(tenantId, userId, email, userContext); if (link.status === "UNKNOWN_USER_ID_ERROR") { return link; } diff --git a/lib/build/version.d.ts b/lib/build/version.d.ts index 9c86e7472..9abafa298 100644 --- a/lib/build/version.d.ts +++ b/lib/build/version.d.ts @@ -1,4 +1,4 @@ // @ts-nocheck -export declare const version = "16.5.0"; +export declare const version = "16.5.1"; export declare const cdiSupported: string[]; export declare const dashboardVersion = "0.8"; diff --git a/lib/build/version.js b/lib/build/version.js index 67e3fb401..d11e2b03c 100644 --- a/lib/build/version.js +++ b/lib/build/version.js @@ -15,7 +15,7 @@ exports.dashboardVersion = exports.cdiSupported = exports.version = void 0; * License for the specific language governing permissions and limitations * under the License. */ -exports.version = "16.5.0"; +exports.version = "16.5.1"; exports.cdiSupported = ["4.0"]; // Note: The actual script import for dashboard uses v{DASHBOARD_VERSION} exports.dashboardVersion = "0.8"; diff --git a/lib/ts/recipe/thirdpartyemailpassword/index.ts b/lib/ts/recipe/thirdpartyemailpassword/index.ts index 04d072df6..e9eb1b0b9 100644 --- a/lib/ts/recipe/thirdpartyemailpassword/index.ts +++ b/lib/ts/recipe/thirdpartyemailpassword/index.ts @@ -133,7 +133,7 @@ export default class Wrapper { email: string, userContext: any = {} ): Promise<{ status: "OK"; link: string } | { status: "UNKNOWN_USER_ID_ERROR" }> { - let token = await createResetPasswordToken(userId, tenantId, email, userContext); + let token = await createResetPasswordToken(tenantId, userId, email, userContext); if (token.status === "UNKNOWN_USER_ID_ERROR") { return token; } @@ -168,7 +168,7 @@ export default class Wrapper { return { status: "UNKNOWN_USER_ID_ERROR" }; } - let link = await createResetPasswordLink(userId, tenantId, email, userContext); + let link = await createResetPasswordLink(tenantId, userId, email, userContext); if (link.status === "UNKNOWN_USER_ID_ERROR") { return link; } diff --git a/lib/ts/version.ts b/lib/ts/version.ts index 03327ca39..b7b04f82a 100644 --- a/lib/ts/version.ts +++ b/lib/ts/version.ts @@ -12,7 +12,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -export const version = "16.5.0"; +export const version = "16.5.1"; export const cdiSupported = ["4.0"]; diff --git a/package-lock.json b/package-lock.json index 8333775c6..32e49d52b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "supertokens-node", - "version": "16.5.0", + "version": "16.5.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "supertokens-node", - "version": "16.5.0", + "version": "16.5.1", "license": "Apache-2.0", "dependencies": { "content-type": "^1.0.5", diff --git a/package.json b/package.json index d4fd72b1f..33ab7e436 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "supertokens-node", - "version": "16.5.0", + "version": "16.5.1", "description": "NodeJS driver for SuperTokens core", "main": "index.js", "scripts": { From d0395cd4395801ae7315ed5bbd2149ae5363bc98 Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Wed, 15 Nov 2023 16:21:23 +0530 Subject: [PATCH 4/4] adding dev-v16.5.1 tag to this commit to ensure building --- docs/classes/framework.BaseRequest.html | 2 +- docs/classes/framework.BaseResponse.html | 2 +- docs/classes/framework_custom.CollectingResponse.html | 2 +- docs/classes/framework_custom.PreParsedRequest.html | 2 +- docs/classes/index.RecipeUserId.html | 2 +- docs/classes/index.User.html | 2 +- docs/classes/index.default.html | 2 +- docs/classes/ingredients_emaildelivery.default.html | 2 +- docs/classes/ingredients_smsdelivery.default.html | 2 +- docs/classes/recipe_accountlinking.default.html | 6 +++--- docs/classes/recipe_dashboard.default.html | 2 +- docs/classes/recipe_emailpassword.default.html | 4 ++-- docs/classes/recipe_emailverification.default.html | 2 +- docs/classes/recipe_jwt.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 2 +- docs/classes/recipe_openid.default.html | 2 +- docs/classes/recipe_passwordless.default.html | 2 +- docs/classes/recipe_session.default.html | 4 ++-- docs/classes/recipe_thirdparty.default.html | 2 +- docs/classes/recipe_thirdpartyemailpassword.default.html | 2 +- docs/classes/recipe_thirdpartypasswordless.default.html | 2 +- docs/classes/recipe_usermetadata.default.html | 2 +- docs/classes/recipe_userroles.default.html | 2 +- docs/interfaces/framework_awsLambda.SessionEvent.html | 2 +- docs/interfaces/framework_awsLambda.SessionEventV2.html | 2 +- docs/interfaces/framework_express.SessionRequest.html | 2 +- docs/interfaces/framework_fastify.SessionRequest.html | 2 +- docs/interfaces/framework_hapi.SessionRequest.html | 2 +- docs/interfaces/framework_koa.SessionContext.html | 2 +- docs/interfaces/framework_loopback.SessionContext.html | 2 +- docs/interfaces/recipe_session.SessionContainer.html | 2 +- docs/interfaces/recipe_session.VerifySessionOptions.html | 2 +- docs/modules/framework.html | 2 +- docs/modules/framework_awsLambda.html | 2 +- docs/modules/framework_custom.html | 2 +- docs/modules/framework_express.html | 2 +- docs/modules/framework_fastify.html | 2 +- docs/modules/framework_hapi.html | 2 +- docs/modules/framework_koa.html | 2 +- docs/modules/framework_loopback.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_accountlinking.html | 2 +- docs/modules/recipe_dashboard.html | 2 +- docs/modules/recipe_emailpassword.html | 4 ++-- docs/modules/recipe_emailverification.html | 2 +- docs/modules/recipe_jwt.html | 2 +- docs/modules/recipe_multitenancy.html | 2 +- docs/modules/recipe_openid.html | 2 +- docs/modules/recipe_passwordless.html | 2 +- docs/modules/recipe_session.html | 8 ++++---- docs/modules/recipe_thirdparty.html | 2 +- docs/modules/recipe_thirdpartyemailpassword.html | 2 +- docs/modules/recipe_thirdpartypasswordless.html | 2 +- docs/modules/recipe_usermetadata.html | 4 ++-- docs/modules/recipe_userroles.html | 2 +- 55 files changed, 64 insertions(+), 64 deletions(-) diff --git a/docs/classes/framework.BaseRequest.html b/docs/classes/framework.BaseRequest.html index 001498370..2daf0366a 100644 --- a/docs/classes/framework.BaseRequest.html +++ b/docs/classes/framework.BaseRequest.html @@ -1 +1 @@ -BaseRequest | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Constructors

    Properties

    getCookieValue: (key_: string) => undefined | string

    Type declaration

      • (key_: string): undefined | string
      • Parameters

        • key_: string

        Returns undefined | string

    getFormData: () => Promise<any>

    Type declaration

      • (): Promise<any>
      • Returns Promise<any>

    getHeaderValue: (key: string) => undefined | string

    Type declaration

      • (key: string): undefined | string
      • Parameters

        • key: string

        Returns undefined | string

    getJSONBody: () => Promise<any>

    Type declaration

      • (): Promise<any>
      • Returns Promise<any>

    getKeyValueFromQuery: (key: string) => undefined | string

    Type declaration

      • (key: string): undefined | string
      • Parameters

        • key: string

        Returns undefined | string

    getMethod: () => HTTPMethod

    Type declaration

      • (): HTTPMethod
      • Returns HTTPMethod

    getOriginalURL: () => string

    Type declaration

      • (): string
      • Returns string

    original: any
    wrapperUsed: boolean

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Property
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +BaseRequest | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Constructors

    Properties

    getCookieValue: (key_: string) => undefined | string

    Type declaration

      • (key_: string): undefined | string
      • Parameters

        • key_: string

        Returns undefined | string

    getFormData: () => Promise<any>

    Type declaration

      • (): Promise<any>
      • Returns Promise<any>

    getHeaderValue: (key: string) => undefined | string

    Type declaration

      • (key: string): undefined | string
      • Parameters

        • key: string

        Returns undefined | string

    getJSONBody: () => Promise<any>

    Type declaration

      • (): Promise<any>
      • Returns Promise<any>

    getKeyValueFromQuery: (key: string) => undefined | string

    Type declaration

      • (key: string): undefined | string
      • Parameters

        • key: string

        Returns undefined | string

    getMethod: () => HTTPMethod

    Type declaration

      • (): HTTPMethod
      • Returns HTTPMethod

    getOriginalURL: () => string

    Type declaration

      • (): string
      • Returns string

    original: any
    wrapperUsed: boolean

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Property
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/framework.BaseResponse.html b/docs/classes/framework.BaseResponse.html index 2a3f68838..57670e411 100644 --- a/docs/classes/framework.BaseResponse.html +++ b/docs/classes/framework.BaseResponse.html @@ -1 +1 @@ -BaseResponse | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Constructors

    Properties

    original: any
    removeHeader: (key: string) => void

    Type declaration

      • (key: string): void
      • Parameters

        • key: string

        Returns void

    sendHTMLResponse: (html: string) => void

    Type declaration

      • (html: string): void
      • Parameters

        • html: string

        Returns void

    sendJSONResponse: (content: any) => void

    Type declaration

      • (content: any): void
      • Parameters

        • content: any

        Returns void

    setCookie: (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none") => void

    Type declaration

      • (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
      • Parameters

        • key: string
        • value: string
        • domain: undefined | string
        • secure: boolean
        • httpOnly: boolean
        • expires: number
        • path: string
        • sameSite: "strict" | "lax" | "none"

        Returns void

    setHeader: (key: string, value: string, allowDuplicateKey: boolean) => void

    Type declaration

      • (key: string, value: string, allowDuplicateKey: boolean): void
      • Parameters

        • key: string
        • value: string
        • allowDuplicateKey: boolean

        Returns void

    setStatusCode: (statusCode: number) => void

    Type declaration

      • (statusCode: number): void
      • Parameters

        • statusCode: number

        Returns void

    wrapperUsed: boolean

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Property
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +BaseResponse | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Constructors

    Properties

    original: any
    removeHeader: (key: string) => void

    Type declaration

      • (key: string): void
      • Parameters

        • key: string

        Returns void

    sendHTMLResponse: (html: string) => void

    Type declaration

      • (html: string): void
      • Parameters

        • html: string

        Returns void

    sendJSONResponse: (content: any) => void

    Type declaration

      • (content: any): void
      • Parameters

        • content: any

        Returns void

    setCookie: (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none") => void

    Type declaration

      • (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
      • Parameters

        • key: string
        • value: string
        • domain: undefined | string
        • secure: boolean
        • httpOnly: boolean
        • expires: number
        • path: string
        • sameSite: "strict" | "lax" | "none"

        Returns void

    setHeader: (key: string, value: string, allowDuplicateKey: boolean) => void

    Type declaration

      • (key: string, value: string, allowDuplicateKey: boolean): void
      • Parameters

        • key: string
        • value: string
        • allowDuplicateKey: boolean

        Returns void

    setStatusCode: (statusCode: number) => void

    Type declaration

      • (statusCode: number): void
      • Parameters

        • statusCode: number

        Returns void

    wrapperUsed: boolean

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Property
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/framework_custom.CollectingResponse.html b/docs/classes/framework_custom.CollectingResponse.html index d226adee5..f280f0b47 100644 --- a/docs/classes/framework_custom.CollectingResponse.html +++ b/docs/classes/framework_custom.CollectingResponse.html @@ -1,2 +1,2 @@ -CollectingResponse | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Constructors

    Properties

    body?: string
    cookies: CookieInfo[]
    headers: Headers
    original: any
    statusCode: number
    wrapperUsed: boolean

    Methods

    • removeHeader(key: string): void
    • sendHTMLResponse(html: string): void
    • sendJSONResponse(content: any): void
    • setCookie(key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
    • Parameters

      • key: string
      • value: string
      • domain: undefined | string
      • secure: boolean
      • httpOnly: boolean
      • expires: number
      • path: string
      • sameSite: "strict" | "lax" | "none"

      Returns void

    • setHeader(key: string, value: string, allowDuplicateKey: boolean): void
    • setStatusCode(statusCode: number): void
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • signIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • signUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_emailverification.default.html b/docs/classes/recipe_emailverification.default.html index cc9cebc90..5e7947bfd 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationClaim
    Error: typeof default = SuperTokensError
    init: (config: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
    • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationClaim
    Error: typeof default = SuperTokensError
    init: (config: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
    • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_jwt.default.html b/docs/classes/recipe_jwt.default.html index 42ddb2ecd..8f0243195 100644 --- a/docs/classes/recipe_jwt.default.html +++ b/docs/classes/recipe_jwt.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index 087edbbb3..ae12bceae 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
    • Parameters

      • tenantId: string
      • recipeUserId: RecipeUserId
      • Optional userContext: any

      Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
        • Optional coreConfig?: {}
          • [key: string]: any
        • Optional emailPasswordEnabled?: boolean
        • Optional passwordlessEnabled?: boolean
        • Optional thirdPartyEnabled?: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • config: ProviderConfig
      • Optional skipValidation: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
    • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
    • Parameters

      • tenantId: string
      • Optional userContext: any

      Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
    • Parameters

      • Optional userContext: any

      Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
    • Parameters

      • tenantId: string
      • recipeUserId: RecipeUserId
      • Optional userContext: any

      Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
        • Optional coreConfig?: {}
          • [key: string]: any
        • Optional emailPasswordEnabled?: boolean
        • Optional passwordlessEnabled?: boolean
        • Optional thirdPartyEnabled?: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • config: ProviderConfig
      • Optional skipValidation: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
    • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
    • Parameters

      • tenantId: string
      • Optional userContext: any

      Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
    • Parameters

      • Optional userContext: any

      Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_openid.default.html b/docs/classes/recipe_openid.default.html index 027cdf8af..53b4cdb90 100644 --- a/docs/classes/recipe_openid.default.html +++ b/docs/classes/recipe_openid.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = OpenIdRecipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • Optional payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = OpenIdRecipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • Optional payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index 5fd719f41..1e38a8539 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<string>

    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any }
        • email: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { phoneNumber: string; tenantId: string; userContext?: any }
        • phoneNumber: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ status: "OK" }>

    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { codeId: string; tenantId: string; userContext?: any }
        • codeId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" }>

    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

    • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<string>

    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any }
        • email: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { phoneNumber: string; tenantId: string; userContext?: any }
        • phoneNumber: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ status: "OK" }>

    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { codeId: string; tenantId: string; userContext?: any }
        • codeId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" }>

    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

    • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_session.default.html b/docs/classes/recipe_session.default.html index dc65cd6cb..141292bf0 100644 --- a/docs/classes/recipe_session.default.html +++ b/docs/classes/recipe_session.default.html @@ -1,4 +1,4 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • Optional payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • userContext: any = {}

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • createNewSession(req: any, res: any, tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, userContext?: any): Promise<SessionContainer>
    • createNewSessionWithoutRequestResponse(tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, disableAntiCsrf?: boolean, userContext?: any): Promise<SessionContainer>
    • fetchAndSetClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • getAllSessionHandlesForUser(userId: string, fetchSessionsForAllLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
    • Parameters

      • userId: string
      • fetchSessionsForAllLinkedAccounts: boolean = true
      • Optional tenantId: string
      • userContext: any = {}

      Returns Promise<string[]>

    • getClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, userContext?: any): Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
    • Type parameters

      • T

      Parameters

      • sessionHandle: string
      • claim: SessionClaim<T>
      • userContext: any = {}

      Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[] }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
    • getSessionInformation(sessionHandle: string, userContext?: any): Promise<undefined | SessionInformation>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string): Promise<SessionContainer>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired?: true }, userContext?: any): Promise<SessionContainer>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired: false }, userContext?: any): Promise<undefined | SessionContainer>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions, userContext?: any): Promise<undefined | SessionContainer>
    • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
    • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
    • refreshSessionWithoutRequestResponse(refreshToken: string, disableAntiCsrf?: boolean, antiCsrfToken?: string, userContext?: any): Promise<SessionContainer>
    • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • revokeAllSessionsForUser(userId: string, revokeSessionsForLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
    • Parameters

      • userId: string
      • revokeSessionsForLinkedAccounts: boolean = true
      • Optional tenantId: string
      • userContext: any = {}

      Returns Promise<string[]>

    • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
    • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
    • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
    • updateSessionDataInDatabase(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +

    Returns Promise<SessionContainer>

  • Parameters

    • accessToken: string
    • Optional antiCsrfToken: string
    • Optional options: VerifySessionOptions & { sessionRequired?: true }
    • Optional userContext: any

    Returns Promise<SessionContainer>

  • Parameters

    • accessToken: string
    • Optional antiCsrfToken: string
    • Optional options: VerifySessionOptions & { sessionRequired: false }
    • Optional userContext: any

    Returns Promise<undefined | SessionContainer>

  • Parameters

    • accessToken: string
    • Optional antiCsrfToken: string
    • Optional options: VerifySessionOptions
    • Optional userContext: any

    Returns Promise<undefined | SessionContainer>

    • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
    • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
    • refreshSessionWithoutRequestResponse(refreshToken: string, disableAntiCsrf?: boolean, antiCsrfToken?: string, userContext?: any): Promise<SessionContainer>
    • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • revokeAllSessionsForUser(userId: string, revokeSessionsForLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
    • Parameters

      • userId: string
      • revokeSessionsForLinkedAccounts: boolean = true
      • Optional tenantId: string
      • userContext: any = {}

      Returns Promise<string[]>

    • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
    • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
    • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
    • updateSessionDataInDatabase(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_thirdparty.default.html b/docs/classes/recipe_thirdparty.default.html index 3b15ce590..8663434d9 100644 --- a/docs/classes/recipe_thirdparty.default.html +++ b/docs/classes/recipe_thirdparty.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_thirdpartyemailpassword.default.html b/docs/classes/recipe_thirdpartyemailpassword.default.html index be61f4b8c..d9070d46e 100644 --- a/docs/classes/recipe_thirdpartyemailpassword.default.html +++ b/docs/classes/recipe_thirdpartyemailpassword.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_thirdpartypasswordless.default.html b/docs/classes/recipe_thirdpartypasswordless.default.html index e3a8fd095..1d65c7c6d 100644 --- a/docs/classes/recipe_thirdpartypasswordless.default.html +++ b/docs/classes/recipe_thirdpartypasswordless.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: (config: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_usermetadata.default.html b/docs/classes/recipe_usermetadata.default.html index 57ce03bd5..7c95f3cf8 100644 --- a/docs/classes/recipe_usermetadata.default.html +++ b/docs/classes/recipe_usermetadata.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_userroles.default.html b/docs/classes/recipe_userroles.default.html index 48647acf5..2069c8f86 100644 --- a/docs/classes/recipe_userroles.default.html +++ b/docs/classes/recipe_userroles.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    PermissionClaim: PermissionClaimClass = PermissionClaim
    UserRoleClaim: UserRoleClaimClass = UserRoleClaim
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    PermissionClaim: PermissionClaimClass = PermissionClaim
    UserRoleClaim: UserRoleClaimClass = UserRoleClaim
    init: (config?: TypeInput) => RecipeListFunction = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Constructor
    • Static property
    • Static method
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_awsLambda.SessionEvent.html b/docs/interfaces/framework_awsLambda.SessionEvent.html index 4d7391bd9..da6be8c37 100644 --- a/docs/interfaces/framework_awsLambda.SessionEvent.html +++ b/docs/interfaces/framework_awsLambda.SessionEvent.html @@ -1 +1 @@ -SessionEvent | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEvent
      • SessionEvent

    Index

    Properties

    body: null | string
    headers: APIGatewayProxyEventHeaders
    httpMethod: string
    isBase64Encoded: boolean
    multiValueHeaders: APIGatewayProxyEventMultiValueHeaders
    multiValueQueryStringParameters: null | APIGatewayProxyEventMultiValueQueryStringParameters
    path: string
    pathParameters: null | APIGatewayProxyEventPathParameters
    queryStringParameters: null | APIGatewayProxyEventQueryStringParameters
    requestContext: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>
    resource: string
    stageVariables: null | APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +SessionEvent | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEvent
      • SessionEvent

    Index

    Properties

    body: null | string
    headers: APIGatewayProxyEventHeaders
    httpMethod: string
    isBase64Encoded: boolean
    multiValueHeaders: APIGatewayProxyEventMultiValueHeaders
    multiValueQueryStringParameters: null | APIGatewayProxyEventMultiValueQueryStringParameters
    path: string
    pathParameters: null | APIGatewayProxyEventPathParameters
    queryStringParameters: null | APIGatewayProxyEventQueryStringParameters
    requestContext: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>
    resource: string
    stageVariables: null | APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_awsLambda.SessionEventV2.html b/docs/interfaces/framework_awsLambda.SessionEventV2.html index eab17fb77..67ec38c32 100644 --- a/docs/interfaces/framework_awsLambda.SessionEventV2.html +++ b/docs/interfaces/framework_awsLambda.SessionEventV2.html @@ -1 +1 @@ -SessionEventV2 | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEventV2
      • SessionEventV2

    Index

    Properties

    body?: string
    cookies?: string[]
    headers: APIGatewayProxyEventHeaders
    isBase64Encoded: boolean
    pathParameters?: APIGatewayProxyEventPathParameters
    queryStringParameters?: APIGatewayProxyEventQueryStringParameters
    rawPath: string
    rawQueryString: string
    requestContext: { accountId: string; apiId: string; authorizer?: { jwt: { claims: {}; scopes: string[] } }; domainName: string; domainPrefix: string; http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }; requestId: string; routeKey: string; stage: string; time: string; timeEpoch: number }

    Type declaration

    • accountId: string
    • apiId: string
    • Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
      • jwt: { claims: {}; scopes: string[] }
        • claims: {}
          • [name: string]: string | number | boolean | string[]
        • scopes: string[]
    • domainName: string
    • domainPrefix: string
    • http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
      • method: string
      • path: string
      • protocol: string
      • sourceIp: string
      • userAgent: string
    • requestId: string
    • routeKey: string
    • stage: string
    • time: string
    • timeEpoch: number
    routeKey: string
    stageVariables?: APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
    version: string

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +SessionEventV2 | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEventV2
      • SessionEventV2

    Index

    Properties

    body?: string
    cookies?: string[]
    headers: APIGatewayProxyEventHeaders
    isBase64Encoded: boolean
    pathParameters?: APIGatewayProxyEventPathParameters
    queryStringParameters?: APIGatewayProxyEventQueryStringParameters
    rawPath: string
    rawQueryString: string
    requestContext: { accountId: string; apiId: string; authorizer?: { jwt: { claims: {}; scopes: string[] } }; domainName: string; domainPrefix: string; http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }; requestId: string; routeKey: string; stage: string; time: string; timeEpoch: number }

    Type declaration

    • accountId: string
    • apiId: string
    • Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
      • jwt: { claims: {}; scopes: string[] }
        • claims: {}
          • [name: string]: string | number | boolean | string[]
        • scopes: string[]
    • domainName: string
    • domainPrefix: string
    • http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
      • method: string
      • path: string
      • protocol: string
      • sourceIp: string
      • userAgent: string
    • requestId: string
    • routeKey: string
    • stage: string
    • time: string
    • timeEpoch: number
    routeKey: string
    stageVariables?: APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
    version: string

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_express.SessionRequest.html b/docs/interfaces/framework_express.SessionRequest.html index d0cdcae7d..8f9bbec9e 100644 --- a/docs/interfaces/framework_express.SessionRequest.html +++ b/docs/interfaces/framework_express.SessionRequest.html @@ -118,7 +118,7 @@
    route: any
    secure: boolean

    Short-hand for:

    req.protocol == 'https'

    -
    signedCookies: any
    socket: Socket
    +
    signedCookies: any
    socket: Socket

    The net.Socket object associated with the connection.

    With HTTPS support, use request.socket.getPeerCertificate() to obtain the client's authentication details.

    diff --git a/docs/interfaces/framework_fastify.SessionRequest.html b/docs/interfaces/framework_fastify.SessionRequest.html index 1c33becf8..6e0974213 100644 --- a/docs/interfaces/framework_fastify.SessionRequest.html +++ b/docs/interfaces/framework_fastify.SessionRequest.html @@ -1,4 +1,4 @@ SessionRequest | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • FastifyRequest
      • SessionRequest

    Index

    Properties

    body: unknown
    connection: Socket
    headers: IncomingHttpHeaders
    hostname: string
    id: any
    ip: string
    ips?: string[]
    is404: boolean
    log: FastifyLoggerInstance
    method: string
    params: unknown
    protocol: "http" | "https"
    query: unknown
    raw: IncomingMessage
    req: IncomingMessage
    deprecated

    Use raw property

    -
    routerMethod: string
    routerPath: string
    socket: Socket
    url: string
    validationError?: Error & { validation: any; validationContext: string }
    +
    routerMethod: string
    routerPath: string
    socket: Socket
    url: string
    validationError?: Error & { validation: any; validationContext: string }

    in order for this to be used the user should ensure they have set the attachValidation option.

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_hapi.SessionRequest.html b/docs/interfaces/framework_hapi.SessionRequest.html index 938181313..49286a6ec 100644 --- a/docs/interfaces/framework_hapi.SessionRequest.html +++ b/docs/interfaces/framework_hapi.SessionRequest.html @@ -89,7 +89,7 @@
    server: Server

    Access: read only and the public server interface. The server object.

    -
    state: Dictionary<any>
    +
    state: Dictionary<any>

    An object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition.

    url: URL

    The parsed request URI.

    diff --git a/docs/interfaces/framework_koa.SessionContext.html b/docs/interfaces/framework_koa.SessionContext.html index fcfba5f2d..7ebc0b46f 100644 --- a/docs/interfaces/framework_koa.SessionContext.html +++ b/docs/interfaces/framework_koa.SessionContext.html @@ -81,7 +81,7 @@
    secure: boolean

    Short-hand for:

    this.protocol == 'https'

    -
    socket: Socket
    +
    socket: Socket

    Return the request socket.

    stale: boolean

    Check if the request is stale, aka diff --git a/docs/interfaces/framework_loopback.SessionContext.html b/docs/interfaces/framework_loopback.SessionContext.html index f598fb919..b55706351 100644 --- a/docs/interfaces/framework_loopback.SessionContext.html +++ b/docs/interfaces/framework_loopback.SessionContext.html @@ -14,7 +14,7 @@

    A flag to tell if the response is finished.

    scope: BindingScope

    Scope for binding resolution

    -
    subscriptionManager: ContextSubscriptionManager
    +
    subscriptionManager: ContextSubscriptionManager

    Manager for observer subscriptions

    tagIndexer: ContextTagIndexer

    Indexer for bindings by tag

    diff --git a/docs/interfaces/recipe_session.SessionContainer.html b/docs/interfaces/recipe_session.SessionContainer.html index f7f256ae4..3724b80b9 100644 --- a/docs/interfaces/recipe_session.SessionContainer.html +++ b/docs/interfaces/recipe_session.SessionContainer.html @@ -1 +1 @@ -SessionContainer | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SessionContainer

    Index

    Methods

    • attachToRequestResponse(reqResInfo: ReqResInfo, userContext?: any): void | Promise<void>
    • fetchAndSetClaim<T>(claim: SessionClaim<T>, userContext?: any): Promise<void>
    • getAccessToken(userContext?: any): string
    • getAccessTokenPayload(userContext?: any): any
    • getAllSessionTokensDangerously(): { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }
    • Returns { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }

      • accessAndFrontTokenUpdated: boolean
      • accessToken: string
      • antiCsrfToken: undefined | string
      • frontToken: string
      • refreshToken: undefined | string
    • getClaimValue<T>(claim: SessionClaim<T>, userContext?: any): Promise<undefined | T>
    • getExpiry(userContext?: any): Promise<number>
    • getHandle(userContext?: any): string
    • getSessionDataFromDatabase(userContext?: any): Promise<any>
    • getTenantId(userContext?: any): string
    • getTimeCreated(userContext?: any): Promise<number>
    • getUserId(userContext?: any): string
    • mergeIntoAccessTokenPayload(accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<void>
    • removeClaim(claim: SessionClaim<any>, userContext?: any): Promise<void>
    • revokeSession(userContext?: any): Promise<void>
    • setClaimValue<T>(claim: SessionClaim<T>, value: T, userContext?: any): Promise<void>
    • updateSessionDataInDatabase(newSessionData: any, userContext?: any): Promise<any>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Method
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +SessionContainer | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SessionContainer

    Index

    Methods

    • attachToRequestResponse(reqResInfo: ReqResInfo, userContext?: any): void | Promise<void>
    • fetchAndSetClaim<T>(claim: SessionClaim<T>, userContext?: any): Promise<void>
    • getAccessToken(userContext?: any): string
    • getAccessTokenPayload(userContext?: any): any
    • getAllSessionTokensDangerously(): { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }
    • Returns { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }

      • accessAndFrontTokenUpdated: boolean
      • accessToken: string
      • antiCsrfToken: undefined | string
      • frontToken: string
      • refreshToken: undefined | string
    • getClaimValue<T>(claim: SessionClaim<T>, userContext?: any): Promise<undefined | T>
    • getExpiry(userContext?: any): Promise<number>
    • getHandle(userContext?: any): string
    • getSessionDataFromDatabase(userContext?: any): Promise<any>
    • getTenantId(userContext?: any): string
    • getTimeCreated(userContext?: any): Promise<number>
    • getUserId(userContext?: any): string
    • mergeIntoAccessTokenPayload(accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<void>
    • removeClaim(claim: SessionClaim<any>, userContext?: any): Promise<void>
    • revokeSession(userContext?: any): Promise<void>
    • setClaimValue<T>(claim: SessionClaim<T>, value: T, userContext?: any): Promise<void>
    • updateSessionDataInDatabase(newSessionData: any, userContext?: any): Promise<any>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Method
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/recipe_session.VerifySessionOptions.html b/docs/interfaces/recipe_session.VerifySessionOptions.html index 2655b281e..135726f3f 100644 --- a/docs/interfaces/recipe_session.VerifySessionOptions.html +++ b/docs/interfaces/recipe_session.VerifySessionOptions.html @@ -1 +1 @@ -VerifySessionOptions | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Method
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +VerifySessionOptions | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Interface
    • Property
    • Method
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework.html b/docs/modules/framework.html index 38602c276..2023cc002 100644 --- a/docs/modules/framework.html +++ b/docs/modules/framework.html @@ -1 +1 @@ -framework | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Properties

    default: { awsLambda: framework/awsLambda; express: framework/express; fastify: framework/fastify; hapi: framework/hapi; koa: framework/koa; loopback: framework/loopback }

    Type declaration

    Variables

    awsLambda: framework/awsLambda = awsLambdaFramework
    express: framework/express = expressFramework
    fastify: framework/fastify = fastifyFramework
    hapi: framework/hapi = hapiFramework
    koa: framework/koa = koaFramework
    loopback: framework/loopback = loopbackFramework

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Properties

    default: { awsLambda: framework/awsLambda; express: framework/express; fastify: framework/fastify; hapi: framework/hapi; koa: framework/koa; loopback: framework/loopback }

    Type declaration

    Variables

    awsLambda: framework/awsLambda = awsLambdaFramework
    express: framework/express = expressFramework
    fastify: framework/fastify = fastifyFramework
    hapi: framework/hapi = hapiFramework
    koa: framework/koa = koaFramework
    loopback: framework/loopback = loopbackFramework

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_awsLambda.html b/docs/modules/framework_awsLambda.html index f15870926..54b1bbb38 100644 --- a/docs/modules/framework_awsLambda.html +++ b/docs/modules/framework_awsLambda.html @@ -1 +1 @@ -framework/awsLambda | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/awsLambda

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/awsLambda | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/awsLambda

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_custom.html b/docs/modules/framework_custom.html index fdba5deda..b5d0d8073 100644 --- a/docs/modules/framework_custom.html +++ b/docs/modules/framework_custom.html @@ -1 +1 @@ -framework/custom | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/custom

    Index

    Functions

    • middleware<OrigReqType, OrigRespType>(wrapRequest?: (req: OrigReqType) => BaseRequest, wrapResponse?: (req: OrigRespType) => BaseResponse): (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
    • Type parameters

      Parameters

      Returns (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

        • (request: OrigReqType, response: OrigRespType, next?: NextFunction): Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
        • Parameters

          • request: OrigReqType
          • response: OrigRespType
          • Optional next: NextFunction

          Returns Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/custom | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/custom

    Index

    Functions

    • middleware<OrigReqType, OrigRespType>(wrapRequest?: (req: OrigReqType) => BaseRequest, wrapResponse?: (req: OrigRespType) => BaseResponse): (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
    • Type parameters

      Parameters

      Returns (request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

        • (request: OrigReqType, response: OrigRespType, next?: NextFunction): Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
        • Parameters

          • request: OrigReqType
          • response: OrigRespType
          • Optional next: NextFunction

          Returns Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_express.html b/docs/modules/framework_express.html index 0e603adc1..1178294eb 100644 --- a/docs/modules/framework_express.html +++ b/docs/modules/framework_express.html @@ -1 +1 @@ -framework/express | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/express

    Index

    Functions

    • errorHandler(): (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>
    • Returns (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>

        • (err: any, req: Request, res: Response, next: NextFunction): Promise<void>
        • Parameters

          • err: any
          • req: Request
          • res: Response
          • next: NextFunction

          Returns Promise<void>

    • middleware(): (req: Request, res: Response, next: NextFunction) => Promise<void>
    • Returns (req: Request, res: Response, next: NextFunction) => Promise<void>

        • (req: Request, res: Response, next: NextFunction): Promise<void>
        • Parameters

          • req: Request
          • res: Response
          • next: NextFunction

          Returns Promise<void>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/express | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/express

    Index

    Functions

    • errorHandler(): (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>
    • Returns (err: any, req: Request, res: Response, next: NextFunction) => Promise<void>

        • (err: any, req: Request, res: Response, next: NextFunction): Promise<void>
        • Parameters

          • err: any
          • req: Request
          • res: Response
          • next: NextFunction

          Returns Promise<void>

    • middleware(): (req: Request, res: Response, next: NextFunction) => Promise<void>
    • Returns (req: Request, res: Response, next: NextFunction) => Promise<void>

        • (req: Request, res: Response, next: NextFunction): Promise<void>
        • Parameters

          • req: Request
          • res: Response
          • next: NextFunction

          Returns Promise<void>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_fastify.html b/docs/modules/framework_fastify.html index 3ecd46f88..7929e038d 100644 --- a/docs/modules/framework_fastify.html +++ b/docs/modules/framework_fastify.html @@ -1 +1 @@ -framework/fastify | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/fastify

    Index

    Functions

    • errorHandler(): (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>
    • Returns (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>

        • (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>): Promise<void>
        • Parameters

          • err: any
          • req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>
          • res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

          Returns Promise<void>

    • plugin(instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>, opts: Record<never, never>, done: (err?: Error) => void): void
    • Parameters

      • instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>
      • opts: Record<never, never>
      • done: (err?: Error) => void
          • (err?: Error): void
          • Parameters

            • Optional err: Error

            Returns void

      Returns void

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/fastify | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/fastify

    Index

    Functions

    • errorHandler(): (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>
    • Returns (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>) => Promise<void>

        • (err: any, req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>, res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>): Promise<void>
        • Parameters

          • err: any
          • req: FastifyRequest<RouteGenericInterface, Server, IncomingMessage>
          • res: FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

          Returns Promise<void>

    • plugin(instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>, opts: Record<never, never>, done: (err?: Error) => void): void
    • Parameters

      • instance: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>
      • opts: Record<never, never>
      • done: (err?: Error) => void
          • (err?: Error): void
          • Parameters

            • Optional err: Error

            Returns void

      Returns void

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_hapi.html b/docs/modules/framework_hapi.html index 045024051..112956a53 100644 --- a/docs/modules/framework_hapi.html +++ b/docs/modules/framework_hapi.html @@ -1 +1 @@ -framework/hapi | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/hapi

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/hapi | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/hapi

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_koa.html b/docs/modules/framework_koa.html index 8a0dfa9c8..0e318e59f 100644 --- a/docs/modules/framework_koa.html +++ b/docs/modules/framework_koa.html @@ -1 +1 @@ -framework/koa | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/koa

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/koa | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/koa

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/framework_loopback.html b/docs/modules/framework_loopback.html index 33c96ab72..0a5c5e17c 100644 --- a/docs/modules/framework_loopback.html +++ b/docs/modules/framework_loopback.html @@ -1 +1 @@ -framework/loopback | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/loopback

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +framework/loopback | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module framework/loopback

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/index.html b/docs/modules/index.html index 2384d0170..2c295f6aa 100644 --- a/docs/modules/index.html +++ b/docs/modules/index.html @@ -1 +1 @@ -index | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Variables

    Error: typeof default = SuperTokensWrapper.Error

    Functions

    • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }
        • externalUserId: string
        • Optional externalUserIdInfo?: string
        • Optional force?: boolean
        • superTokensUserId: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

    • deleteUser(userId: string, removeAllLinkedAccounts?: boolean, userContext?: any): Promise<{ status: "OK" }>
    • Parameters

      • userId: string
      • removeAllLinkedAccounts: boolean = true
      • Optional userContext: any

      Returns Promise<{ status: "OK" }>

    • deleteUserIdMapping(input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
    • Parameters

      • input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional force?: boolean
        • Optional userContext?: any
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ didMappingExist: boolean; status: "OK" }>

    • getAllCORSHeaders(): string[]
    • getRequestFromUserContext(userContext: any): undefined | BaseRequest
    • getUser(userId: string, userContext?: any): Promise<undefined | User>
    • Parameters

      • userId: string
      • Optional userContext: any

      Returns Promise<undefined | User>

    • getUserCount(includeRecipeIds?: string[], tenantId?: string, userContext?: any): Promise<number>
    • Parameters

      • Optional includeRecipeIds: string[]
      • Optional tenantId: string
      • Optional userContext: any

      Returns Promise<number>

    • getUserIdMapping(input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
    • Parameters

      • input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional userContext?: any
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

    • getUsersNewestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
    • Parameters

      • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
        • Optional includeRecipeIds?: string[]
        • Optional limit?: number
        • Optional paginationToken?: string
        • Optional query?: {}
          • [key: string]: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • getUsersOldestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
    • Parameters

      • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
        • Optional includeRecipeIds?: string[]
        • Optional limit?: number
        • Optional paginationToken?: string
        • Optional query?: {}
          • [key: string]: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • init(config: TypeInput): void
    • listUsersByAccountInfo(tenantId: string, accountInfo: AccountInfo, doUnionOfAccountInfo?: boolean, userContext?: any): Promise<User[]>
    • Parameters

      • tenantId: string
      • accountInfo: AccountInfo
      • doUnionOfAccountInfo: boolean = false
      • Optional userContext: any

      Returns Promise<User[]>

    • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
    • Parameters

      • input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional externalUserIdInfo?: string
        • Optional userContext?: any
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +index | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Variables

    Error: typeof default = SuperTokensWrapper.Error

    Functions

    • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
    • Parameters

      • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }
        • externalUserId: string
        • Optional externalUserIdInfo?: string
        • Optional force?: boolean
        • superTokensUserId: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

    • deleteUser(userId: string, removeAllLinkedAccounts?: boolean, userContext?: any): Promise<{ status: "OK" }>
    • Parameters

      • userId: string
      • removeAllLinkedAccounts: boolean = true
      • Optional userContext: any

      Returns Promise<{ status: "OK" }>

    • deleteUserIdMapping(input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
    • Parameters

      • input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional force?: boolean
        • Optional userContext?: any
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ didMappingExist: boolean; status: "OK" }>

    • getAllCORSHeaders(): string[]
    • getRequestFromUserContext(userContext: any): undefined | BaseRequest
    • getUser(userId: string, userContext?: any): Promise<undefined | User>
    • Parameters

      • userId: string
      • Optional userContext: any

      Returns Promise<undefined | User>

    • getUserCount(includeRecipeIds?: string[], tenantId?: string, userContext?: any): Promise<number>
    • Parameters

      • Optional includeRecipeIds: string[]
      • Optional tenantId: string
      • Optional userContext: any

      Returns Promise<number>

    • getUserIdMapping(input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
    • Parameters

      • input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional userContext?: any
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

    • getUsersNewestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
    • Parameters

      • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
        • Optional includeRecipeIds?: string[]
        • Optional limit?: number
        • Optional paginationToken?: string
        • Optional query?: {}
          • [key: string]: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • getUsersOldestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
    • Parameters

      • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
        • Optional includeRecipeIds?: string[]
        • Optional limit?: number
        • Optional paginationToken?: string
        • Optional query?: {}
          • [key: string]: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • init(config: TypeInput): void
    • listUsersByAccountInfo(tenantId: string, accountInfo: AccountInfo, doUnionOfAccountInfo?: boolean, userContext?: any): Promise<User[]>
    • Parameters

      • tenantId: string
      • accountInfo: AccountInfo
      • doUnionOfAccountInfo: boolean = false
      • Optional userContext: any

      Returns Promise<User[]>

    • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
    • Parameters

      • input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
        • Optional externalUserIdInfo?: string
        • Optional userContext?: any
        • userId: string
        • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

      Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_accountlinking.html b/docs/modules/recipe_accountlinking.html index 73677acb1..34425b1b7 100644 --- a/docs/modules/recipe_accountlinking.html +++ b/docs/modules/recipe_accountlinking.html @@ -1 +1 @@ -recipe/accountlinking | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/accountlinking

    Index

    Type aliases

    RecipeInterface: { canCreatePrimaryUser: any; canLinkAccounts: any; createPrimaryUser: any; deleteUser: any; getUser: any; getUsers: any; linkAccounts: any; listUsersByAccountInfo: any; unlinkAccount: any }

    Type declaration

    • canCreatePrimaryUser:function
      • canCreatePrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
      • Parameters

        Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • canLinkAccounts:function
      • canLinkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
      • Parameters

        • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
          • primaryUserId: string
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • createPrimaryUser:function
      • createPrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
      • Parameters

        Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • deleteUser:function
      • deleteUser(input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }): Promise<{ status: "OK" }>
      • Parameters

        • input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }
          • removeAllLinkedAccounts: boolean
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK" }>

    • getUser:function
      • getUser(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUsers:function
      • getUsers(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
      • Parameters

        • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }
          • Optional includeRecipeIds?: string[]
          • Optional limit?: number
          • Optional paginationToken?: string
          • Optional query?: {}
            • [key: string]: string
          • tenantId: string
          • timeJoinedOrder: "ASC" | "DESC"
          • userContext: any

        Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • linkAccounts:function
      • linkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
      • Parameters

        • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
          • primaryUserId: string
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • listUsersByAccountInfo:function
      • listUsersByAccountInfo(input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }): Promise<User[]>
      • Parameters

        • input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }
          • accountInfo: AccountInfo
          • doUnionOfAccountInfo: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<User[]>

    • unlinkAccount:function
      • unlinkAccount(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

    Functions

    • canCreatePrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
    • Parameters

      Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • canLinkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
    • Parameters

      • recipeUserId: RecipeUserId
      • primaryUserId: string
      • userContext: any = {}

      Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • createPrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
    • Parameters

      Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • createPrimaryUserIdOrLinkAccounts(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<User>
    • getPrimaryUserThatCanBeLinkedToRecipeUserId(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<undefined | User>
    • init(config?: TypeInput): RecipeListFunction
    • isEmailChangeAllowed(recipeUserId: RecipeUserId, newEmail: string, isVerified: boolean, userContext?: any): Promise<boolean>
    • isSignInAllowed(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<boolean>
    • isSignUpAllowed(tenantId: string, newUser: AccountInfoWithRecipeId, isVerified: boolean, userContext?: any): Promise<boolean>
    • linkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
    • Parameters

      • recipeUserId: RecipeUserId
      • primaryUserId: string
      • userContext: any = {}

      Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • unlinkAccount(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/accountlinking | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/accountlinking

    Index

    Type aliases

    RecipeInterface: { canCreatePrimaryUser: any; canLinkAccounts: any; createPrimaryUser: any; deleteUser: any; getUser: any; getUsers: any; linkAccounts: any; listUsersByAccountInfo: any; unlinkAccount: any }

    Type declaration

    • canCreatePrimaryUser:function
      • canCreatePrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
      • Parameters

        Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • canLinkAccounts:function
      • canLinkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
      • Parameters

        • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
          • primaryUserId: string
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • createPrimaryUser:function
      • createPrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
      • Parameters

        Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • deleteUser:function
      • deleteUser(input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }): Promise<{ status: "OK" }>
      • Parameters

        • input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }
          • removeAllLinkedAccounts: boolean
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK" }>

    • getUser:function
      • getUser(input: { userContext: any; userId: string }): Promise<undefined | User>
    • getUsers:function
      • getUsers(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
      • Parameters

        • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }
          • Optional includeRecipeIds?: string[]
          • Optional limit?: number
          • Optional paginationToken?: string
          • Optional query?: {}
            • [key: string]: string
          • tenantId: string
          • timeJoinedOrder: "ASC" | "DESC"
          • userContext: any

        Returns Promise<{ nextPaginationToken?: string; users: User[] }>

    • linkAccounts:function
      • linkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
      • Parameters

        • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
          • primaryUserId: string
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • listUsersByAccountInfo:function
      • listUsersByAccountInfo(input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }): Promise<User[]>
      • Parameters

        • input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }
          • accountInfo: AccountInfo
          • doUnionOfAccountInfo: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<User[]>

    • unlinkAccount:function
      • unlinkAccount(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

    Functions

    • canCreatePrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
    • Parameters

      Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • canLinkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
    • Parameters

      • recipeUserId: RecipeUserId
      • primaryUserId: string
      • userContext: any = {}

      Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • createPrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
    • Parameters

      Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

    • createPrimaryUserIdOrLinkAccounts(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<User>
    • getPrimaryUserThatCanBeLinkedToRecipeUserId(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<undefined | User>
    • init(config?: TypeInput): RecipeListFunction
    • isEmailChangeAllowed(recipeUserId: RecipeUserId, newEmail: string, isVerified: boolean, userContext?: any): Promise<boolean>
    • isSignInAllowed(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<boolean>
    • isSignUpAllowed(tenantId: string, newUser: AccountInfoWithRecipeId, isVerified: boolean, userContext?: any): Promise<boolean>
    • linkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
    • Parameters

      • recipeUserId: RecipeUserId
      • primaryUserId: string
      • userContext: any = {}

      Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

    • unlinkAccount(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_dashboard.html b/docs/modules/recipe_dashboard.html index 07f400716..4e5b2c942 100644 --- a/docs/modules/recipe_dashboard.html +++ b/docs/modules/recipe_dashboard.html @@ -1 +1 @@ -recipe/dashboard | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/dashboard

    Index

    Type aliases

    APIInterface: { dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>) }

    Type declaration

    • dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    RecipeInterface: { getDashboardBundleLocation: any; shouldAllowAccess: any }

    Type declaration

    • getDashboardBundleLocation:function
      • getDashboardBundleLocation(input: { userContext: any }): Promise<string>
    • shouldAllowAccess:function
      • shouldAllowAccess(input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }): Promise<boolean>

    Functions

    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/dashboard | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/dashboard

    Index

    Type aliases

    APIInterface: { dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>) }

    Type declaration

    • dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    RecipeInterface: { getDashboardBundleLocation: any; shouldAllowAccess: any }

    Type declaration

    • getDashboardBundleLocation:function
      • getDashboardBundleLocation(input: { userContext: any }): Promise<string>
    • shouldAllowAccess:function
      • shouldAllowAccess(input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }): Promise<boolean>

    Functions

    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_emailpassword.html b/docs/modules/recipe_emailpassword.html index ead41cb9a..38deb0ba3 100644 --- a/docs/modules/recipe_emailpassword.html +++ b/docs/modules/recipe_emailpassword.html @@ -1,5 +1,5 @@ -recipe/emailpassword | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/emailpassword

    Index

    Type aliases

    APIInterface: { emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>) }

    Type declaration

    • emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
    • signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
    • signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailPasswordEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    RecipeInterface: { consumePasswordResetToken: any; createNewRecipeUser: any; createResetPasswordToken: any; signIn: any; signUp: any; updateEmailOrPassword: any }

    Type declaration

    • consumePasswordResetToken:function
      • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { tenantId: string; token: string; userContext: any }
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • createNewRecipeUser:function
      • createNewRecipeUser(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

    • createResetPasswordToken:function
      • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
      • +recipe/emailpassword | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/emailpassword

        Index

        Type aliases

        APIInterface: { emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>) }

        Type declaration

        • emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
        • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
        • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
        • signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
        • signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailPasswordEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        RecipeInterface: { consumePasswordResetToken: any; createNewRecipeUser: any; createResetPasswordToken: any; signIn: any; signUp: any; updateEmailOrPassword: any }

        Type declaration

        • consumePasswordResetToken:function
          • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
          • Parameters

            • input: { tenantId: string; token: string; userContext: any }
              • tenantId: string
              • token: string
              • userContext: any

            Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

        • createNewRecipeUser:function
          • createNewRecipeUser(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

        • createResetPasswordToken:function
          • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
          • We pass in the email as well to this function cause the input userId may not be associated with an emailpassword account. In this case, we need to know which email to use to create an emailpassword account later on.

            -

            Parameters

            • input: { email: string; tenantId: string; userContext: any; userId: string }
              • email: string
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • signIn:function
          • signIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>

        • signUp:function
          • signUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

        • updateEmailOrPassword:function
          • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
          • Parameters

            • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
              • Optional applyPasswordPolicy?: boolean
              • Optional email?: string
              • Optional password?: string
              • recipeUserId: RecipeUserId
              • tenantIdForPasswordPolicy: string
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
        • Parameters

          • tenantId: string
          • token: string
          • Optional userContext: any

          Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

        • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • email: string
          • userContext: any = {}

          Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • email: string
          • Optional userContext: any

          Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • init(config?: TypeInput): RecipeListFunction
        • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • tenantId: string
          • token: string
          • newPassword: string
          • Optional userContext: any

          Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
        • signIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
        • signUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
        • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
            • Optional applyPasswordPolicy?: boolean
            • Optional email?: string
            • Optional password?: string
            • recipeUserId: RecipeUserId
            • Optional tenantIdForPasswordPolicy?: string
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        Legend

        • Variable
        • Function
        • Function with type parameter
        • Type alias
        • Class
        • Class with type parameter
        • Interface

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +

        Parameters

        • input: { email: string; tenantId: string; userContext: any; userId: string }
          • email: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • signIn:function
      • signIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>

    • signUp:function
      • signUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

    • updateEmailOrPassword:function
      • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
      • Parameters

        • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
          • Optional applyPasswordPolicy?: boolean
          • Optional email?: string
          • Optional password?: string
          • recipeUserId: RecipeUserId
          • tenantIdForPasswordPolicy: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • Optional userContext: any

      Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • email: string
      • userContext: any = {}

      Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • email: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • init(config?: TypeInput): RecipeListFunction
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • signIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • signUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_emailverification.html b/docs/modules/recipe_emailverification.html index 137545ccc..cbbd73aca 100644 --- a/docs/modules/recipe_emailverification.html +++ b/docs/modules/recipe_emailverification.html @@ -1 +1 @@ -recipe/emailverification | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/emailverification

    Index

    Type aliases

    APIInterface: { generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>); isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>); verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>) }

    Type declaration

    • generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>)
    • isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>)
    • verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>
    • isInServerlessEnv: boolean
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    RecipeInterface: { createEmailVerificationToken: any; isEmailVerified: any; revokeEmailVerificationTokens: any; unverifyEmail: any; verifyEmailUsingToken: any }

    Type declaration

    • createEmailVerificationToken:function
      • createEmailVerificationToken(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • isEmailVerified:function
      • isEmailVerified(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<boolean>
    • revokeEmailVerificationTokens:function
      • revokeEmailVerificationTokens(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • unverifyEmail:function
      • unverifyEmail(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" }>
    • verifyEmailUsingToken:function
      • verifyEmailUsingToken(input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }
          • attemptAccountLinking: boolean
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    UserEmailInfo: { email: string; recipeUserId: RecipeUserId }

    Type declaration

    Variables

    EmailVerificationClaim: EmailVerificationClaimClass = ...
    Error: typeof default = Wrapper.Error

    Functions

    • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • init(config: TypeInput): RecipeListFunction
    • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
    • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/emailverification | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/emailverification

    Index

    Type aliases

    APIInterface: { generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>); isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>); verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>) }

    Type declaration

    • generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>)
    • isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>)
    • verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>
    • isInServerlessEnv: boolean
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    RecipeInterface: { createEmailVerificationToken: any; isEmailVerified: any; revokeEmailVerificationTokens: any; unverifyEmail: any; verifyEmailUsingToken: any }

    Type declaration

    • createEmailVerificationToken:function
      • createEmailVerificationToken(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • isEmailVerified:function
      • isEmailVerified(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<boolean>
    • revokeEmailVerificationTokens:function
      • revokeEmailVerificationTokens(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • unverifyEmail:function
      • unverifyEmail(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" }>
    • verifyEmailUsingToken:function
      • verifyEmailUsingToken(input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }
          • attemptAccountLinking: boolean
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    UserEmailInfo: { email: string; recipeUserId: RecipeUserId }

    Type declaration

    Variables

    EmailVerificationClaim: EmailVerificationClaimClass = ...
    Error: typeof default = Wrapper.Error

    Functions

    • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • init(config: TypeInput): RecipeListFunction
    • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
    • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
    • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
    • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_jwt.html b/docs/modules/recipe_jwt.html index cfd92648e..483c0131f 100644 --- a/docs/modules/recipe_jwt.html +++ b/docs/modules/recipe_jwt.html @@ -1 +1 @@ -recipe/jwt | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Type aliases

    APIInterface: { getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>) }

    Type declaration

    • getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>)
    APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    JsonWebKey: { alg: string; e: string; kid: string; kty: string; n: string; use: string }

    Type declaration

    • alg: string
    • e: string
    • kid: string
    • kty: string
    • n: string
    • use: string
    RecipeInterface: { createJWT: any; getJWKS: any }

    Type declaration

    • createJWT:function
      • createJWT(input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
      • Parameters

        • input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }
          • Optional payload?: any
          • Optional useStaticSigningKey?: boolean
          • userContext: any
          • Optional validitySeconds?: number

        Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS:function
      • getJWKS(input: { userContext: any }): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

    Functions

    • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/jwt | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Type aliases

    APIInterface: { getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>) }

    Type declaration

    • getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>)
    APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    JsonWebKey: { alg: string; e: string; kid: string; kty: string; n: string; use: string }

    Type declaration

    • alg: string
    • e: string
    • kid: string
    • kty: string
    • n: string
    • use: string
    RecipeInterface: { createJWT: any; getJWKS: any }

    Type declaration

    • createJWT:function
      • createJWT(input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
      • Parameters

        • input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }
          • Optional payload?: any
          • Optional useStaticSigningKey?: boolean
          • userContext: any
          • Optional validitySeconds?: number

        Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS:function
      • getJWKS(input: { userContext: any }): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

    Functions

    • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_multitenancy.html b/docs/modules/recipe_multitenancy.html index 10080a56b..963f743ef 100644 --- a/docs/modules/recipe_multitenancy.html +++ b/docs/modules/recipe_multitenancy.html @@ -1 +1 @@ -recipe/multitenancy | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/multitenancy

    Index

    Type aliases

    APIInterface: { loginMethodsGET: any }

    Type declaration

    • loginMethodsGET:function
      • loginMethodsGET(input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>
      • Parameters

        • input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }
          • Optional clientType?: string
          • options: APIOptions
          • tenantId: string
          • userContext: any

        Returns Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>

    APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; staticThirdPartyProviders: ProviderInput[] }

    Type declaration

    RecipeInterface: { associateUserToTenant: any; createOrUpdateTenant: any; createOrUpdateThirdPartyConfig: any; deleteTenant: any; deleteThirdPartyConfig: any; disassociateUserFromTenant: any; getTenant: any; getTenantId: any; listAllTenants: any }

    Type declaration

    • associateUserToTenant:function
      • associateUserToTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }

        Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant:function
      • createOrUpdateTenant(input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
      • Parameters

        • input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }
          • Optional config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
            • Optional coreConfig?: {}
              • [key: string]: any
            • Optional emailPasswordEnabled?: boolean
            • Optional passwordlessEnabled?: boolean
            • Optional thirdPartyEnabled?: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig:function
      • createOrUpdateThirdPartyConfig(input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
      • Parameters

        • input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }
          • config: ProviderConfig
          • Optional skipValidation?: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant:function
      • deleteTenant(input: { tenantId: string; userContext: any }): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig:function
      • deleteThirdPartyConfig(input: { tenantId: string; thirdPartyId: string; userContext: any }): Promise<{ didConfigExist: boolean; status: "OK" }>
      • Parameters

        • input: { tenantId: string; thirdPartyId: string; userContext: any }
          • tenantId: string
          • thirdPartyId: string
          • userContext: any

        Returns Promise<{ didConfigExist: boolean; status: "OK" }>

    • disassociateUserFromTenant:function
      • disassociateUserFromTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant:function
      • getTenant(input: { tenantId: string; userContext: any }): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
      • Parameters

        • input: { tenantId: string; userContext: any }
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • getTenantId:function
      • getTenantId(input: { tenantIdFromFrontend: string; userContext: any }): Promise<string>
    • listAllTenants:function
      • listAllTenants(input: { userContext: any }): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
      • Parameters

        • input: { userContext: any }
          • userContext: any

        Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Variables

    AllowedDomainsClaim: AllowedDomainsClaimClass = ...

    Functions

    • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
    • Parameters

      • tenantId: string
      • recipeUserId: RecipeUserId
      • Optional userContext: any

      Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
        • Optional coreConfig?: {}
          • [key: string]: any
        • Optional emailPasswordEnabled?: boolean
        • Optional passwordlessEnabled?: boolean
        • Optional thirdPartyEnabled?: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • config: ProviderConfig
      • Optional skipValidation: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
    • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
    • Parameters

      • tenantId: string
      • Optional userContext: any

      Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • init(config?: TypeInput): RecipeListFunction
    • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
    • Parameters

      • Optional userContext: any

      Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/multitenancy | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/multitenancy

    Index

    Type aliases

    APIInterface: { loginMethodsGET: any }

    Type declaration

    • loginMethodsGET:function
      • loginMethodsGET(input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>
      • Parameters

        • input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }
          • Optional clientType?: string
          • options: APIOptions
          • tenantId: string
          • userContext: any

        Returns Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>

    APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; staticThirdPartyProviders: ProviderInput[] }

    Type declaration

    RecipeInterface: { associateUserToTenant: any; createOrUpdateTenant: any; createOrUpdateThirdPartyConfig: any; deleteTenant: any; deleteThirdPartyConfig: any; disassociateUserFromTenant: any; getTenant: any; getTenantId: any; listAllTenants: any }

    Type declaration

    • associateUserToTenant:function
      • associateUserToTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }

        Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant:function
      • createOrUpdateTenant(input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
      • Parameters

        • input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }
          • Optional config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
            • Optional coreConfig?: {}
              • [key: string]: any
            • Optional emailPasswordEnabled?: boolean
            • Optional passwordlessEnabled?: boolean
            • Optional thirdPartyEnabled?: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig:function
      • createOrUpdateThirdPartyConfig(input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
      • Parameters

        • input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }
          • config: ProviderConfig
          • Optional skipValidation?: boolean
          • tenantId: string
          • userContext: any

        Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant:function
      • deleteTenant(input: { tenantId: string; userContext: any }): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig:function
      • deleteThirdPartyConfig(input: { tenantId: string; thirdPartyId: string; userContext: any }): Promise<{ didConfigExist: boolean; status: "OK" }>
      • Parameters

        • input: { tenantId: string; thirdPartyId: string; userContext: any }
          • tenantId: string
          • thirdPartyId: string
          • userContext: any

        Returns Promise<{ didConfigExist: boolean; status: "OK" }>

    • disassociateUserFromTenant:function
      • disassociateUserFromTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant:function
      • getTenant(input: { tenantId: string; userContext: any }): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
      • Parameters

        • input: { tenantId: string; userContext: any }
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • getTenantId:function
      • getTenantId(input: { tenantIdFromFrontend: string; userContext: any }): Promise<string>
    • listAllTenants:function
      • listAllTenants(input: { userContext: any }): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
      • Parameters

        • input: { userContext: any }
          • userContext: any

        Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Variables

    AllowedDomainsClaim: AllowedDomainsClaimClass = ...

    Functions

    • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
    • Parameters

      • tenantId: string
      • recipeUserId: RecipeUserId
      • Optional userContext: any

      Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

    • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
        • Optional coreConfig?: {}
          • [key: string]: any
        • Optional emailPasswordEnabled?: boolean
        • Optional passwordlessEnabled?: boolean
        • Optional thirdPartyEnabled?: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
    • Parameters

      • tenantId: string
      • config: ProviderConfig
      • Optional skipValidation: boolean
      • Optional userContext: any

      Returns Promise<{ createdNew: boolean; status: "OK" }>

    • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
    • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
    • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
    • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
    • Parameters

      • tenantId: string
      • Optional userContext: any

      Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

    • init(config?: TypeInput): RecipeListFunction
    • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
    • Parameters

      • Optional userContext: any

      Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_openid.html b/docs/modules/recipe_openid.html index 6329e65c5..b7b85ed9f 100644 --- a/docs/modules/recipe_openid.html +++ b/docs/modules/recipe_openid.html @@ -1 +1 @@ -recipe/openid | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/openid

    Index

    Functions

    • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • Optional payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/openid | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/openid

    Index

    Functions

    • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • Optional payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • Optional userContext: any

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
    • init(config?: TypeInput): RecipeListFunction

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index d65c41425..1c4733535 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1 +1 @@ -recipe/passwordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/passwordless

    Index

    Type aliases

    APIInterface: { consumeCodePOST?: any; createCodePOST?: any; emailExistsGET?: any; phoneNumberExistsGET?: any; resendCodePOST?: any }

    Type declaration

    • consumeCodePOST?:function
      • consumeCodePOST(input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any })): Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any })

        Returns Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • createCodePOST?:function
      • createCodePOST(input: ({ email: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any })): Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: ({ email: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any })

        Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • emailExistsGET?:function
      • emailExistsGET(input: { email: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
    • phoneNumberExistsGET?:function
      • phoneNumberExistsGET(input: { options: APIOptions; phoneNumber: string; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
    • resendCodePOST?:function
      • resendCodePOST(input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }

        Returns Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>

    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypePasswordlessEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; smsDelivery: default<TypePasswordlessSmsDeliveryInput> }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • emailDelivery: default<TypePasswordlessEmailDeliveryInput>
    • isInServerlessEnv: boolean
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    • smsDelivery: default<TypePasswordlessSmsDeliveryInput>
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; updateUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • tenantId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any }
          • deviceId: string
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | DeviceType>

    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
      • Parameters

        • input: { phoneNumber: string; tenantId: string; userContext: any }
          • phoneNumber: string
          • tenantId: string
          • userContext: any

        Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
      • Parameters

        • input: { preAuthSessionId: string; tenantId: string; userContext: any }
          • preAuthSessionId: string
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | DeviceType>

    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
      • Parameters

        • input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }

        Returns Promise<{ status: "OK" }>

    • revokeCode:function
      • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
      • Parameters

        • input: { codeId: string; tenantId: string; userContext: any }
          • codeId: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ status: "OK" }>

    • updateUser:function
      • updateUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<string>

    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any }
        • email: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { phoneNumber: string; tenantId: string; userContext?: any }
        • phoneNumber: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ status: "OK" }>

    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { codeId: string; tenantId: string; userContext?: any }
        • codeId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" }>

    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

    • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/passwordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/passwordless

    Index

    Type aliases

    APIInterface: { consumeCodePOST?: any; createCodePOST?: any; emailExistsGET?: any; phoneNumberExistsGET?: any; resendCodePOST?: any }

    Type declaration

    • consumeCodePOST?:function
      • consumeCodePOST(input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any })): Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any })

        Returns Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • createCodePOST?:function
      • createCodePOST(input: ({ email: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any })): Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: ({ email: string } & { options: APIOptions; tenantId: string; userContext: any }) & ({ phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any })

        Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • emailExistsGET?:function
      • emailExistsGET(input: { email: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
    • phoneNumberExistsGET?:function
      • phoneNumberExistsGET(input: { options: APIOptions; phoneNumber: string; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
    • resendCodePOST?:function
      • resendCodePOST(input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }

        Returns Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>

    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypePasswordlessEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; smsDelivery: default<TypePasswordlessSmsDeliveryInput> }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • emailDelivery: default<TypePasswordlessEmailDeliveryInput>
    • isInServerlessEnv: boolean
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    • smsDelivery: default<TypePasswordlessSmsDeliveryInput>
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; updateUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • tenantId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any }
          • deviceId: string
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | DeviceType>

    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
      • Parameters

        • input: { phoneNumber: string; tenantId: string; userContext: any }
          • phoneNumber: string
          • tenantId: string
          • userContext: any

        Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
      • Parameters

        • input: { preAuthSessionId: string; tenantId: string; userContext: any }
          • preAuthSessionId: string
          • tenantId: string
          • userContext: any

        Returns Promise<undefined | DeviceType>

    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
      • Parameters

        • input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }

        Returns Promise<{ status: "OK" }>

    • revokeCode:function
      • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
      • Parameters

        • input: { codeId: string; tenantId: string; userContext: any }
          • codeId: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ status: "OK" }>

    • updateUser:function
      • updateUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<string>

    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any }
        • email: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • Parameters

      • input: { phoneNumber: string; tenantId: string; userContext?: any }
        • phoneNumber: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<DeviceType[]>

    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ status: "OK" }>

    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • Parameters

      • input: { codeId: string; tenantId: string; userContext?: any }
        • codeId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" }>

    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • Parameters

      • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

    • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index 6359e2f19..16c40ee62 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,13 +1,13 @@ -recipe/session | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/session

    Index

    Type aliases

    APIInterface: { refreshPOST: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<SessionContainer>); signOutPOST: undefined | ((input: { options: APIOptions; session: SessionContainer | undefined; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>); verifySession: any }

    Type declaration

  • mergeIntoAccessTokenPayload:function
    • mergeIntoAccessTokenPayload(input: { accessTokenPayloadUpdate: JSONObject; sessionHandle: string; userContext: any }): Promise<boolean>
  • refreshSession:function
    • refreshSession(input: { antiCsrfToken?: string; disableAntiCsrf: boolean; refreshToken: string; userContext: any }): Promise<SessionContainer>
    • Parameters

      • input: { antiCsrfToken?: string; disableAntiCsrf: boolean; refreshToken: string; userContext: any }
        • Optional antiCsrfToken?: string
        • disableAntiCsrf: boolean
        • refreshToken: string
        • userContext: any

      Returns Promise<SessionContainer>

  • regenerateAccessToken:function
    • regenerateAccessToken(input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }): Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; recipeUserId: RecipeUserId; tenantId: string; userDataInJWT: any; userId: string }; status: "OK" }>
    • Parameters

      • input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }
        • accessToken: string
        • Optional newAccessTokenPayload?: any
        • userContext: any

      Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; recipeUserId: RecipeUserId; tenantId: string; userDataInJWT: any; userId: string }; status: "OK" }>

      Returns false if the sessionHandle does not exist

      +
  • removeClaim:function
    • removeClaim(input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }): Promise<boolean>
    • Parameters

      • input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }
        • claim: SessionClaim<any>
        • sessionHandle: string
        • userContext: any

      Returns Promise<boolean>

  • revokeAllSessionsForUser:function
    • revokeAllSessionsForUser(input: { revokeAcrossAllTenants?: boolean; revokeSessionsForLinkedAccounts: boolean; tenantId: string; userContext: any; userId: string }): Promise<string[]>
    • Parameters

      • input: { revokeAcrossAllTenants?: boolean; revokeSessionsForLinkedAccounts: boolean; tenantId: string; userContext: any; userId: string }
        • Optional revokeAcrossAllTenants?: boolean
        • revokeSessionsForLinkedAccounts: boolean
        • tenantId: string
        • userContext: any
        • userId: string

      Returns Promise<string[]>

  • revokeMultipleSessions:function
    • revokeMultipleSessions(input: { sessionHandles: string[]; userContext: any }): Promise<string[]>
    • Parameters

      • input: { sessionHandles: string[]; userContext: any }
        • sessionHandles: string[]
        • userContext: any

      Returns Promise<string[]>

  • revokeSession:function
    • revokeSession(input: { sessionHandle: string; userContext: any }): Promise<boolean>
  • setClaimValue:function
    • setClaimValue<T>(input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }): Promise<boolean>
    • Type parameters

      • T

      Parameters

      • input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }
        • claim: SessionClaim<T>
        • sessionHandle: string
        • userContext: any
        • value: T

      Returns Promise<boolean>

  • updateSessionDataInDatabase:function
    • updateSessionDataInDatabase(input: { newSessionData: any; sessionHandle: string; userContext: any }): Promise<boolean>
    • Parameters

      • input: { newSessionData: any; sessionHandle: string; userContext: any }
        • newSessionData: any
        • sessionHandle: string
        • userContext: any

      Returns Promise<boolean>

  • validateClaims:function
    • validateClaims(input: { accessTokenPayload: any; claimValidators: SessionClaimValidator[]; recipeUserId: RecipeUserId; userContext: any; userId: string }): Promise<{ accessTokenPayloadUpdate?: any; invalidClaims: ClaimValidationError[] }>
  • SessionClaimValidator: ({ claim: SessionClaim<any>; shouldRefetch: any } | {}) & { id: string; validate: any }
    SessionInformation: { customClaimsInAccessTokenPayload: any; expiry: number; recipeUserId: RecipeUserId; sessionDataInDatabase: any; sessionHandle: string; tenantId: string; timeCreated: number; userId: string }

    Type declaration

    • customClaimsInAccessTokenPayload: any
    • expiry: number
    • recipeUserId: RecipeUserId
    • sessionDataInDatabase: any
    • sessionHandle: string
    • tenantId: string
    • timeCreated: number
    • userId: string

    Variables

    Error: typeof default = SessionWrapper.Error

    Functions

    • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
    • Parameters

      • Optional payload: any
      • Optional validitySeconds: number
      • Optional useStaticSigningKey: boolean
      • userContext: any = {}

      Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

    • createNewSession(req: any, res: any, tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, userContext?: any): Promise<SessionContainer>
    • createNewSessionWithoutRequestResponse(tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, disableAntiCsrf?: boolean, userContext?: any): Promise<SessionContainer>
    • fetchAndSetClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • getAllSessionHandlesForUser(userId: string, fetchSessionsForAllLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
    • Parameters

      • userId: string
      • fetchSessionsForAllLinkedAccounts: boolean = true
      • Optional tenantId: string
      • userContext: any = {}

      Returns Promise<string[]>

    • getClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, userContext?: any): Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
    • Type parameters

      • T

      Parameters

      • sessionHandle: string
      • claim: SessionClaim<T>
      • userContext: any = {}

      Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>

    • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[] }>
    • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
    • getSessionInformation(sessionHandle: string, userContext?: any): Promise<undefined | SessionInformation>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string): Promise<SessionContainer>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired?: true }, userContext?: any): Promise<SessionContainer>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired: false }, userContext?: any): Promise<undefined | SessionContainer>
    • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions, userContext?: any): Promise<undefined | SessionContainer>
    • init(config?: TypeInput): RecipeListFunction
    • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
    • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
    • refreshSessionWithoutRequestResponse(refreshToken: string, disableAntiCsrf?: boolean, antiCsrfToken?: string, userContext?: any): Promise<SessionContainer>
    • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
    • revokeAllSessionsForUser(userId: string, revokeSessionsForLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
    • Parameters

      • userId: string
      • revokeSessionsForLinkedAccounts: boolean = true
      • Optional tenantId: string
      • userContext: any = {}

      Returns Promise<string[]>

    • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
    • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
    • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
    • updateSessionDataInDatabase(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index 92d6b7813..4e762420f 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1 +1 @@ -recipe/thirdparty | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdparty

    Index

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: ProviderInput[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • isInServerlessEnv: boolean
    • providers: ProviderInput[]
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    RecipeInterface: { getProvider: any; manuallyCreateOrUpdateUser: any; signInUp: any }

    Type declaration

    • getProvider:function
      • getProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
      • Parameters

        • input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }
          • Optional clientType?: string
          • tenantId: string
          • thirdPartyId: string
          • userContext: any

        Returns Promise<undefined | TypeProvider>

    • manuallyCreateOrUpdateUser:function
      • manuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • signInUp:function
      • signInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    TypeProvider: { config: ProviderConfigForClientType; id: string; exchangeAuthCodeForOAuthTokens: any; getAuthorisationRedirectURL: any; getConfigForClientType: any; getUserInfo: any }

    Type declaration

    • config: ProviderConfigForClientType
    • id: string
    • exchangeAuthCodeForOAuthTokens:function
      • exchangeAuthCodeForOAuthTokens(input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }): Promise<any>
      • Parameters

        • input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }
          • redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }
            • Optional pkceCodeVerifier?: string
            • redirectURIOnProviderDashboard: string
            • redirectURIQueryParams: any
          • userContext: any

        Returns Promise<any>

    • getAuthorisationRedirectURL:function
      • getAuthorisationRedirectURL(input: { redirectURIOnProviderDashboard: string; userContext: any }): Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>
      • Parameters

        • input: { redirectURIOnProviderDashboard: string; userContext: any }
          • redirectURIOnProviderDashboard: string
          • userContext: any

        Returns Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>

    • getConfigForClientType:function
      • getConfigForClientType(input: { clientType?: string; userContext: any }): Promise<ProviderConfigForClientType>
      • Parameters

        • input: { clientType?: string; userContext: any }
          • Optional clientType?: string
          • userContext: any

        Returns Promise<ProviderConfigForClientType>

    • getUserInfo:function
      • getUserInfo(input: { oAuthTokens: any; userContext: any }): Promise<UserInfo>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • init(config?: TypeInput): RecipeListFunction
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/thirdparty | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdparty

    Index

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: ProviderInput[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

    Type declaration

    • appInfo: NormalisedAppinfo
    • config: TypeNormalisedInput
    • isInServerlessEnv: boolean
    • providers: ProviderInput[]
    • recipeId: string
    • recipeImplementation: RecipeInterface
    • req: BaseRequest
    • res: BaseResponse
    RecipeInterface: { getProvider: any; manuallyCreateOrUpdateUser: any; signInUp: any }

    Type declaration

    • getProvider:function
      • getProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
      • Parameters

        • input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }
          • Optional clientType?: string
          • tenantId: string
          • thirdPartyId: string
          • userContext: any

        Returns Promise<undefined | TypeProvider>

    • manuallyCreateOrUpdateUser:function
      • manuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • signInUp:function
      • signInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    TypeProvider: { config: ProviderConfigForClientType; id: string; exchangeAuthCodeForOAuthTokens: any; getAuthorisationRedirectURL: any; getConfigForClientType: any; getUserInfo: any }

    Type declaration

    • config: ProviderConfigForClientType
    • id: string
    • exchangeAuthCodeForOAuthTokens:function
      • exchangeAuthCodeForOAuthTokens(input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }): Promise<any>
      • Parameters

        • input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }
          • redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }
            • Optional pkceCodeVerifier?: string
            • redirectURIOnProviderDashboard: string
            • redirectURIQueryParams: any
          • userContext: any

        Returns Promise<any>

    • getAuthorisationRedirectURL:function
      • getAuthorisationRedirectURL(input: { redirectURIOnProviderDashboard: string; userContext: any }): Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>
      • Parameters

        • input: { redirectURIOnProviderDashboard: string; userContext: any }
          • redirectURIOnProviderDashboard: string
          • userContext: any

        Returns Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>

    • getConfigForClientType:function
      • getConfigForClientType(input: { clientType?: string; userContext: any }): Promise<ProviderConfigForClientType>
      • Parameters

        • input: { clientType?: string; userContext: any }
          • Optional clientType?: string
          • userContext: any

        Returns Promise<ProviderConfigForClientType>

    • getUserInfo:function
      • getUserInfo(input: { oAuthTokens: any; userContext: any }): Promise<UserInfo>

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • init(config?: TypeInput): RecipeListFunction
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index 98098184f..e070b423b 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1 +1 @@ -recipe/thirdpartyemailpassword | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartyemailpassword

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
    • emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
    • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
    • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    EmailPasswordAPIOptions: APIOptions
    RecipeInterface: { consumePasswordResetToken: any; createNewEmailPasswordRecipeUser: any; createResetPasswordToken: any; emailPasswordSignIn: any; emailPasswordSignUp: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updateEmailOrPassword: any }

    Type declaration

    • consumePasswordResetToken:function
      • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { tenantId: string; token: string; userContext: any }
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • createNewEmailPasswordRecipeUser:function
      • createNewEmailPasswordRecipeUser(input: { email: string; password: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • createResetPasswordToken:function
      • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
      • Parameters

        • input: { email: string; tenantId: string; userContext: any; userId: string }
          • email: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • emailPasswordSignIn:function
      • emailPasswordSignIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>

    • emailPasswordSignUp:function
      • emailPasswordSignUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

    • thirdPartyGetProvider:function
      • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser:function
      • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword:function
      • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
      • Parameters

        • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
          • Optional applyPasswordPolicy?: boolean
          • Optional email?: string
          • Optional password?: string
          • recipeUserId: RecipeUserId
          • tenantIdForPasswordPolicy: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    ThirdPartyAPIOptions: APIOptions

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • init(config?: TypeInput): RecipeListFunction
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/thirdpartyemailpassword | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartyemailpassword

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
    • emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
    • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
    • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    EmailPasswordAPIOptions: APIOptions
    RecipeInterface: { consumePasswordResetToken: any; createNewEmailPasswordRecipeUser: any; createResetPasswordToken: any; emailPasswordSignIn: any; emailPasswordSignUp: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updateEmailOrPassword: any }

    Type declaration

    • consumePasswordResetToken:function
      • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
      • Parameters

        • input: { tenantId: string; token: string; userContext: any }
          • tenantId: string
          • token: string
          • userContext: any

        Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

    • createNewEmailPasswordRecipeUser:function
      • createNewEmailPasswordRecipeUser(input: { email: string; password: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • createResetPasswordToken:function
      • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
      • Parameters

        • input: { email: string; tenantId: string; userContext: any; userId: string }
          • email: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

    • emailPasswordSignIn:function
      • emailPasswordSignIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>

    • emailPasswordSignUp:function
      • emailPasswordSignUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
      • Parameters

        • input: { email: string; password: string; tenantId: string; userContext: any }
          • email: string
          • password: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

    • thirdPartyGetProvider:function
      • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser:function
      • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword:function
      • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
      • Parameters

        • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
          • Optional applyPasswordPolicy?: boolean
          • Optional email?: string
          • Optional password?: string
          • recipeUserId: RecipeUserId
          • tenantIdForPasswordPolicy: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    ThirdPartyAPIOptions: APIOptions

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • init(config?: TypeInput): RecipeListFunction
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index ddd1b9c22..98300d978 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1 +1 @@ -recipe/thirdpartypasswordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartypasswordless

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>); createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>); passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>)
    • createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
    • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    PasswordlessAPIOptions: APIOptions
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updatePasswordlessUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • tenantId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • revokeCode:function
      • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • thirdPartyGetProvider:function
      • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser:function
      • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser:function
      • updatePasswordlessUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    ThirdPartyAPIOptions: APIOptions

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/thirdpartypasswordless | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdpartypasswordless

    Index

    References

    Re-exports TypeProvider

    Type aliases

    APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>); createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>); passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

    Type declaration

    • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
    • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
    • consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>)
    • createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    • passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
    • resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
    • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
    PasswordlessAPIOptions: APIOptions
    RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updatePasswordlessUser: any }

    Type declaration

    • consumeCode:function
      • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
      • Parameters

        • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode:function
      • createCode(input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
      • Parameters

        • input: ({ email: string } & { tenantId: string; userContext: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string })

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createNewCodeForDevice:function
      • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
      • Parameters

        • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
          • deviceId: string
          • tenantId: string
          • userContext: any
          • Optional userInputCode?: string

        Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId:function
      • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
    • listCodesByEmail:function
      • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber:function
      • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId:function
      • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
    • revokeAllCodes:function
      • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • revokeCode:function
      • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
    • thirdPartyGetProvider:function
      • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser:function
      • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • thirdPartySignInUp:function
      • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
          • email: string
          • isVerified: boolean
          • oAuthTokens: {}
            • [key: string]: any
          • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
            • Optional fromIdTokenPayload?: {}
              • [key: string]: any
            • Optional fromUserInfoAPI?: {}
              • [key: string]: any
          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • userContext: any

        Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser:function
      • updatePasswordlessUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
      • Parameters

        • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
          • Optional email?: string | null
          • Optional phoneNumber?: string | null
          • recipeUserId: RecipeUserId
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    ThirdPartyAPIOptions: APIOptions

    Variables

    Error: typeof default = Wrapper.Error

    Functions

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: ({ email: string } & { tenantId: string; userContext?: any; userInputCode?: string }) & ({ phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string })

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • init(config: TypeInput): RecipeListFunction
    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_usermetadata.html b/docs/modules/recipe_usermetadata.html index 804f9b3c5..358923b42 100644 --- a/docs/modules/recipe_usermetadata.html +++ b/docs/modules/recipe_usermetadata.html @@ -1,4 +1,4 @@ -recipe/usermetadata | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/usermetadata

    Index

    Type aliases

    RecipeInterface: { clearUserMetadata: any; getUserMetadata: any; updateUserMetadata: any }

    Type declaration

    • clearUserMetadata:function
      • clearUserMetadata(input: { userContext: any; userId: string }): Promise<{ status: "OK" }>
    • getUserMetadata:function
      • getUserMetadata(input: { userContext: any; userId: string }): Promise<{ metadata: any; status: "OK" }>
    • updateUserMetadata:function
      • updateUserMetadata(input: { metadataUpdate: JSONObject; userContext: any; userId: string }): Promise<{ metadata: JSONObject; status: "OK" }>
      • +recipe/usermetadata | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/usermetadata

        Index

        Type aliases

        RecipeInterface: { clearUserMetadata: any; getUserMetadata: any; updateUserMetadata: any }

        Type declaration

        • clearUserMetadata:function
          • clearUserMetadata(input: { userContext: any; userId: string }): Promise<{ status: "OK" }>
        • getUserMetadata:function
          • getUserMetadata(input: { userContext: any; userId: string }): Promise<{ metadata: any; status: "OK" }>
        • updateUserMetadata:function
          • updateUserMetadata(input: { metadataUpdate: JSONObject; userContext: any; userId: string }): Promise<{ metadata: JSONObject; status: "OK" }>
          • Updates the metadata object of the user by doing a shallow merge of the stored and the update JSONs and removing properties set to null on the root level of the update object. e.g.:

            @@ -7,4 +7,4 @@
          • update: { "notifications": { "sms": true }, "todos": null }
          • result: { "preferences": { "theme":"dark" }, "notifications": { "sms": true } }
          -

        Parameters

        • input: { metadataUpdate: JSONObject; userContext: any; userId: string }
          • metadataUpdate: JSONObject
          • userContext: any
          • userId: string

        Returns Promise<{ metadata: JSONObject; status: "OK" }>

    Functions

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • init(config?: TypeInput): RecipeListFunction
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    • input: { metadataUpdate: JSONObject; userContext: any; userId: string }
      • metadataUpdate: JSONObject
      • userContext: any
      • userId: string

    Returns Promise<{ metadata: JSONObject; status: "OK" }>

    Functions

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • init(config?: TypeInput): RecipeListFunction
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_userroles.html b/docs/modules/recipe_userroles.html index 9fabe0789..946adf8cb 100644 --- a/docs/modules/recipe_userroles.html +++ b/docs/modules/recipe_userroles.html @@ -1 +1 @@ -recipe/userroles | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Index

    Type aliases

    RecipeInterface: { addRoleToUser: any; createNewRoleOrAddPermissions: any; deleteRole: any; getAllRoles: any; getPermissionsForRole: any; getRolesForUser: any; getRolesThatHavePermission: any; getUsersThatHaveRole: any; removePermissionsFromRole: any; removeUserRole: any }

    Type declaration

    • addRoleToUser:function
      • addRoleToUser(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any; userId: string }
          • role: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions:function
      • createNewRoleOrAddPermissions(input: { permissions: string[]; role: string; userContext: any }): Promise<{ createdNewRole: boolean; status: "OK" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ createdNewRole: boolean; status: "OK" }>

    • deleteRole:function
      • deleteRole(input: { role: string; userContext: any }): Promise<{ didRoleExist: boolean; status: "OK" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ didRoleExist: boolean; status: "OK" }>

    • getAllRoles:function
      • getAllRoles(input: { userContext: any }): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole:function
      • getPermissionsForRole(input: { role: string; userContext: any }): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser:function
      • getRolesForUser(input: { tenantId: string; userContext: any; userId: string }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { tenantId: string; userContext: any; userId: string }
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getRolesThatHavePermission:function
      • getRolesThatHavePermission(input: { permission: string; userContext: any }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { permission: string; userContext: any }
          • permission: string
          • userContext: any

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getUsersThatHaveRole:function
      • getUsersThatHaveRole(input: { role: string; tenantId: string; userContext: any }): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any }
          • role: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole:function
      • removePermissionsFromRole(input: { permissions: string[]; role: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

    • removeUserRole:function
      • removeUserRole(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any; userId: string }
          • role: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Variables

    PermissionClaim: PermissionClaimClass = ...
    UserRoleClaim: UserRoleClaimClass = ...

    Functions

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • init(config?: TypeInput): RecipeListFunction
    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/userroles | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Index

    Type aliases

    RecipeInterface: { addRoleToUser: any; createNewRoleOrAddPermissions: any; deleteRole: any; getAllRoles: any; getPermissionsForRole: any; getRolesForUser: any; getRolesThatHavePermission: any; getUsersThatHaveRole: any; removePermissionsFromRole: any; removeUserRole: any }

    Type declaration

    • addRoleToUser:function
      • addRoleToUser(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any; userId: string }
          • role: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions:function
      • createNewRoleOrAddPermissions(input: { permissions: string[]; role: string; userContext: any }): Promise<{ createdNewRole: boolean; status: "OK" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ createdNewRole: boolean; status: "OK" }>

    • deleteRole:function
      • deleteRole(input: { role: string; userContext: any }): Promise<{ didRoleExist: boolean; status: "OK" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ didRoleExist: boolean; status: "OK" }>

    • getAllRoles:function
      • getAllRoles(input: { userContext: any }): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole:function
      • getPermissionsForRole(input: { role: string; userContext: any }): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; userContext: any }
          • role: string
          • userContext: any

        Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser:function
      • getRolesForUser(input: { tenantId: string; userContext: any; userId: string }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { tenantId: string; userContext: any; userId: string }
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getRolesThatHavePermission:function
      • getRolesThatHavePermission(input: { permission: string; userContext: any }): Promise<{ roles: string[]; status: "OK" }>
      • Parameters

        • input: { permission: string; userContext: any }
          • permission: string
          • userContext: any

        Returns Promise<{ roles: string[]; status: "OK" }>

    • getUsersThatHaveRole:function
      • getUsersThatHaveRole(input: { role: string; tenantId: string; userContext: any }): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any }
          • role: string
          • tenantId: string
          • userContext: any

        Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole:function
      • removePermissionsFromRole(input: { permissions: string[]; role: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { permissions: string[]; role: string; userContext: any }
          • permissions: string[]
          • role: string
          • userContext: any

        Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

    • removeUserRole:function
      • removeUserRole(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
      • Parameters

        • input: { role: string; tenantId: string; userContext: any; userId: string }
          • role: string
          • tenantId: string
          • userContext: any
          • userId: string

        Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Variables

    PermissionClaim: PermissionClaimClass = ...
    UserRoleClaim: UserRoleClaimClass = ...

    Functions

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • init(config?: TypeInput): RecipeListFunction
    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter
    • Interface

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file