@contember/react-client-tenant 1.3.0-alpha.26 → 2.0.0-alpha.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/dist/development/components/IdentityProvider.cjs +38 -0
- package/dist/development/components/IdentityProvider.cjs.map +1 -0
- package/dist/development/components/IdentityProvider.js +38 -0
- package/dist/development/components/IdentityProvider.js.map +1 -0
- package/dist/development/components/IdentityState.cjs +14 -0
- package/dist/development/components/IdentityState.cjs.map +1 -0
- package/dist/development/components/IdentityState.js +14 -0
- package/dist/development/components/IdentityState.js.map +1 -0
- package/dist/development/components/forms/ChangeMyPasswordForm.cjs +59 -0
- package/dist/development/components/forms/ChangeMyPasswordForm.cjs.map +1 -0
- package/dist/development/components/forms/ChangeMyPasswordForm.js +59 -0
- package/dist/development/components/forms/ChangeMyPasswordForm.js.map +1 -0
- package/dist/development/components/forms/CreateApiKeyForm.cjs +57 -0
- package/dist/development/components/forms/CreateApiKeyForm.cjs.map +1 -0
- package/dist/development/components/forms/CreateApiKeyForm.js +57 -0
- package/dist/development/components/forms/CreateApiKeyForm.js.map +1 -0
- package/dist/development/components/forms/CreateSessionTokenForm.cjs +50 -0
- package/dist/development/components/forms/CreateSessionTokenForm.cjs.map +1 -0
- package/dist/development/components/forms/CreateSessionTokenForm.js +50 -0
- package/dist/development/components/forms/CreateSessionTokenForm.js.map +1 -0
- package/dist/development/components/forms/InviteForm.cjs +62 -0
- package/dist/development/components/forms/InviteForm.cjs.map +1 -0
- package/dist/development/components/forms/InviteForm.js +62 -0
- package/dist/development/components/forms/InviteForm.js.map +1 -0
- package/dist/development/components/forms/LoginForm.cjs +85 -0
- package/dist/development/components/forms/LoginForm.cjs.map +1 -0
- package/dist/development/components/forms/LoginForm.js +85 -0
- package/dist/development/components/forms/LoginForm.js.map +1 -0
- package/dist/development/components/forms/OtpConfirmForm.cjs +49 -0
- package/dist/development/components/forms/OtpConfirmForm.cjs.map +1 -0
- package/dist/development/components/forms/OtpConfirmForm.js +49 -0
- package/dist/development/components/forms/OtpConfirmForm.js.map +1 -0
- package/dist/development/components/forms/OtpPrepareForm.cjs +36 -0
- package/dist/development/components/forms/OtpPrepareForm.cjs.map +1 -0
- package/dist/development/components/forms/OtpPrepareForm.js +36 -0
- package/dist/development/components/forms/OtpPrepareForm.js.map +1 -0
- package/dist/development/components/forms/PasswordResetForm.cjs +62 -0
- package/dist/development/components/forms/PasswordResetForm.cjs.map +1 -0
- package/dist/development/components/forms/PasswordResetForm.js +62 -0
- package/dist/development/components/forms/PasswordResetForm.js.map +1 -0
- package/dist/development/components/forms/PasswordResetRequestForm.cjs +49 -0
- package/dist/development/components/forms/PasswordResetRequestForm.cjs.map +1 -0
- package/dist/development/components/forms/PasswordResetRequestForm.js +49 -0
- package/dist/development/components/forms/PasswordResetRequestForm.js.map +1 -0
- package/dist/development/components/forms/TenantForm.cjs +91 -0
- package/dist/development/components/forms/TenantForm.cjs.map +1 -0
- package/dist/development/components/forms/TenantForm.js +91 -0
- package/dist/development/components/forms/TenantForm.js.map +1 -0
- package/dist/development/components/forms/UpdateProjectMemberForm.cjs +64 -0
- package/dist/development/components/forms/UpdateProjectMemberForm.cjs.map +1 -0
- package/dist/development/components/forms/UpdateProjectMemberForm.js +64 -0
- package/dist/development/components/forms/UpdateProjectMemberForm.js.map +1 -0
- package/dist/development/components/idp/IDP.cjs +56 -0
- package/dist/development/components/idp/IDP.cjs.map +1 -0
- package/dist/development/components/idp/IDP.js +56 -0
- package/dist/development/components/idp/IDP.js.map +1 -0
- package/dist/development/components/idp/IDPInitTrigger.cjs +16 -0
- package/dist/development/components/idp/IDPInitTrigger.cjs.map +1 -0
- package/dist/development/components/idp/IDPInitTrigger.js +16 -0
- package/dist/development/components/idp/IDPInitTrigger.js.map +1 -0
- package/dist/development/components/idp/IDPState.cjs +14 -0
- package/dist/development/components/idp/IDPState.cjs.map +1 -0
- package/dist/development/components/idp/IDPState.js +14 -0
- package/dist/development/components/idp/IDPState.js.map +1 -0
- package/dist/development/components/triggers/DisableOtpTrigger.cjs +32 -0
- package/dist/development/components/triggers/DisableOtpTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/DisableOtpTrigger.js +32 -0
- package/dist/development/components/triggers/DisableOtpTrigger.js.map +1 -0
- package/dist/development/components/triggers/LogoutTrigger.cjs +16 -0
- package/dist/development/components/triggers/LogoutTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/LogoutTrigger.js +16 -0
- package/dist/development/components/triggers/LogoutTrigger.js.map +1 -0
- package/dist/development/components/triggers/RemoveProjectMemberTrigger.cjs +17 -0
- package/dist/development/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/RemoveProjectMemberTrigger.js +17 -0
- package/dist/development/components/triggers/RemoveProjectMemberTrigger.js.map +1 -0
- package/dist/development/components/triggers/TenantActionTrigger.cjs +37 -0
- package/dist/development/components/triggers/TenantActionTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/TenantActionTrigger.js +37 -0
- package/dist/development/components/triggers/TenantActionTrigger.js.map +1 -0
- package/dist/development/contexts.cjs +34 -0
- package/dist/development/contexts.cjs.map +1 -0
- package/dist/development/contexts.js +34 -0
- package/dist/development/contexts.js.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs +30 -0
- package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.js +13 -0
- package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.js.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs +30 -0
- package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js +13 -0
- package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs +30 -0
- package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.js +13 -0
- package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs +29 -0
- package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.js +12 -0
- package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.js.map +1 -0
- package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.cjs +29 -0
- package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.js +12 -0
- package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.js.map +1 -0
- package/dist/development/hooks/mutations/auth/useSignInMutation.cjs +33 -0
- package/dist/development/hooks/mutations/auth/useSignInMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/auth/useSignInMutation.js +16 -0
- package/dist/development/hooks/mutations/auth/useSignInMutation.js.map +1 -0
- package/dist/development/hooks/mutations/auth/useSignOutMutation.cjs +29 -0
- package/dist/development/hooks/mutations/auth/useSignOutMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/auth/useSignOutMutation.js +12 -0
- package/dist/development/hooks/mutations/auth/useSignOutMutation.js.map +1 -0
- package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.cjs +31 -0
- package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.js +14 -0
- package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -0
- package/dist/development/hooks/mutations/idp/useSignInIdpMutation.cjs +33 -0
- package/dist/development/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/idp/useSignInIdpMutation.js +16 -0
- package/dist/development/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -0
- package/dist/development/hooks/mutations/invite/useInviteMutation.cjs +30 -0
- package/dist/development/hooks/mutations/invite/useInviteMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/invite/useInviteMutation.js +13 -0
- package/dist/development/hooks/mutations/invite/useInviteMutation.js.map +1 -0
- package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.cjs +29 -0
- package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.js +12 -0
- package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.js.map +1 -0
- package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs +29 -0
- package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.js +12 -0
- package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.js.map +1 -0
- package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs +29 -0
- package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.js +12 -0
- package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.js.map +1 -0
- package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.cjs +29 -0
- package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.js +12 -0
- package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.js.map +1 -0
- package/dist/development/hooks/mutations/otp/useDisableOtpMutation.cjs +29 -0
- package/dist/development/hooks/mutations/otp/useDisableOtpMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/otp/useDisableOtpMutation.js +12 -0
- package/dist/development/hooks/mutations/otp/useDisableOtpMutation.js.map +1 -0
- package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.cjs +30 -0
- package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.js +13 -0
- package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.js.map +1 -0
- package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs +32 -0
- package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js +15 -0
- package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js.map +1 -0
- package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.cjs +32 -0
- package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.js +15 -0
- package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.js.map +1 -0
- package/dist/development/hooks/queries/useMeQuery.cjs +33 -0
- package/dist/development/hooks/queries/useMeQuery.cjs.map +1 -0
- package/dist/development/hooks/queries/useMeQuery.js +16 -0
- package/dist/development/hooks/queries/useMeQuery.js.map +1 -0
- package/dist/development/hooks/queries/useProjectMembersQuery.cjs +47 -0
- package/dist/development/hooks/queries/useProjectMembersQuery.cjs.map +1 -0
- package/dist/development/hooks/queries/useProjectMembersQuery.js +30 -0
- package/dist/development/hooks/queries/useProjectMembersQuery.js.map +1 -0
- package/dist/development/hooks/queries/useProjectMembershipsQuery.cjs +34 -0
- package/dist/development/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -0
- package/dist/development/hooks/queries/useProjectMembershipsQuery.js +17 -0
- package/dist/development/hooks/queries/useProjectMembershipsQuery.js.map +1 -0
- package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.cjs +36 -0
- package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -0
- package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.js +19 -0
- package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -0
- package/dist/development/hooks/useFetchIdentity.cjs +52 -0
- package/dist/development/hooks/useFetchIdentity.cjs.map +1 -0
- package/dist/development/hooks/useFetchIdentity.js +52 -0
- package/dist/development/hooks/useFetchIdentity.js.map +1 -0
- package/dist/development/hooks/useLogout.cjs +10 -0
- package/dist/development/hooks/useLogout.cjs.map +1 -0
- package/dist/development/hooks/useLogout.js +10 -0
- package/dist/development/hooks/useLogout.js.map +1 -0
- package/dist/development/hooks/useTenantApi.cjs +11 -4
- package/dist/development/hooks/useTenantApi.cjs.map +1 -1
- package/dist/development/hooks/useTenantApi.js +12 -5
- package/dist/development/hooks/useTenantApi.js.map +1 -1
- package/dist/development/hooks/useTenantMutation.cjs +33 -0
- package/dist/development/hooks/useTenantMutation.cjs.map +1 -0
- package/dist/development/hooks/useTenantMutation.js +33 -0
- package/dist/development/hooks/useTenantMutation.js.map +1 -0
- package/dist/development/hooks/useTenantQueryLoader.cjs +36 -0
- package/dist/development/hooks/useTenantQueryLoader.cjs.map +1 -0
- package/dist/development/hooks/useTenantQueryLoader.js +36 -0
- package/dist/development/hooks/useTenantQueryLoader.js.map +1 -0
- package/dist/development/index.cjs +130 -0
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +132 -2
- package/dist/development/index.js.map +1 -1
- package/dist/development/internal/hooks/useHandleIDPResponse.cjs +51 -0
- package/dist/development/internal/hooks/useHandleIDPResponse.cjs.map +1 -0
- package/dist/development/internal/hooks/useHandleIDPResponse.js +51 -0
- package/dist/development/internal/hooks/useHandleIDPResponse.js.map +1 -0
- package/dist/development/internal/hooks/useIDPAutoInit.cjs +19 -0
- package/dist/development/internal/hooks/useIDPAutoInit.cjs.map +1 -0
- package/dist/development/internal/hooks/useIDPAutoInit.js +19 -0
- package/dist/development/internal/hooks/useIDPAutoInit.js.map +1 -0
- package/dist/development/internal/hooks/useIDPStateStore.cjs +19 -0
- package/dist/development/internal/hooks/useIDPStateStore.cjs.map +1 -0
- package/dist/development/internal/hooks/useIDPStateStore.js +19 -0
- package/dist/development/internal/hooks/useIDPStateStore.js.map +1 -0
- package/dist/development/internal/hooks/useInitIDPRedirect.cjs +44 -0
- package/dist/development/internal/hooks/useInitIDPRedirect.cjs.map +1 -0
- package/dist/development/internal/hooks/useInitIDPRedirect.js +44 -0
- package/dist/development/internal/hooks/useInitIDPRedirect.js.map +1 -0
- package/dist/development/internal/hooks/useLogoutInternal.cjs +35 -0
- package/dist/development/internal/hooks/useLogoutInternal.cjs.map +1 -0
- package/dist/development/internal/hooks/useLogoutInternal.js +35 -0
- package/dist/development/internal/hooks/useLogoutInternal.js.map +1 -0
- package/dist/development/internal/hooks/useRedirectToBacklink.cjs +31 -0
- package/dist/development/internal/hooks/useRedirectToBacklink.cjs.map +1 -0
- package/dist/development/internal/hooks/useRedirectToBacklink.js +31 -0
- package/dist/development/internal/hooks/useRedirectToBacklink.js.map +1 -0
- package/dist/development/internal/utils/getBaseHref.cjs +8 -0
- package/dist/development/internal/utils/getBaseHref.cjs.map +1 -0
- package/dist/development/internal/utils/getBaseHref.js +8 -0
- package/dist/development/internal/utils/getBaseHref.js.map +1 -0
- package/dist/production/components/IdentityProvider.cjs +26 -0
- package/dist/production/components/IdentityProvider.cjs.map +1 -0
- package/dist/production/components/IdentityProvider.js +26 -0
- package/dist/production/components/IdentityProvider.js.map +1 -0
- package/dist/production/components/IdentityState.cjs +10 -0
- package/dist/production/components/IdentityState.cjs.map +1 -0
- package/dist/production/components/IdentityState.js +10 -0
- package/dist/production/components/IdentityState.js.map +1 -0
- package/dist/production/components/forms/ChangeMyPasswordForm.cjs +51 -0
- package/dist/production/components/forms/ChangeMyPasswordForm.cjs.map +1 -0
- package/dist/production/components/forms/ChangeMyPasswordForm.js +51 -0
- package/dist/production/components/forms/ChangeMyPasswordForm.js.map +1 -0
- package/dist/production/components/forms/CreateApiKeyForm.cjs +49 -0
- package/dist/production/components/forms/CreateApiKeyForm.cjs.map +1 -0
- package/dist/production/components/forms/CreateApiKeyForm.js +49 -0
- package/dist/production/components/forms/CreateApiKeyForm.js.map +1 -0
- package/dist/production/components/forms/CreateSessionTokenForm.cjs +42 -0
- package/dist/production/components/forms/CreateSessionTokenForm.cjs.map +1 -0
- package/dist/production/components/forms/CreateSessionTokenForm.js +42 -0
- package/dist/production/components/forms/CreateSessionTokenForm.js.map +1 -0
- package/dist/production/components/forms/InviteForm.cjs +54 -0
- package/dist/production/components/forms/InviteForm.cjs.map +1 -0
- package/dist/production/components/forms/InviteForm.js +54 -0
- package/dist/production/components/forms/InviteForm.js.map +1 -0
- package/dist/production/components/forms/LoginForm.cjs +77 -0
- package/dist/production/components/forms/LoginForm.cjs.map +1 -0
- package/dist/production/components/forms/LoginForm.js +77 -0
- package/dist/production/components/forms/LoginForm.js.map +1 -0
- package/dist/production/components/forms/OtpConfirmForm.cjs +41 -0
- package/dist/production/components/forms/OtpConfirmForm.cjs.map +1 -0
- package/dist/production/components/forms/OtpConfirmForm.js +41 -0
- package/dist/production/components/forms/OtpConfirmForm.js.map +1 -0
- package/dist/production/components/forms/OtpPrepareForm.cjs +28 -0
- package/dist/production/components/forms/OtpPrepareForm.cjs.map +1 -0
- package/dist/production/components/forms/OtpPrepareForm.js +28 -0
- package/dist/production/components/forms/OtpPrepareForm.js.map +1 -0
- package/dist/production/components/forms/PasswordResetForm.cjs +54 -0
- package/dist/production/components/forms/PasswordResetForm.cjs.map +1 -0
- package/dist/production/components/forms/PasswordResetForm.js +54 -0
- package/dist/production/components/forms/PasswordResetForm.js.map +1 -0
- package/dist/production/components/forms/PasswordResetRequestForm.cjs +41 -0
- package/dist/production/components/forms/PasswordResetRequestForm.cjs.map +1 -0
- package/dist/production/components/forms/PasswordResetRequestForm.js +41 -0
- package/dist/production/components/forms/PasswordResetRequestForm.js.map +1 -0
- package/dist/production/components/forms/TenantForm.cjs +83 -0
- package/dist/production/components/forms/TenantForm.cjs.map +1 -0
- package/dist/production/components/forms/TenantForm.js +83 -0
- package/dist/production/components/forms/TenantForm.js.map +1 -0
- package/dist/production/components/forms/UpdateProjectMemberForm.cjs +56 -0
- package/dist/production/components/forms/UpdateProjectMemberForm.cjs.map +1 -0
- package/dist/production/components/forms/UpdateProjectMemberForm.js +56 -0
- package/dist/production/components/forms/UpdateProjectMemberForm.js.map +1 -0
- package/dist/production/components/idp/IDP.cjs +48 -0
- package/dist/production/components/idp/IDP.cjs.map +1 -0
- package/dist/production/components/idp/IDP.js +48 -0
- package/dist/production/components/idp/IDP.js.map +1 -0
- package/dist/production/components/idp/IDPInitTrigger.cjs +12 -0
- package/dist/production/components/idp/IDPInitTrigger.cjs.map +1 -0
- package/dist/production/components/idp/IDPInitTrigger.js +12 -0
- package/dist/production/components/idp/IDPInitTrigger.js.map +1 -0
- package/dist/production/components/idp/IDPState.cjs +10 -0
- package/dist/production/components/idp/IDPState.cjs.map +1 -0
- package/dist/production/components/idp/IDPState.js +10 -0
- package/dist/production/components/idp/IDPState.js.map +1 -0
- package/dist/production/components/triggers/DisableOtpTrigger.cjs +24 -0
- package/dist/production/components/triggers/DisableOtpTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/DisableOtpTrigger.js +24 -0
- package/dist/production/components/triggers/DisableOtpTrigger.js.map +1 -0
- package/dist/production/components/triggers/LogoutTrigger.cjs +12 -0
- package/dist/production/components/triggers/LogoutTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/LogoutTrigger.js +12 -0
- package/dist/production/components/triggers/LogoutTrigger.js.map +1 -0
- package/dist/production/components/triggers/RemoveProjectMemberTrigger.cjs +13 -0
- package/dist/production/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/RemoveProjectMemberTrigger.js +13 -0
- package/dist/production/components/triggers/RemoveProjectMemberTrigger.js.map +1 -0
- package/dist/production/components/triggers/TenantActionTrigger.cjs +33 -0
- package/dist/production/components/triggers/TenantActionTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/TenantActionTrigger.js +33 -0
- package/dist/production/components/triggers/TenantActionTrigger.js.map +1 -0
- package/dist/production/contexts.cjs +34 -0
- package/dist/production/contexts.cjs.map +1 -0
- package/dist/production/contexts.js +34 -0
- package/dist/production/contexts.js.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs +30 -0
- package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.js +13 -0
- package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.js.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs +30 -0
- package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js +13 -0
- package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs +30 -0
- package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.js +13 -0
- package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs +29 -0
- package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.js +12 -0
- package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.js.map +1 -0
- package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.cjs +29 -0
- package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.js +12 -0
- package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.js.map +1 -0
- package/dist/production/hooks/mutations/auth/useSignInMutation.cjs +33 -0
- package/dist/production/hooks/mutations/auth/useSignInMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/auth/useSignInMutation.js +16 -0
- package/dist/production/hooks/mutations/auth/useSignInMutation.js.map +1 -0
- package/dist/production/hooks/mutations/auth/useSignOutMutation.cjs +29 -0
- package/dist/production/hooks/mutations/auth/useSignOutMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/auth/useSignOutMutation.js +12 -0
- package/dist/production/hooks/mutations/auth/useSignOutMutation.js.map +1 -0
- package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.cjs +31 -0
- package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.js +14 -0
- package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -0
- package/dist/production/hooks/mutations/idp/useSignInIdpMutation.cjs +33 -0
- package/dist/production/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/idp/useSignInIdpMutation.js +16 -0
- package/dist/production/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -0
- package/dist/production/hooks/mutations/invite/useInviteMutation.cjs +30 -0
- package/dist/production/hooks/mutations/invite/useInviteMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/invite/useInviteMutation.js +13 -0
- package/dist/production/hooks/mutations/invite/useInviteMutation.js.map +1 -0
- package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.cjs +29 -0
- package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.js +12 -0
- package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.js.map +1 -0
- package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs +29 -0
- package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.js +12 -0
- package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.js.map +1 -0
- package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs +29 -0
- package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.js +12 -0
- package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.js.map +1 -0
- package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.cjs +29 -0
- package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.js +12 -0
- package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.js.map +1 -0
- package/dist/production/hooks/mutations/otp/useDisableOtpMutation.cjs +29 -0
- package/dist/production/hooks/mutations/otp/useDisableOtpMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/otp/useDisableOtpMutation.js +12 -0
- package/dist/production/hooks/mutations/otp/useDisableOtpMutation.js.map +1 -0
- package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.cjs +30 -0
- package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.js +13 -0
- package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.js.map +1 -0
- package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs +32 -0
- package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js +15 -0
- package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js.map +1 -0
- package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.cjs +32 -0
- package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.js +15 -0
- package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.js.map +1 -0
- package/dist/production/hooks/queries/useMeQuery.cjs +33 -0
- package/dist/production/hooks/queries/useMeQuery.cjs.map +1 -0
- package/dist/production/hooks/queries/useMeQuery.js +16 -0
- package/dist/production/hooks/queries/useMeQuery.js.map +1 -0
- package/dist/production/hooks/queries/useProjectMembersQuery.cjs +47 -0
- package/dist/production/hooks/queries/useProjectMembersQuery.cjs.map +1 -0
- package/dist/production/hooks/queries/useProjectMembersQuery.js +30 -0
- package/dist/production/hooks/queries/useProjectMembersQuery.js.map +1 -0
- package/dist/production/hooks/queries/useProjectMembershipsQuery.cjs +34 -0
- package/dist/production/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -0
- package/dist/production/hooks/queries/useProjectMembershipsQuery.js +17 -0
- package/dist/production/hooks/queries/useProjectMembershipsQuery.js.map +1 -0
- package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.cjs +36 -0
- package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -0
- package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.js +19 -0
- package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -0
- package/dist/production/hooks/useFetchIdentity.cjs +52 -0
- package/dist/production/hooks/useFetchIdentity.cjs.map +1 -0
- package/dist/production/hooks/useFetchIdentity.js +52 -0
- package/dist/production/hooks/useFetchIdentity.js.map +1 -0
- package/dist/production/hooks/useLogout.cjs +10 -0
- package/dist/production/hooks/useLogout.cjs.map +1 -0
- package/dist/production/hooks/useLogout.js +10 -0
- package/dist/production/hooks/useLogout.js.map +1 -0
- package/dist/production/hooks/useTenantApi.cjs +11 -4
- package/dist/production/hooks/useTenantApi.cjs.map +1 -1
- package/dist/production/hooks/useTenantApi.js +12 -5
- package/dist/production/hooks/useTenantApi.js.map +1 -1
- package/dist/production/hooks/useTenantMutation.cjs +33 -0
- package/dist/production/hooks/useTenantMutation.cjs.map +1 -0
- package/dist/production/hooks/useTenantMutation.js +33 -0
- package/dist/production/hooks/useTenantMutation.js.map +1 -0
- package/dist/production/hooks/useTenantQueryLoader.cjs +36 -0
- package/dist/production/hooks/useTenantQueryLoader.cjs.map +1 -0
- package/dist/production/hooks/useTenantQueryLoader.js +36 -0
- package/dist/production/hooks/useTenantQueryLoader.js.map +1 -0
- package/dist/production/index.cjs +130 -0
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +132 -2
- package/dist/production/index.js.map +1 -1
- package/dist/production/internal/hooks/useHandleIDPResponse.cjs +51 -0
- package/dist/production/internal/hooks/useHandleIDPResponse.cjs.map +1 -0
- package/dist/production/internal/hooks/useHandleIDPResponse.js +51 -0
- package/dist/production/internal/hooks/useHandleIDPResponse.js.map +1 -0
- package/dist/production/internal/hooks/useIDPAutoInit.cjs +19 -0
- package/dist/production/internal/hooks/useIDPAutoInit.cjs.map +1 -0
- package/dist/production/internal/hooks/useIDPAutoInit.js +19 -0
- package/dist/production/internal/hooks/useIDPAutoInit.js.map +1 -0
- package/dist/production/internal/hooks/useIDPStateStore.cjs +19 -0
- package/dist/production/internal/hooks/useIDPStateStore.cjs.map +1 -0
- package/dist/production/internal/hooks/useIDPStateStore.js +19 -0
- package/dist/production/internal/hooks/useIDPStateStore.js.map +1 -0
- package/dist/production/internal/hooks/useInitIDPRedirect.cjs +44 -0
- package/dist/production/internal/hooks/useInitIDPRedirect.cjs.map +1 -0
- package/dist/production/internal/hooks/useInitIDPRedirect.js +44 -0
- package/dist/production/internal/hooks/useInitIDPRedirect.js.map +1 -0
- package/dist/production/internal/hooks/useLogoutInternal.cjs +35 -0
- package/dist/production/internal/hooks/useLogoutInternal.cjs.map +1 -0
- package/dist/production/internal/hooks/useLogoutInternal.js +35 -0
- package/dist/production/internal/hooks/useLogoutInternal.js.map +1 -0
- package/dist/production/internal/hooks/useRedirectToBacklink.cjs +31 -0
- package/dist/production/internal/hooks/useRedirectToBacklink.cjs.map +1 -0
- package/dist/production/internal/hooks/useRedirectToBacklink.js +31 -0
- package/dist/production/internal/hooks/useRedirectToBacklink.js.map +1 -0
- package/dist/production/internal/utils/getBaseHref.cjs +8 -0
- package/dist/production/internal/utils/getBaseHref.cjs.map +1 -0
- package/dist/production/internal/utils/getBaseHref.js +8 -0
- package/dist/production/internal/utils/getBaseHref.js.map +1 -0
- package/dist/types/components/IdentityProvider.d.ts +6 -0
- package/dist/types/components/IdentityProvider.d.ts.map +1 -0
- package/dist/types/components/IdentityState.d.ts +8 -0
- package/dist/types/components/IdentityState.d.ts.map +1 -0
- package/dist/types/components/forms/ChangeMyPasswordForm.d.ts +19 -0
- package/dist/types/components/forms/ChangeMyPasswordForm.d.ts.map +1 -0
- package/dist/types/components/forms/CreateApiKeyForm.d.ts +23 -0
- package/dist/types/components/forms/CreateApiKeyForm.d.ts.map +1 -0
- package/dist/types/components/forms/CreateSessionTokenForm.d.ts +22 -0
- package/dist/types/components/forms/CreateSessionTokenForm.d.ts.map +1 -0
- package/dist/types/components/forms/InviteForm.d.ts +25 -0
- package/dist/types/components/forms/InviteForm.d.ts.map +1 -0
- package/dist/types/components/forms/LoginForm.d.ts +20 -0
- package/dist/types/components/forms/LoginForm.d.ts.map +1 -0
- package/dist/types/components/forms/OtpConfirmForm.d.ts +17 -0
- package/dist/types/components/forms/OtpConfirmForm.d.ts.map +1 -0
- package/dist/types/components/forms/OtpPrepareForm.d.ts +19 -0
- package/dist/types/components/forms/OtpPrepareForm.d.ts.map +1 -0
- package/dist/types/components/forms/PasswordResetForm.d.ts +20 -0
- package/dist/types/components/forms/PasswordResetForm.d.ts.map +1 -0
- package/dist/types/components/forms/PasswordResetRequestForm.d.ts +17 -0
- package/dist/types/components/forms/PasswordResetRequestForm.d.ts.map +1 -0
- package/dist/types/components/forms/TenantForm.d.ts +37 -0
- package/dist/types/components/forms/TenantForm.d.ts.map +1 -0
- package/dist/types/components/forms/UpdateProjectMemberForm.d.ts +19 -0
- package/dist/types/components/forms/UpdateProjectMemberForm.d.ts.map +1 -0
- package/dist/types/components/forms/index.d.ts +11 -0
- package/dist/types/components/forms/index.d.ts.map +1 -0
- package/dist/types/components/idp/IDP.d.ts +10 -0
- package/dist/types/components/idp/IDP.d.ts.map +1 -0
- package/dist/types/components/idp/IDPInitTrigger.d.ts +7 -0
- package/dist/types/components/idp/IDPInitTrigger.d.ts.map +1 -0
- package/dist/types/components/idp/IDPState.d.ts +8 -0
- package/dist/types/components/idp/IDPState.d.ts.map +1 -0
- package/dist/types/components/idp/index.d.ts +4 -0
- package/dist/types/components/idp/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +6 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/triggers/DisableOtpTrigger.d.ts +8 -0
- package/dist/types/components/triggers/DisableOtpTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/LogoutTrigger.d.ts +5 -0
- package/dist/types/components/triggers/LogoutTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/RemoveProjectMemberTrigger.d.ts +9 -0
- package/dist/types/components/triggers/RemoveProjectMemberTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/TenantActionTrigger.d.ts +22 -0
- package/dist/types/components/triggers/TenantActionTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/index.d.ts +4 -0
- package/dist/types/components/triggers/index.d.ts.map +1 -0
- package/dist/types/contexts.d.ts +20 -0
- package/dist/types/contexts.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +6 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/mutations/apiKey/index.d.ts +5 -0
- package/dist/types/hooks/mutations/apiKey/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/apiKey/useCreateApiKeyMutation.d.ts +83 -0
- package/dist/types/hooks/mutations/apiKey/useCreateApiKeyMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.d.ts +73 -0
- package/dist/types/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/apiKey/useCreateSessionTokenMutation.d.ts +65 -0
- package/dist/types/hooks/mutations/apiKey/useCreateSessionTokenMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/apiKey/useDisableApiKeyMutation.d.ts +21 -0
- package/dist/types/hooks/mutations/apiKey/useDisableApiKeyMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/auth/index.d.ts +4 -0
- package/dist/types/hooks/mutations/auth/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts +21 -0
- package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts +69 -0
- package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/auth/useSignOutMutation.d.ts +21 -0
- package/dist/types/hooks/mutations/auth/useSignOutMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/idp/index.d.ts +3 -0
- package/dist/types/hooks/mutations/idp/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/idp/useInitSignInIDPMutation.d.ts +17 -0
- package/dist/types/hooks/mutations/idp/useInitSignInIDPMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts +76 -0
- package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/index.d.ts +8 -0
- package/dist/types/hooks/mutations/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/invite/index.d.ts +2 -0
- package/dist/types/hooks/mutations/invite/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/invite/useInviteMutation.d.ts +103 -0
- package/dist/types/hooks/mutations/invite/useInviteMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/memberships/index.d.ts +4 -0
- package/dist/types/hooks/mutations/memberships/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/memberships/useAddProjectMemberMutation.d.ts +33 -0
- package/dist/types/hooks/mutations/memberships/useAddProjectMemberMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/memberships/useRemoveProjectMemberMutation.d.ts +23 -0
- package/dist/types/hooks/mutations/memberships/useRemoveProjectMemberMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/memberships/useUpdateProjectMemberMutation.d.ts +33 -0
- package/dist/types/hooks/mutations/memberships/useUpdateProjectMemberMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/otp/index.d.ts +4 -0
- package/dist/types/hooks/mutations/otp/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/otp/useConfirmOtpMutation.d.ts +21 -0
- package/dist/types/hooks/mutations/otp/useConfirmOtpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/otp/useDisableOtpMutation.d.ts +17 -0
- package/dist/types/hooks/mutations/otp/useDisableOtpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/otp/usePrepareOtpMutation.d.ts +25 -0
- package/dist/types/hooks/mutations/otp/usePrepareOtpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/passwordReset/index.d.ts +3 -0
- package/dist/types/hooks/mutations/passwordReset/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.d.ts +23 -0
- package/dist/types/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts +23 -0
- package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts.map +1 -0
- package/dist/types/hooks/queries/index.d.ts +5 -0
- package/dist/types/hooks/queries/index.d.ts.map +1 -0
- package/dist/types/hooks/queries/useMeQuery.d.ts +52 -0
- package/dist/types/hooks/queries/useMeQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useProjectMembersQuery.d.ts +43 -0
- package/dist/types/hooks/queries/useProjectMembersQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useProjectMembershipsQuery.d.ts +20 -0
- package/dist/types/hooks/queries/useProjectMembershipsQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useProjectRolesDefinitionQuery.d.ts +66 -0
- package/dist/types/hooks/queries/useProjectRolesDefinitionQuery.d.ts.map +1 -0
- package/dist/types/hooks/useFetchIdentity.d.ts +6 -0
- package/dist/types/hooks/useFetchIdentity.d.ts.map +1 -0
- package/dist/types/hooks/useLogout.d.ts +4 -0
- package/dist/types/hooks/useLogout.d.ts.map +1 -0
- package/dist/types/hooks/useTenantApi.d.ts +7 -2
- package/dist/types/hooks/useTenantApi.d.ts.map +1 -1
- package/dist/types/hooks/useTenantMutation.d.ts +25 -0
- package/dist/types/hooks/useTenantMutation.d.ts.map +1 -0
- package/dist/types/hooks/useTenantQueryLoader.d.ts +17 -0
- package/dist/types/hooks/useTenantQueryLoader.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/internal/hooks/useHandleIDPResponse.d.ts +10 -0
- package/dist/types/internal/hooks/useHandleIDPResponse.d.ts.map +1 -0
- package/dist/types/internal/hooks/useIDPAutoInit.d.ts +2 -0
- package/dist/types/internal/hooks/useIDPAutoInit.d.ts.map +1 -0
- package/dist/types/internal/hooks/useIDPStateStore.d.ts +9 -0
- package/dist/types/internal/hooks/useIDPStateStore.d.ts.map +1 -0
- package/dist/types/internal/hooks/useInitIDPRedirect.d.ts +15 -0
- package/dist/types/internal/hooks/useInitIDPRedirect.d.ts.map +1 -0
- package/dist/types/internal/hooks/useLogoutInternal.d.ts +4 -0
- package/dist/types/internal/hooks/useLogoutInternal.d.ts.map +1 -0
- package/dist/types/internal/hooks/useRedirectToBacklink.d.ts +4 -0
- package/dist/types/internal/hooks/useRedirectToBacklink.d.ts.map +1 -0
- package/dist/types/internal/utils/getBaseHref.d.ts +2 -0
- package/dist/types/internal/utils/getBaseHref.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/Identity.d.ts +19 -0
- package/dist/types/types/Identity.d.ts.map +1 -0
- package/dist/types/types/IdentityMethods.d.ts +5 -0
- package/dist/types/types/IdentityMethods.d.ts.map +1 -0
- package/dist/types/types/IdentityStateValue.d.ts +2 -0
- package/dist/types/types/IdentityStateValue.d.ts.map +1 -0
- package/dist/types/types/forms.d.ts +18 -0
- package/dist/types/types/forms.d.ts.map +1 -0
- package/dist/types/types/idp.d.ts +30 -0
- package/dist/types/types/idp.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +6 -2
- package/src/components/IdentityProvider.tsx +39 -0
- package/src/components/IdentityState.tsx +14 -0
- package/src/components/forms/ChangeMyPasswordForm.tsx +75 -0
- package/src/components/forms/CreateApiKeyForm.tsx +72 -0
- package/src/components/forms/CreateSessionTokenForm.tsx +64 -0
- package/src/components/forms/InviteForm.tsx +79 -0
- package/src/components/forms/LoginForm.tsx +110 -0
- package/src/components/forms/OtpConfirmForm.tsx +61 -0
- package/src/components/forms/OtpPrepareForm.tsx +45 -0
- package/src/components/forms/PasswordResetForm.tsx +80 -0
- package/src/components/forms/PasswordResetRequestForm.tsx +64 -0
- package/src/components/forms/TenantForm.tsx +116 -0
- package/src/components/forms/UpdateProjectMemberForm.tsx +77 -0
- package/src/components/forms/index.ts +10 -0
- package/src/components/idp/IDP.tsx +65 -0
- package/src/components/idp/IDPInitTrigger.tsx +17 -0
- package/src/components/idp/IDPState.tsx +14 -0
- package/src/components/idp/index.ts +3 -0
- package/src/components/index.ts +5 -0
- package/src/components/triggers/DisableOtpTrigger.tsx +25 -0
- package/src/components/triggers/LogoutTrigger.tsx +10 -0
- package/src/components/triggers/RemoveProjectMemberTrigger.tsx +18 -0
- package/src/components/triggers/TenantActionTrigger.tsx +41 -0
- package/src/components/triggers/index.ts +3 -0
- package/src/contexts.ts +34 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/mutations/apiKey/index.ts +4 -0
- package/src/hooks/mutations/apiKey/useCreateApiKeyMutation.tsx +19 -0
- package/src/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.tsx +19 -0
- package/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.tsx +19 -0
- package/src/hooks/mutations/apiKey/useDisableApiKeyMutation.tsx +14 -0
- package/src/hooks/mutations/auth/index.ts +3 -0
- package/src/hooks/mutations/auth/useChangeMyPasswordMutation.ts +14 -0
- package/src/hooks/mutations/auth/useSignInMutation.ts +25 -0
- package/src/hooks/mutations/auth/useSignOutMutation.ts +12 -0
- package/src/hooks/mutations/idp/index.ts +2 -0
- package/src/hooks/mutations/idp/useInitSignInIDPMutation.ts +29 -0
- package/src/hooks/mutations/idp/useSignInIdpMutation.ts +35 -0
- package/src/hooks/mutations/index.ts +7 -0
- package/src/hooks/mutations/invite/index.ts +1 -0
- package/src/hooks/mutations/invite/useInviteMutation.tsx +20 -0
- package/src/hooks/mutations/memberships/index.ts +3 -0
- package/src/hooks/mutations/memberships/useAddProjectMemberMutation.ts +13 -0
- package/src/hooks/mutations/memberships/useRemoveProjectMemberMutation.ts +13 -0
- package/src/hooks/mutations/memberships/useUpdateProjectMemberMutation.ts +13 -0
- package/src/hooks/mutations/otp/index.ts +3 -0
- package/src/hooks/mutations/otp/useConfirmOtpMutation.ts +13 -0
- package/src/hooks/mutations/otp/useDisableOtpMutation.ts +10 -0
- package/src/hooks/mutations/otp/usePrepareOtpMutation.ts +16 -0
- package/src/hooks/mutations/passwordReset/index.ts +2 -0
- package/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.ts +17 -0
- package/src/hooks/mutations/passwordReset/useResetPasswordMutation.ts +17 -0
- package/src/hooks/queries/index.ts +4 -0
- package/src/hooks/queries/useMeQuery.ts +23 -0
- package/src/hooks/queries/useProjectMembersQuery.ts +43 -0
- package/src/hooks/queries/useProjectMembershipsQuery.ts +25 -0
- package/src/hooks/queries/useProjectRolesDefinitionQuery.ts +34 -0
- package/src/hooks/useFetchIdentity.ts +55 -0
- package/src/hooks/useLogout.ts +7 -0
- package/src/hooks/useTenantApi.ts +18 -6
- package/src/hooks/useTenantMutation.ts +45 -0
- package/src/hooks/useTenantQueryLoader.ts +49 -0
- package/src/index.ts +3 -0
- package/src/internal/hooks/useHandleIDPResponse.ts +64 -0
- package/src/internal/hooks/useIDPAutoInit.ts +18 -0
- package/src/internal/hooks/useIDPStateStore.ts +18 -0
- package/src/internal/hooks/useInitIDPRedirect.ts +48 -0
- package/src/internal/hooks/useLogoutInternal.ts +35 -0
- package/src/internal/hooks/useRedirectToBacklink.ts +42 -0
- package/src/internal/utils/getBaseHref.ts +4 -0
- package/src/tsconfig.json +1 -0
- package/src/types/Identity.ts +20 -0
- package/src/types/IdentityMethods.ts +4 -0
- package/src/types/IdentityStateValue.ts +6 -0
- package/src/types/forms.ts +26 -0
- package/src/types/idp.ts +25 -0
- package/src/types/index.ts +5 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { useInviteMutation } from "../../hooks/mutations/invite/useInviteMutation.js";
|
|
5
|
+
const useInviteForm = useForm;
|
|
6
|
+
const InviteForm = ({ children, onSuccess, projectSlug, initialMemberships, inviteOptions }) => {
|
|
7
|
+
const invite = useInviteMutation();
|
|
8
|
+
return /* @__PURE__ */ jsxDEV(
|
|
9
|
+
TenantForm,
|
|
10
|
+
{
|
|
11
|
+
onSuccess,
|
|
12
|
+
initialValues: {
|
|
13
|
+
email: "",
|
|
14
|
+
name: "",
|
|
15
|
+
memberships: initialMemberships || []
|
|
16
|
+
},
|
|
17
|
+
validate: ({ values }) => {
|
|
18
|
+
const errors = [];
|
|
19
|
+
if (!values.email) {
|
|
20
|
+
errors.push({ code: "FIELD_REQUIRED", field: "email" });
|
|
21
|
+
}
|
|
22
|
+
if (values.memberships.length === 0) {
|
|
23
|
+
errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
|
|
24
|
+
}
|
|
25
|
+
return errors;
|
|
26
|
+
},
|
|
27
|
+
execute: async ({ values }) => {
|
|
28
|
+
return await invite({
|
|
29
|
+
email: values.email,
|
|
30
|
+
name: values.name,
|
|
31
|
+
projectSlug,
|
|
32
|
+
options: inviteOptions,
|
|
33
|
+
memberships: values.memberships
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
errorMapping: errorToField,
|
|
37
|
+
children
|
|
38
|
+
},
|
|
39
|
+
void 0,
|
|
40
|
+
false,
|
|
41
|
+
{
|
|
42
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/InviteForm.tsx",
|
|
43
|
+
lineNumber: 38,
|
|
44
|
+
columnNumber: 3
|
|
45
|
+
},
|
|
46
|
+
void 0
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
const errorToField = {
|
|
50
|
+
ALREADY_MEMBER: "email",
|
|
51
|
+
INVALID_EMAIL_FORMAT: "email",
|
|
52
|
+
INVALID_MEMBERSHIP: "memberships",
|
|
53
|
+
PROJECT_NOT_FOUND: void 0,
|
|
54
|
+
ROLE_NOT_FOUND: "memberships",
|
|
55
|
+
VARIABLE_EMPTY: "memberships",
|
|
56
|
+
VARIABLE_NOT_FOUND: "memberships"
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
InviteForm,
|
|
60
|
+
useInviteForm
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=InviteForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InviteForm.js","sources":["../../../../src/components/forms/InviteForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { InviteErrorCode, InviteOptions, MembershipInput } from '@contember/graphql-client-tenant'\nimport { InviteMutationResult, useInviteMutation } from '../../hooks'\n\nexport type InviteFormValues = {\n\temail: string\n\tname: string\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type InviteFormErrorCode =\n\t| InviteErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type InviteFormState = FormState\n\nexport type InviteFormError = FormError<InviteFormValues, InviteFormErrorCode>\n\nexport type InviteFormContextValue = FormContextValue<InviteFormValues, InviteFormErrorCode>\n\nexport interface InviteFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tinviteOptions?: InviteOptions\n\tinitialMemberships?: readonly MembershipInput[]\n\tonSuccess?: (args: { result: InviteMutationResult }) => void\n}\n\nexport const useInviteForm = useForm as () => InviteFormContextValue\n\nexport const InviteForm = ({ children, onSuccess, projectSlug, initialMemberships, inviteOptions }: InviteFormProps) => {\n\tconst invite = useInviteMutation()\n\treturn (\n\t\t<TenantForm<InviteFormContextValue, InviteMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\temail: '',\n\t\t\t\tname: '',\n\t\t\t\tmemberships: initialMemberships || [],\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: InviteFormError[] = []\n\t\t\t\tif (!values.email) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'email' })\n\t\t\t\t}\n\t\t\t\tif (values.memberships.length === 0) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'memberships' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await invite({\n\t\t\t\t\temail: values.email,\n\t\t\t\t\tname: values.name,\n\t\t\t\t\tprojectSlug,\n\t\t\t\t\toptions: inviteOptions,\n\t\t\t\t\tmemberships: values.memberships,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<InviteErrorCode, keyof InviteFormValues | undefined> = {\n\tALREADY_MEMBER: 'email',\n\tINVALID_EMAIL_FORMAT: 'email',\n\tINVALID_MEMBERSHIP: 'memberships',\n\tPROJECT_NOT_FOUND: undefined,\n\tROLE_NOT_FOUND: 'memberships',\n\tVARIABLE_EMPTY: 'memberships',\n\tVARIABLE_NOT_FOUND: 'memberships',\n}\n"],"names":["this"],"mappings":";;;;AAgCO,MAAM,gBAAgB;AAEhB,MAAA,aAAa,CAAC,EAAE,UAAU,WAAW,aAAa,oBAAoB,oBAAqC;AACvH,QAAM,SAAS;AAEd,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,OAAO;AAAA,QACP,MAAM;AAAA,QACN,aAAa,sBAAsB,CAAC;AAAA,MACrC;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAA4B,CAAA;AAC9B,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACI,YAAA,OAAO,YAAY,WAAW,GAAG;AACpC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,OAAO;AAAA,UACnB,OAAO,OAAO;AAAA,UACd,MAAM,OAAO;AAAA,UACb;AAAA,UACA,SAAS;AAAA,UACT,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IA5BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA+BF;AAEA,MAAM,eAA4E;AAAA,EACjF,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AACrB;"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const TenantForm = require("./TenantForm.cjs");
|
|
5
|
+
const contexts = require("../../contexts.cjs");
|
|
6
|
+
const reactClient = require("@contember/react-client");
|
|
7
|
+
const useRedirectToBacklink = require("../../internal/hooks/useRedirectToBacklink.cjs");
|
|
8
|
+
const useSignInMutation = require("../../hooks/mutations/auth/useSignInMutation.cjs");
|
|
9
|
+
const useLoginForm = contexts.useForm;
|
|
10
|
+
const headers = {
|
|
11
|
+
"X-Contember-Token-Path": "data.mutation.result.token"
|
|
12
|
+
};
|
|
13
|
+
const DEFAULT_LOGIN_EXPIRATION = 14 * 24 * 3600;
|
|
14
|
+
const LoginForm = ({ children, expiration = DEFAULT_LOGIN_EXPIRATION, onSuccess }) => {
|
|
15
|
+
const login = useSignInMutation.useSignInMutation({ headers });
|
|
16
|
+
const redirectToBacklink = useRedirectToBacklink.useRedirectToBacklinkCallback();
|
|
17
|
+
const setSessionToken = reactClient.useSetSessionToken();
|
|
18
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
19
|
+
TenantForm.TenantForm,
|
|
20
|
+
{
|
|
21
|
+
onSuccess: (args) => {
|
|
22
|
+
onSuccess?.();
|
|
23
|
+
setSessionToken(args.result.token);
|
|
24
|
+
redirectToBacklink();
|
|
25
|
+
},
|
|
26
|
+
errorMapping: errorToField,
|
|
27
|
+
initialValues: {
|
|
28
|
+
email: "",
|
|
29
|
+
password: "",
|
|
30
|
+
otpToken: ""
|
|
31
|
+
},
|
|
32
|
+
validate: ({ values, state }) => {
|
|
33
|
+
const errors = [];
|
|
34
|
+
if (!values.email) {
|
|
35
|
+
errors.push({ code: "FIELD_REQUIRED", field: "email" });
|
|
36
|
+
} else if (!values.email.match(/^.+@.+$/)) {
|
|
37
|
+
errors.push({ code: "INVALID_VALUE", field: "email" });
|
|
38
|
+
}
|
|
39
|
+
if (!values.password) {
|
|
40
|
+
errors.push({ code: "FIELD_REQUIRED", field: "password" });
|
|
41
|
+
} else if (values.password.length < 6) {
|
|
42
|
+
errors.push({ code: "INVALID_VALUE", field: "password" });
|
|
43
|
+
}
|
|
44
|
+
if (!values.otpToken && state === "otp-required") {
|
|
45
|
+
errors.push({ code: "FIELD_REQUIRED", field: "otpToken" });
|
|
46
|
+
} else if (values.otpToken && !values.otpToken.match(/^\d{6}$/)) {
|
|
47
|
+
errors.push({ code: "INVALID_VALUE", field: "otpToken" });
|
|
48
|
+
}
|
|
49
|
+
return errors;
|
|
50
|
+
},
|
|
51
|
+
execute: async ({ values }) => {
|
|
52
|
+
const result = await login({
|
|
53
|
+
email: values.email,
|
|
54
|
+
password: values.password,
|
|
55
|
+
otpToken: values.otpToken || void 0,
|
|
56
|
+
expiration
|
|
57
|
+
});
|
|
58
|
+
if (!result.ok && result.error === "OTP_REQUIRED") {
|
|
59
|
+
return { ...result, state: "otp-required" };
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
},
|
|
63
|
+
children
|
|
64
|
+
},
|
|
65
|
+
void 0,
|
|
66
|
+
false,
|
|
67
|
+
{
|
|
68
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/LoginForm.tsx",
|
|
69
|
+
lineNumber: 51,
|
|
70
|
+
columnNumber: 3
|
|
71
|
+
},
|
|
72
|
+
void 0
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
const errorToField = {
|
|
76
|
+
"INVALID_PASSWORD": "password",
|
|
77
|
+
"NO_PASSWORD_SET": "password",
|
|
78
|
+
"UNKNOWN_EMAIL": "email",
|
|
79
|
+
"PERSON_DISABLED": "email",
|
|
80
|
+
"INVALID_OTP_TOKEN": "otpToken",
|
|
81
|
+
"OTP_REQUIRED": void 0
|
|
82
|
+
};
|
|
83
|
+
exports.LoginForm = LoginForm;
|
|
84
|
+
exports.useLoginForm = useLoginForm;
|
|
85
|
+
//# sourceMappingURL=LoginForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginForm.cjs","sources":["../../../../src/components/forms/LoginForm.tsx"],"sourcesContent":["import { ReactElement, useCallback, useMemo } from 'react'\nimport * as TenantApi from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { SignInErrorCode } from '@contember/graphql-client-tenant'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { useSetSessionToken } from '@contember/react-client'\nimport { SignInMutationResult, useSignInMutation } from '../../hooks'\nimport { useRedirectToBacklinkCallback } from '../../internal/hooks/useRedirectToBacklink'\n\n\nexport type LoginFormValues = {\n\temail: string\n\tpassword: string\n\totpToken: string\n}\n\nexport type LoginFormErrorCode =\n\t| SignInErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'UNKNOWN_ERROR'\n\nexport type LoginFormState =\n\t| FormState\n\t| 'otp-required'\n\nexport type LoginFormError = FormError<LoginFormValues, LoginFormErrorCode>\n\nexport type LoginFormContextValue = FormContextValue<LoginFormValues, LoginFormErrorCode, LoginFormState>\n\nexport interface LoginFormProps {\n\texpiration?: number\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const useLoginForm = useForm as () => LoginFormContextValue\n\nconst headers = {\n\t'X-Contember-Token-Path': 'data.mutation.result.token',\n}\n\nconst DEFAULT_LOGIN_EXPIRATION = 14 * 24 * 3600 // 14 days\n\nexport const LoginForm = ({ children, expiration = DEFAULT_LOGIN_EXPIRATION, onSuccess }: LoginFormProps) => {\n\tconst login = useSignInMutation({ headers })\n\tconst redirectToBacklink = useRedirectToBacklinkCallback()\n\tconst setSessionToken = useSetSessionToken()\n\treturn (\n\t\t<TenantForm<LoginFormContextValue, SignInMutationResult>\n\t\t\tonSuccess={args => {\n\t\t\t\tonSuccess?.()\n\t\t\t\tsetSessionToken(args.result.token)\n\t\t\t\tredirectToBacklink()\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\temail: '',\n\t\t\t\tpassword: '',\n\t\t\t\totpToken: '',\n\t\t\t}}\n\t\t\tvalidate={({ values, state }) => {\n\t\t\t\tconst errors: LoginFormError[] = []\n\t\t\t\tif (!values.email) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'email' })\n\t\t\t\t} else if (!values.email.match(/^.+@.+$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'email' })\n\t\t\t\t}\n\n\t\t\t\tif (!values.password) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'password' })\n\t\t\t\t} else if (values.password.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'password' })\n\t\t\t\t}\n\t\t\t\tif (!values.otpToken && state === 'otp-required') {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'otpToken' })\n\t\t\t\t} else if (values.otpToken && !values.otpToken.match(/^\\d{6}$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'otpToken' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\tconst result = await login({\n\t\t\t\t\temail: values.email!,\n\t\t\t\t\tpassword: values.password!,\n\t\t\t\t\totpToken: values.otpToken || undefined,\n\t\t\t\t\texpiration: expiration,\n\t\t\t\t})\n\n\t\t\t\tif (!result.ok && result.error === 'OTP_REQUIRED') {\n\t\t\t\t\treturn { ...result, state: 'otp-required' }\n\t\t\t\t}\n\n\t\t\t\treturn result\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Record<TenantApi.SignInErrorCode, keyof LoginFormValues | undefined> = {\n\t'INVALID_PASSWORD': 'password',\n\t'NO_PASSWORD_SET': 'password',\n\t'UNKNOWN_EMAIL': 'email',\n\t'PERSON_DISABLED': 'email',\n\t'INVALID_OTP_TOKEN': 'otpToken',\n\t'OTP_REQUIRED': undefined,\n}\n"],"names":["useForm","useSignInMutation","useRedirectToBacklinkCallback","useSetSessionToken","jsxDEV","TenantForm","this"],"mappings":";;;;;;;;AAqCO,MAAM,eAAeA,SAAA;AAE5B,MAAM,UAAU;AAAA,EACf,0BAA0B;AAC3B;AAEA,MAAM,2BAA2B,KAAK,KAAK;AAEpC,MAAM,YAAY,CAAC,EAAE,UAAU,aAAa,0BAA0B,gBAAgC;AAC5G,QAAM,QAAQC,kBAAAA,kBAAkB,EAAE,QAAS,CAAA;AAC3C,QAAM,qBAAqBC,sBAAAA;AAC3B,QAAM,kBAAkBC,YAAAA;AAEvB,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA,WAAW,CAAQ,SAAA;AACN;AACI,wBAAA,KAAK,OAAO,KAAK;AACd;MACpB;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,OAAO;AAAA,QACP,UAAU;AAAA,QACV,UAAU;AAAA,MACX;AAAA,MACA,UAAU,CAAC,EAAE,QAAQ,YAAY;AAChC,cAAM,SAA2B,CAAA;AAC7B,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,mBAC5C,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AAC1C,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,SAAS;AAAA,QACtD;AAEI,YAAA,CAAC,OAAO,UAAU;AACrB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAC/C,WAAA,OAAO,SAAS,SAAS,GAAG;AACtC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,YAAY;AAAA,QACzD;AACA,YAAI,CAAC,OAAO,YAAY,UAAU,gBAAgB;AACjD,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAAA,WAC/C,OAAO,YAAY,CAAC,OAAO,SAAS,MAAM,SAAS,GAAG;AAChE,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,YAAY;AAAA,QACzD;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AACxB,cAAA,SAAS,MAAM,MAAM;AAAA,UAC1B,OAAO,OAAO;AAAA,UACd,UAAU,OAAO;AAAA,UACjB,UAAU,OAAO,YAAY;AAAA,UAC7B;AAAA,QAAA,CACA;AAED,YAAI,CAAC,OAAO,MAAM,OAAO,UAAU,gBAAgB;AAClD,iBAAO,EAAE,GAAG,QAAQ,OAAO,eAAe;AAAA,QAC3C;AAEO,eAAA;AAAA,MACR;AAAA,MAEC;AAAA,IAAA;AAAA,IA/CF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAmDF;AACA,MAAM,eAAqF;AAAA,EAC1F,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,gBAAgB;AACjB;;;"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { useSetSessionToken } from "@contember/react-client";
|
|
5
|
+
import { useRedirectToBacklinkCallback } from "../../internal/hooks/useRedirectToBacklink.js";
|
|
6
|
+
import { useSignInMutation } from "../../hooks/mutations/auth/useSignInMutation.js";
|
|
7
|
+
const useLoginForm = useForm;
|
|
8
|
+
const headers = {
|
|
9
|
+
"X-Contember-Token-Path": "data.mutation.result.token"
|
|
10
|
+
};
|
|
11
|
+
const DEFAULT_LOGIN_EXPIRATION = 14 * 24 * 3600;
|
|
12
|
+
const LoginForm = ({ children, expiration = DEFAULT_LOGIN_EXPIRATION, onSuccess }) => {
|
|
13
|
+
const login = useSignInMutation({ headers });
|
|
14
|
+
const redirectToBacklink = useRedirectToBacklinkCallback();
|
|
15
|
+
const setSessionToken = useSetSessionToken();
|
|
16
|
+
return /* @__PURE__ */ jsxDEV(
|
|
17
|
+
TenantForm,
|
|
18
|
+
{
|
|
19
|
+
onSuccess: (args) => {
|
|
20
|
+
onSuccess?.();
|
|
21
|
+
setSessionToken(args.result.token);
|
|
22
|
+
redirectToBacklink();
|
|
23
|
+
},
|
|
24
|
+
errorMapping: errorToField,
|
|
25
|
+
initialValues: {
|
|
26
|
+
email: "",
|
|
27
|
+
password: "",
|
|
28
|
+
otpToken: ""
|
|
29
|
+
},
|
|
30
|
+
validate: ({ values, state }) => {
|
|
31
|
+
const errors = [];
|
|
32
|
+
if (!values.email) {
|
|
33
|
+
errors.push({ code: "FIELD_REQUIRED", field: "email" });
|
|
34
|
+
} else if (!values.email.match(/^.+@.+$/)) {
|
|
35
|
+
errors.push({ code: "INVALID_VALUE", field: "email" });
|
|
36
|
+
}
|
|
37
|
+
if (!values.password) {
|
|
38
|
+
errors.push({ code: "FIELD_REQUIRED", field: "password" });
|
|
39
|
+
} else if (values.password.length < 6) {
|
|
40
|
+
errors.push({ code: "INVALID_VALUE", field: "password" });
|
|
41
|
+
}
|
|
42
|
+
if (!values.otpToken && state === "otp-required") {
|
|
43
|
+
errors.push({ code: "FIELD_REQUIRED", field: "otpToken" });
|
|
44
|
+
} else if (values.otpToken && !values.otpToken.match(/^\d{6}$/)) {
|
|
45
|
+
errors.push({ code: "INVALID_VALUE", field: "otpToken" });
|
|
46
|
+
}
|
|
47
|
+
return errors;
|
|
48
|
+
},
|
|
49
|
+
execute: async ({ values }) => {
|
|
50
|
+
const result = await login({
|
|
51
|
+
email: values.email,
|
|
52
|
+
password: values.password,
|
|
53
|
+
otpToken: values.otpToken || void 0,
|
|
54
|
+
expiration
|
|
55
|
+
});
|
|
56
|
+
if (!result.ok && result.error === "OTP_REQUIRED") {
|
|
57
|
+
return { ...result, state: "otp-required" };
|
|
58
|
+
}
|
|
59
|
+
return result;
|
|
60
|
+
},
|
|
61
|
+
children
|
|
62
|
+
},
|
|
63
|
+
void 0,
|
|
64
|
+
false,
|
|
65
|
+
{
|
|
66
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/LoginForm.tsx",
|
|
67
|
+
lineNumber: 51,
|
|
68
|
+
columnNumber: 3
|
|
69
|
+
},
|
|
70
|
+
void 0
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
const errorToField = {
|
|
74
|
+
"INVALID_PASSWORD": "password",
|
|
75
|
+
"NO_PASSWORD_SET": "password",
|
|
76
|
+
"UNKNOWN_EMAIL": "email",
|
|
77
|
+
"PERSON_DISABLED": "email",
|
|
78
|
+
"INVALID_OTP_TOKEN": "otpToken",
|
|
79
|
+
"OTP_REQUIRED": void 0
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
LoginForm,
|
|
83
|
+
useLoginForm
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=LoginForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginForm.js","sources":["../../../../src/components/forms/LoginForm.tsx"],"sourcesContent":["import { ReactElement, useCallback, useMemo } from 'react'\nimport * as TenantApi from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { SignInErrorCode } from '@contember/graphql-client-tenant'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { useSetSessionToken } from '@contember/react-client'\nimport { SignInMutationResult, useSignInMutation } from '../../hooks'\nimport { useRedirectToBacklinkCallback } from '../../internal/hooks/useRedirectToBacklink'\n\n\nexport type LoginFormValues = {\n\temail: string\n\tpassword: string\n\totpToken: string\n}\n\nexport type LoginFormErrorCode =\n\t| SignInErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'UNKNOWN_ERROR'\n\nexport type LoginFormState =\n\t| FormState\n\t| 'otp-required'\n\nexport type LoginFormError = FormError<LoginFormValues, LoginFormErrorCode>\n\nexport type LoginFormContextValue = FormContextValue<LoginFormValues, LoginFormErrorCode, LoginFormState>\n\nexport interface LoginFormProps {\n\texpiration?: number\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const useLoginForm = useForm as () => LoginFormContextValue\n\nconst headers = {\n\t'X-Contember-Token-Path': 'data.mutation.result.token',\n}\n\nconst DEFAULT_LOGIN_EXPIRATION = 14 * 24 * 3600 // 14 days\n\nexport const LoginForm = ({ children, expiration = DEFAULT_LOGIN_EXPIRATION, onSuccess }: LoginFormProps) => {\n\tconst login = useSignInMutation({ headers })\n\tconst redirectToBacklink = useRedirectToBacklinkCallback()\n\tconst setSessionToken = useSetSessionToken()\n\treturn (\n\t\t<TenantForm<LoginFormContextValue, SignInMutationResult>\n\t\t\tonSuccess={args => {\n\t\t\t\tonSuccess?.()\n\t\t\t\tsetSessionToken(args.result.token)\n\t\t\t\tredirectToBacklink()\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\temail: '',\n\t\t\t\tpassword: '',\n\t\t\t\totpToken: '',\n\t\t\t}}\n\t\t\tvalidate={({ values, state }) => {\n\t\t\t\tconst errors: LoginFormError[] = []\n\t\t\t\tif (!values.email) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'email' })\n\t\t\t\t} else if (!values.email.match(/^.+@.+$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'email' })\n\t\t\t\t}\n\n\t\t\t\tif (!values.password) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'password' })\n\t\t\t\t} else if (values.password.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'password' })\n\t\t\t\t}\n\t\t\t\tif (!values.otpToken && state === 'otp-required') {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'otpToken' })\n\t\t\t\t} else if (values.otpToken && !values.otpToken.match(/^\\d{6}$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'otpToken' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\tconst result = await login({\n\t\t\t\t\temail: values.email!,\n\t\t\t\t\tpassword: values.password!,\n\t\t\t\t\totpToken: values.otpToken || undefined,\n\t\t\t\t\texpiration: expiration,\n\t\t\t\t})\n\n\t\t\t\tif (!result.ok && result.error === 'OTP_REQUIRED') {\n\t\t\t\t\treturn { ...result, state: 'otp-required' }\n\t\t\t\t}\n\n\t\t\t\treturn result\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Record<TenantApi.SignInErrorCode, keyof LoginFormValues | undefined> = {\n\t'INVALID_PASSWORD': 'password',\n\t'NO_PASSWORD_SET': 'password',\n\t'UNKNOWN_EMAIL': 'email',\n\t'PERSON_DISABLED': 'email',\n\t'INVALID_OTP_TOKEN': 'otpToken',\n\t'OTP_REQUIRED': undefined,\n}\n"],"names":["this"],"mappings":";;;;;;AAqCO,MAAM,eAAe;AAE5B,MAAM,UAAU;AAAA,EACf,0BAA0B;AAC3B;AAEA,MAAM,2BAA2B,KAAK,KAAK;AAEpC,MAAM,YAAY,CAAC,EAAE,UAAU,aAAa,0BAA0B,gBAAgC;AAC5G,QAAM,QAAQ,kBAAkB,EAAE,QAAS,CAAA;AAC3C,QAAM,qBAAqB;AAC3B,QAAM,kBAAkB;AAEvB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,WAAW,CAAQ,SAAA;AACN;AACI,wBAAA,KAAK,OAAO,KAAK;AACd;MACpB;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,OAAO;AAAA,QACP,UAAU;AAAA,QACV,UAAU;AAAA,MACX;AAAA,MACA,UAAU,CAAC,EAAE,QAAQ,YAAY;AAChC,cAAM,SAA2B,CAAA;AAC7B,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,mBAC5C,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AAC1C,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,SAAS;AAAA,QACtD;AAEI,YAAA,CAAC,OAAO,UAAU;AACrB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAC/C,WAAA,OAAO,SAAS,SAAS,GAAG;AACtC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,YAAY;AAAA,QACzD;AACA,YAAI,CAAC,OAAO,YAAY,UAAU,gBAAgB;AACjD,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAAA,WAC/C,OAAO,YAAY,CAAC,OAAO,SAAS,MAAM,SAAS,GAAG;AAChE,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,YAAY;AAAA,QACzD;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AACxB,cAAA,SAAS,MAAM,MAAM;AAAA,UAC1B,OAAO,OAAO;AAAA,UACd,UAAU,OAAO;AAAA,UACjB,UAAU,OAAO,YAAY;AAAA,UAC7B;AAAA,QAAA,CACA;AAED,YAAI,CAAC,OAAO,MAAM,OAAO,UAAU,gBAAgB;AAClD,iBAAO,EAAE,GAAG,QAAQ,OAAO,eAAe;AAAA,QAC3C;AAEO,eAAA;AAAA,MACR;AAAA,MAEC;AAAA,IAAA;AAAA,IA/CF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAmDF;AACA,MAAM,eAAqF;AAAA,EAC1F,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,gBAAgB;AACjB;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const TenantForm = require("./TenantForm.cjs");
|
|
5
|
+
const contexts = require("../../contexts.cjs");
|
|
6
|
+
const useConfirmOtpMutation = require("../../hooks/mutations/otp/useConfirmOtpMutation.cjs");
|
|
7
|
+
const useOtpConfirmForm = contexts.useForm;
|
|
8
|
+
const OtpConfirmForm = ({ children, onSuccess }) => {
|
|
9
|
+
const confirmOtp = useConfirmOtpMutation.useConfirmOtpMutation();
|
|
10
|
+
const { refreshIdentity } = contexts.useIdentityMethods();
|
|
11
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
12
|
+
TenantForm.TenantForm,
|
|
13
|
+
{
|
|
14
|
+
onSuccess: async (args) => {
|
|
15
|
+
await refreshIdentity();
|
|
16
|
+
onSuccess?.();
|
|
17
|
+
},
|
|
18
|
+
initialValues: {
|
|
19
|
+
otpToken: ""
|
|
20
|
+
},
|
|
21
|
+
validate: ({ values }) => {
|
|
22
|
+
if (!values.otpToken) {
|
|
23
|
+
return [{ code: "FIELD_REQUIRED", field: "otpToken" }];
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
execute: async ({ values }) => {
|
|
27
|
+
return await confirmOtp({
|
|
28
|
+
otpToken: values.otpToken
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
errorMapping: {
|
|
32
|
+
INVALID_OTP_TOKEN: "otpToken",
|
|
33
|
+
NOT_PREPARED: "otpToken"
|
|
34
|
+
},
|
|
35
|
+
children
|
|
36
|
+
},
|
|
37
|
+
void 0,
|
|
38
|
+
false,
|
|
39
|
+
{
|
|
40
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/OtpConfirmForm.tsx",
|
|
41
|
+
lineNumber: 34,
|
|
42
|
+
columnNumber: 3
|
|
43
|
+
},
|
|
44
|
+
void 0
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
exports.OtpConfirmForm = OtpConfirmForm;
|
|
48
|
+
exports.useOtpConfirmForm = useOtpConfirmForm;
|
|
49
|
+
//# sourceMappingURL=OtpConfirmForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtpConfirmForm.cjs","sources":["../../../../src/components/forms/OtpConfirmForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm, useIdentityMethods } from '../../contexts'\nimport { ConfirmOtpErrorCode } from '@contember/graphql-client-tenant'\nimport { useConfirmOtpMutation } from '../../hooks'\n\nexport type OtpConfirmFormValues = {\n\totpToken: string\n}\n\nexport type OtpConfirmFormErrorCode =\n\t| ConfirmOtpErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'UNKNOWN_ERROR'\n\nexport type OtpConfirmFormState = FormState\n\nexport type OtpConfirmFormError = FormError<OtpConfirmFormValues, OtpConfirmFormErrorCode>\n\nexport type OtpConfirmFormContextValue = FormContextValue<OtpConfirmFormValues, OtpConfirmFormErrorCode>\n\nexport interface OtpConfirmFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const useOtpConfirmForm = useForm as () => OtpConfirmFormContextValue\n\nexport const OtpConfirmForm = ({ children, onSuccess }: OtpConfirmFormProps) => {\n\tconst confirmOtp = useConfirmOtpMutation()\n\tconst { refreshIdentity } = useIdentityMethods()\n\treturn (\n\t\t<TenantForm<OtpConfirmFormContextValue>\n\t\t\tonSuccess={async args => {\n\t\t\t\tawait refreshIdentity()\n\t\t\t\tonSuccess?.()\n\t\t\t}}\n\t\t\tinitialValues={{\n\t\t\t\totpToken: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tif (!values.otpToken) {\n\t\t\t\t\treturn [{ code: 'FIELD_REQUIRED', field: 'otpToken' }]\n\t\t\t\t}\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await confirmOtp({\n\t\t\t\t\t otpToken: values.otpToken,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={{\n\t\t\t\tINVALID_OTP_TOKEN: 'otpToken',\n\t\t\t\tNOT_PREPARED: 'otpToken',\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\n"],"names":["useForm","useConfirmOtpMutation","useIdentityMethods","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA2BO,MAAM,oBAAoBA,SAAA;AAE1B,MAAM,iBAAiB,CAAC,EAAE,UAAU,gBAAqC;AAC/E,QAAM,aAAaC,sBAAAA;AACb,QAAA,EAAE,oBAAoBC,SAAAA;AAE3B,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA,WAAW,OAAM,SAAQ;AACxB,cAAM,gBAAgB;AACV;MACb;AAAA,MACA,eAAe;AAAA,QACd,UAAU;AAAA,MACX;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACrB,YAAA,CAAC,OAAO,UAAU;AACrB,iBAAO,CAAC,EAAE,MAAM,kBAAkB,OAAO,WAAY,CAAA;AAAA,QACtD;AAAA,MACD;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,WAAW;AAAA,UACtB,UAAU,OAAO;AAAA,QAAA,CAClB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,QACb,mBAAmB;AAAA,QACnB,cAAc;AAAA,MACf;AAAA,MAEC;AAAA,IAAA;AAAA,IAvBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AA0BF;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm, useIdentityMethods } from "../../contexts.js";
|
|
4
|
+
import { useConfirmOtpMutation } from "../../hooks/mutations/otp/useConfirmOtpMutation.js";
|
|
5
|
+
const useOtpConfirmForm = useForm;
|
|
6
|
+
const OtpConfirmForm = ({ children, onSuccess }) => {
|
|
7
|
+
const confirmOtp = useConfirmOtpMutation();
|
|
8
|
+
const { refreshIdentity } = useIdentityMethods();
|
|
9
|
+
return /* @__PURE__ */ jsxDEV(
|
|
10
|
+
TenantForm,
|
|
11
|
+
{
|
|
12
|
+
onSuccess: async (args) => {
|
|
13
|
+
await refreshIdentity();
|
|
14
|
+
onSuccess?.();
|
|
15
|
+
},
|
|
16
|
+
initialValues: {
|
|
17
|
+
otpToken: ""
|
|
18
|
+
},
|
|
19
|
+
validate: ({ values }) => {
|
|
20
|
+
if (!values.otpToken) {
|
|
21
|
+
return [{ code: "FIELD_REQUIRED", field: "otpToken" }];
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
execute: async ({ values }) => {
|
|
25
|
+
return await confirmOtp({
|
|
26
|
+
otpToken: values.otpToken
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
errorMapping: {
|
|
30
|
+
INVALID_OTP_TOKEN: "otpToken",
|
|
31
|
+
NOT_PREPARED: "otpToken"
|
|
32
|
+
},
|
|
33
|
+
children
|
|
34
|
+
},
|
|
35
|
+
void 0,
|
|
36
|
+
false,
|
|
37
|
+
{
|
|
38
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/OtpConfirmForm.tsx",
|
|
39
|
+
lineNumber: 34,
|
|
40
|
+
columnNumber: 3
|
|
41
|
+
},
|
|
42
|
+
void 0
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
OtpConfirmForm,
|
|
47
|
+
useOtpConfirmForm
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=OtpConfirmForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtpConfirmForm.js","sources":["../../../../src/components/forms/OtpConfirmForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm, useIdentityMethods } from '../../contexts'\nimport { ConfirmOtpErrorCode } from '@contember/graphql-client-tenant'\nimport { useConfirmOtpMutation } from '../../hooks'\n\nexport type OtpConfirmFormValues = {\n\totpToken: string\n}\n\nexport type OtpConfirmFormErrorCode =\n\t| ConfirmOtpErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'UNKNOWN_ERROR'\n\nexport type OtpConfirmFormState = FormState\n\nexport type OtpConfirmFormError = FormError<OtpConfirmFormValues, OtpConfirmFormErrorCode>\n\nexport type OtpConfirmFormContextValue = FormContextValue<OtpConfirmFormValues, OtpConfirmFormErrorCode>\n\nexport interface OtpConfirmFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const useOtpConfirmForm = useForm as () => OtpConfirmFormContextValue\n\nexport const OtpConfirmForm = ({ children, onSuccess }: OtpConfirmFormProps) => {\n\tconst confirmOtp = useConfirmOtpMutation()\n\tconst { refreshIdentity } = useIdentityMethods()\n\treturn (\n\t\t<TenantForm<OtpConfirmFormContextValue>\n\t\t\tonSuccess={async args => {\n\t\t\t\tawait refreshIdentity()\n\t\t\t\tonSuccess?.()\n\t\t\t}}\n\t\t\tinitialValues={{\n\t\t\t\totpToken: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tif (!values.otpToken) {\n\t\t\t\t\treturn [{ code: 'FIELD_REQUIRED', field: 'otpToken' }]\n\t\t\t\t}\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await confirmOtp({\n\t\t\t\t\t otpToken: values.otpToken,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={{\n\t\t\t\tINVALID_OTP_TOKEN: 'otpToken',\n\t\t\t\tNOT_PREPARED: 'otpToken',\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\n"],"names":["this"],"mappings":";;;;AA2BO,MAAM,oBAAoB;AAE1B,MAAM,iBAAiB,CAAC,EAAE,UAAU,gBAAqC;AAC/E,QAAM,aAAa;AACb,QAAA,EAAE,oBAAoB;AAE3B,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,WAAW,OAAM,SAAQ;AACxB,cAAM,gBAAgB;AACV;MACb;AAAA,MACA,eAAe;AAAA,QACd,UAAU;AAAA,MACX;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACrB,YAAA,CAAC,OAAO,UAAU;AACrB,iBAAO,CAAC,EAAE,MAAM,kBAAkB,OAAO,WAAY,CAAA;AAAA,QACtD;AAAA,MACD;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,WAAW;AAAA,UACtB,UAAU,OAAO;AAAA,QAAA,CAClB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,QACb,mBAAmB;AAAA,QACnB,cAAc;AAAA,MACf;AAAA,MAEC;AAAA,IAAA;AAAA,IAvBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA0BF;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const TenantForm = require("./TenantForm.cjs");
|
|
5
|
+
const contexts = require("../../contexts.cjs");
|
|
6
|
+
const usePrepareOtpMutation = require("../../hooks/mutations/otp/usePrepareOtpMutation.cjs");
|
|
7
|
+
const useOtpPrepareForm = contexts.useForm;
|
|
8
|
+
const OtpPrepareForm = ({ children, onSuccess }) => {
|
|
9
|
+
const prepareOtp = usePrepareOtpMutation.usePrepareOtpMutation();
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
initialValues: {
|
|
15
|
+
label: window.location.hostname
|
|
16
|
+
},
|
|
17
|
+
execute: async ({ values }) => {
|
|
18
|
+
return await prepareOtp({
|
|
19
|
+
label: values.label
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
children
|
|
23
|
+
},
|
|
24
|
+
void 0,
|
|
25
|
+
false,
|
|
26
|
+
{
|
|
27
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/OtpPrepareForm.tsx",
|
|
28
|
+
lineNumber: 30,
|
|
29
|
+
columnNumber: 3
|
|
30
|
+
},
|
|
31
|
+
void 0
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
exports.OtpPrepareForm = OtpPrepareForm;
|
|
35
|
+
exports.useOtpPrepareForm = useOtpPrepareForm;
|
|
36
|
+
//# sourceMappingURL=OtpPrepareForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtpPrepareForm.cjs","sources":["../../../../src/components/forms/OtpPrepareForm.tsx"],"sourcesContent":["import { ReactElement, useCallback, useMemo } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { PrepareOtpMutationResult, usePrepareOtpMutation } from '../../hooks'\n\nexport type OtpPrepareFormValues = {\n\tlabel: string\n}\n\nexport type OtpPrepareFormErrorCode =\n\t| 'UNKNOWN_ERROR'\n\nexport type OtpPrepareFormState = FormState\n\nexport type OtpPrepareFormError = FormError<OtpPrepareFormValues, OtpPrepareFormErrorCode>\n\nexport type OtpPrepareFormContextValue = FormContextValue<OtpPrepareFormValues, OtpPrepareFormErrorCode>\n\nexport interface OtpPrepareFormProps {\n\tchildren: ReactElement\n\tonSuccess?: (args: { result: PrepareOtpMutationResult }) => void\n}\n\nexport const useOtpPrepareForm = useForm as () => OtpPrepareFormContextValue\n\nexport const OtpPrepareForm = ({ children, onSuccess }: OtpPrepareFormProps) => {\n\tconst prepareOtp = usePrepareOtpMutation()\n\treturn (\n\t\t<TenantForm<OtpPrepareFormContextValue, PrepareOtpMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\tlabel: window.location.hostname,\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await prepareOtp({\n\t\t\t\t\tlabel: values.label,\n\t\t\t\t})\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\n"],"names":["useForm","usePrepareOtpMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AAwBO,MAAM,oBAAoBA,SAAA;AAE1B,MAAM,iBAAiB,CAAC,EAAE,UAAU,gBAAqC;AAC/E,QAAM,aAAaC,sBAAAA;AAElB,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,OAAO,OAAO,SAAS;AAAA,MACxB;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,WAAW;AAAA,UACvB,OAAO,OAAO;AAAA,QAAA,CACd;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IAXF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAcF;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { usePrepareOtpMutation } from "../../hooks/mutations/otp/usePrepareOtpMutation.js";
|
|
5
|
+
const useOtpPrepareForm = useForm;
|
|
6
|
+
const OtpPrepareForm = ({ children, onSuccess }) => {
|
|
7
|
+
const prepareOtp = usePrepareOtpMutation();
|
|
8
|
+
return /* @__PURE__ */ jsxDEV(
|
|
9
|
+
TenantForm,
|
|
10
|
+
{
|
|
11
|
+
onSuccess,
|
|
12
|
+
initialValues: {
|
|
13
|
+
label: window.location.hostname
|
|
14
|
+
},
|
|
15
|
+
execute: async ({ values }) => {
|
|
16
|
+
return await prepareOtp({
|
|
17
|
+
label: values.label
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
children
|
|
21
|
+
},
|
|
22
|
+
void 0,
|
|
23
|
+
false,
|
|
24
|
+
{
|
|
25
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/OtpPrepareForm.tsx",
|
|
26
|
+
lineNumber: 30,
|
|
27
|
+
columnNumber: 3
|
|
28
|
+
},
|
|
29
|
+
void 0
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
OtpPrepareForm,
|
|
34
|
+
useOtpPrepareForm
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=OtpPrepareForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtpPrepareForm.js","sources":["../../../../src/components/forms/OtpPrepareForm.tsx"],"sourcesContent":["import { ReactElement, useCallback, useMemo } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { PrepareOtpMutationResult, usePrepareOtpMutation } from '../../hooks'\n\nexport type OtpPrepareFormValues = {\n\tlabel: string\n}\n\nexport type OtpPrepareFormErrorCode =\n\t| 'UNKNOWN_ERROR'\n\nexport type OtpPrepareFormState = FormState\n\nexport type OtpPrepareFormError = FormError<OtpPrepareFormValues, OtpPrepareFormErrorCode>\n\nexport type OtpPrepareFormContextValue = FormContextValue<OtpPrepareFormValues, OtpPrepareFormErrorCode>\n\nexport interface OtpPrepareFormProps {\n\tchildren: ReactElement\n\tonSuccess?: (args: { result: PrepareOtpMutationResult }) => void\n}\n\nexport const useOtpPrepareForm = useForm as () => OtpPrepareFormContextValue\n\nexport const OtpPrepareForm = ({ children, onSuccess }: OtpPrepareFormProps) => {\n\tconst prepareOtp = usePrepareOtpMutation()\n\treturn (\n\t\t<TenantForm<OtpPrepareFormContextValue, PrepareOtpMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\tlabel: window.location.hostname,\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await prepareOtp({\n\t\t\t\t\tlabel: values.label,\n\t\t\t\t})\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\n"],"names":["this"],"mappings":";;;;AAwBO,MAAM,oBAAoB;AAE1B,MAAM,iBAAiB,CAAC,EAAE,UAAU,gBAAqC;AAC/E,QAAM,aAAa;AAElB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,OAAO,OAAO,SAAS;AAAA,MACxB;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,WAAW;AAAA,UACvB,OAAO,OAAO;AAAA,QAAA,CACd;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IAXF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAcF;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const TenantForm = require("./TenantForm.cjs");
|
|
5
|
+
const contexts = require("../../contexts.cjs");
|
|
6
|
+
const useResetPasswordMutation = require("../../hooks/mutations/passwordReset/useResetPasswordMutation.cjs");
|
|
7
|
+
const usePasswordResetForm = contexts.useForm;
|
|
8
|
+
const PasswordResetForm = ({ children, onSuccess, token }) => {
|
|
9
|
+
const createReset = useResetPasswordMutation.useResetPasswordMutation();
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
errorMapping: errorToField,
|
|
15
|
+
initialValues: {
|
|
16
|
+
token: token ?? "",
|
|
17
|
+
password: "",
|
|
18
|
+
passwordConfirmation: ""
|
|
19
|
+
},
|
|
20
|
+
validate: ({ values }) => {
|
|
21
|
+
const errors = [];
|
|
22
|
+
if (!values.token) {
|
|
23
|
+
errors.push({ code: "FIELD_REQUIRED", field: "token" });
|
|
24
|
+
}
|
|
25
|
+
if (!values.password) {
|
|
26
|
+
errors.push({ code: "FIELD_REQUIRED", field: "password" });
|
|
27
|
+
} else if (values.password.length < 6) {
|
|
28
|
+
errors.push({ code: "INVALID_VALUE", field: "password" });
|
|
29
|
+
} else if (!values.passwordConfirmation) {
|
|
30
|
+
errors.push({ code: "FIELD_REQUIRED", field: "passwordConfirmation" });
|
|
31
|
+
} else if (values.password !== values.passwordConfirmation) {
|
|
32
|
+
errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
|
|
33
|
+
}
|
|
34
|
+
return errors;
|
|
35
|
+
},
|
|
36
|
+
execute: async ({ values }) => {
|
|
37
|
+
return await createReset({
|
|
38
|
+
password: values.password,
|
|
39
|
+
token: values.token
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
children
|
|
43
|
+
},
|
|
44
|
+
void 0,
|
|
45
|
+
false,
|
|
46
|
+
{
|
|
47
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/PasswordResetForm.tsx",
|
|
48
|
+
lineNumber: 39,
|
|
49
|
+
columnNumber: 3
|
|
50
|
+
},
|
|
51
|
+
void 0
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
const errorToField = {
|
|
55
|
+
PASSWORD_TOO_WEAK: "password",
|
|
56
|
+
TOKEN_EXPIRED: "token",
|
|
57
|
+
TOKEN_NOT_FOUND: "token",
|
|
58
|
+
TOKEN_USED: "token"
|
|
59
|
+
};
|
|
60
|
+
exports.PasswordResetForm = PasswordResetForm;
|
|
61
|
+
exports.usePasswordResetForm = usePasswordResetForm;
|
|
62
|
+
//# sourceMappingURL=PasswordResetForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordResetForm.cjs","sources":["../../../../src/components/forms/PasswordResetForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport * as TenantApi from '@contember/graphql-client-tenant'\nimport { ResetPasswordErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { useResetPasswordMutation } from '../../hooks'\n\nexport type PasswordResetFormValues = {\n\ttoken: string\n\tpassword: string\n\tpasswordConfirmation: string\n}\n\nexport type PasswordResetFormErrorCode =\n\t| ResetPasswordErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type PasswordResetFormState = FormState\n\nexport type PasswordResetFormError = FormError<PasswordResetFormValues, PasswordResetFormErrorCode>\n\nexport type PasswordResetFormContextValue = FormContextValue<PasswordResetFormValues, PasswordResetFormErrorCode>\n\nexport interface PasswordResetFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n\ttoken?: string\n}\n\nexport const usePasswordResetForm = useForm as () => PasswordResetFormContextValue\n\nexport const PasswordResetForm = ({ children, onSuccess, token }: PasswordResetFormProps) => {\n\tconst createReset = useResetPasswordMutation()\n\treturn (\n\t\t<TenantForm<PasswordResetFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\ttoken: token ?? '',\n\t\t\t\tpassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: PasswordResetFormError[] = []\n\t\t\t\tif (!values.token) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'token' })\n\t\t\t\t}\n\t\t\t\tif (!values.password) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'password' })\n\t\t\t\t} else if (values.password.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'password' })\n\t\t\t\t} else if (!values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'passwordConfirmation' })\n\t\t\t\t} else if (values.password !== values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await createReset({\n\t\t\t\t\tpassword: values.password,\n\t\t\t\t\ttoken: values.token,\n\t\t\t\t})\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Record<TenantApi.ResetPasswordErrorCode, keyof PasswordResetFormValues | undefined> = {\n\tPASSWORD_TOO_WEAK: 'password',\n\tTOKEN_EXPIRED: 'token',\n\tTOKEN_NOT_FOUND: 'token',\n\tTOKEN_USED: 'token',\n}\n"],"names":["useForm","useResetPasswordMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AAiCO,MAAM,uBAAuBA,SAAA;AAE7B,MAAM,oBAAoB,CAAC,EAAE,UAAU,WAAW,YAAoC;AAC5F,QAAM,cAAcC,yBAAAA;AAEnB,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,OAAO,SAAS;AAAA,QAChB,UAAU;AAAA,QACV,sBAAsB;AAAA,MACvB;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAmC,CAAA;AACrC,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACI,YAAA,CAAC,OAAO,UAAU;AACrB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAC/C,WAAA,OAAO,SAAS,SAAS,GAAG;AACtC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,YAAY;AAAA,QAAA,WAC9C,CAAC,OAAO,sBAAsB;AACxC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,wBAAwB;AAAA,QAC3D,WAAA,OAAO,aAAa,OAAO,sBAAsB;AAC3D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,YAAY;AAAA,UACxB,UAAU,OAAO;AAAA,UACjB,OAAO,OAAO;AAAA,QAAA,CACd;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IA/BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAmCF;AACA,MAAM,eAAoG;AAAA,EACzG,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,YAAY;AACb;;;"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { useResetPasswordMutation } from "../../hooks/mutations/passwordReset/useResetPasswordMutation.js";
|
|
5
|
+
const usePasswordResetForm = useForm;
|
|
6
|
+
const PasswordResetForm = ({ children, onSuccess, token }) => {
|
|
7
|
+
const createReset = useResetPasswordMutation();
|
|
8
|
+
return /* @__PURE__ */ jsxDEV(
|
|
9
|
+
TenantForm,
|
|
10
|
+
{
|
|
11
|
+
onSuccess,
|
|
12
|
+
errorMapping: errorToField,
|
|
13
|
+
initialValues: {
|
|
14
|
+
token: token ?? "",
|
|
15
|
+
password: "",
|
|
16
|
+
passwordConfirmation: ""
|
|
17
|
+
},
|
|
18
|
+
validate: ({ values }) => {
|
|
19
|
+
const errors = [];
|
|
20
|
+
if (!values.token) {
|
|
21
|
+
errors.push({ code: "FIELD_REQUIRED", field: "token" });
|
|
22
|
+
}
|
|
23
|
+
if (!values.password) {
|
|
24
|
+
errors.push({ code: "FIELD_REQUIRED", field: "password" });
|
|
25
|
+
} else if (values.password.length < 6) {
|
|
26
|
+
errors.push({ code: "INVALID_VALUE", field: "password" });
|
|
27
|
+
} else if (!values.passwordConfirmation) {
|
|
28
|
+
errors.push({ code: "FIELD_REQUIRED", field: "passwordConfirmation" });
|
|
29
|
+
} else if (values.password !== values.passwordConfirmation) {
|
|
30
|
+
errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
|
|
31
|
+
}
|
|
32
|
+
return errors;
|
|
33
|
+
},
|
|
34
|
+
execute: async ({ values }) => {
|
|
35
|
+
return await createReset({
|
|
36
|
+
password: values.password,
|
|
37
|
+
token: values.token
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
children
|
|
41
|
+
},
|
|
42
|
+
void 0,
|
|
43
|
+
false,
|
|
44
|
+
{
|
|
45
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/PasswordResetForm.tsx",
|
|
46
|
+
lineNumber: 39,
|
|
47
|
+
columnNumber: 3
|
|
48
|
+
},
|
|
49
|
+
void 0
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
const errorToField = {
|
|
53
|
+
PASSWORD_TOO_WEAK: "password",
|
|
54
|
+
TOKEN_EXPIRED: "token",
|
|
55
|
+
TOKEN_NOT_FOUND: "token",
|
|
56
|
+
TOKEN_USED: "token"
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
PasswordResetForm,
|
|
60
|
+
usePasswordResetForm
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=PasswordResetForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordResetForm.js","sources":["../../../../src/components/forms/PasswordResetForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport * as TenantApi from '@contember/graphql-client-tenant'\nimport { ResetPasswordErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { useResetPasswordMutation } from '../../hooks'\n\nexport type PasswordResetFormValues = {\n\ttoken: string\n\tpassword: string\n\tpasswordConfirmation: string\n}\n\nexport type PasswordResetFormErrorCode =\n\t| ResetPasswordErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type PasswordResetFormState = FormState\n\nexport type PasswordResetFormError = FormError<PasswordResetFormValues, PasswordResetFormErrorCode>\n\nexport type PasswordResetFormContextValue = FormContextValue<PasswordResetFormValues, PasswordResetFormErrorCode>\n\nexport interface PasswordResetFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n\ttoken?: string\n}\n\nexport const usePasswordResetForm = useForm as () => PasswordResetFormContextValue\n\nexport const PasswordResetForm = ({ children, onSuccess, token }: PasswordResetFormProps) => {\n\tconst createReset = useResetPasswordMutation()\n\treturn (\n\t\t<TenantForm<PasswordResetFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\ttoken: token ?? '',\n\t\t\t\tpassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: PasswordResetFormError[] = []\n\t\t\t\tif (!values.token) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'token' })\n\t\t\t\t}\n\t\t\t\tif (!values.password) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'password' })\n\t\t\t\t} else if (values.password.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'password' })\n\t\t\t\t} else if (!values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'passwordConfirmation' })\n\t\t\t\t} else if (values.password !== values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await createReset({\n\t\t\t\t\tpassword: values.password,\n\t\t\t\t\ttoken: values.token,\n\t\t\t\t})\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Record<TenantApi.ResetPasswordErrorCode, keyof PasswordResetFormValues | undefined> = {\n\tPASSWORD_TOO_WEAK: 'password',\n\tTOKEN_EXPIRED: 'token',\n\tTOKEN_NOT_FOUND: 'token',\n\tTOKEN_USED: 'token',\n}\n"],"names":["this"],"mappings":";;;;AAiCO,MAAM,uBAAuB;AAE7B,MAAM,oBAAoB,CAAC,EAAE,UAAU,WAAW,YAAoC;AAC5F,QAAM,cAAc;AAEnB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,OAAO,SAAS;AAAA,QAChB,UAAU;AAAA,QACV,sBAAsB;AAAA,MACvB;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAmC,CAAA;AACrC,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACI,YAAA,CAAC,OAAO,UAAU;AACrB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAC/C,WAAA,OAAO,SAAS,SAAS,GAAG;AACtC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,YAAY;AAAA,QAAA,WAC9C,CAAC,OAAO,sBAAsB;AACxC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,wBAAwB;AAAA,QAC3D,WAAA,OAAO,aAAa,OAAO,sBAAsB;AAC3D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,YAAY;AAAA,UACxB,UAAU,OAAO;AAAA,UACjB,OAAO,OAAO;AAAA,QAAA,CACd;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IA/BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAmCF;AACA,MAAM,eAAoG;AAAA,EACzG,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,YAAY;AACb;"}
|