@@ -249,7 +249,7 @@ export default class Wrapper {
249249 return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . recoverAccount ( input ) ;
250250 }
251251
252- static registerCredential ( input : {
252+ static createCredential ( input : {
253253 registrationOptions : Omit < RegistrationOptions , "fetchResponse" | "status" > ;
254254 userContext : any ;
255255 } ) : Promise <
@@ -269,7 +269,7 @@ export default class Wrapper {
269269 error : any ;
270270 }
271271 > {
272- return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . registerCredential ( input ) ;
272+ return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . createCredential ( input ) ;
273273 }
274274
275275 static authenticateCredential ( input : {
@@ -446,6 +446,69 @@ export default class Wrapper {
446446 return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . registerCredentialWithRecoverAccount ( input ) ;
447447 }
448448
449+ static listCredentials ( input : { options ?: RecipeFunctionOptions ; userContext : any } ) : Promise <
450+ | {
451+ status : "OK" ;
452+ credentials : {
453+ webauthnCredentialId : string ;
454+ relyingPartyId : string ;
455+ recipeUserId : string ;
456+ createdAt : number ;
457+ } [ ] ;
458+ }
459+ | GeneralErrorResponse
460+ > {
461+ return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . listCredentials ( input ) ;
462+ }
463+
464+ static removeCredential ( input : {
465+ webauthnCredentialId : string ;
466+ userContext : any ;
467+ } ) : Promise <
468+ { status : "OK" } | GeneralErrorResponse | { status : "CREDENTIAL_NOT_FOUND_ERROR" ; fetchResponse : Response }
469+ > {
470+ return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . removeCredential ( input ) ;
471+ }
472+
473+ static createAndRegisterCredentialForSessionUser ( input : {
474+ recipeUserId : string ;
475+ email : string ;
476+ options ?: RecipeFunctionOptions ;
477+ userContext : any ;
478+ } ) : Promise <
479+ | { status : "OK" }
480+ | GeneralErrorResponse
481+ | { status : "REGISTER_CREDENTIAL_NOT_ALLOWED" ; reason ?: string }
482+ | { status : "INVALID_EMAIL_ERROR" ; err : string }
483+ | { status : "INVALID_CREDENTIALS_ERROR" }
484+ | { status : "OPTIONS_NOT_FOUND_ERROR" }
485+ | { status : "INVALID_OPTIONS_ERROR" }
486+ | { status : "INVALID_AUTHENTICATOR_ERROR" ; reason ?: string }
487+ | { status : "AUTHENTICATOR_ALREADY_REGISTERED" }
488+ | { status : "FAILED_TO_REGISTER_USER" ; error : any }
489+ | { status : "WEBAUTHN_NOT_SUPPORTED" ; error : any }
490+ > {
491+ return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . createAndRegisterCredentialForSessionUser ( input ) ;
492+ }
493+
494+ static registerCredential ( input : {
495+ recipeUserId : string ;
496+ webauthnGeneratedOptionsId : string ;
497+ credential : RegistrationResponseJSON ;
498+ options ?: RecipeFunctionOptions ;
499+ userContext : any ;
500+ } ) : Promise <
501+ | { status : "OK" }
502+ | GeneralErrorResponse
503+ | { status : "REGISTER_CREDENTIAL_NOT_ALLOWED" ; reason ?: string }
504+ | { status : "INVALID_CREDENTIALS_ERROR" }
505+ | { status : "OPTIONS_NOT_FOUND_ERROR" }
506+ | { status : "INVALID_OPTIONS_ERROR" }
507+ | { status : "INVALID_AUTHENTICATOR_ERROR" ; reason ?: string }
508+ > {
509+ return Webauthn . getInstanceOrThrow ( ) . webJSRecipe . registerCredential ( input ) ;
510+ }
511+
449512 static doesBrowserSupportWebAuthn ( input : { userContext : any } ) : Promise <
450513 | {
451514 status : "OK" ;
@@ -471,11 +534,15 @@ const signIn = Wrapper.signIn;
471534const getEmailExists = Wrapper . getEmailExists ;
472535const generateRecoverAccountToken = Wrapper . generateRecoverAccountToken ;
473536const recoverAccount = Wrapper . recoverAccount ;
474- const registerCredential = Wrapper . registerCredential ;
537+ const createCredential = Wrapper . createCredential ;
475538const authenticateCredential = Wrapper . authenticateCredential ;
476539const registerCredentialWithSignUp = Wrapper . registerCredentialWithSignUp ;
477540const authenticateCredentialWithSignIn = Wrapper . authenticateCredentialWithSignIn ;
478541const registerCredentialWithRecoverAccount = Wrapper . registerCredentialWithRecoverAccount ;
542+ const createAndRegisterCredentialForSessionUser = Wrapper . createAndRegisterCredentialForSessionUser ;
543+ const listCredentials = Wrapper . listCredentials ;
544+ const removeCredential = Wrapper . removeCredential ;
545+ const registerCredential = Wrapper . registerCredential ;
479546const doesBrowserSupportWebAuthn = Wrapper . doesBrowserSupportWebAuthn ;
480547const WebauthnComponentsOverrideProvider = Wrapper . ComponentsOverrideProvider ;
481548
@@ -488,11 +555,15 @@ export {
488555 getEmailExists ,
489556 generateRecoverAccountToken ,
490557 recoverAccount ,
491- registerCredential ,
558+ createCredential ,
492559 authenticateCredential ,
493560 registerCredentialWithSignUp ,
494561 authenticateCredentialWithSignIn ,
495562 registerCredentialWithRecoverAccount ,
563+ createAndRegisterCredentialForSessionUser ,
496564 doesBrowserSupportWebAuthn ,
497565 WebauthnComponentsOverrideProvider ,
566+ listCredentials ,
567+ removeCredential ,
568+ registerCredential ,
498569} ;
0 commit comments