@gopherium/react-auth 0.15.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -6
- package/dist/account.d.ts +3 -0
- package/dist/account.js +3 -0
- package/dist/admin/errors.d.ts +62 -0
- package/dist/admin/errors.js +63 -0
- package/dist/admin/fieldError.d.ts +19 -0
- package/dist/admin/fieldError.js +46 -0
- package/dist/admin/index.d.ts +10 -37
- package/dist/admin/index.js +88 -94
- package/dist/languages/es-ES.json +1 -1
- package/dist/languages/fr-FR.json +1 -0
- package/dist/languages/languages/es-ES.json +1 -1
- package/dist/languages/languages/fr-FR.json +1 -0
- package/dist/languages.js +1 -0
- package/dist/testing/index.d.ts +9 -0
- package/dist/testing/index.js +21 -0
- package/dist/testing/setup.js +2 -0
- package/dist/testing/users.d.ts +91 -0
- package/dist/testing/users.js +84 -0
- package/dist/transport.d.ts +1 -0
- package/dist/wpds/PasswordField.d.ts +21 -0
- package/dist/wpds/PasswordField.js +130 -0
- package/dist/wpds/SetupAccountStep.js +17 -177
- package/dist/wpds/index.d.ts +3 -2
- package/dist/wpds/index.js +2 -2
- package/dist/wpds/style.css +11 -22
- package/dist/wpds/usePasswordField.d.ts +37 -0
- package/dist/wpds/usePasswordField.js +86 -0
- package/dist/wpds/users/ChangeRoleDialog.d.ts +35 -0
- package/dist/wpds/users/ChangeRoleDialog.js +90 -0
- package/dist/wpds/users/ResendModal.d.ts +13 -0
- package/dist/wpds/users/ResendModal.js +60 -0
- package/dist/wpds/users/RoleSelect.d.ts +20 -0
- package/dist/wpds/users/RoleSelect.js +18 -0
- package/dist/wpds/users/UsersPage.d.ts +34 -0
- package/dist/wpds/users/UsersPage.js +91 -0
- package/dist/wpds/users/actions.d.ts +31 -0
- package/dist/wpds/users/actions.js +79 -0
- package/dist/wpds/users/defaults.d.ts +14 -0
- package/dist/wpds/users/defaults.js +17 -0
- package/dist/wpds/users/fields.d.ts +40 -0
- package/dist/wpds/users/fields.js +172 -0
- package/dist/wpds/users/index.d.ts +9 -0
- package/dist/wpds/users/index.js +5 -0
- package/dist/wpds/users/words.d.ts +47 -0
- package/dist/wpds/users/words.js +151 -0
- package/package.json +33 -1
- package/dist/wpds/NewUserScreen.d.ts +0 -9
- package/dist/wpds/NewUserScreen.js +0 -70
- package/dist/wpds/UsersScreen.d.ts +0 -11
- package/dist/wpds/UsersScreen.js +0 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "": { "lang": "es-ES", "plural-forms": "nplurals=3; plural=((n == 1) ? 0 : ((n != 0 && n % 1000000 == 0) ? 1 : 2));" }, "
|
|
1
|
+
{ "": { "lang": "es-ES", "plural-forms": "nplurals=3; plural=((n == 1) ? 0 : ((n != 0 && n % 1000000 == 0) ? 1 : 2));" }, "\"%(name)s\" disabled.": ["«%(name)s» se ha desactivado."], "\"%(name)s\" enabled.": ["«%(name)s» se ha activado."], "%s user could not be disabled.": ["No se ha podido desactivar %s usuario.", "No se han podido desactivar %s de usuarios.", "No se han podido desactivar %s usuarios."], "%s user could not be enabled.": ["No se ha podido activar %s usuario.", "No se han podido activar %s de usuarios.", "No se han podido activar %s usuarios."], "%s user disabled.": ["%s usuario desactivado.", "%s de usuarios desactivados.", "%s usuarios desactivados."], "%s user enabled.": ["%s usuario activado.", "%s de usuarios activados.", "%s usuarios activados."], "Activation link": ["Enlace de activación"], "Add User": ["Añadir usuario"], "Add one with %(button)s.": ["Añade uno con %(button)s."], "Avatar": ["Avatar"], "Back to login": ["Volver al inicio de sesión"], "Cancel": ["Cancelar"], "Caps lock is on.": ["El bloqueo de mayúsculas está activado."], "Change role": ["Cambiar el rol"], "Change role to…": ["Cambiar el rol a…"], "Change role…": ["Cambiar el rol…"], "Changed roles.": ["Roles cambiados."], "Choose the role of %(name)s.": ["Elige el rol de %(name)s."], "Choose the role of %s user.": ["Elige el rol de %s usuario.", "Elige el rol de %s de usuarios.", "Elige el rol de %s usuarios."], "Confirm Password": ["Confirma la contraseña"], "Confirm use of weak password": ["Confirma el uso de una contraseña débil."], "Continue": ["Continuar"], "Created": ["Creado"], "Disable": ["Desactivar"], "Done": ["Hecho"], "Double-check your email address before continuing.": ["Comprueba bien tu dirección de correo electrónico antes de continuar."], "Email": ["Correo electrónico"], "Enable": ["Activar"], "Generate password": ["Generar contraseña"], "Go to login": ["Ir al inicio de sesión"], "Hide": ["Ocultar"], "Hide password": ["Ocultar la contraseña"], "Hint: The password should be at least %d character long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! \" ? $ %% ^ & ).": ["Sugerencia: La contraseña debe ser de al menos %d carácter. Para hacerla más fuerte usa mayúsculas y minúsculas, números y símbolos como ! \" ? $ %% ^ y ).", "Sugerencia: La contraseña debe ser de al menos %d de caracteres. Para hacerla más fuerte usa mayúsculas y minúsculas, números y símbolos como ! \" ? $ %% ^ y ).", "Sugerencia: La contraseña debe ser de al menos %d caracteres. Para hacerla más fuerte usa mayúsculas y minúsculas, números y símbolos como ! \" ? $ %% ^ y )."], "If that address has an account, a reset link is on its way.": ["Si esa dirección tiene una cuenta, le llegará un enlace para restablecerla."], "Important:": ["Importante:"], "Invalid email or password.": ["Correo o contraseña no válidos."], "Invalid user ID.": ["ID de usuario no válido."], "Invitation sent to \"%(name)s\".": ["Invitación enviada a «%(name)s»."], "Loading…": ["Cargando…"], "Log in": ["Iniciar sesión"], "Log out": ["Cerrar sesión"], "Login failed, please try again.": ["No se pudo iniciar sesión, inténtalo de nuevo."], "Logout failed, please try again.": ["No se pudo cerrar sesión, inténtalo de nuevo."], "Lost your password?": ["¿Has olvidado tu contraseña?"], "Manage who can sign in and what they can do.": ["Gestiona quién puede entrar y qué puede hacer."], "Name": ["Nombre"], "No mail server is configured. Deliver the activation link by hand.": ["No hay servidor de correo configurado. Entrega el enlace de activación a mano."], "No users found.": ["No se encontraron usuarios."], "No users yet.": ["Todavía no hay usuarios."], "Password": ["Contraseña"], "Please copy the setup code from the file and paste it below.": ["Por favor, copia el código de configuración del archivo y pégalo abajo."], "Please provide a name.": ["Por favor, facilita un nombre."], "Resend invitation": ["Reenviar invitación"], "Resend invitation…": ["Reenviar invitación…"], "Role": ["Rol"], "Role changed for \"%(name)s\".": ["Rol de «%(name)s» cambiado."], "Search users…": ["Buscar usuarios…"], "Send a new invitation to \"%(name)s\" (%(email)s)? The link sent before stops working.": ["¿Enviar una invitación nueva a «%(name)s» (%(email)s)? El enlace anterior dejará de funcionar."], "Send reset link": ["Enviar enlace de restablecimiento"], "Set password": ["Guardar contraseña"], "Setup code": ["Código de configuración"], "Show": ["Mostrar"], "Show password": ["Mostrar la contraseña"], "Somebody must be able to manage users.": ["Alguien tiene que poder gestionar los usuarios."], "Something went wrong.": ["Algo ha ido mal."], "Sorry, that is not a valid email address. Email addresses look like <code>username@example.com</code>.": ["Lo siento, esa no es una dirección de correo electrónico válida. Las direcciones de correo electrónico deben parecerse a <code>usuario@example.com</code>."], "Sorry, you are not allowed to edit this user.": ["Lo siento, no tienes permisos para modificar este usuario."], "Sorry, you are not allowed to edit users.": ["Lo siento, no tienes permisos para editar usuarios."], "Sorry, you are not allowed to give users that role.": ["Lo siento, no tienes permisos para dar ese rol a los usuarios."], "Status": ["Estado"], "The account could not be created, please try again.": ["No se pudo crear la cuenta, inténtalo de nuevo."], "The email address is not correct.": ["La dirección de correo electrónico no es correcta."], "The invitation could not be sent.": ["No se pudo enviar la invitación."], "The password could not be set, please try again.": ["No se pudo guardar la contraseña, inténtalo de nuevo."], "The request failed, please try again.": ["No se pudo completar la petición, inténtalo de nuevo."], "The role could not be changed.": ["No se ha podido cambiar el rol."], "The role of %s user could not be changed.": ["No se ha podido cambiar el rol de %s usuario.", "No se han podido cambiar los roles de %s de usuarios.", "No se han podido cambiar los roles de %s usuarios."], "The role of that account just changed. Reload the page and try again.": ["El rol de esa cuenta acaba de cambiar. Recarga la página e inténtalo de nuevo."], "The setup code file cannot be used. Please check it and try again.": ["No se puede usar el archivo del código de configuración. Por favor, revísalo e inténtalo de nuevo."], "The site is starting. Please wait a moment and try again.": ["El sitio se está iniciando. Por favor, espera un momento e inténtalo de nuevo."], "The user could not be disabled.": ["No se ha podido desactivar el usuario."], "The user could not be enabled.": ["No se ha podido activar el usuario."], "This email is already registered. Please choose another one.": ["Este correo electrónico ya está registrado. Por favor, elige otro."], "This link is no longer valid. Ask for a new one.": ["Este enlace ya no es válido. Pide uno nuevo."], "This link is no longer valid. Ask the person who invited you for a new one.": ["Este enlace ya no es válido. Pide uno nuevo a quien te invitó."], "This name is too long.": ["Este nombre es demasiado largo."], "This password is too long.": ["Esta contraseña es demasiado larga."], "To ensure this site is securely set up by its owner, a setup code has been written to a file on the server.": ["Para garantizar que la persona propietaria configure este sitio de forma segura, se ha escrito un código de configuración en un archivo del servidor."], "Too many attempts. Please try again later.": ["Demasiados intentos. Por favor, inténtalo de nuevo más tarde."], "Too many attempts. Please wait a minute and try again.": ["Demasiados intentos. Espera un minuto e inténtalo de nuevo."], "Try again": ["Inténtalo de nuevo"], "Unlock %s": ["Desbloquear %s"], "Users could not be loaded.": ["No se han podido cargar los usuarios."], "You appear to have already set up this site.": ["Parece que ya has configurado este sitio."], "You cannot change your own role.": ["No puedes cambiar tu propio rol."], "You cannot disable your own account.": ["No puedes desactivar tu propia cuenta."], "You will need this password to log in. Please store it in a secure location.": ["Necesitas esta contraseña para acceder. Por favor, guárdala en un lugar seguro."], "Your Email": ["Tu correo electrónico"], "Your password is set. Sign in with it.": ["Tu contraseña está guardada. Inicia sesión con ella."], "Your setup code appears to be invalid. Please copy it again from the setup code file.": ["Tu código de configuración parece que no es válido. Por favor, cópialo de nuevo del archivo del código de configuración."], "Your setup code has expired. A new one is waiting in the setup code file.": ["Tu código de configuración ha caducado. Hay uno nuevo esperando en el archivo del código de configuración."], "admin section\u0004Users": ["Usuarios"], "field label\u0004Email": ["Correo"], "field label\u0004Name": ["Nombre"], "invalid invitation details": ["datos de invitación no válidos"], "invalid password details": ["datos de contraseña no válidos"], "invalid user details": ["datos de usuario no válidos"], "no user roles\u0004None": ["Ninguno"], "password strength\u0004Medium": ["Medio"], "password strength\u0004Password strength unknown": ["Fortaleza de la contraseña desconocida"], "password strength\u0004Strong": ["Fuerte"], "password strength\u0004Very weak": ["Muy débil"], "password strength\u0004Weak": ["Débil"], "role\u0004No role": ["Sin rol"], "the account could not be updated": ["no se ha podido actualizar la cuenta"], "user status\u0004Active": ["Activo"], "user status\u0004Disabled": ["Desactivado"], "user status\u0004Invited": ["Invitado"] }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "": { "lang": "fr-FR", "plural-forms": "nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;" }, "\"%(name)s\" disabled.": ["Compte « %(name)s » désactivé."], "\"%(name)s\" enabled.": ["Compte « %(name)s » activé."], "%s user could not be disabled.": ["%s compte n’a pas pu être désactivé.", "%s de comptes n’ont pas pu être désactivés.", "%s comptes n’ont pas pu être désactivés."], "%s user could not be enabled.": ["%s compte n’a pas pu être activé.", "%s de comptes n’ont pas pu être activés.", "%s comptes n’ont pas pu être activés."], "%s user disabled.": ["%s compte désactivé.", "%s de comptes désactivés.", "%s comptes désactivés."], "%s user enabled.": ["%s compte activé.", "%s de comptes activés.", "%s comptes activés."], "Activation link": ["Lien d’activation"], "Add User": ["Ajouter un compte"], "Add one with %(button)s.": ["Ajoutez-en un avec %(button)s."], "Avatar": ["Avatar"], "Back to login": ["Retour à la connexion"], "Cancel": ["Annuler"], "Caps lock is on.": ["Le verrouillage majuscule est activé."], "Change role": ["Changer le rôle"], "Change role to…": ["Changer de rôle pour…"], "Change role…": ["Changer le rôle…"], "Changed roles.": ["Rôles modifiés."], "Choose the role of %(name)s.": ["Choisissez le rôle de %(name)s."], "Choose the role of %s user.": ["Choisissez le rôle de %s compte.", "Choisissez le rôle de %s de comptes.", "Choisissez le rôle de %s comptes."], "Confirm Password": ["Confirmer le mot de passe"], "Confirm use of weak password": ["Confirmer l’utilisation du mot de passe faible"], "Continue": ["Continuer"], "Created": ["Créé"], "Disable": ["Désactiver"], "Done": ["Terminé"], "Double-check your email address before continuing.": ["Vérifiez bien cette adresse e-mail avant de continuer."], "Email": ["E-mail"], "Enable": ["Activer"], "Generate password": ["Générer un mot de passe"], "Go to login": ["Aller à la connexion"], "Hide": ["Masquer"], "Hide password": ["Masquer le mot de passe"], "Hint: The password should be at least %d character long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! \" ? $ %% ^ & ).": ["Conseil : Le mot de passe devrait contenir au moins %d caractère. Pour le rendre plus sûr, utilisez des lettres en majuscules et minuscules, des nombres, et des symboles tels que ! \" ? $ %% ^ & ).", "Conseil : Le mot de passe devrait contenir au moins %d de caractères. Pour le rendre plus sûr, utilisez des lettres en majuscules et minuscules, des nombres, et des symboles tels que ! \" ? $ %% ^ & ).", "Conseil : Le mot de passe devrait contenir au moins %d caractères. Pour le rendre plus sûr, utilisez des lettres en majuscules et minuscules, des nombres, et des symboles tels que ! \" ? $ %% ^ & )."], "If that address has an account, a reset link is on its way.": ["Si cette adresse correspond à un compte, un lien de réinitialisation est en route."], "Important:": ["Important :"], "Invalid email or password.": ["E-mail ou mot de passe incorrect."], "Invalid user ID.": ["ID du compte non valide."], "Invitation sent to \"%(name)s\".": ["Invitation envoyée à « %(name)s »."], "Loading…": ["Chargement…"], "Log in": ["Se connecter"], "Log out": ["Se déconnecter"], "Login failed, please try again.": ["La connexion a échoué, veuillez réessayer."], "Logout failed, please try again.": ["La déconnexion a échoué, veuillez réessayer."], "Lost your password?": ["Mot de passe oublié ?"], "Manage who can sign in and what they can do.": ["Gérez qui peut se connecter et ce que chaque compte peut faire."], "Name": ["Nom"], "No mail server is configured. Deliver the activation link by hand.": ["Aucun serveur de messagerie n’est configuré. Transmettez le lien d’activation vous-même."], "No users found.": ["Aucun compte trouvé."], "No users yet.": ["Aucun compte pour l’instant."], "Password": ["Mot de passe"], "Please copy the setup code from the file and paste it below.": ["Veuillez copier le code de configuration depuis le fichier et le coller ci-dessous."], "Please provide a name.": ["Veuillez indiquer un nom."], "Resend invitation": ["Renvoyer l’invitation"], "Resend invitation…": ["Renvoyer l’invitation…"], "Role": ["Rôle"], "Role changed for \"%(name)s\".": ["Rôle modifié pour « %(name)s »."], "Search users…": ["Rechercher des comptes…"], "Send a new invitation to \"%(name)s\" (%(email)s)? The link sent before stops working.": ["Envoyer une nouvelle invitation à « %(name)s » (%(email)s) ? Le lien envoyé auparavant ne fonctionnera plus."], "Send reset link": ["Envoyer le lien de réinitialisation"], "Set password": ["Enregistrer le mot de passe"], "Setup code": ["Code de configuration"], "Show": ["Afficher"], "Show password": ["Afficher le mot de passe"], "Somebody must be able to manage users.": ["Quelqu’un doit pouvoir gérer les comptes."], "Something went wrong.": ["Un problème est survenu."], "Sorry, that is not a valid email address. Email addresses look like <code>username@example.com</code>.": ["Désolé, ce n’est pas une adresse e-mail valide. Les adresses de messagerie ressemblent à cela : <code>identifiant@example.com</code>."], "Sorry, you are not allowed to edit this user.": ["Désolé, vous n’avez pas l’autorisation de modifier ce compte."], "Sorry, you are not allowed to edit users.": ["Désolé, vous n’avez pas l’autorisation de modifier des comptes."], "Sorry, you are not allowed to give users that role.": ["Désolé, vous n’avez pas l’autorisation de donner ce rôle aux comptes."], "Status": ["État"], "The account could not be created, please try again.": ["Le compte n’a pas pu être créé, veuillez réessayer."], "The email address is not correct.": ["L’adresse e-mail est incorrecte."], "The invitation could not be sent.": ["L’invitation n’a pas pu être envoyée."], "The password could not be set, please try again.": ["Le mot de passe n’a pas pu être enregistré, veuillez réessayer."], "The request failed, please try again.": ["La requête a échoué, veuillez réessayer."], "The role could not be changed.": ["Le rôle n’a pas pu être modifié."], "The role of %s user could not be changed.": ["Le rôle de %s compte n’a pas pu être modifié.", "Les rôles de %s de comptes n’ont pas pu être modifiés.", "Les rôles de %s comptes n’ont pas pu être modifiés."], "The role of that account just changed. Reload the page and try again.": ["Le rôle de ce compte vient de changer. Rechargez la page et réessayez."], "The setup code file cannot be used. Please check it and try again.": ["Le fichier du code de configuration ne peut pas être utilisé. Veuillez le vérifier et réessayer."], "The site is starting. Please wait a moment and try again.": ["Le site est en cours de démarrage. Veuillez patienter un instant et réessayer."], "The user could not be disabled.": ["Le compte n’a pas pu être désactivé."], "The user could not be enabled.": ["Le compte n’a pas pu être activé."], "This email is already registered. Please choose another one.": ["Cet e-mail est déjà inscrit. Veuillez en choisir un autre."], "This link is no longer valid. Ask for a new one.": ["Ce lien n’est plus valide. Demandez-en un nouveau."], "This link is no longer valid. Ask the person who invited you for a new one.": ["Ce lien n’est plus valide. Demandez-en un nouveau à la personne qui vous a envoyé l’invitation."], "This name is too long.": ["Ce nom est trop long."], "This password is too long.": ["Ce mot de passe est trop long."], "To ensure this site is securely set up by its owner, a setup code has been written to a file on the server.": ["Pour garantir que ce site est configuré en toute sécurité par la personne qui en est propriétaire, un code de configuration a été écrit dans un fichier sur le serveur."], "Too many attempts. Please try again later.": ["Trop de tentatives. Veuillez réessayer plus tard."], "Too many attempts. Please wait a minute and try again.": ["Trop de tentatives. Veuillez patienter une minute et réessayer."], "Try again": ["Réessayer"], "Unlock %s": ["Déverrouiller %s"], "Users could not be loaded.": ["Les comptes n’ont pas pu être chargés."], "You appear to have already set up this site.": ["Vous semblez avoir déjà configuré ce site."], "You cannot change your own role.": ["Vous ne pouvez pas modifier votre propre rôle."], "You cannot disable your own account.": ["Vous ne pouvez pas désactiver votre propre compte."], "You will need this password to log in. Please store it in a secure location.": ["Vous aurez besoin de ce mot de passe pour vous connecter. Pensez à le stocker dans un lieu sûr."], "Your Email": ["Votre e-mail"], "Your password is set. Sign in with it.": ["Votre mot de passe est enregistré. Utilisez-le pour vous connecter."], "Your setup code appears to be invalid. Please copy it again from the setup code file.": ["Votre code de configuration semble non valide. Veuillez le copier à nouveau depuis le fichier du code de configuration."], "Your setup code has expired. A new one is waiting in the setup code file.": ["Votre code de configuration a expiré. Un nouveau code vous attend dans le fichier du code de configuration."], "admin section\u0004Users": ["Comptes"], "field label\u0004Email": ["E-mail"], "field label\u0004Name": ["Nom"], "invalid invitation details": ["données d’invitation non valides"], "invalid password details": ["données de mot de passe non valides"], "invalid user details": ["données de compte non valides"], "no user roles\u0004None": ["Aucun"], "password strength\u0004Medium": ["Moyenne"], "password strength\u0004Password strength unknown": ["Force du mot de passe inconnue."], "password strength\u0004Strong": ["Forte"], "password strength\u0004Very weak": ["Très faible"], "password strength\u0004Weak": ["Faible"], "role\u0004No role": ["Aucun rôle"], "the account could not be updated": ["le compte n’a pas pu être mis à jour"], "user status\u0004Active": ["Actif"], "user status\u0004Disabled": ["Désactivé"], "user status\u0004Invited": ["Invité"] }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"":{"lang":"es-ES","plural-forms":"nplurals=3; plural=((n == 1) ? 0 : ((n != 0 && n % 1000000 == 0) ? 1 : 2));"},"
|
|
1
|
+
{"":{"lang":"es-ES","plural-forms":"nplurals=3; plural=((n == 1) ? 0 : ((n != 0 && n % 1000000 == 0) ? 1 : 2));"},"\"%(name)s\" disabled.":["«%(name)s» se ha desactivado."],"\"%(name)s\" enabled.":["«%(name)s» se ha activado."],"%s user could not be disabled.":["No se ha podido desactivar %s usuario.","No se han podido desactivar %s de usuarios.","No se han podido desactivar %s usuarios."],"%s user could not be enabled.":["No se ha podido activar %s usuario.","No se han podido activar %s de usuarios.","No se han podido activar %s usuarios."],"%s user disabled.":["%s usuario desactivado.","%s de usuarios desactivados.","%s usuarios desactivados."],"%s user enabled.":["%s usuario activado.","%s de usuarios activados.","%s usuarios activados."],"Activation link":["Enlace de activación"],"Add User":["Añadir usuario"],"Add one with %(button)s.":["Añade uno con %(button)s."],"Avatar":["Avatar"],"Back to login":["Volver al inicio de sesión"],"Cancel":["Cancelar"],"Caps lock is on.":["El bloqueo de mayúsculas está activado."],"Change role":["Cambiar el rol"],"Change role to…":["Cambiar el rol a…"],"Change role…":["Cambiar el rol…"],"Changed roles.":["Roles cambiados."],"Choose the role of %(name)s.":["Elige el rol de %(name)s."],"Choose the role of %s user.":["Elige el rol de %s usuario.","Elige el rol de %s de usuarios.","Elige el rol de %s usuarios."],"Confirm Password":["Confirma la contraseña"],"Confirm use of weak password":["Confirma el uso de una contraseña débil."],"Continue":["Continuar"],"Created":["Creado"],"Disable":["Desactivar"],"Done":["Hecho"],"Double-check your email address before continuing.":["Comprueba bien tu dirección de correo electrónico antes de continuar."],"Email":["Correo electrónico"],"Enable":["Activar"],"Generate password":["Generar contraseña"],"Go to login":["Ir al inicio de sesión"],"Hide":["Ocultar"],"Hide password":["Ocultar la contraseña"],"Hint: The password should be at least %d character long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! \" ? $ %% ^ & ).":["Sugerencia: La contraseña debe ser de al menos %d carácter. Para hacerla más fuerte usa mayúsculas y minúsculas, números y símbolos como ! \" ? $ %% ^ y ).","Sugerencia: La contraseña debe ser de al menos %d de caracteres. Para hacerla más fuerte usa mayúsculas y minúsculas, números y símbolos como ! \" ? $ %% ^ y ).","Sugerencia: La contraseña debe ser de al menos %d caracteres. Para hacerla más fuerte usa mayúsculas y minúsculas, números y símbolos como ! \" ? $ %% ^ y )."],"If that address has an account, a reset link is on its way.":["Si esa dirección tiene una cuenta, le llegará un enlace para restablecerla."],"Important:":["Importante:"],"Invalid email or password.":["Correo o contraseña no válidos."],"Invalid user ID.":["ID de usuario no válido."],"Invitation sent to \"%(name)s\".":["Invitación enviada a «%(name)s»."],"Loading…":["Cargando…"],"Log in":["Iniciar sesión"],"Log out":["Cerrar sesión"],"Login failed, please try again.":["No se pudo iniciar sesión, inténtalo de nuevo."],"Logout failed, please try again.":["No se pudo cerrar sesión, inténtalo de nuevo."],"Lost your password?":["¿Has olvidado tu contraseña?"],"Manage who can sign in and what they can do.":["Gestiona quién puede entrar y qué puede hacer."],"Name":["Nombre"],"No mail server is configured. Deliver the activation link by hand.":["No hay servidor de correo configurado. Entrega el enlace de activación a mano."],"No users found.":["No se encontraron usuarios."],"No users yet.":["Todavía no hay usuarios."],"Password":["Contraseña"],"Please copy the setup code from the file and paste it below.":["Por favor, copia el código de configuración del archivo y pégalo abajo."],"Please provide a name.":["Por favor, facilita un nombre."],"Resend invitation":["Reenviar invitación"],"Resend invitation…":["Reenviar invitación…"],"Role":["Rol"],"Role changed for \"%(name)s\".":["Rol de «%(name)s» cambiado."],"Search users…":["Buscar usuarios…"],"Send a new invitation to \"%(name)s\" (%(email)s)? The link sent before stops working.":["¿Enviar una invitación nueva a «%(name)s» (%(email)s)? El enlace anterior dejará de funcionar."],"Send reset link":["Enviar enlace de restablecimiento"],"Set password":["Guardar contraseña"],"Setup code":["Código de configuración"],"Show":["Mostrar"],"Show password":["Mostrar la contraseña"],"Somebody must be able to manage users.":["Alguien tiene que poder gestionar los usuarios."],"Something went wrong.":["Algo ha ido mal."],"Sorry, that is not a valid email address. Email addresses look like <code>username@example.com</code>.":["Lo siento, esa no es una dirección de correo electrónico válida. Las direcciones de correo electrónico deben parecerse a <code>usuario@example.com</code>."],"Sorry, you are not allowed to edit this user.":["Lo siento, no tienes permisos para modificar este usuario."],"Sorry, you are not allowed to edit users.":["Lo siento, no tienes permisos para editar usuarios."],"Sorry, you are not allowed to give users that role.":["Lo siento, no tienes permisos para dar ese rol a los usuarios."],"Status":["Estado"],"The account could not be created, please try again.":["No se pudo crear la cuenta, inténtalo de nuevo."],"The email address is not correct.":["La dirección de correo electrónico no es correcta."],"The invitation could not be sent.":["No se pudo enviar la invitación."],"The password could not be set, please try again.":["No se pudo guardar la contraseña, inténtalo de nuevo."],"The request failed, please try again.":["No se pudo completar la petición, inténtalo de nuevo."],"The role could not be changed.":["No se ha podido cambiar el rol."],"The role of %s user could not be changed.":["No se ha podido cambiar el rol de %s usuario.","No se han podido cambiar los roles de %s de usuarios.","No se han podido cambiar los roles de %s usuarios."],"The role of that account just changed. Reload the page and try again.":["El rol de esa cuenta acaba de cambiar. Recarga la página e inténtalo de nuevo."],"The setup code file cannot be used. Please check it and try again.":["No se puede usar el archivo del código de configuración. Por favor, revísalo e inténtalo de nuevo."],"The site is starting. Please wait a moment and try again.":["El sitio se está iniciando. Por favor, espera un momento e inténtalo de nuevo."],"The user could not be disabled.":["No se ha podido desactivar el usuario."],"The user could not be enabled.":["No se ha podido activar el usuario."],"This email is already registered. Please choose another one.":["Este correo electrónico ya está registrado. Por favor, elige otro."],"This link is no longer valid. Ask for a new one.":["Este enlace ya no es válido. Pide uno nuevo."],"This link is no longer valid. Ask the person who invited you for a new one.":["Este enlace ya no es válido. Pide uno nuevo a quien te invitó."],"This name is too long.":["Este nombre es demasiado largo."],"This password is too long.":["Esta contraseña es demasiado larga."],"To ensure this site is securely set up by its owner, a setup code has been written to a file on the server.":["Para garantizar que la persona propietaria configure este sitio de forma segura, se ha escrito un código de configuración en un archivo del servidor."],"Too many attempts. Please try again later.":["Demasiados intentos. Por favor, inténtalo de nuevo más tarde."],"Too many attempts. Please wait a minute and try again.":["Demasiados intentos. Espera un minuto e inténtalo de nuevo."],"Try again":["Inténtalo de nuevo"],"Unlock %s":["Desbloquear %s"],"Users could not be loaded.":["No se han podido cargar los usuarios."],"You appear to have already set up this site.":["Parece que ya has configurado este sitio."],"You cannot change your own role.":["No puedes cambiar tu propio rol."],"You cannot disable your own account.":["No puedes desactivar tu propia cuenta."],"You will need this password to log in. Please store it in a secure location.":["Necesitas esta contraseña para acceder. Por favor, guárdala en un lugar seguro."],"Your Email":["Tu correo electrónico"],"Your password is set. Sign in with it.":["Tu contraseña está guardada. Inicia sesión con ella."],"Your setup code appears to be invalid. Please copy it again from the setup code file.":["Tu código de configuración parece que no es válido. Por favor, cópialo de nuevo del archivo del código de configuración."],"Your setup code has expired. A new one is waiting in the setup code file.":["Tu código de configuración ha caducado. Hay uno nuevo esperando en el archivo del código de configuración."],"admin section\u0004Users":["Usuarios"],"field label\u0004Email":["Correo"],"field label\u0004Name":["Nombre"],"invalid invitation details":["datos de invitación no válidos"],"invalid password details":["datos de contraseña no válidos"],"invalid user details":["datos de usuario no válidos"],"no user roles\u0004None":["Ninguno"],"password strength\u0004Medium":["Medio"],"password strength\u0004Password strength unknown":["Fortaleza de la contraseña desconocida"],"password strength\u0004Strong":["Fuerte"],"password strength\u0004Very weak":["Muy débil"],"password strength\u0004Weak":["Débil"],"role\u0004No role":["Sin rol"],"the account could not be updated":["no se ha podido actualizar la cuenta"],"user status\u0004Active":["Activo"],"user status\u0004Disabled":["Desactivado"],"user status\u0004Invited":["Invitado"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"":{"lang":"fr-FR","plural-forms":"nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;"},"\"%(name)s\" disabled.":["Compte « %(name)s » désactivé."],"\"%(name)s\" enabled.":["Compte « %(name)s » activé."],"%s user could not be disabled.":["%s compte n’a pas pu être désactivé.","%s de comptes n’ont pas pu être désactivés.","%s comptes n’ont pas pu être désactivés."],"%s user could not be enabled.":["%s compte n’a pas pu être activé.","%s de comptes n’ont pas pu être activés.","%s comptes n’ont pas pu être activés."],"%s user disabled.":["%s compte désactivé.","%s de comptes désactivés.","%s comptes désactivés."],"%s user enabled.":["%s compte activé.","%s de comptes activés.","%s comptes activés."],"Activation link":["Lien d’activation"],"Add User":["Ajouter un compte"],"Add one with %(button)s.":["Ajoutez-en un avec %(button)s."],"Avatar":["Avatar"],"Back to login":["Retour à la connexion"],"Cancel":["Annuler"],"Caps lock is on.":["Le verrouillage majuscule est activé."],"Change role":["Changer le rôle"],"Change role to…":["Changer de rôle pour…"],"Change role…":["Changer le rôle…"],"Changed roles.":["Rôles modifiés."],"Choose the role of %(name)s.":["Choisissez le rôle de %(name)s."],"Choose the role of %s user.":["Choisissez le rôle de %s compte.","Choisissez le rôle de %s de comptes.","Choisissez le rôle de %s comptes."],"Confirm Password":["Confirmer le mot de passe"],"Confirm use of weak password":["Confirmer l’utilisation du mot de passe faible"],"Continue":["Continuer"],"Created":["Créé"],"Disable":["Désactiver"],"Done":["Terminé"],"Double-check your email address before continuing.":["Vérifiez bien cette adresse e-mail avant de continuer."],"Email":["E-mail"],"Enable":["Activer"],"Generate password":["Générer un mot de passe"],"Go to login":["Aller à la connexion"],"Hide":["Masquer"],"Hide password":["Masquer le mot de passe"],"Hint: The password should be at least %d character long. To make it stronger, use upper and lower case letters, numbers, and symbols like ! \" ? $ %% ^ & ).":["Conseil : Le mot de passe devrait contenir au moins %d caractère. Pour le rendre plus sûr, utilisez des lettres en majuscules et minuscules, des nombres, et des symboles tels que ! \" ? $ %% ^ & ).","Conseil : Le mot de passe devrait contenir au moins %d de caractères. Pour le rendre plus sûr, utilisez des lettres en majuscules et minuscules, des nombres, et des symboles tels que ! \" ? $ %% ^ & ).","Conseil : Le mot de passe devrait contenir au moins %d caractères. Pour le rendre plus sûr, utilisez des lettres en majuscules et minuscules, des nombres, et des symboles tels que ! \" ? $ %% ^ & )."],"If that address has an account, a reset link is on its way.":["Si cette adresse correspond à un compte, un lien de réinitialisation est en route."],"Important:":["Important :"],"Invalid email or password.":["E-mail ou mot de passe incorrect."],"Invalid user ID.":["ID du compte non valide."],"Invitation sent to \"%(name)s\".":["Invitation envoyée à « %(name)s »."],"Loading…":["Chargement…"],"Log in":["Se connecter"],"Log out":["Se déconnecter"],"Login failed, please try again.":["La connexion a échoué, veuillez réessayer."],"Logout failed, please try again.":["La déconnexion a échoué, veuillez réessayer."],"Lost your password?":["Mot de passe oublié ?"],"Manage who can sign in and what they can do.":["Gérez qui peut se connecter et ce que chaque compte peut faire."],"Name":["Nom"],"No mail server is configured. Deliver the activation link by hand.":["Aucun serveur de messagerie n’est configuré. Transmettez le lien d’activation vous-même."],"No users found.":["Aucun compte trouvé."],"No users yet.":["Aucun compte pour l’instant."],"Password":["Mot de passe"],"Please copy the setup code from the file and paste it below.":["Veuillez copier le code de configuration depuis le fichier et le coller ci-dessous."],"Please provide a name.":["Veuillez indiquer un nom."],"Resend invitation":["Renvoyer l’invitation"],"Resend invitation…":["Renvoyer l’invitation…"],"Role":["Rôle"],"Role changed for \"%(name)s\".":["Rôle modifié pour « %(name)s »."],"Search users…":["Rechercher des comptes…"],"Send a new invitation to \"%(name)s\" (%(email)s)? The link sent before stops working.":["Envoyer une nouvelle invitation à « %(name)s » (%(email)s) ? Le lien envoyé auparavant ne fonctionnera plus."],"Send reset link":["Envoyer le lien de réinitialisation"],"Set password":["Enregistrer le mot de passe"],"Setup code":["Code de configuration"],"Show":["Afficher"],"Show password":["Afficher le mot de passe"],"Somebody must be able to manage users.":["Quelqu’un doit pouvoir gérer les comptes."],"Something went wrong.":["Un problème est survenu."],"Sorry, that is not a valid email address. Email addresses look like <code>username@example.com</code>.":["Désolé, ce n’est pas une adresse e-mail valide. Les adresses de messagerie ressemblent à cela : <code>identifiant@example.com</code>."],"Sorry, you are not allowed to edit this user.":["Désolé, vous n’avez pas l’autorisation de modifier ce compte."],"Sorry, you are not allowed to edit users.":["Désolé, vous n’avez pas l’autorisation de modifier des comptes."],"Sorry, you are not allowed to give users that role.":["Désolé, vous n’avez pas l’autorisation de donner ce rôle aux comptes."],"Status":["État"],"The account could not be created, please try again.":["Le compte n’a pas pu être créé, veuillez réessayer."],"The email address is not correct.":["L’adresse e-mail est incorrecte."],"The invitation could not be sent.":["L’invitation n’a pas pu être envoyée."],"The password could not be set, please try again.":["Le mot de passe n’a pas pu être enregistré, veuillez réessayer."],"The request failed, please try again.":["La requête a échoué, veuillez réessayer."],"The role could not be changed.":["Le rôle n’a pas pu être modifié."],"The role of %s user could not be changed.":["Le rôle de %s compte n’a pas pu être modifié.","Les rôles de %s de comptes n’ont pas pu être modifiés.","Les rôles de %s comptes n’ont pas pu être modifiés."],"The role of that account just changed. Reload the page and try again.":["Le rôle de ce compte vient de changer. Rechargez la page et réessayez."],"The setup code file cannot be used. Please check it and try again.":["Le fichier du code de configuration ne peut pas être utilisé. Veuillez le vérifier et réessayer."],"The site is starting. Please wait a moment and try again.":["Le site est en cours de démarrage. Veuillez patienter un instant et réessayer."],"The user could not be disabled.":["Le compte n’a pas pu être désactivé."],"The user could not be enabled.":["Le compte n’a pas pu être activé."],"This email is already registered. Please choose another one.":["Cet e-mail est déjà inscrit. Veuillez en choisir un autre."],"This link is no longer valid. Ask for a new one.":["Ce lien n’est plus valide. Demandez-en un nouveau."],"This link is no longer valid. Ask the person who invited you for a new one.":["Ce lien n’est plus valide. Demandez-en un nouveau à la personne qui vous a envoyé l’invitation."],"This name is too long.":["Ce nom est trop long."],"This password is too long.":["Ce mot de passe est trop long."],"To ensure this site is securely set up by its owner, a setup code has been written to a file on the server.":["Pour garantir que ce site est configuré en toute sécurité par la personne qui en est propriétaire, un code de configuration a été écrit dans un fichier sur le serveur."],"Too many attempts. Please try again later.":["Trop de tentatives. Veuillez réessayer plus tard."],"Too many attempts. Please wait a minute and try again.":["Trop de tentatives. Veuillez patienter une minute et réessayer."],"Try again":["Réessayer"],"Unlock %s":["Déverrouiller %s"],"Users could not be loaded.":["Les comptes n’ont pas pu être chargés."],"You appear to have already set up this site.":["Vous semblez avoir déjà configuré ce site."],"You cannot change your own role.":["Vous ne pouvez pas modifier votre propre rôle."],"You cannot disable your own account.":["Vous ne pouvez pas désactiver votre propre compte."],"You will need this password to log in. Please store it in a secure location.":["Vous aurez besoin de ce mot de passe pour vous connecter. Pensez à le stocker dans un lieu sûr."],"Your Email":["Votre e-mail"],"Your password is set. Sign in with it.":["Votre mot de passe est enregistré. Utilisez-le pour vous connecter."],"Your setup code appears to be invalid. Please copy it again from the setup code file.":["Votre code de configuration semble non valide. Veuillez le copier à nouveau depuis le fichier du code de configuration."],"Your setup code has expired. A new one is waiting in the setup code file.":["Votre code de configuration a expiré. Un nouveau code vous attend dans le fichier du code de configuration."],"admin section\u0004Users":["Comptes"],"field label\u0004Email":["E-mail"],"field label\u0004Name":["Nom"],"invalid invitation details":["données d’invitation non valides"],"invalid password details":["données de mot de passe non valides"],"invalid user details":["données de compte non valides"],"no user roles\u0004None":["Aucun"],"password strength\u0004Medium":["Moyenne"],"password strength\u0004Password strength unknown":["Force du mot de passe inconnue."],"password strength\u0004Strong":["Forte"],"password strength\u0004Very weak":["Très faible"],"password strength\u0004Weak":["Faible"],"role\u0004No role":["Aucun rôle"],"the account could not be updated":["le compte n’a pas pu être mis à jour"],"user status\u0004Active":["Actif"],"user status\u0004Disabled":["Désactivé"],"user status\u0004Invited":["Invité"]}
|
package/dist/languages.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** The catalogue this package ships for each language it has one for. */
|
|
3
3
|
const SHIPPED = {
|
|
4
4
|
'es-ES': () => import('./languages/es-ES.json', { with: { type: 'json' } }),
|
|
5
|
+
'fr-FR': () => import('./languages/fr-FR.json', { with: { type: 'json' } }),
|
|
5
6
|
};
|
|
6
7
|
/**
|
|
7
8
|
* Returns the catalogue this package ships for a language.
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import '@testing-library/jest-dom/vitest';
|
|
2
2
|
import type { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
import type { Account } from '../account.js';
|
|
3
4
|
import type { User } from '../api.js';
|
|
4
5
|
export { http, HttpResponse } from 'msw';
|
|
5
6
|
export { createdAccount, firstAccountClosed, firstAccountCodeRefused, firstAccountOk, firstAccountRateLimited, firstAccountStarting, setupCodeClosed, setupCodeOk, setupCodeRateLimited, setupCodeRefused, setupCodeStarting, setupStatus, } from './setup.js';
|
|
7
|
+
export { disabledOk, disabledRefused, resendDelivered, resendRefused, resendUndelivered, roleRefused, usersFailure, usersOk, } from './users.js';
|
|
6
8
|
export declare const server: import("msw/node").SetupServer;
|
|
7
9
|
/**
|
|
8
10
|
* Installs the msw server lifecycle and DOM cleanup as vitest hooks.
|
|
@@ -26,6 +28,13 @@ export declare function userWithRole(role: string): User;
|
|
|
26
28
|
* @returns The account.
|
|
27
29
|
*/
|
|
28
30
|
export declare function userWithCapabilities(role: string, capabilities: string[], grantable?: string[]): User;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a canned listed account holding the role, under the identity userWithRole gives it.
|
|
33
|
+
* @param role - The role the account holds.
|
|
34
|
+
* @param changes - The fields a test sets apart from the canned ones.
|
|
35
|
+
* @returns The account.
|
|
36
|
+
*/
|
|
37
|
+
export declare function accountWithRole(role: string, changes?: Partial<Account>): Account;
|
|
29
38
|
/**
|
|
30
39
|
* Answers an invitation as mailed.
|
|
31
40
|
* @returns The msw handler.
|
package/dist/testing/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { afterAll, afterEach, beforeAll } from 'vitest';
|
|
|
7
7
|
import { sessionQueryKey } from '../session.js';
|
|
8
8
|
export { http, HttpResponse } from 'msw';
|
|
9
9
|
export { createdAccount, firstAccountClosed, firstAccountCodeRefused, firstAccountOk, firstAccountRateLimited, firstAccountStarting, setupCodeClosed, setupCodeOk, setupCodeRateLimited, setupCodeRefused, setupCodeStarting, setupStatus, } from './setup.js';
|
|
10
|
+
export { disabledOk, disabledRefused, resendDelivered, resendRefused, resendUndelivered, roleRefused, usersFailure, usersOk, } from './users.js';
|
|
10
11
|
export const server = setupServer();
|
|
11
12
|
/**
|
|
12
13
|
* Installs the msw server lifecycle and DOM cleanup as vitest hooks.
|
|
@@ -57,6 +58,26 @@ export function userWithRole(role) {
|
|
|
57
58
|
export function userWithCapabilities(role, capabilities, grantable = []) {
|
|
58
59
|
return { ...userWithRole(role), capabilities: [...capabilities], grantable: [...grantable] };
|
|
59
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns a canned listed account holding the role, under the identity userWithRole gives it.
|
|
63
|
+
* @param role - The role the account holds.
|
|
64
|
+
* @param changes - The fields a test sets apart from the canned ones.
|
|
65
|
+
* @returns The account.
|
|
66
|
+
*/
|
|
67
|
+
export function accountWithRole(role, changes = {}) {
|
|
68
|
+
const { id, email, name } = userWithRole(role);
|
|
69
|
+
return {
|
|
70
|
+
id,
|
|
71
|
+
email,
|
|
72
|
+
name,
|
|
73
|
+
role,
|
|
74
|
+
disabled: false,
|
|
75
|
+
confirmed: true,
|
|
76
|
+
editable: true,
|
|
77
|
+
created_at: new Date('2026-10-19T10:00:00Z'),
|
|
78
|
+
...changes,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
60
81
|
/**
|
|
61
82
|
* Answers an invitation as mailed.
|
|
62
83
|
* @returns The msw handler.
|
package/dist/testing/setup.js
CHANGED
|
@@ -6,8 +6,10 @@ export const createdAccount = {
|
|
|
6
6
|
email: 'maria@example.com',
|
|
7
7
|
name: 'Maria Perez',
|
|
8
8
|
disabled: false,
|
|
9
|
+
confirmed: true,
|
|
9
10
|
role: 'owner',
|
|
10
11
|
created_at: new Date('2026-10-19T10:00:00Z'),
|
|
12
|
+
editable: true,
|
|
11
13
|
};
|
|
12
14
|
/** The answer the site gives for each reason it refuses a setup code. */
|
|
13
15
|
const codeRefused = {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Account } from '../account.js';
|
|
2
|
+
/** The status, message and meta the server answers each account write's error code with. */
|
|
3
|
+
declare const accountErrors: {
|
|
4
|
+
role_insufficient: {
|
|
5
|
+
status: number;
|
|
6
|
+
error: string;
|
|
7
|
+
};
|
|
8
|
+
user_not_found: {
|
|
9
|
+
status: number;
|
|
10
|
+
error: string;
|
|
11
|
+
};
|
|
12
|
+
user_not_editable: {
|
|
13
|
+
status: number;
|
|
14
|
+
error: string;
|
|
15
|
+
};
|
|
16
|
+
role_not_grantable: {
|
|
17
|
+
status: number;
|
|
18
|
+
error: string;
|
|
19
|
+
};
|
|
20
|
+
role_unknown: {
|
|
21
|
+
status: number;
|
|
22
|
+
error: string;
|
|
23
|
+
meta: {
|
|
24
|
+
field: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
role_changed: {
|
|
28
|
+
status: number;
|
|
29
|
+
error: string;
|
|
30
|
+
};
|
|
31
|
+
self_disable_refused: {
|
|
32
|
+
status: number;
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
self_role_refused: {
|
|
36
|
+
status: number;
|
|
37
|
+
error: string;
|
|
38
|
+
};
|
|
39
|
+
last_privileged_refused: {
|
|
40
|
+
status: number;
|
|
41
|
+
error: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/** An error code the server answers an account write with. */
|
|
45
|
+
type AccountErrorCode = keyof typeof accountErrors;
|
|
46
|
+
/**
|
|
47
|
+
* Lists the given accounts.
|
|
48
|
+
* @param accounts - The accounts the list answers.
|
|
49
|
+
* @returns The msw handler.
|
|
50
|
+
*/
|
|
51
|
+
export declare function usersOk(accounts: Account[]): import("msw").HttpHandler;
|
|
52
|
+
/**
|
|
53
|
+
* Fails the account list with a server error.
|
|
54
|
+
* @returns The msw handler.
|
|
55
|
+
*/
|
|
56
|
+
export declare function usersFailure(): import("msw").HttpHandler;
|
|
57
|
+
/**
|
|
58
|
+
* Accepts an Enable or a Disable.
|
|
59
|
+
* @returns The msw handler.
|
|
60
|
+
*/
|
|
61
|
+
export declare function disabledOk(): import("msw").HttpHandler;
|
|
62
|
+
/**
|
|
63
|
+
* Turns down an Enable or a Disable with the given error code.
|
|
64
|
+
* @param code - The error code the server answers.
|
|
65
|
+
* @returns The msw handler.
|
|
66
|
+
*/
|
|
67
|
+
export declare function disabledRefused(code: AccountErrorCode): import("msw").HttpHandler;
|
|
68
|
+
/**
|
|
69
|
+
* Turns down a role change with the given error code.
|
|
70
|
+
* @param code - The error code the server answers.
|
|
71
|
+
* @returns The msw handler.
|
|
72
|
+
*/
|
|
73
|
+
export declare function roleRefused(code: AccountErrorCode): import("msw").HttpHandler;
|
|
74
|
+
/**
|
|
75
|
+
* Answers a resent invitation as mailed.
|
|
76
|
+
* @returns The msw handler.
|
|
77
|
+
*/
|
|
78
|
+
export declare function resendDelivered(): import("msw").HttpHandler;
|
|
79
|
+
/**
|
|
80
|
+
* Answers a resent invitation with the by-hand activation link.
|
|
81
|
+
* @param link - The activation link the admin delivers by hand.
|
|
82
|
+
* @returns The msw handler.
|
|
83
|
+
*/
|
|
84
|
+
export declare function resendUndelivered(link: string): import("msw").HttpHandler;
|
|
85
|
+
/**
|
|
86
|
+
* Turns down a resent invitation with the given error code.
|
|
87
|
+
* @param code - The error code the server answers.
|
|
88
|
+
* @returns The msw handler.
|
|
89
|
+
*/
|
|
90
|
+
export declare function resendRefused(code: AccountErrorCode): import("msw").HttpHandler;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
import { HttpResponse, http } from 'msw';
|
|
3
|
+
/** The status, message and meta the server answers each account write's error code with. */
|
|
4
|
+
const accountErrors = {
|
|
5
|
+
role_insufficient: { status: 403, error: 'role insufficient' },
|
|
6
|
+
user_not_found: { status: 404, error: 'user not found' },
|
|
7
|
+
user_not_editable: { status: 403, error: 'Sorry, you are not allowed to edit this user.' },
|
|
8
|
+
role_not_grantable: { status: 403, error: 'Sorry, you are not allowed to give users that role.' },
|
|
9
|
+
role_unknown: { status: 422, error: 'unknown role', meta: { field: 'role' } },
|
|
10
|
+
role_changed: { status: 409, error: 'role changed' },
|
|
11
|
+
self_disable_refused: { status: 422, error: 'cannot disable your own account' },
|
|
12
|
+
self_role_refused: { status: 422, error: 'cannot change your own role' },
|
|
13
|
+
last_privileged_refused: { status: 422, error: 'the last privileged account must remain' },
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Answers an account write with an error code as the server does.
|
|
17
|
+
* @param code - The error code.
|
|
18
|
+
* @returns The msw response.
|
|
19
|
+
*/
|
|
20
|
+
function errorAnswer(code) {
|
|
21
|
+
const { status, ...body } = accountErrors[code];
|
|
22
|
+
return HttpResponse.json({ ...body, code }, { status });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Lists the given accounts.
|
|
26
|
+
* @param accounts - The accounts the list answers.
|
|
27
|
+
* @returns The msw handler.
|
|
28
|
+
*/
|
|
29
|
+
export function usersOk(accounts) {
|
|
30
|
+
return http.get('/api/users', () => HttpResponse.json(accounts));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Fails the account list with a server error.
|
|
34
|
+
* @returns The msw handler.
|
|
35
|
+
*/
|
|
36
|
+
export function usersFailure() {
|
|
37
|
+
return http.get('/api/users', () => HttpResponse.json({ error: 'internal error', code: 'internal' }, { status: 500 }));
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Accepts an Enable or a Disable.
|
|
41
|
+
* @returns The msw handler.
|
|
42
|
+
*/
|
|
43
|
+
export function disabledOk() {
|
|
44
|
+
return http.patch('/api/users/:id', () => new HttpResponse(null, { status: 204 }));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Turns down an Enable or a Disable with the given error code.
|
|
48
|
+
* @param code - The error code the server answers.
|
|
49
|
+
* @returns The msw handler.
|
|
50
|
+
*/
|
|
51
|
+
export function disabledRefused(code) {
|
|
52
|
+
return http.patch('/api/users/:id', () => errorAnswer(code));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Turns down a role change with the given error code.
|
|
56
|
+
* @param code - The error code the server answers.
|
|
57
|
+
* @returns The msw handler.
|
|
58
|
+
*/
|
|
59
|
+
export function roleRefused(code) {
|
|
60
|
+
return http.put('/api/users/:id/role', () => errorAnswer(code));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Answers a resent invitation as mailed.
|
|
64
|
+
* @returns The msw handler.
|
|
65
|
+
*/
|
|
66
|
+
export function resendDelivered() {
|
|
67
|
+
return http.post('/api/users/invite/resend', () => HttpResponse.json({ delivered: true }));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Answers a resent invitation with the by-hand activation link.
|
|
71
|
+
* @param link - The activation link the admin delivers by hand.
|
|
72
|
+
* @returns The msw handler.
|
|
73
|
+
*/
|
|
74
|
+
export function resendUndelivered(link) {
|
|
75
|
+
return http.post('/api/users/invite/resend', () => HttpResponse.json({ delivered: false, activation_link: link }));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Turns down a resent invitation with the given error code.
|
|
79
|
+
* @param code - The error code the server answers.
|
|
80
|
+
* @returns The msw handler.
|
|
81
|
+
*/
|
|
82
|
+
export function resendRefused(code) {
|
|
83
|
+
return http.post('/api/users/invite/resend', () => errorAnswer(code));
|
|
84
|
+
}
|
package/dist/transport.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface AuthTransport {
|
|
|
17
17
|
setUserDisabled(id: string, disabled: boolean): Promise<void>;
|
|
18
18
|
setUserRole(id: string, role: string): Promise<void>;
|
|
19
19
|
invite(input: NewInvite): Promise<Invitation>;
|
|
20
|
+
resendInvite(email: string): Promise<Invitation>;
|
|
20
21
|
acceptInvite(token: string, password: string): Promise<User>;
|
|
21
22
|
requestPasswordReset(email: string): Promise<void>;
|
|
22
23
|
resetPassword(token: string, password: string): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PasswordFieldState } from './usePasswordField.js';
|
|
3
|
+
/** Where a label sits as DataForm names it: beside its field as the installer's, or above it as a godmin form's. */
|
|
4
|
+
type LabelPosition = 'side' | 'top';
|
|
5
|
+
/**
|
|
6
|
+
* Renders the Password row with its meter and show or hide button, then the weak password row when one is needed.
|
|
7
|
+
* @param password - The password and its setters, from usePasswordField.
|
|
8
|
+
* @param generateFirst - Draws the Generate password button before the field, as WordPress's Add User does.
|
|
9
|
+
* @param readOnly - Whether the password and its confirmation stay as they are, such as while the form is sent.
|
|
10
|
+
* @param help - The line under the field, such as the installer's line asking to store the password.
|
|
11
|
+
* @param labelPosition - Each label beside its field as the installer's, the default, or above it as a godmin form's.
|
|
12
|
+
* @returns The password rows.
|
|
13
|
+
*/
|
|
14
|
+
export declare function PasswordField({ password, generateFirst, readOnly, help, labelPosition, }: {
|
|
15
|
+
password: PasswordFieldState;
|
|
16
|
+
generateFirst?: boolean;
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
help?: ReactNode;
|
|
19
|
+
labelPosition?: LabelPosition;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { __ } from '@wordpress/i18n';
|
|
4
|
+
import { Button, CheckboxControl, Field, Input, Stack, Text } from '@wordpress/ui';
|
|
5
|
+
import { useId, useState } from 'react';
|
|
6
|
+
import { DOMAIN } from '../domain.js';
|
|
7
|
+
import { levelOf } from './strength.js';
|
|
8
|
+
import { needsConfirmation, toneOf } from './usePasswordField.js';
|
|
9
|
+
/** How a row lays out for each label position. */
|
|
10
|
+
const ROW_LAYOUTS = {
|
|
11
|
+
side: { row: 'gopherium-setup__row', label: 'gopherium-setup__label', root: _jsx("div", {}) },
|
|
12
|
+
top: {},
|
|
13
|
+
};
|
|
14
|
+
/** The word the meter box holds for an empty password. */
|
|
15
|
+
const NO_WORD = '\u00a0';
|
|
16
|
+
/** The arrow drawn before the Caps Lock words. */
|
|
17
|
+
const CAPS_ARROW = (_jsx("span", { "aria-hidden": "true", className: "gopherium-setup__caps-icon", children: _jsxs("svg", { viewBox: "0 0 24 26", fill: "currentColor", stroke: "currentColor", strokeWidth: "0.5", children: [_jsx("path", { d: "M12 5L19 15H16V19H8V15H5L12 5Z" }), _jsx("rect", { x: "8", y: "21", width: "8", height: "1.5", rx: "0.75" })] }) }));
|
|
18
|
+
/**
|
|
19
|
+
* Returns the word the meter box holds.
|
|
20
|
+
* @param strength - What the meter knows of the password.
|
|
21
|
+
* @returns Nothing before scoring, a no-break space for an empty field, or the level's word.
|
|
22
|
+
*/
|
|
23
|
+
function meterWord(strength) {
|
|
24
|
+
if (strength === undefined) {
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
return strength === 'empty' ? NO_WORD : levelOf(strength).word;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns a class with its tone modifier when it has a tone.
|
|
31
|
+
* @param block - The class without a tone.
|
|
32
|
+
* @param tone - The tone to add, if any.
|
|
33
|
+
* @returns The class names.
|
|
34
|
+
*/
|
|
35
|
+
function withTone(block, tone) {
|
|
36
|
+
return tone === undefined ? block : `${block} ${block}--${tone}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Reports whether a key types a character, the only keys Caps Lock is read from.
|
|
40
|
+
* @param event - The key the person pressed.
|
|
41
|
+
* @returns True for a printable key pressed without Control, Alt or Meta.
|
|
42
|
+
*/
|
|
43
|
+
function isPrintable(event) {
|
|
44
|
+
return event.key.length === 1 && !event.ctrlKey && !event.altKey && !event.metaKey;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Renders the button that puts a new generated password in the field.
|
|
48
|
+
* @param disabled - Whether the password stays as it is.
|
|
49
|
+
* @param onGenerate - Called when the button is pressed.
|
|
50
|
+
* @returns The button element.
|
|
51
|
+
*/
|
|
52
|
+
function GenerateButton({ disabled, onGenerate }) {
|
|
53
|
+
return (_jsx(Button, { type: "button", variant: "outline", className: "gopherium-setup__generate", disabled: disabled, onClick: onGenerate, children: __('Generate password', DOMAIN) }));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Renders the button that shows or hides the password.
|
|
57
|
+
* @param masked - Whether the password is hidden.
|
|
58
|
+
* @param onToggle - Called when the button is pressed.
|
|
59
|
+
* @returns The toggle element.
|
|
60
|
+
*/
|
|
61
|
+
function MaskToggle({ masked, onToggle }) {
|
|
62
|
+
const show = __('Show', DOMAIN);
|
|
63
|
+
const hide = __('Hide', DOMAIN);
|
|
64
|
+
return (_jsx(Button, { type: "button", variant: "outline", className: "gopherium-setup__toggle", "data-other-word": masked ? hide : show, "aria-label": masked ? __('Show password', DOMAIN) : __('Hide password', DOMAIN), onClick: onToggle, children: masked ? show : hide }));
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Renders the box that shows the meter's word in its tone.
|
|
68
|
+
* @param id - The id the password field is described by.
|
|
69
|
+
* @param strength - What the meter knows of the password.
|
|
70
|
+
* @returns The meter box element.
|
|
71
|
+
*/
|
|
72
|
+
function MeterBox({ id, strength }) {
|
|
73
|
+
return (_jsx("div", { id: id, "aria-live": "polite", className: withTone('gopherium-setup__meter', toneOf(strength)), children: meterWord(strength) }));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Renders the line that warns while Caps Lock is on, empty while it is off.
|
|
77
|
+
* @param on - Whether Caps Lock is on.
|
|
78
|
+
* @returns The Caps Lock line element.
|
|
79
|
+
*/
|
|
80
|
+
function CapsLockLine({ on }) {
|
|
81
|
+
return (_jsx("div", { "aria-live": "assertive", className: "gopherium-setup__caps", children: on ? (_jsxs(_Fragment, { children: [CAPS_ARROW, _jsx("span", { className: "gopherium-setup__caps-text", children: __('Caps lock is on.', DOMAIN) })] })) : null }));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Renders the password row with the meter box, the Caps Lock line and the help line when it has one.
|
|
85
|
+
* @param password - The password and its setters.
|
|
86
|
+
* @param generateFirst - Whether the Generate password button comes before the field.
|
|
87
|
+
* @param readOnly - Whether the password stays as it is.
|
|
88
|
+
* @param help - The line under the field, if any.
|
|
89
|
+
* @param layout - How the row lays out its label and field.
|
|
90
|
+
* @returns The row element.
|
|
91
|
+
*/
|
|
92
|
+
function PasswordRow({ password, generateFirst, readOnly, help, layout, }) {
|
|
93
|
+
const [capsLock, setCapsLock] = useState(false);
|
|
94
|
+
const meterId = useId();
|
|
95
|
+
const helpId = useId();
|
|
96
|
+
return (_jsxs(Field.Root, { className: layout.row, render: layout.root, children: [_jsx(Field.Label, { className: layout.label, children: __('Password', DOMAIN) }), _jsxs("div", { children: [generateFirst ? _jsx(GenerateButton, { disabled: readOnly, onGenerate: password.generate }) : null, _jsxs("div", { className: "gopherium-setup__password", children: [_jsxs("div", { className: "gopherium-setup__password-field", children: [_jsx(Input, { type: password.masked ? 'password' : 'text', className: withTone('gopherium-setup__input', toneOf(password.strength)), value: password.value, readOnly: readOnly, onChange: (event) => password.change(event.target.value), onKeyDown: (event) => {
|
|
97
|
+
if (isPrintable(event)) {
|
|
98
|
+
setCapsLock(event.getModifierState('CapsLock'));
|
|
99
|
+
}
|
|
100
|
+
}, autoComplete: "new-password", spellCheck: false, "aria-describedby": help === undefined ? meterId : `${meterId} ${helpId}` }), _jsx(MeterBox, { id: meterId, strength: password.strength }), _jsx(CapsLockLine, { on: capsLock })] }), _jsx(MaskToggle, { masked: password.masked, onToggle: () => password.mask(!password.masked) })] }), help === undefined ? null : _jsx(Text, { render: _jsx("p", { id: helpId, className: "gopherium-setup__help" }), children: help })] })] }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Renders the row asking to confirm the use of a weak password.
|
|
104
|
+
* @param checked - Whether the use is confirmed.
|
|
105
|
+
* @param readOnly - Whether the choice stays as it is.
|
|
106
|
+
* @param onCheckedChange - Called with the new choice.
|
|
107
|
+
* @param layout - How the row lays out its label and checkbox.
|
|
108
|
+
* @returns The row element.
|
|
109
|
+
*/
|
|
110
|
+
function ConfirmRow({ checked, readOnly, onCheckedChange, layout, }) {
|
|
111
|
+
const label = _jsx(Field.VisualLabel, { className: layout.label, children: __('Confirm Password', DOMAIN) });
|
|
112
|
+
const checkbox = (_jsx(CheckboxControl, { className: "gopherium-setup__checkbox", label: __('Confirm use of weak password', DOMAIN), checked: checked, readOnly: readOnly, onCheckedChange: (next) => onCheckedChange(next) }));
|
|
113
|
+
if (layout.row === undefined) {
|
|
114
|
+
return (_jsxs(Stack, { direction: "column", gap: "sm", children: [label, checkbox] }));
|
|
115
|
+
}
|
|
116
|
+
return (_jsxs("div", { className: layout.row, children: [label, _jsx("div", { children: checkbox })] }));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Renders the Password row with its meter and show or hide button, then the weak password row when one is needed.
|
|
120
|
+
* @param password - The password and its setters, from usePasswordField.
|
|
121
|
+
* @param generateFirst - Draws the Generate password button before the field, as WordPress's Add User does.
|
|
122
|
+
* @param readOnly - Whether the password and its confirmation stay as they are, such as while the form is sent.
|
|
123
|
+
* @param help - The line under the field, such as the installer's line asking to store the password.
|
|
124
|
+
* @param labelPosition - Each label beside its field as the installer's, the default, or above it as a godmin form's.
|
|
125
|
+
* @returns The password rows.
|
|
126
|
+
*/
|
|
127
|
+
export function PasswordField({ password, generateFirst = false, readOnly = false, help, labelPosition = 'side', }) {
|
|
128
|
+
const layout = ROW_LAYOUTS[labelPosition];
|
|
129
|
+
return (_jsxs(_Fragment, { children: [_jsx(PasswordRow, { password: password, generateFirst: generateFirst, readOnly: readOnly, help: help, layout: layout }), needsConfirmation(password.strength) ? (_jsx(ConfirmRow, { checked: password.confirmed, readOnly: readOnly, onCheckedChange: password.confirm, layout: layout })) : null] }));
|
|
130
|
+
}
|