diff --git a/lib/build/recipe/multifactorauth/api/implementation.js b/lib/build/recipe/multifactorauth/api/implementation.js index 954ae11bd..9dea130f2 100644 --- a/lib/build/recipe/multifactorauth/api/implementation.js +++ b/lib/build/recipe/multifactorauth/api/implementation.js @@ -120,6 +120,9 @@ function getAPIInterface() { phoneNumbers: getPhoneNumbersForFactorsResult.factorIdToPhoneNumberMap, }; }, + factorsForUserGET: undefined, + addFactorForUserPOST: undefined, + deleteFactorForUserDELETE: undefined, }; } exports.default = getAPIInterface; diff --git a/lib/build/recipe/multifactorauth/types.d.ts b/lib/build/recipe/multifactorauth/types.d.ts index 25915804b..ca2452da3 100644 --- a/lib/build/recipe/multifactorauth/types.d.ts +++ b/lib/build/recipe/multifactorauth/types.d.ts @@ -106,61 +106,45 @@ export declare type APIInterface = { } | GeneralErrorResponse >); - factorsSetupForUserGET?: (input: { - session: SessionContainerInterface; - options: APIOptions; - userContext: UserContext; - }) => Promise< - | { - status: "OK"; - factors: { - id: string; - details: JSONObject; - }[]; - backupCodes: string[] | undefined; - } - | GeneralErrorResponse - >; - addFactorForUserPOST?: (input: { - factor: { - id: string; - }; - session: SessionContainerInterface; - options: APIOptions; - userContext: UserContext; - }) => Promise< - | { - status: "OK"; - backupCodes: string[]; - } - | GeneralErrorResponse - >; - deleteFactorForUserDELETE?: (input: { - factorId: string; - session: SessionContainerInterface; - options: APIOptions; - userContext: UserContext; - }) => Promise< - | { - status: "OK"; - } - | GeneralErrorResponse - >; - generateBackupCodesPOST?: (input: { - session: SessionContainerInterface; - options: APIOptions; - userContext: UserContext; - }) => Promise< - | { - status: "OK"; - backupCodes: string[]; - } - | { - status: "NO_FACTORS_ARE_SETUP"; - reason: string; - } - | GeneralErrorResponse - >; + factorsForUserGET: + | undefined + | ((input: { + session: SessionContainerInterface; + options: APIOptions; + userContext: UserContext; + }) => Promise< + | { + status: "OK"; + factors: string[]; + } + | GeneralErrorResponse + >); + addFactorForUserPOST: + | undefined + | ((input: { + factorId: string; + session: SessionContainerInterface; + options: APIOptions; + userContext: UserContext; + }) => Promise< + | { + status: "OK"; + } + | GeneralErrorResponse + >); + deleteFactorForUserDELETE: + | undefined + | ((input: { + factorId: string; + session: SessionContainerInterface; + options: APIOptions; + userContext: UserContext; + }) => Promise< + | { + status: "OK"; + } + | GeneralErrorResponse + >); }; export declare type GetFactorsSetupForUserFromOtherRecipesFunc = ( user: User, diff --git a/lib/ts/recipe/multifactorauth/api/implementation.ts b/lib/ts/recipe/multifactorauth/api/implementation.ts index c0c8ced7e..d5f22266e 100644 --- a/lib/ts/recipe/multifactorauth/api/implementation.ts +++ b/lib/ts/recipe/multifactorauth/api/implementation.ts @@ -125,5 +125,8 @@ export default function getAPIInterface(): APIInterface { phoneNumbers: getPhoneNumbersForFactorsResult.factorIdToPhoneNumberMap, }; }, + factorsForUserGET: undefined, + addFactorForUserPOST: undefined, + deleteFactorForUserDELETE: undefined, }; } diff --git a/lib/ts/recipe/multifactorauth/types.ts b/lib/ts/recipe/multifactorauth/types.ts index 1b2312bbc..d47cd7b10 100644 --- a/lib/ts/recipe/multifactorauth/types.ts +++ b/lib/ts/recipe/multifactorauth/types.ts @@ -136,64 +136,47 @@ export type APIInterface = { | GeneralErrorResponse >); - factorsSetupForUserGET?: (input: { - session: SessionContainerInterface; - options: APIOptions; - userContext: UserContext; - }) => Promise< - | { - status: "OK"; - factors: { - id: string; - details: JSONObject; - }[]; - backupCodes: string[] | undefined; - } - | GeneralErrorResponse - >; - - addFactorForUserPOST?: (input: { - factor: { - id: string; - }; - session: SessionContainerInterface; - options: APIOptions; - userContext: UserContext; - }) => Promise< - | { - status: "OK"; - backupCodes: string[]; - } - | GeneralErrorResponse - >; - - deleteFactorForUserDELETE?: (input: { - factorId: string; - session: SessionContainerInterface; - options: APIOptions; - userContext: UserContext; - }) => Promise< - | { - status: "OK"; - } - | GeneralErrorResponse - >; - - generateBackupCodesPOST?: (input: { - session: SessionContainerInterface; - options: APIOptions; - userContext: UserContext; - }) => Promise< - | { - status: "OK"; - backupCodes: string[]; - } - | { - status: "NO_FACTORS_ARE_SETUP"; - reason: string; - } - | GeneralErrorResponse - >; + factorsForUserGET: + | undefined + | ((input: { + session: SessionContainerInterface; + options: APIOptions; + userContext: UserContext; + }) => Promise< + | { + status: "OK"; + factors: string[]; + } + | GeneralErrorResponse + >); + + addFactorForUserPOST: + | undefined + | ((input: { + factorId: string; + session: SessionContainerInterface; + options: APIOptions; + userContext: UserContext; + }) => Promise< + | { + status: "OK"; + } + | GeneralErrorResponse + >); + + deleteFactorForUserDELETE: + | undefined + | ((input: { + factorId: string; + session: SessionContainerInterface; + options: APIOptions; + userContext: UserContext; + }) => Promise< + | { + status: "OK"; + } + | GeneralErrorResponse + >); }; export type GetFactorsSetupForUserFromOtherRecipesFunc = (user: User, userContext: UserContext) => Promise;