@contember/react-client-tenant 1.3.0-alpha.25 → 1.3.0-alpha.27
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 +10 -5
- 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 +10 -6
- 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,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const reactClient = require("@contember/react-client");
|
|
5
|
+
const react = require("react");
|
|
6
|
+
const contexts = require("../contexts.cjs");
|
|
7
|
+
const useFetchIdentity = require("../hooks/useFetchIdentity.cjs");
|
|
8
|
+
const IdentityProvider = ({ children }) => {
|
|
9
|
+
const sessionToken = reactClient.useSessionToken();
|
|
10
|
+
const [{ identity, state }, methods] = useFetchIdentity.useFetchIdentity();
|
|
11
|
+
const { refreshIdentity, clearIdentity } = methods;
|
|
12
|
+
react.useEffect(() => {
|
|
13
|
+
if (sessionToken !== void 0) {
|
|
14
|
+
refreshIdentity();
|
|
15
|
+
}
|
|
16
|
+
}, [sessionToken, refreshIdentity]);
|
|
17
|
+
const hasIdentity = identity !== void 0;
|
|
18
|
+
react.useEffect(() => {
|
|
19
|
+
if (sessionToken === void 0 && hasIdentity) {
|
|
20
|
+
clearIdentity();
|
|
21
|
+
}
|
|
22
|
+
}, [sessionToken, clearIdentity, hasIdentity]);
|
|
23
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.IdentityStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.IdentityContext.Provider, { value: identity, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.IdentityMethodsContext.Provider, { value: methods, children }, void 0, false, {
|
|
24
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
|
|
25
|
+
lineNumber: 33,
|
|
26
|
+
columnNumber: 5
|
|
27
|
+
}, void 0) }, void 0, false, {
|
|
28
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
|
|
29
|
+
lineNumber: 32,
|
|
30
|
+
columnNumber: 4
|
|
31
|
+
}, void 0) }, void 0, false, {
|
|
32
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
|
|
33
|
+
lineNumber: 31,
|
|
34
|
+
columnNumber: 3
|
|
35
|
+
}, void 0);
|
|
36
|
+
};
|
|
37
|
+
exports.IdentityProvider = IdentityProvider;
|
|
38
|
+
//# sourceMappingURL=IdentityProvider.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityProvider.cjs","sources":["../../../src/components/IdentityProvider.tsx"],"sourcesContent":["import { useSessionToken } from '@contember/react-client'\nimport { ReactNode, useEffect } from 'react'\nimport { useFetchIdentity } from '../hooks'\nimport { IdentityContext, IdentityMethodsContext, IdentityStateContext } from '../contexts'\n\n\nexport interface IdentityProviderProps {\n\tchildren: ReactNode\n}\n\nexport const IdentityProvider: React.FC<IdentityProviderProps> = ({ children }) => {\n\tconst sessionToken = useSessionToken()\n\tconst [{ identity, state }, methods] = useFetchIdentity()\n\n\tconst { refreshIdentity, clearIdentity } = methods\n\tuseEffect(() => {\n\t\tif (sessionToken !== undefined) {\n\t\t\trefreshIdentity()\n\t\t}\n\t}, [sessionToken, refreshIdentity])\n\n\n\tconst hasIdentity = identity !== undefined\n\tuseEffect(() => {\n\t\tif (sessionToken === undefined && hasIdentity) {\n\t\t\tclearIdentity()\n\t\t}\n\t}, [sessionToken, clearIdentity, hasIdentity])\n\n\treturn (\n\t\t<IdentityStateContext.Provider value={state}>\n\t\t\t<IdentityContext.Provider value={identity}>\n\t\t\t\t<IdentityMethodsContext.Provider value={methods}>\n\t\t\t\t\t\t{children}\n\t\t\t\t</IdentityMethodsContext.Provider>\n\t\t\t</IdentityContext.Provider>\n\t\t</IdentityStateContext.Provider>\n\t)\n}\n"],"names":["useSessionToken","useFetchIdentity","useEffect","IdentityStateContext","IdentityContext","jsxDEV","IdentityMethodsContext","this"],"mappings":";;;;;;;AAUO,MAAM,mBAAoD,CAAC,EAAE,eAAe;AAClF,QAAM,eAAeA,YAAAA;AACrB,QAAM,CAAC,EAAE,UAAU,MAAS,GAAA,OAAO,IAAIC,iBAAAA;AAEjC,QAAA,EAAE,iBAAiB,cAAkB,IAAA;AAC3CC,QAAAA,UAAU,MAAM;AACf,QAAI,iBAAiB,QAAW;AACf;IACjB;AAAA,EAAA,GACE,CAAC,cAAc,eAAe,CAAC;AAGlC,QAAM,cAAc,aAAa;AACjCA,QAAAA,UAAU,MAAM;AACX,QAAA,iBAAiB,UAAa,aAAa;AAChC;IACf;AAAA,EACE,GAAA,CAAC,cAAc,eAAe,WAAW,CAAC;AAE7C,8CACEC,SAAAA,qBAAqB,UAArB,EAA8B,OAAO,OACrC,+CAACC,yBAAgB,UAAhB,EAAyB,OAAO,UAChC,UAACC,8BAAAA,OAAAC,SAAA,uBAAuB,UAAvB,EAAgC,OAAO,SACrC,SADH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAMA,GAAAA,MAAA;AAEF;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useSessionToken } from "@contember/react-client";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { IdentityStateContext, IdentityContext, IdentityMethodsContext } from "../contexts.js";
|
|
5
|
+
import { useFetchIdentity } from "../hooks/useFetchIdentity.js";
|
|
6
|
+
const IdentityProvider = ({ children }) => {
|
|
7
|
+
const sessionToken = useSessionToken();
|
|
8
|
+
const [{ identity, state }, methods] = useFetchIdentity();
|
|
9
|
+
const { refreshIdentity, clearIdentity } = methods;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (sessionToken !== void 0) {
|
|
12
|
+
refreshIdentity();
|
|
13
|
+
}
|
|
14
|
+
}, [sessionToken, refreshIdentity]);
|
|
15
|
+
const hasIdentity = identity !== void 0;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (sessionToken === void 0 && hasIdentity) {
|
|
18
|
+
clearIdentity();
|
|
19
|
+
}
|
|
20
|
+
}, [sessionToken, clearIdentity, hasIdentity]);
|
|
21
|
+
return /* @__PURE__ */ jsxDEV(IdentityStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxDEV(IdentityContext.Provider, { value: identity, children: /* @__PURE__ */ jsxDEV(IdentityMethodsContext.Provider, { value: methods, children }, void 0, false, {
|
|
22
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
|
|
23
|
+
lineNumber: 33,
|
|
24
|
+
columnNumber: 5
|
|
25
|
+
}, void 0) }, void 0, false, {
|
|
26
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
|
|
27
|
+
lineNumber: 32,
|
|
28
|
+
columnNumber: 4
|
|
29
|
+
}, void 0) }, void 0, false, {
|
|
30
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityProvider.tsx",
|
|
31
|
+
lineNumber: 31,
|
|
32
|
+
columnNumber: 3
|
|
33
|
+
}, void 0);
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
IdentityProvider
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=IdentityProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityProvider.js","sources":["../../../src/components/IdentityProvider.tsx"],"sourcesContent":["import { useSessionToken } from '@contember/react-client'\nimport { ReactNode, useEffect } from 'react'\nimport { useFetchIdentity } from '../hooks'\nimport { IdentityContext, IdentityMethodsContext, IdentityStateContext } from '../contexts'\n\n\nexport interface IdentityProviderProps {\n\tchildren: ReactNode\n}\n\nexport const IdentityProvider: React.FC<IdentityProviderProps> = ({ children }) => {\n\tconst sessionToken = useSessionToken()\n\tconst [{ identity, state }, methods] = useFetchIdentity()\n\n\tconst { refreshIdentity, clearIdentity } = methods\n\tuseEffect(() => {\n\t\tif (sessionToken !== undefined) {\n\t\t\trefreshIdentity()\n\t\t}\n\t}, [sessionToken, refreshIdentity])\n\n\n\tconst hasIdentity = identity !== undefined\n\tuseEffect(() => {\n\t\tif (sessionToken === undefined && hasIdentity) {\n\t\t\tclearIdentity()\n\t\t}\n\t}, [sessionToken, clearIdentity, hasIdentity])\n\n\treturn (\n\t\t<IdentityStateContext.Provider value={state}>\n\t\t\t<IdentityContext.Provider value={identity}>\n\t\t\t\t<IdentityMethodsContext.Provider value={methods}>\n\t\t\t\t\t\t{children}\n\t\t\t\t</IdentityMethodsContext.Provider>\n\t\t\t</IdentityContext.Provider>\n\t\t</IdentityStateContext.Provider>\n\t)\n}\n"],"names":["this"],"mappings":";;;;;AAUO,MAAM,mBAAoD,CAAC,EAAE,eAAe;AAClF,QAAM,eAAe;AACrB,QAAM,CAAC,EAAE,UAAU,MAAS,GAAA,OAAO,IAAI;AAEjC,QAAA,EAAE,iBAAiB,cAAkB,IAAA;AAC3C,YAAU,MAAM;AACf,QAAI,iBAAiB,QAAW;AACf;IACjB;AAAA,EAAA,GACE,CAAC,cAAc,eAAe,CAAC;AAGlC,QAAM,cAAc,aAAa;AACjC,YAAU,MAAM;AACX,QAAA,iBAAiB,UAAa,aAAa;AAChC;IACf;AAAA,EACE,GAAA,CAAC,cAAc,eAAe,WAAW,CAAC;AAE7C,gCACE,qBAAqB,UAArB,EAA8B,OAAO,OACrC,iCAAC,gBAAgB,UAAhB,EAAyB,OAAO,UAChC,UAAC,uBAAA,uBAAuB,UAAvB,EAAgC,OAAO,SACrC,SADH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAEA,EAHD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAIA,EALD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAMA,GAAAA,MAAA;AAEF;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const contexts = require("../contexts.cjs");
|
|
5
|
+
const IdentityState = ({ state, children }) => {
|
|
6
|
+
const currentState = contexts.useIdentityState();
|
|
7
|
+
return state === currentState || Array.isArray(state) && state.includes(currentState) ? /* @__PURE__ */ jsxDevRuntime.jsxDEV(jsxDevRuntime.Fragment, { children }, void 0, false, {
|
|
8
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityState.tsx",
|
|
9
|
+
lineNumber: 13,
|
|
10
|
+
columnNumber: 92
|
|
11
|
+
}, void 0) : null;
|
|
12
|
+
};
|
|
13
|
+
exports.IdentityState = IdentityState;
|
|
14
|
+
//# sourceMappingURL=IdentityState.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityState.cjs","sources":["../../../src/components/IdentityState.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { IdentityStateValue } from '../types'\nimport { useIdentityState } from '../contexts'\n\nexport interface IdentityStateProps {\n\tstate: IdentityStateValue | IdentityStateValue[]\n\tchildren: ReactNode\n}\n\nexport const IdentityState = ({ state, children }: IdentityStateProps) => {\n\tconst currentState = useIdentityState()\n\n\treturn state === currentState || (Array.isArray(state) && state.includes(currentState)) ? <>{children}</> : null\n}\n"],"names":["useIdentityState","jsxDEV","Fragment","this"],"mappings":";;;;AASO,MAAM,gBAAgB,CAAC,EAAE,OAAO,eAAmC;AACzE,QAAM,eAAeA,SAAAA;AAEd,SAAA,UAAU,gBAAiB,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,YAAY,IAAKC,8BAAA,OAAAC,wBAAA,EAAG,SAAH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAAY,IAAM;AAC7G;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useIdentityState } from "../contexts.js";
|
|
3
|
+
const IdentityState = ({ state, children }) => {
|
|
4
|
+
const currentState = useIdentityState();
|
|
5
|
+
return state === currentState || Array.isArray(state) && state.includes(currentState) ? /* @__PURE__ */ jsxDEV(Fragment, { children }, void 0, false, {
|
|
6
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/IdentityState.tsx",
|
|
7
|
+
lineNumber: 13,
|
|
8
|
+
columnNumber: 92
|
|
9
|
+
}, void 0) : null;
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
IdentityState
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=IdentityState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityState.js","sources":["../../../src/components/IdentityState.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { IdentityStateValue } from '../types'\nimport { useIdentityState } from '../contexts'\n\nexport interface IdentityStateProps {\n\tstate: IdentityStateValue | IdentityStateValue[]\n\tchildren: ReactNode\n}\n\nexport const IdentityState = ({ state, children }: IdentityStateProps) => {\n\tconst currentState = useIdentityState()\n\n\treturn state === currentState || (Array.isArray(state) && state.includes(currentState)) ? <>{children}</> : null\n}\n"],"names":["this"],"mappings":";;AASO,MAAM,gBAAgB,CAAC,EAAE,OAAO,eAAmC;AACzE,QAAM,eAAe;AAEd,SAAA,UAAU,gBAAiB,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,YAAY,IAAK,uBAAA,UAAA,EAAG,SAAH,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAA,MAAY,IAAM;AAC7G;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 useChangeMyPasswordMutation = require("../../hooks/mutations/auth/useChangeMyPasswordMutation.cjs");
|
|
7
|
+
const useChangeMyPasswordForm = contexts.useForm;
|
|
8
|
+
const ChangeMyPasswordForm = ({ children, onSuccess }) => {
|
|
9
|
+
const changePassword = useChangeMyPasswordMutation.useChangeMyPasswordMutation();
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
errorMapping: errorToField,
|
|
15
|
+
initialValues: {
|
|
16
|
+
currentPassword: "",
|
|
17
|
+
newPassword: "",
|
|
18
|
+
passwordConfirmation: ""
|
|
19
|
+
},
|
|
20
|
+
validate: ({ values }) => {
|
|
21
|
+
const errors = [];
|
|
22
|
+
if (!values.currentPassword) {
|
|
23
|
+
errors.push({ code: "FIELD_REQUIRED", field: "currentPassword" });
|
|
24
|
+
}
|
|
25
|
+
if (!values.newPassword) {
|
|
26
|
+
errors.push({ code: "FIELD_REQUIRED", field: "newPassword" });
|
|
27
|
+
} else if (values.newPassword.length < 6) {
|
|
28
|
+
errors.push({ code: "INVALID_VALUE", field: "newPassword" });
|
|
29
|
+
} else if (!values.passwordConfirmation) {
|
|
30
|
+
errors.push({ code: "FIELD_REQUIRED", field: "passwordConfirmation" });
|
|
31
|
+
} else if (values.newPassword !== values.passwordConfirmation) {
|
|
32
|
+
errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
|
|
33
|
+
}
|
|
34
|
+
return errors;
|
|
35
|
+
},
|
|
36
|
+
execute: async ({ values }) => {
|
|
37
|
+
return await changePassword(values);
|
|
38
|
+
},
|
|
39
|
+
children
|
|
40
|
+
},
|
|
41
|
+
void 0,
|
|
42
|
+
false,
|
|
43
|
+
{
|
|
44
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/ChangeMyPasswordForm.tsx",
|
|
45
|
+
lineNumber: 37,
|
|
46
|
+
columnNumber: 3
|
|
47
|
+
},
|
|
48
|
+
void 0
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
const errorToField = {
|
|
52
|
+
PASSWORD_MISMATCH: "passwordConfirmation",
|
|
53
|
+
TOO_WEAK: "newPassword",
|
|
54
|
+
NO_PASSWORD_SET: "currentPassword",
|
|
55
|
+
INVALID_PASSWORD: "currentPassword"
|
|
56
|
+
};
|
|
57
|
+
exports.ChangeMyPasswordForm = ChangeMyPasswordForm;
|
|
58
|
+
exports.useChangeMyPasswordForm = useChangeMyPasswordForm;
|
|
59
|
+
//# sourceMappingURL=ChangeMyPasswordForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangeMyPasswordForm.cjs","sources":["../../../../src/components/forms/ChangeMyPasswordForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { ChangeMyPasswordErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { useChangeMyPasswordMutation } from '../../hooks'\n\nexport type ChangeMyPasswordFormValues = {\n\tcurrentPassword: string\n\tnewPassword: string\n\tpasswordConfirmation: string\n}\n\nexport type ChangeMyPasswordFormErrorCode =\n\t| ChangeMyPasswordErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangeMyPasswordFormState = FormState\n\nexport type ChangeMyPasswordFormError = FormError<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>\n\nexport type ChangeMyPasswordFormContextValue = FormContextValue<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>\n\nexport interface ChangeMyPasswordFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const useChangeMyPasswordForm = useForm as () => ChangeMyPasswordFormContextValue\n\nexport const ChangeMyPasswordForm = ({ children, onSuccess }: ChangeMyPasswordFormProps) => {\n\tconst changePassword = useChangeMyPasswordMutation()\n\treturn (\n\t\t<TenantForm<ChangeMyPasswordFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\tcurrentPassword: '',\n\t\t\t\tnewPassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangeMyPasswordFormError[] = []\n\t\t\t\tif (!values.currentPassword) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'currentPassword' })\n\t\t\t\t}\n\t\t\t\tif (!values.newPassword) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'newPassword' })\n\t\t\t\t} else if (values.newPassword.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'newPassword' })\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.newPassword !== 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 changePassword(values)\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Partial<Record<ChangeMyPasswordFormErrorCode, keyof ChangeMyPasswordFormValues | undefined>> = {\n\tPASSWORD_MISMATCH: 'passwordConfirmation',\n\tTOO_WEAK: 'newPassword',\n\tNO_PASSWORD_SET: 'currentPassword',\n\tINVALID_PASSWORD: 'currentPassword',\n}\n"],"names":["useForm","useChangeMyPasswordMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA+BO,MAAM,0BAA0BA,SAAA;AAEhC,MAAM,uBAAuB,CAAC,EAAE,UAAU,gBAA2C;AAC3F,QAAM,iBAAiBC,4BAAAA;AAEtB,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,iBAAiB;AAAA,QACjB,aAAa;AAAA,QACb,sBAAsB;AAAA,MACvB;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAsC,CAAA;AACxC,YAAA,CAAC,OAAO,iBAAiB;AAC5B,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,mBAAmB;AAAA,QACjE;AACI,YAAA,CAAC,OAAO,aAAa;AACxB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAClD,WAAA,OAAO,YAAY,SAAS,GAAG;AACzC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,eAAe;AAAA,QAAA,WACjD,CAAC,OAAO,sBAAsB;AACxC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,wBAAwB;AAAA,QAC3D,WAAA,OAAO,gBAAgB,OAAO,sBAAsB;AAC9D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AACvB,eAAA,MAAM,eAAe,MAAM;AAAA,MACnC;AAAA,MAEC;AAAA,IAAA;AAAA,IA5BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAgCF;AACA,MAAM,eAA6G;AAAA,EAClH,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,kBAAkB;AACnB;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { useChangeMyPasswordMutation } from "../../hooks/mutations/auth/useChangeMyPasswordMutation.js";
|
|
5
|
+
const useChangeMyPasswordForm = useForm;
|
|
6
|
+
const ChangeMyPasswordForm = ({ children, onSuccess }) => {
|
|
7
|
+
const changePassword = useChangeMyPasswordMutation();
|
|
8
|
+
return /* @__PURE__ */ jsxDEV(
|
|
9
|
+
TenantForm,
|
|
10
|
+
{
|
|
11
|
+
onSuccess,
|
|
12
|
+
errorMapping: errorToField,
|
|
13
|
+
initialValues: {
|
|
14
|
+
currentPassword: "",
|
|
15
|
+
newPassword: "",
|
|
16
|
+
passwordConfirmation: ""
|
|
17
|
+
},
|
|
18
|
+
validate: ({ values }) => {
|
|
19
|
+
const errors = [];
|
|
20
|
+
if (!values.currentPassword) {
|
|
21
|
+
errors.push({ code: "FIELD_REQUIRED", field: "currentPassword" });
|
|
22
|
+
}
|
|
23
|
+
if (!values.newPassword) {
|
|
24
|
+
errors.push({ code: "FIELD_REQUIRED", field: "newPassword" });
|
|
25
|
+
} else if (values.newPassword.length < 6) {
|
|
26
|
+
errors.push({ code: "INVALID_VALUE", field: "newPassword" });
|
|
27
|
+
} else if (!values.passwordConfirmation) {
|
|
28
|
+
errors.push({ code: "FIELD_REQUIRED", field: "passwordConfirmation" });
|
|
29
|
+
} else if (values.newPassword !== values.passwordConfirmation) {
|
|
30
|
+
errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
|
|
31
|
+
}
|
|
32
|
+
return errors;
|
|
33
|
+
},
|
|
34
|
+
execute: async ({ values }) => {
|
|
35
|
+
return await changePassword(values);
|
|
36
|
+
},
|
|
37
|
+
children
|
|
38
|
+
},
|
|
39
|
+
void 0,
|
|
40
|
+
false,
|
|
41
|
+
{
|
|
42
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/ChangeMyPasswordForm.tsx",
|
|
43
|
+
lineNumber: 37,
|
|
44
|
+
columnNumber: 3
|
|
45
|
+
},
|
|
46
|
+
void 0
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
const errorToField = {
|
|
50
|
+
PASSWORD_MISMATCH: "passwordConfirmation",
|
|
51
|
+
TOO_WEAK: "newPassword",
|
|
52
|
+
NO_PASSWORD_SET: "currentPassword",
|
|
53
|
+
INVALID_PASSWORD: "currentPassword"
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
ChangeMyPasswordForm,
|
|
57
|
+
useChangeMyPasswordForm
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=ChangeMyPasswordForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangeMyPasswordForm.js","sources":["../../../../src/components/forms/ChangeMyPasswordForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { ChangeMyPasswordErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { useChangeMyPasswordMutation } from '../../hooks'\n\nexport type ChangeMyPasswordFormValues = {\n\tcurrentPassword: string\n\tnewPassword: string\n\tpasswordConfirmation: string\n}\n\nexport type ChangeMyPasswordFormErrorCode =\n\t| ChangeMyPasswordErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangeMyPasswordFormState = FormState\n\nexport type ChangeMyPasswordFormError = FormError<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>\n\nexport type ChangeMyPasswordFormContextValue = FormContextValue<ChangeMyPasswordFormValues, ChangeMyPasswordFormErrorCode>\n\nexport interface ChangeMyPasswordFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const useChangeMyPasswordForm = useForm as () => ChangeMyPasswordFormContextValue\n\nexport const ChangeMyPasswordForm = ({ children, onSuccess }: ChangeMyPasswordFormProps) => {\n\tconst changePassword = useChangeMyPasswordMutation()\n\treturn (\n\t\t<TenantForm<ChangeMyPasswordFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\tcurrentPassword: '',\n\t\t\t\tnewPassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangeMyPasswordFormError[] = []\n\t\t\t\tif (!values.currentPassword) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'currentPassword' })\n\t\t\t\t}\n\t\t\t\tif (!values.newPassword) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'newPassword' })\n\t\t\t\t} else if (values.newPassword.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'newPassword' })\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.newPassword !== 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 changePassword(values)\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Partial<Record<ChangeMyPasswordFormErrorCode, keyof ChangeMyPasswordFormValues | undefined>> = {\n\tPASSWORD_MISMATCH: 'passwordConfirmation',\n\tTOO_WEAK: 'newPassword',\n\tNO_PASSWORD_SET: 'currentPassword',\n\tINVALID_PASSWORD: 'currentPassword',\n}\n"],"names":["this"],"mappings":";;;;AA+BO,MAAM,0BAA0B;AAEhC,MAAM,uBAAuB,CAAC,EAAE,UAAU,gBAA2C;AAC3F,QAAM,iBAAiB;AAEtB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,iBAAiB;AAAA,QACjB,aAAa;AAAA,QACb,sBAAsB;AAAA,MACvB;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAsC,CAAA;AACxC,YAAA,CAAC,OAAO,iBAAiB;AAC5B,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,mBAAmB;AAAA,QACjE;AACI,YAAA,CAAC,OAAO,aAAa;AACxB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAClD,WAAA,OAAO,YAAY,SAAS,GAAG;AACzC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,eAAe;AAAA,QAAA,WACjD,CAAC,OAAO,sBAAsB;AACxC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,wBAAwB;AAAA,QAC3D,WAAA,OAAO,gBAAgB,OAAO,sBAAsB;AAC9D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AACvB,eAAA,MAAM,eAAe,MAAM;AAAA,MACnC;AAAA,MAEC;AAAA,IAAA;AAAA,IA5BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAgCF;AACA,MAAM,eAA6G;AAAA,EAClH,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,kBAAkB;AACnB;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 useCreateApiKeyMutation = require("../../hooks/mutations/apiKey/useCreateApiKeyMutation.cjs");
|
|
7
|
+
const useCreateApiKeyForm = contexts.useForm;
|
|
8
|
+
const CreateApiKeyForm = ({ children, onSuccess, projectSlug, initialMemberships }) => {
|
|
9
|
+
const createApiKey = useCreateApiKeyMutation.useCreateApiKeyMutation();
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
initialValues: {
|
|
15
|
+
description: "",
|
|
16
|
+
memberships: initialMemberships || []
|
|
17
|
+
},
|
|
18
|
+
validate: ({ values }) => {
|
|
19
|
+
const errors = [];
|
|
20
|
+
if (!values.description) {
|
|
21
|
+
errors.push({ code: "FIELD_REQUIRED", field: "description" });
|
|
22
|
+
}
|
|
23
|
+
if (values.memberships.length === 0) {
|
|
24
|
+
errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
|
|
25
|
+
}
|
|
26
|
+
return errors;
|
|
27
|
+
},
|
|
28
|
+
execute: async ({ values }) => {
|
|
29
|
+
return await createApiKey({
|
|
30
|
+
description: values.description,
|
|
31
|
+
projectSlug,
|
|
32
|
+
memberships: values.memberships
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
errorMapping: errorToField,
|
|
36
|
+
children
|
|
37
|
+
},
|
|
38
|
+
void 0,
|
|
39
|
+
false,
|
|
40
|
+
{
|
|
41
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/CreateApiKeyForm.tsx",
|
|
42
|
+
lineNumber: 36,
|
|
43
|
+
columnNumber: 3
|
|
44
|
+
},
|
|
45
|
+
void 0
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
const errorToField = {
|
|
49
|
+
INVALID_MEMBERSHIP: "memberships",
|
|
50
|
+
PROJECT_NOT_FOUND: void 0,
|
|
51
|
+
ROLE_NOT_FOUND: "memberships",
|
|
52
|
+
VARIABLE_EMPTY: "memberships",
|
|
53
|
+
VARIABLE_NOT_FOUND: "memberships"
|
|
54
|
+
};
|
|
55
|
+
exports.CreateApiKeyForm = CreateApiKeyForm;
|
|
56
|
+
exports.useCreateApiKeyForm = useCreateApiKeyForm;
|
|
57
|
+
//# sourceMappingURL=CreateApiKeyForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateApiKeyForm.cjs","sources":["../../../../src/components/forms/CreateApiKeyForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { CreateApiKeyErrorCode, MembershipInput } from '@contember/graphql-client-tenant'\nimport { CreateApiKeyMutationResult, useCreateApiKeyMutation } from '../../hooks'\n\nexport type CreateApiKeyFormValues = {\n\tdescription: string\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type CreateApiKeyFormErrorCode =\n\t| CreateApiKeyErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type CreateApiKeyFormState = FormState\n\nexport type CreateApiKeyFormError = FormError<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>\n\nexport type CreateApiKeyFormContextValue = FormContextValue<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>\n\nexport interface CreateApiKeyFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tinitialMemberships?: readonly MembershipInput[]\n\tonSuccess?: (args: { result: CreateApiKeyMutationResult }) => void\n}\n\nexport const useCreateApiKeyForm = useForm as () => CreateApiKeyFormContextValue\n\nexport const CreateApiKeyForm = ({ children, onSuccess, projectSlug, initialMemberships }: CreateApiKeyFormProps) => {\n\tconst createApiKey = useCreateApiKeyMutation()\n\treturn (\n\t\t<TenantForm<CreateApiKeyFormContextValue, CreateApiKeyMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\tdescription: '',\n\t\t\t\tmemberships: initialMemberships || [],\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: CreateApiKeyFormError[] = []\n\t\t\t\tif (!values.description) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'description' })\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 createApiKey({\n\t\t\t\t\tdescription: values.description,\n\t\t\t\t\tprojectSlug,\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<CreateApiKeyErrorCode, keyof CreateApiKeyFormValues | undefined> = {\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":["useForm","useCreateApiKeyMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA8BO,MAAM,sBAAsBA,SAAA;AAE5B,MAAM,mBAAmB,CAAC,EAAE,UAAU,WAAW,aAAa,yBAAgD;AACpH,QAAM,eAAeC,wBAAAA;AAEpB,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,aAAa;AAAA,QACb,aAAa,sBAAsB,CAAC;AAAA,MACrC;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAkC,CAAA;AACpC,YAAA,CAAC,OAAO,aAAa;AACxB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;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,aAAa;AAAA,UACzB,aAAa,OAAO;AAAA,UACpB;AAAA,UACA,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IAzBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AA4BF;AAEA,MAAM,eAAwF;AAAA,EAC7F,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AACrB;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { useCreateApiKeyMutation } from "../../hooks/mutations/apiKey/useCreateApiKeyMutation.js";
|
|
5
|
+
const useCreateApiKeyForm = useForm;
|
|
6
|
+
const CreateApiKeyForm = ({ children, onSuccess, projectSlug, initialMemberships }) => {
|
|
7
|
+
const createApiKey = useCreateApiKeyMutation();
|
|
8
|
+
return /* @__PURE__ */ jsxDEV(
|
|
9
|
+
TenantForm,
|
|
10
|
+
{
|
|
11
|
+
onSuccess,
|
|
12
|
+
initialValues: {
|
|
13
|
+
description: "",
|
|
14
|
+
memberships: initialMemberships || []
|
|
15
|
+
},
|
|
16
|
+
validate: ({ values }) => {
|
|
17
|
+
const errors = [];
|
|
18
|
+
if (!values.description) {
|
|
19
|
+
errors.push({ code: "FIELD_REQUIRED", field: "description" });
|
|
20
|
+
}
|
|
21
|
+
if (values.memberships.length === 0) {
|
|
22
|
+
errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
|
|
23
|
+
}
|
|
24
|
+
return errors;
|
|
25
|
+
},
|
|
26
|
+
execute: async ({ values }) => {
|
|
27
|
+
return await createApiKey({
|
|
28
|
+
description: values.description,
|
|
29
|
+
projectSlug,
|
|
30
|
+
memberships: values.memberships
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
errorMapping: errorToField,
|
|
34
|
+
children
|
|
35
|
+
},
|
|
36
|
+
void 0,
|
|
37
|
+
false,
|
|
38
|
+
{
|
|
39
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/CreateApiKeyForm.tsx",
|
|
40
|
+
lineNumber: 36,
|
|
41
|
+
columnNumber: 3
|
|
42
|
+
},
|
|
43
|
+
void 0
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
const errorToField = {
|
|
47
|
+
INVALID_MEMBERSHIP: "memberships",
|
|
48
|
+
PROJECT_NOT_FOUND: void 0,
|
|
49
|
+
ROLE_NOT_FOUND: "memberships",
|
|
50
|
+
VARIABLE_EMPTY: "memberships",
|
|
51
|
+
VARIABLE_NOT_FOUND: "memberships"
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
CreateApiKeyForm,
|
|
55
|
+
useCreateApiKeyForm
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=CreateApiKeyForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateApiKeyForm.js","sources":["../../../../src/components/forms/CreateApiKeyForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { CreateApiKeyErrorCode, MembershipInput } from '@contember/graphql-client-tenant'\nimport { CreateApiKeyMutationResult, useCreateApiKeyMutation } from '../../hooks'\n\nexport type CreateApiKeyFormValues = {\n\tdescription: string\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type CreateApiKeyFormErrorCode =\n\t| CreateApiKeyErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type CreateApiKeyFormState = FormState\n\nexport type CreateApiKeyFormError = FormError<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>\n\nexport type CreateApiKeyFormContextValue = FormContextValue<CreateApiKeyFormValues, CreateApiKeyFormErrorCode>\n\nexport interface CreateApiKeyFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tinitialMemberships?: readonly MembershipInput[]\n\tonSuccess?: (args: { result: CreateApiKeyMutationResult }) => void\n}\n\nexport const useCreateApiKeyForm = useForm as () => CreateApiKeyFormContextValue\n\nexport const CreateApiKeyForm = ({ children, onSuccess, projectSlug, initialMemberships }: CreateApiKeyFormProps) => {\n\tconst createApiKey = useCreateApiKeyMutation()\n\treturn (\n\t\t<TenantForm<CreateApiKeyFormContextValue, CreateApiKeyMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\tdescription: '',\n\t\t\t\tmemberships: initialMemberships || [],\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: CreateApiKeyFormError[] = []\n\t\t\t\tif (!values.description) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'description' })\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 createApiKey({\n\t\t\t\t\tdescription: values.description,\n\t\t\t\t\tprojectSlug,\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<CreateApiKeyErrorCode, keyof CreateApiKeyFormValues | undefined> = {\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":";;;;AA8BO,MAAM,sBAAsB;AAE5B,MAAM,mBAAmB,CAAC,EAAE,UAAU,WAAW,aAAa,yBAAgD;AACpH,QAAM,eAAe;AAEpB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,aAAa;AAAA,QACb,aAAa,sBAAsB,CAAC;AAAA,MACrC;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAkC,CAAA;AACpC,YAAA,CAAC,OAAO,aAAa;AACxB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;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,aAAa;AAAA,UACzB,aAAa,OAAO;AAAA,UACpB;AAAA,UACA,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IAzBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA4BF;AAEA,MAAM,eAAwF;AAAA,EAC7F,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AACrB;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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 useCreateSessionTokenMutation = require("../../hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs");
|
|
7
|
+
const useCreateSessionTokenForm = contexts.useForm;
|
|
8
|
+
const CreateSessionTokenForm = ({ children, onSuccess, expiration, apiToken }) => {
|
|
9
|
+
const createSessionToken = useCreateSessionTokenMutation.useCreateSessionTokenMutation({ apiToken });
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
initialValues: {
|
|
15
|
+
email: ""
|
|
16
|
+
},
|
|
17
|
+
validate: ({ values }) => {
|
|
18
|
+
const errors = [];
|
|
19
|
+
if (!values.email) {
|
|
20
|
+
errors.push({ code: "FIELD_REQUIRED", field: "email" });
|
|
21
|
+
}
|
|
22
|
+
return errors;
|
|
23
|
+
},
|
|
24
|
+
execute: async ({ values }) => {
|
|
25
|
+
return await createSessionToken({
|
|
26
|
+
email: values.email,
|
|
27
|
+
expiration
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
errorMapping: errorToField,
|
|
31
|
+
children
|
|
32
|
+
},
|
|
33
|
+
void 0,
|
|
34
|
+
false,
|
|
35
|
+
{
|
|
36
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/CreateSessionTokenForm.tsx",
|
|
37
|
+
lineNumber: 35,
|
|
38
|
+
columnNumber: 3
|
|
39
|
+
},
|
|
40
|
+
void 0
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
const errorToField = {
|
|
44
|
+
PERSON_DISABLED: "email",
|
|
45
|
+
UNKNOWN_EMAIL: "email",
|
|
46
|
+
UNKNOWN_PERSON_ID: "email"
|
|
47
|
+
};
|
|
48
|
+
exports.CreateSessionTokenForm = CreateSessionTokenForm;
|
|
49
|
+
exports.useCreateSessionTokenForm = useCreateSessionTokenForm;
|
|
50
|
+
//# sourceMappingURL=CreateSessionTokenForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateSessionTokenForm.cjs","sources":["../../../../src/components/forms/CreateSessionTokenForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { CreateSessionTokenErrorCode } from '@contember/graphql-client-tenant'\nimport { CreateSessionTokenMutationResult, useCreateSessionTokenMutation } from '../../hooks'\n\nexport type CreateSessionTokenFormValues = {\n\temail: string\n}\n\nexport type CreateSessionTokenFormErrorCode =\n\t| CreateSessionTokenErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type CreateSessionTokenFormState = FormState\n\nexport type CreateSessionTokenFormError = FormError<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>\n\nexport type CreateSessionTokenFormContextValue = FormContextValue<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>\n\nexport interface CreateSessionTokenFormProps {\n\tchildren: ReactElement\n\texpiration?: number\n\tapiToken?: string\n\tonSuccess?: (args: { result: CreateSessionTokenMutationResult }) => void\n}\n\nexport const useCreateSessionTokenForm = useForm as () => CreateSessionTokenFormContextValue\n\nexport const CreateSessionTokenForm = ({ children, onSuccess, expiration, apiToken }: CreateSessionTokenFormProps) => {\n\tconst createSessionToken = useCreateSessionTokenMutation({ apiToken })\n\treturn (\n\t\t<TenantForm<CreateSessionTokenFormContextValue, CreateSessionTokenMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\temail: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: CreateSessionTokenFormError[] = []\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\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await createSessionToken({\n\t\t\t\t\temail: values.email,\n\t\t\t\t\texpiration,\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<CreateSessionTokenErrorCode, keyof CreateSessionTokenFormValues | undefined> = {\n\tPERSON_DISABLED: 'email',\n\tUNKNOWN_EMAIL: 'email',\n\tUNKNOWN_PERSON_ID: 'email',\n}\n"],"names":["useForm","useCreateSessionTokenMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA6BO,MAAM,4BAA4BA,SAAA;AAElC,MAAM,yBAAyB,CAAC,EAAE,UAAU,WAAW,YAAY,eAA4C;AACrH,QAAM,qBAAqBC,8BAAAA,8BAA8B,EAAE,SAAU,CAAA;AAEpE,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,OAAO;AAAA,MACR;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAwC,CAAA;AAC1C,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,mBAAmB;AAAA,UAC/B,OAAO,OAAO;AAAA,UACd;AAAA,QAAA,CACA;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IApBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAuBF;AAEA,MAAM,eAAoG;AAAA,EACzG,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,mBAAmB;AACpB;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { useCreateSessionTokenMutation } from "../../hooks/mutations/apiKey/useCreateSessionTokenMutation.js";
|
|
5
|
+
const useCreateSessionTokenForm = useForm;
|
|
6
|
+
const CreateSessionTokenForm = ({ children, onSuccess, expiration, apiToken }) => {
|
|
7
|
+
const createSessionToken = useCreateSessionTokenMutation({ apiToken });
|
|
8
|
+
return /* @__PURE__ */ jsxDEV(
|
|
9
|
+
TenantForm,
|
|
10
|
+
{
|
|
11
|
+
onSuccess,
|
|
12
|
+
initialValues: {
|
|
13
|
+
email: ""
|
|
14
|
+
},
|
|
15
|
+
validate: ({ values }) => {
|
|
16
|
+
const errors = [];
|
|
17
|
+
if (!values.email) {
|
|
18
|
+
errors.push({ code: "FIELD_REQUIRED", field: "email" });
|
|
19
|
+
}
|
|
20
|
+
return errors;
|
|
21
|
+
},
|
|
22
|
+
execute: async ({ values }) => {
|
|
23
|
+
return await createSessionToken({
|
|
24
|
+
email: values.email,
|
|
25
|
+
expiration
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
errorMapping: errorToField,
|
|
29
|
+
children
|
|
30
|
+
},
|
|
31
|
+
void 0,
|
|
32
|
+
false,
|
|
33
|
+
{
|
|
34
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/CreateSessionTokenForm.tsx",
|
|
35
|
+
lineNumber: 35,
|
|
36
|
+
columnNumber: 3
|
|
37
|
+
},
|
|
38
|
+
void 0
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
const errorToField = {
|
|
42
|
+
PERSON_DISABLED: "email",
|
|
43
|
+
UNKNOWN_EMAIL: "email",
|
|
44
|
+
UNKNOWN_PERSON_ID: "email"
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
CreateSessionTokenForm,
|
|
48
|
+
useCreateSessionTokenForm
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=CreateSessionTokenForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateSessionTokenForm.js","sources":["../../../../src/components/forms/CreateSessionTokenForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { CreateSessionTokenErrorCode } from '@contember/graphql-client-tenant'\nimport { CreateSessionTokenMutationResult, useCreateSessionTokenMutation } from '../../hooks'\n\nexport type CreateSessionTokenFormValues = {\n\temail: string\n}\n\nexport type CreateSessionTokenFormErrorCode =\n\t| CreateSessionTokenErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type CreateSessionTokenFormState = FormState\n\nexport type CreateSessionTokenFormError = FormError<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>\n\nexport type CreateSessionTokenFormContextValue = FormContextValue<CreateSessionTokenFormValues, CreateSessionTokenFormErrorCode>\n\nexport interface CreateSessionTokenFormProps {\n\tchildren: ReactElement\n\texpiration?: number\n\tapiToken?: string\n\tonSuccess?: (args: { result: CreateSessionTokenMutationResult }) => void\n}\n\nexport const useCreateSessionTokenForm = useForm as () => CreateSessionTokenFormContextValue\n\nexport const CreateSessionTokenForm = ({ children, onSuccess, expiration, apiToken }: CreateSessionTokenFormProps) => {\n\tconst createSessionToken = useCreateSessionTokenMutation({ apiToken })\n\treturn (\n\t\t<TenantForm<CreateSessionTokenFormContextValue, CreateSessionTokenMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\temail: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: CreateSessionTokenFormError[] = []\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\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await createSessionToken({\n\t\t\t\t\temail: values.email,\n\t\t\t\t\texpiration,\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<CreateSessionTokenErrorCode, keyof CreateSessionTokenFormValues | undefined> = {\n\tPERSON_DISABLED: 'email',\n\tUNKNOWN_EMAIL: 'email',\n\tUNKNOWN_PERSON_ID: 'email',\n}\n"],"names":["this"],"mappings":";;;;AA6BO,MAAM,4BAA4B;AAElC,MAAM,yBAAyB,CAAC,EAAE,UAAU,WAAW,YAAY,eAA4C;AACrH,QAAM,qBAAqB,8BAA8B,EAAE,SAAU,CAAA;AAEpE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,OAAO;AAAA,MACR;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAwC,CAAA;AAC1C,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACO,eAAA;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,mBAAmB;AAAA,UAC/B,OAAO,OAAO;AAAA,UACd;AAAA,QAAA,CACA;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IApBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAuBF;AAEA,MAAM,eAAoG;AAAA,EACzG,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,mBAAmB;AACpB;"}
|
|
@@ -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 useInviteMutation = require("../../hooks/mutations/invite/useInviteMutation.cjs");
|
|
7
|
+
const useInviteForm = contexts.useForm;
|
|
8
|
+
const InviteForm = ({ children, onSuccess, projectSlug, initialMemberships, inviteOptions }) => {
|
|
9
|
+
const invite = useInviteMutation.useInviteMutation();
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
initialValues: {
|
|
15
|
+
email: "",
|
|
16
|
+
name: "",
|
|
17
|
+
memberships: initialMemberships || []
|
|
18
|
+
},
|
|
19
|
+
validate: ({ values }) => {
|
|
20
|
+
const errors = [];
|
|
21
|
+
if (!values.email) {
|
|
22
|
+
errors.push({ code: "FIELD_REQUIRED", field: "email" });
|
|
23
|
+
}
|
|
24
|
+
if (values.memberships.length === 0) {
|
|
25
|
+
errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
|
|
26
|
+
}
|
|
27
|
+
return errors;
|
|
28
|
+
},
|
|
29
|
+
execute: async ({ values }) => {
|
|
30
|
+
return await invite({
|
|
31
|
+
email: values.email,
|
|
32
|
+
name: values.name,
|
|
33
|
+
projectSlug,
|
|
34
|
+
options: inviteOptions,
|
|
35
|
+
memberships: values.memberships
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
errorMapping: errorToField,
|
|
39
|
+
children
|
|
40
|
+
},
|
|
41
|
+
void 0,
|
|
42
|
+
false,
|
|
43
|
+
{
|
|
44
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/InviteForm.tsx",
|
|
45
|
+
lineNumber: 38,
|
|
46
|
+
columnNumber: 3
|
|
47
|
+
},
|
|
48
|
+
void 0
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
const errorToField = {
|
|
52
|
+
ALREADY_MEMBER: "email",
|
|
53
|
+
INVALID_EMAIL_FORMAT: "email",
|
|
54
|
+
INVALID_MEMBERSHIP: "memberships",
|
|
55
|
+
PROJECT_NOT_FOUND: void 0,
|
|
56
|
+
ROLE_NOT_FOUND: "memberships",
|
|
57
|
+
VARIABLE_EMPTY: "memberships",
|
|
58
|
+
VARIABLE_NOT_FOUND: "memberships"
|
|
59
|
+
};
|
|
60
|
+
exports.InviteForm = InviteForm;
|
|
61
|
+
exports.useInviteForm = useInviteForm;
|
|
62
|
+
//# sourceMappingURL=InviteForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InviteForm.cjs","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":["useForm","useInviteMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AAgCO,MAAM,gBAAgBA,SAAA;AAEhB,MAAA,aAAa,CAAC,EAAE,UAAU,WAAW,aAAa,oBAAoB,oBAAqC;AACvH,QAAM,SAASC,kBAAAA;AAEd,SAAAC,8BAAA;AAAA,IAACC,WAAA;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,IAAAC;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;;;"}
|