@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,14 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react'
|
|
2
|
+
import { IdentityStateValue } from '../types'
|
|
3
|
+
import { useIdentityState } from '../contexts'
|
|
4
|
+
|
|
5
|
+
export interface IdentityStateProps {
|
|
6
|
+
state: IdentityStateValue | IdentityStateValue[]
|
|
7
|
+
children: ReactNode
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const IdentityState = ({ state, children }: IdentityStateProps) => {
|
|
11
|
+
const currentState = useIdentityState()
|
|
12
|
+
|
|
13
|
+
return state === currentState || (Array.isArray(state) && state.includes(currentState)) ? <>{children}</> : null
|
|
14
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ReactElement } from 'react'
|
|
2
|
+
import { ChangeMyPasswordErrorCode } from '@contember/graphql-client-tenant'
|
|
3
|
+
import { TenantForm } from './TenantForm'
|
|
4
|
+
import { FormContextValue, FormError, FormState } from '../../types'
|
|
5
|
+
import { useForm } from '../../contexts'
|
|
6
|
+
import { useChangeMyPasswordMutation } from '../../hooks'
|
|
7
|
+
|
|
8
|
+
export type ChangeMyPasswordFormValues = {
|
|
9
|
+
currentPassword: string
|
|
10
|
+
newPassword: string
|
|
11
|
+
passwordConfirmation: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type ChangeMyPasswordFormErrorCode =
|
|
15
|
+
| ChangeMyPasswordErrorCode
|
|
16
|
+
| 'FIELD_REQUIRED'
|
|
17
|
+
| 'INVALID_VALUE'
|
|
18
|
+
| 'PASSWORD_MISMATCH'
|
|
19
|
+
| 'UNKNOWN_ERROR'
|
|
20
|
+
|
|
21
|
+
export type ChangeMyPasswordFormState = FormState
|
|
22
|
+
|
|
23
|
+
export type ChangeMyPasswordFormError = FormError<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>
|
|
24
|
+
|
|
25
|
+
export type ChangeMyPasswordFormContextValue = FormContextValue<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>
|
|
26
|
+
|
|
27
|
+
export interface ChangeMyPasswordFormProps {
|
|
28
|
+
children: ReactElement
|
|
29
|
+
onSuccess?: () => void
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const useChangeMyPasswordForm = useForm as () => ChangeMyPasswordFormContextValue
|
|
33
|
+
|
|
34
|
+
export const ChangeMyPasswordForm = ({ children, onSuccess }: ChangeMyPasswordFormProps) => {
|
|
35
|
+
const changePassword = useChangeMyPasswordMutation()
|
|
36
|
+
return (
|
|
37
|
+
<TenantForm<ChangeMyPasswordFormContextValue>
|
|
38
|
+
onSuccess={onSuccess}
|
|
39
|
+
errorMapping={errorToField}
|
|
40
|
+
initialValues={{
|
|
41
|
+
currentPassword: '',
|
|
42
|
+
newPassword: '',
|
|
43
|
+
passwordConfirmation: '',
|
|
44
|
+
}}
|
|
45
|
+
validate={({ values }) => {
|
|
46
|
+
const errors: ChangeMyPasswordFormError[] = []
|
|
47
|
+
if (!values.currentPassword) {
|
|
48
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'currentPassword' })
|
|
49
|
+
}
|
|
50
|
+
if (!values.newPassword) {
|
|
51
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'newPassword' })
|
|
52
|
+
} else if (values.newPassword.length < 6) {
|
|
53
|
+
errors.push({ code: 'INVALID_VALUE', field: 'newPassword' })
|
|
54
|
+
} else if (!values.passwordConfirmation) {
|
|
55
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'passwordConfirmation' })
|
|
56
|
+
} else if (values.newPassword !== values.passwordConfirmation) {
|
|
57
|
+
errors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })
|
|
58
|
+
}
|
|
59
|
+
return errors
|
|
60
|
+
}}
|
|
61
|
+
execute={async ({ values }) => {
|
|
62
|
+
return await changePassword(values)
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
{children}
|
|
66
|
+
</TenantForm>
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
const errorToField: Partial<Record<ChangeMyPasswordFormErrorCode, keyof ChangeMyPasswordFormValues | undefined>> = {
|
|
71
|
+
PASSWORD_MISMATCH: 'passwordConfirmation',
|
|
72
|
+
TOO_WEAK: 'newPassword',
|
|
73
|
+
NO_PASSWORD_SET: 'currentPassword',
|
|
74
|
+
INVALID_PASSWORD: 'currentPassword',
|
|
75
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ReactElement } from 'react'
|
|
2
|
+
import { TenantForm } from './TenantForm'
|
|
3
|
+
import { FormContextValue, FormError, FormState } from '../../types'
|
|
4
|
+
import { useForm } from '../../contexts'
|
|
5
|
+
import { CreateApiKeyErrorCode, MembershipInput } from '@contember/graphql-client-tenant'
|
|
6
|
+
import { CreateApiKeyMutationResult, useCreateApiKeyMutation } from '../../hooks'
|
|
7
|
+
|
|
8
|
+
export type CreateApiKeyFormValues = {
|
|
9
|
+
description: string
|
|
10
|
+
memberships: readonly MembershipInput[]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type CreateApiKeyFormErrorCode =
|
|
14
|
+
| CreateApiKeyErrorCode
|
|
15
|
+
| 'UNKNOWN_ERROR'
|
|
16
|
+
| 'FIELD_REQUIRED'
|
|
17
|
+
|
|
18
|
+
export type CreateApiKeyFormState = FormState
|
|
19
|
+
|
|
20
|
+
export type CreateApiKeyFormError = FormError<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>
|
|
21
|
+
|
|
22
|
+
export type CreateApiKeyFormContextValue = FormContextValue<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>
|
|
23
|
+
|
|
24
|
+
export interface CreateApiKeyFormProps {
|
|
25
|
+
children: ReactElement
|
|
26
|
+
projectSlug: string
|
|
27
|
+
initialMemberships?: readonly MembershipInput[]
|
|
28
|
+
onSuccess?: (args: { result: CreateApiKeyMutationResult }) => void
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const useCreateApiKeyForm = useForm as () => CreateApiKeyFormContextValue
|
|
32
|
+
|
|
33
|
+
export const CreateApiKeyForm = ({ children, onSuccess, projectSlug, initialMemberships }: CreateApiKeyFormProps) => {
|
|
34
|
+
const createApiKey = useCreateApiKeyMutation()
|
|
35
|
+
return (
|
|
36
|
+
<TenantForm<CreateApiKeyFormContextValue, CreateApiKeyMutationResult>
|
|
37
|
+
onSuccess={onSuccess}
|
|
38
|
+
initialValues={{
|
|
39
|
+
description: '',
|
|
40
|
+
memberships: initialMemberships || [],
|
|
41
|
+
}}
|
|
42
|
+
validate={({ values }) => {
|
|
43
|
+
const errors: CreateApiKeyFormError[] = []
|
|
44
|
+
if (!values.description) {
|
|
45
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'description' })
|
|
46
|
+
}
|
|
47
|
+
if (values.memberships.length === 0) {
|
|
48
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'memberships' })
|
|
49
|
+
}
|
|
50
|
+
return errors
|
|
51
|
+
}}
|
|
52
|
+
execute={async ({ values }) => {
|
|
53
|
+
return await createApiKey({
|
|
54
|
+
description: values.description,
|
|
55
|
+
projectSlug,
|
|
56
|
+
memberships: values.memberships,
|
|
57
|
+
})
|
|
58
|
+
}}
|
|
59
|
+
errorMapping={errorToField}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</TenantForm>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const errorToField: Record<CreateApiKeyErrorCode, keyof CreateApiKeyFormValues | undefined> = {
|
|
67
|
+
INVALID_MEMBERSHIP: 'memberships',
|
|
68
|
+
PROJECT_NOT_FOUND: undefined,
|
|
69
|
+
ROLE_NOT_FOUND: 'memberships',
|
|
70
|
+
VARIABLE_EMPTY: 'memberships',
|
|
71
|
+
VARIABLE_NOT_FOUND: 'memberships',
|
|
72
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ReactElement } from 'react'
|
|
2
|
+
import { TenantForm } from './TenantForm'
|
|
3
|
+
import { FormContextValue, FormError, FormState } from '../../types'
|
|
4
|
+
import { useForm } from '../../contexts'
|
|
5
|
+
import { CreateSessionTokenErrorCode } from '@contember/graphql-client-tenant'
|
|
6
|
+
import { CreateSessionTokenMutationResult, useCreateSessionTokenMutation } from '../../hooks'
|
|
7
|
+
|
|
8
|
+
export type CreateSessionTokenFormValues = {
|
|
9
|
+
email: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type CreateSessionTokenFormErrorCode =
|
|
13
|
+
| CreateSessionTokenErrorCode
|
|
14
|
+
| 'UNKNOWN_ERROR'
|
|
15
|
+
| 'FIELD_REQUIRED'
|
|
16
|
+
|
|
17
|
+
export type CreateSessionTokenFormState = FormState
|
|
18
|
+
|
|
19
|
+
export type CreateSessionTokenFormError = FormError<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>
|
|
20
|
+
|
|
21
|
+
export type CreateSessionTokenFormContextValue = FormContextValue<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>
|
|
22
|
+
|
|
23
|
+
export interface CreateSessionTokenFormProps {
|
|
24
|
+
children: ReactElement
|
|
25
|
+
expiration?: number
|
|
26
|
+
apiToken?: string
|
|
27
|
+
onSuccess?: (args: { result: CreateSessionTokenMutationResult }) => void
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const useCreateSessionTokenForm = useForm as () => CreateSessionTokenFormContextValue
|
|
31
|
+
|
|
32
|
+
export const CreateSessionTokenForm = ({ children, onSuccess, expiration, apiToken }: CreateSessionTokenFormProps) => {
|
|
33
|
+
const createSessionToken = useCreateSessionTokenMutation({ apiToken })
|
|
34
|
+
return (
|
|
35
|
+
<TenantForm<CreateSessionTokenFormContextValue, CreateSessionTokenMutationResult>
|
|
36
|
+
onSuccess={onSuccess}
|
|
37
|
+
initialValues={{
|
|
38
|
+
email: '',
|
|
39
|
+
}}
|
|
40
|
+
validate={({ values }) => {
|
|
41
|
+
const errors: CreateSessionTokenFormError[] = []
|
|
42
|
+
if (!values.email) {
|
|
43
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'email' })
|
|
44
|
+
}
|
|
45
|
+
return errors
|
|
46
|
+
}}
|
|
47
|
+
execute={async ({ values }) => {
|
|
48
|
+
return await createSessionToken({
|
|
49
|
+
email: values.email,
|
|
50
|
+
expiration,
|
|
51
|
+
})
|
|
52
|
+
}}
|
|
53
|
+
errorMapping={errorToField}
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</TenantForm>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const errorToField: Record<CreateSessionTokenErrorCode, keyof CreateSessionTokenFormValues | undefined> = {
|
|
61
|
+
PERSON_DISABLED: 'email',
|
|
62
|
+
UNKNOWN_EMAIL: 'email',
|
|
63
|
+
UNKNOWN_PERSON_ID: 'email',
|
|
64
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ReactElement } from 'react'
|
|
2
|
+
import { TenantForm } from './TenantForm'
|
|
3
|
+
import { FormContextValue, FormError, FormState } from '../../types'
|
|
4
|
+
import { useForm } from '../../contexts'
|
|
5
|
+
import { InviteErrorCode, InviteOptions, MembershipInput } from '@contember/graphql-client-tenant'
|
|
6
|
+
import { InviteMutationResult, useInviteMutation } from '../../hooks'
|
|
7
|
+
|
|
8
|
+
export type InviteFormValues = {
|
|
9
|
+
email: string
|
|
10
|
+
name: string
|
|
11
|
+
memberships: readonly MembershipInput[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type InviteFormErrorCode =
|
|
15
|
+
| InviteErrorCode
|
|
16
|
+
| 'UNKNOWN_ERROR'
|
|
17
|
+
| 'FIELD_REQUIRED'
|
|
18
|
+
|
|
19
|
+
export type InviteFormState = FormState
|
|
20
|
+
|
|
21
|
+
export type InviteFormError = FormError<InviteFormValues, InviteFormErrorCode>
|
|
22
|
+
|
|
23
|
+
export type InviteFormContextValue = FormContextValue<InviteFormValues, InviteFormErrorCode>
|
|
24
|
+
|
|
25
|
+
export interface InviteFormProps {
|
|
26
|
+
children: ReactElement
|
|
27
|
+
projectSlug: string
|
|
28
|
+
inviteOptions?: InviteOptions
|
|
29
|
+
initialMemberships?: readonly MembershipInput[]
|
|
30
|
+
onSuccess?: (args: { result: InviteMutationResult }) => void
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const useInviteForm = useForm as () => InviteFormContextValue
|
|
34
|
+
|
|
35
|
+
export const InviteForm = ({ children, onSuccess, projectSlug, initialMemberships, inviteOptions }: InviteFormProps) => {
|
|
36
|
+
const invite = useInviteMutation()
|
|
37
|
+
return (
|
|
38
|
+
<TenantForm<InviteFormContextValue, InviteMutationResult>
|
|
39
|
+
onSuccess={onSuccess}
|
|
40
|
+
initialValues={{
|
|
41
|
+
email: '',
|
|
42
|
+
name: '',
|
|
43
|
+
memberships: initialMemberships || [],
|
|
44
|
+
}}
|
|
45
|
+
validate={({ values }) => {
|
|
46
|
+
const errors: InviteFormError[] = []
|
|
47
|
+
if (!values.email) {
|
|
48
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'email' })
|
|
49
|
+
}
|
|
50
|
+
if (values.memberships.length === 0) {
|
|
51
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'memberships' })
|
|
52
|
+
}
|
|
53
|
+
return errors
|
|
54
|
+
}}
|
|
55
|
+
execute={async ({ values }) => {
|
|
56
|
+
return await invite({
|
|
57
|
+
email: values.email,
|
|
58
|
+
name: values.name,
|
|
59
|
+
projectSlug,
|
|
60
|
+
options: inviteOptions,
|
|
61
|
+
memberships: values.memberships,
|
|
62
|
+
})
|
|
63
|
+
}}
|
|
64
|
+
errorMapping={errorToField}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</TenantForm>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const errorToField: Record<InviteErrorCode, keyof InviteFormValues | undefined> = {
|
|
72
|
+
ALREADY_MEMBER: 'email',
|
|
73
|
+
INVALID_EMAIL_FORMAT: 'email',
|
|
74
|
+
INVALID_MEMBERSHIP: 'memberships',
|
|
75
|
+
PROJECT_NOT_FOUND: undefined,
|
|
76
|
+
ROLE_NOT_FOUND: 'memberships',
|
|
77
|
+
VARIABLE_EMPTY: 'memberships',
|
|
78
|
+
VARIABLE_NOT_FOUND: 'memberships',
|
|
79
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { ReactElement, useCallback, useMemo } from 'react'
|
|
2
|
+
import * as TenantApi from '@contember/graphql-client-tenant'
|
|
3
|
+
import { TenantForm } from './TenantForm'
|
|
4
|
+
import { SignInErrorCode } from '@contember/graphql-client-tenant'
|
|
5
|
+
import { FormContextValue, FormError, FormState } from '../../types'
|
|
6
|
+
import { useForm } from '../../contexts'
|
|
7
|
+
import { useSetSessionToken } from '@contember/react-client'
|
|
8
|
+
import { SignInMutationResult, useSignInMutation } from '../../hooks'
|
|
9
|
+
import { useRedirectToBacklinkCallback } from '../../internal/hooks/useRedirectToBacklink'
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export type LoginFormValues = {
|
|
13
|
+
email: string
|
|
14
|
+
password: string
|
|
15
|
+
otpToken: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type LoginFormErrorCode =
|
|
19
|
+
| SignInErrorCode
|
|
20
|
+
| 'FIELD_REQUIRED'
|
|
21
|
+
| 'INVALID_VALUE'
|
|
22
|
+
| 'UNKNOWN_ERROR'
|
|
23
|
+
|
|
24
|
+
export type LoginFormState =
|
|
25
|
+
| FormState
|
|
26
|
+
| 'otp-required'
|
|
27
|
+
|
|
28
|
+
export type LoginFormError = FormError<LoginFormValues, LoginFormErrorCode>
|
|
29
|
+
|
|
30
|
+
export type LoginFormContextValue = FormContextValue<LoginFormValues, LoginFormErrorCode, LoginFormState>
|
|
31
|
+
|
|
32
|
+
export interface LoginFormProps {
|
|
33
|
+
expiration?: number
|
|
34
|
+
children: ReactElement
|
|
35
|
+
onSuccess?: () => void
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const useLoginForm = useForm as () => LoginFormContextValue
|
|
39
|
+
|
|
40
|
+
const headers = {
|
|
41
|
+
'X-Contember-Token-Path': 'data.mutation.result.token',
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const DEFAULT_LOGIN_EXPIRATION = 14 * 24 * 3600 // 14 days
|
|
45
|
+
|
|
46
|
+
export const LoginForm = ({ children, expiration = DEFAULT_LOGIN_EXPIRATION, onSuccess }: LoginFormProps) => {
|
|
47
|
+
const login = useSignInMutation({ headers })
|
|
48
|
+
const redirectToBacklink = useRedirectToBacklinkCallback()
|
|
49
|
+
const setSessionToken = useSetSessionToken()
|
|
50
|
+
return (
|
|
51
|
+
<TenantForm<LoginFormContextValue, SignInMutationResult>
|
|
52
|
+
onSuccess={args => {
|
|
53
|
+
onSuccess?.()
|
|
54
|
+
setSessionToken(args.result.token)
|
|
55
|
+
redirectToBacklink()
|
|
56
|
+
}}
|
|
57
|
+
errorMapping={errorToField}
|
|
58
|
+
initialValues={{
|
|
59
|
+
email: '',
|
|
60
|
+
password: '',
|
|
61
|
+
otpToken: '',
|
|
62
|
+
}}
|
|
63
|
+
validate={({ values, state }) => {
|
|
64
|
+
const errors: LoginFormError[] = []
|
|
65
|
+
if (!values.email) {
|
|
66
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'email' })
|
|
67
|
+
} else if (!values.email.match(/^.+@.+$/)) {
|
|
68
|
+
errors.push({ code: 'INVALID_VALUE', field: 'email' })
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (!values.password) {
|
|
72
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'password' })
|
|
73
|
+
} else if (values.password.length < 6) {
|
|
74
|
+
errors.push({ code: 'INVALID_VALUE', field: 'password' })
|
|
75
|
+
}
|
|
76
|
+
if (!values.otpToken && state === 'otp-required') {
|
|
77
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'otpToken' })
|
|
78
|
+
} else if (values.otpToken && !values.otpToken.match(/^\d{6}$/)) {
|
|
79
|
+
errors.push({ code: 'INVALID_VALUE', field: 'otpToken' })
|
|
80
|
+
}
|
|
81
|
+
return errors
|
|
82
|
+
}}
|
|
83
|
+
execute={async ({ values }) => {
|
|
84
|
+
const result = await login({
|
|
85
|
+
email: values.email!,
|
|
86
|
+
password: values.password!,
|
|
87
|
+
otpToken: values.otpToken || undefined,
|
|
88
|
+
expiration: expiration,
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
if (!result.ok && result.error === 'OTP_REQUIRED') {
|
|
92
|
+
return { ...result, state: 'otp-required' }
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return result
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</TenantForm>
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
const errorToField: Record<TenantApi.SignInErrorCode, keyof LoginFormValues | undefined> = {
|
|
104
|
+
'INVALID_PASSWORD': 'password',
|
|
105
|
+
'NO_PASSWORD_SET': 'password',
|
|
106
|
+
'UNKNOWN_EMAIL': 'email',
|
|
107
|
+
'PERSON_DISABLED': 'email',
|
|
108
|
+
'INVALID_OTP_TOKEN': 'otpToken',
|
|
109
|
+
'OTP_REQUIRED': undefined,
|
|
110
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ReactElement } from 'react'
|
|
2
|
+
import { TenantForm } from './TenantForm'
|
|
3
|
+
import { FormContextValue, FormError, FormState } from '../../types'
|
|
4
|
+
import { useForm, useIdentityMethods } from '../../contexts'
|
|
5
|
+
import { ConfirmOtpErrorCode } from '@contember/graphql-client-tenant'
|
|
6
|
+
import { useConfirmOtpMutation } from '../../hooks'
|
|
7
|
+
|
|
8
|
+
export type OtpConfirmFormValues = {
|
|
9
|
+
otpToken: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type OtpConfirmFormErrorCode =
|
|
13
|
+
| ConfirmOtpErrorCode
|
|
14
|
+
| 'FIELD_REQUIRED'
|
|
15
|
+
| 'UNKNOWN_ERROR'
|
|
16
|
+
|
|
17
|
+
export type OtpConfirmFormState = FormState
|
|
18
|
+
|
|
19
|
+
export type OtpConfirmFormError = FormError<OtpConfirmFormValues, OtpConfirmFormErrorCode>
|
|
20
|
+
|
|
21
|
+
export type OtpConfirmFormContextValue = FormContextValue<OtpConfirmFormValues, OtpConfirmFormErrorCode>
|
|
22
|
+
|
|
23
|
+
export interface OtpConfirmFormProps {
|
|
24
|
+
children: ReactElement
|
|
25
|
+
onSuccess?: () => void
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const useOtpConfirmForm = useForm as () => OtpConfirmFormContextValue
|
|
29
|
+
|
|
30
|
+
export const OtpConfirmForm = ({ children, onSuccess }: OtpConfirmFormProps) => {
|
|
31
|
+
const confirmOtp = useConfirmOtpMutation()
|
|
32
|
+
const { refreshIdentity } = useIdentityMethods()
|
|
33
|
+
return (
|
|
34
|
+
<TenantForm<OtpConfirmFormContextValue>
|
|
35
|
+
onSuccess={async args => {
|
|
36
|
+
await refreshIdentity()
|
|
37
|
+
onSuccess?.()
|
|
38
|
+
}}
|
|
39
|
+
initialValues={{
|
|
40
|
+
otpToken: '',
|
|
41
|
+
}}
|
|
42
|
+
validate={({ values }) => {
|
|
43
|
+
if (!values.otpToken) {
|
|
44
|
+
return [{ code: 'FIELD_REQUIRED', field: 'otpToken' }]
|
|
45
|
+
}
|
|
46
|
+
}}
|
|
47
|
+
execute={async ({ values }) => {
|
|
48
|
+
return await confirmOtp({
|
|
49
|
+
otpToken: values.otpToken,
|
|
50
|
+
})
|
|
51
|
+
}}
|
|
52
|
+
errorMapping={{
|
|
53
|
+
INVALID_OTP_TOKEN: 'otpToken',
|
|
54
|
+
NOT_PREPARED: 'otpToken',
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</TenantForm>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ReactElement, useCallback, useMemo } from 'react'
|
|
2
|
+
import { TenantForm } from './TenantForm'
|
|
3
|
+
import { FormContextValue, FormError, FormState } from '../../types'
|
|
4
|
+
import { useForm } from '../../contexts'
|
|
5
|
+
import { PrepareOtpMutationResult, usePrepareOtpMutation } from '../../hooks'
|
|
6
|
+
|
|
7
|
+
export type OtpPrepareFormValues = {
|
|
8
|
+
label: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type OtpPrepareFormErrorCode =
|
|
12
|
+
| 'UNKNOWN_ERROR'
|
|
13
|
+
|
|
14
|
+
export type OtpPrepareFormState = FormState
|
|
15
|
+
|
|
16
|
+
export type OtpPrepareFormError = FormError<OtpPrepareFormValues, OtpPrepareFormErrorCode>
|
|
17
|
+
|
|
18
|
+
export type OtpPrepareFormContextValue = FormContextValue<OtpPrepareFormValues, OtpPrepareFormErrorCode>
|
|
19
|
+
|
|
20
|
+
export interface OtpPrepareFormProps {
|
|
21
|
+
children: ReactElement
|
|
22
|
+
onSuccess?: (args: { result: PrepareOtpMutationResult }) => void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const useOtpPrepareForm = useForm as () => OtpPrepareFormContextValue
|
|
26
|
+
|
|
27
|
+
export const OtpPrepareForm = ({ children, onSuccess }: OtpPrepareFormProps) => {
|
|
28
|
+
const prepareOtp = usePrepareOtpMutation()
|
|
29
|
+
return (
|
|
30
|
+
<TenantForm<OtpPrepareFormContextValue, PrepareOtpMutationResult>
|
|
31
|
+
onSuccess={onSuccess}
|
|
32
|
+
initialValues={{
|
|
33
|
+
label: window.location.hostname,
|
|
34
|
+
}}
|
|
35
|
+
execute={async ({ values }) => {
|
|
36
|
+
return await prepareOtp({
|
|
37
|
+
label: values.label,
|
|
38
|
+
})
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</TenantForm>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { ReactElement } from 'react'
|
|
2
|
+
import * as TenantApi from '@contember/graphql-client-tenant'
|
|
3
|
+
import { ResetPasswordErrorCode } from '@contember/graphql-client-tenant'
|
|
4
|
+
import { TenantForm } from './TenantForm'
|
|
5
|
+
import { FormContextValue, FormError, FormState } from '../../types'
|
|
6
|
+
import { useForm } from '../../contexts'
|
|
7
|
+
import { useResetPasswordMutation } from '../../hooks'
|
|
8
|
+
|
|
9
|
+
export type PasswordResetFormValues = {
|
|
10
|
+
token: string
|
|
11
|
+
password: string
|
|
12
|
+
passwordConfirmation: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type PasswordResetFormErrorCode =
|
|
16
|
+
| ResetPasswordErrorCode
|
|
17
|
+
| 'FIELD_REQUIRED'
|
|
18
|
+
| 'INVALID_VALUE'
|
|
19
|
+
| 'PASSWORD_MISMATCH'
|
|
20
|
+
| 'UNKNOWN_ERROR'
|
|
21
|
+
|
|
22
|
+
export type PasswordResetFormState = FormState
|
|
23
|
+
|
|
24
|
+
export type PasswordResetFormError = FormError<PasswordResetFormValues, PasswordResetFormErrorCode>
|
|
25
|
+
|
|
26
|
+
export type PasswordResetFormContextValue = FormContextValue<PasswordResetFormValues, PasswordResetFormErrorCode>
|
|
27
|
+
|
|
28
|
+
export interface PasswordResetFormProps {
|
|
29
|
+
children: ReactElement
|
|
30
|
+
onSuccess?: () => void
|
|
31
|
+
token?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const usePasswordResetForm = useForm as () => PasswordResetFormContextValue
|
|
35
|
+
|
|
36
|
+
export const PasswordResetForm = ({ children, onSuccess, token }: PasswordResetFormProps) => {
|
|
37
|
+
const createReset = useResetPasswordMutation()
|
|
38
|
+
return (
|
|
39
|
+
<TenantForm<PasswordResetFormContextValue>
|
|
40
|
+
onSuccess={onSuccess}
|
|
41
|
+
errorMapping={errorToField}
|
|
42
|
+
initialValues={{
|
|
43
|
+
token: token ?? '',
|
|
44
|
+
password: '',
|
|
45
|
+
passwordConfirmation: '',
|
|
46
|
+
}}
|
|
47
|
+
validate={({ values }) => {
|
|
48
|
+
const errors: PasswordResetFormError[] = []
|
|
49
|
+
if (!values.token) {
|
|
50
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'token' })
|
|
51
|
+
}
|
|
52
|
+
if (!values.password) {
|
|
53
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'password' })
|
|
54
|
+
} else if (values.password.length < 6) {
|
|
55
|
+
errors.push({ code: 'INVALID_VALUE', field: 'password' })
|
|
56
|
+
} else if (!values.passwordConfirmation) {
|
|
57
|
+
errors.push({ code: 'FIELD_REQUIRED', field: 'passwordConfirmation' })
|
|
58
|
+
} else if (values.password !== values.passwordConfirmation) {
|
|
59
|
+
errors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })
|
|
60
|
+
}
|
|
61
|
+
return errors
|
|
62
|
+
}}
|
|
63
|
+
execute={async ({ values }) => {
|
|
64
|
+
return await createReset({
|
|
65
|
+
password: values.password,
|
|
66
|
+
token: values.token,
|
|
67
|
+
})
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</TenantForm>
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
const errorToField: Record<TenantApi.ResetPasswordErrorCode, keyof PasswordResetFormValues | undefined> = {
|
|
76
|
+
PASSWORD_TOO_WEAK: 'password',
|
|
77
|
+
TOKEN_EXPIRED: 'token',
|
|
78
|
+
TOKEN_NOT_FOUND: 'token',
|
|
79
|
+
TOKEN_USED: 'token',
|
|
80
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ReactElement, useCallback, useMemo } from 'react'
|
|
2
|
+
import * as TenantApi from '@contember/graphql-client-tenant'
|
|
3
|
+
import { CreatePasswordResetRequestErrorCode } from '@contember/graphql-client-tenant'
|
|
4
|
+
import { TenantForm } from './TenantForm'
|
|
5
|
+
import { FormContextValue, FormError, FormState } from '../../types/forms'
|
|
6
|
+
import { useForm } from '../../contexts'
|
|
7
|
+
import { useCreateResetPasswordRequestMutation } from '../../hooks'
|
|
8
|
+
|
|
9
|
+
export type PasswordResetRequestFormValues = {
|
|
10
|
+
email: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type PasswordResetRequestFormErrorCode =
|
|
14
|
+
| CreatePasswordResetRequestErrorCode
|
|
15
|
+
| 'FIELD_REQUIRED'
|
|
16
|
+
| 'INVALID_VALUE'
|
|
17
|
+
| 'UNKNOWN_ERROR'
|
|
18
|
+
|
|
19
|
+
export type PasswordResetRequestFormState = FormState
|
|
20
|
+
|
|
21
|
+
export type PasswordResetRequestFormError = FormError<PasswordResetRequestFormValues, PasswordResetRequestFormErrorCode>
|
|
22
|
+
|
|
23
|
+
export type PasswordResetRequestFormContextValue = FormContextValue<PasswordResetRequestFormValues, PasswordResetRequestFormErrorCode>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export interface PasswordResetRequestFormProps {
|
|
27
|
+
children: ReactElement
|
|
28
|
+
onSuccess?: () => void
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const usePasswordResetRequestForm = useForm as () => PasswordResetRequestFormContextValue
|
|
32
|
+
|
|
33
|
+
export const PasswordResetRequestForm = ({ children, onSuccess }: PasswordResetRequestFormProps) => {
|
|
34
|
+
|
|
35
|
+
const createResetRequest = useCreateResetPasswordRequestMutation()
|
|
36
|
+
return (
|
|
37
|
+
<TenantForm<PasswordResetRequestFormContextValue>
|
|
38
|
+
onSuccess={onSuccess}
|
|
39
|
+
errorMapping={errorToField}
|
|
40
|
+
initialValues={useMemo(() => ({
|
|
41
|
+
email: '',
|
|
42
|
+
}), [])}
|
|
43
|
+
validate={({ values }) => {
|
|
44
|
+
if (!values.email) {
|
|
45
|
+
return [{ code: 'FIELD_REQUIRED', field: 'email' }]
|
|
46
|
+
} else if (!values.email.match(/^.+@.+$/)) {
|
|
47
|
+
return [{ code: 'INVALID_VALUE', field: 'email' }]
|
|
48
|
+
}
|
|
49
|
+
return []
|
|
50
|
+
}}
|
|
51
|
+
execute={useCallback(async ({ values }) => {
|
|
52
|
+
return await createResetRequest({
|
|
53
|
+
email: values.email,
|
|
54
|
+
})
|
|
55
|
+
}, [createResetRequest])}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</TenantForm>
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
const errorToField: Record<TenantApi.CreatePasswordResetRequestErrorCode, keyof PasswordResetRequestFormValues | undefined> = {
|
|
63
|
+
PERSON_NOT_FOUND: 'email',
|
|
64
|
+
}
|