@contember/react-client-tenant 1.3.0-alpha.26 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/components/IdentityProvider.cjs +38 -0
- package/dist/development/components/IdentityProvider.cjs.map +1 -0
- package/dist/development/components/IdentityProvider.js +38 -0
- package/dist/development/components/IdentityProvider.js.map +1 -0
- package/dist/development/components/IdentityState.cjs +14 -0
- package/dist/development/components/IdentityState.cjs.map +1 -0
- package/dist/development/components/IdentityState.js +14 -0
- package/dist/development/components/IdentityState.js.map +1 -0
- package/dist/development/components/forms/ChangeMyPasswordForm.cjs +59 -0
- package/dist/development/components/forms/ChangeMyPasswordForm.cjs.map +1 -0
- package/dist/development/components/forms/ChangeMyPasswordForm.js +59 -0
- package/dist/development/components/forms/ChangeMyPasswordForm.js.map +1 -0
- package/dist/development/components/forms/CreateApiKeyForm.cjs +57 -0
- package/dist/development/components/forms/CreateApiKeyForm.cjs.map +1 -0
- package/dist/development/components/forms/CreateApiKeyForm.js +57 -0
- package/dist/development/components/forms/CreateApiKeyForm.js.map +1 -0
- package/dist/development/components/forms/CreateSessionTokenForm.cjs +50 -0
- package/dist/development/components/forms/CreateSessionTokenForm.cjs.map +1 -0
- package/dist/development/components/forms/CreateSessionTokenForm.js +50 -0
- package/dist/development/components/forms/CreateSessionTokenForm.js.map +1 -0
- package/dist/development/components/forms/InviteForm.cjs +62 -0
- package/dist/development/components/forms/InviteForm.cjs.map +1 -0
- package/dist/development/components/forms/InviteForm.js +62 -0
- package/dist/development/components/forms/InviteForm.js.map +1 -0
- package/dist/development/components/forms/LoginForm.cjs +85 -0
- package/dist/development/components/forms/LoginForm.cjs.map +1 -0
- package/dist/development/components/forms/LoginForm.js +85 -0
- package/dist/development/components/forms/LoginForm.js.map +1 -0
- package/dist/development/components/forms/OtpConfirmForm.cjs +49 -0
- package/dist/development/components/forms/OtpConfirmForm.cjs.map +1 -0
- package/dist/development/components/forms/OtpConfirmForm.js +49 -0
- package/dist/development/components/forms/OtpConfirmForm.js.map +1 -0
- package/dist/development/components/forms/OtpPrepareForm.cjs +36 -0
- package/dist/development/components/forms/OtpPrepareForm.cjs.map +1 -0
- package/dist/development/components/forms/OtpPrepareForm.js +36 -0
- package/dist/development/components/forms/OtpPrepareForm.js.map +1 -0
- package/dist/development/components/forms/PasswordResetForm.cjs +62 -0
- package/dist/development/components/forms/PasswordResetForm.cjs.map +1 -0
- package/dist/development/components/forms/PasswordResetForm.js +62 -0
- package/dist/development/components/forms/PasswordResetForm.js.map +1 -0
- package/dist/development/components/forms/PasswordResetRequestForm.cjs +49 -0
- package/dist/development/components/forms/PasswordResetRequestForm.cjs.map +1 -0
- package/dist/development/components/forms/PasswordResetRequestForm.js +49 -0
- package/dist/development/components/forms/PasswordResetRequestForm.js.map +1 -0
- package/dist/development/components/forms/TenantForm.cjs +91 -0
- package/dist/development/components/forms/TenantForm.cjs.map +1 -0
- package/dist/development/components/forms/TenantForm.js +91 -0
- package/dist/development/components/forms/TenantForm.js.map +1 -0
- package/dist/development/components/forms/UpdateProjectMemberForm.cjs +64 -0
- package/dist/development/components/forms/UpdateProjectMemberForm.cjs.map +1 -0
- package/dist/development/components/forms/UpdateProjectMemberForm.js +64 -0
- package/dist/development/components/forms/UpdateProjectMemberForm.js.map +1 -0
- package/dist/development/components/idp/IDP.cjs +56 -0
- package/dist/development/components/idp/IDP.cjs.map +1 -0
- package/dist/development/components/idp/IDP.js +56 -0
- package/dist/development/components/idp/IDP.js.map +1 -0
- package/dist/development/components/idp/IDPInitTrigger.cjs +16 -0
- package/dist/development/components/idp/IDPInitTrigger.cjs.map +1 -0
- package/dist/development/components/idp/IDPInitTrigger.js +16 -0
- package/dist/development/components/idp/IDPInitTrigger.js.map +1 -0
- package/dist/development/components/idp/IDPState.cjs +14 -0
- package/dist/development/components/idp/IDPState.cjs.map +1 -0
- package/dist/development/components/idp/IDPState.js +14 -0
- package/dist/development/components/idp/IDPState.js.map +1 -0
- package/dist/development/components/triggers/DisableOtpTrigger.cjs +32 -0
- package/dist/development/components/triggers/DisableOtpTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/DisableOtpTrigger.js +32 -0
- package/dist/development/components/triggers/DisableOtpTrigger.js.map +1 -0
- package/dist/development/components/triggers/LogoutTrigger.cjs +16 -0
- package/dist/development/components/triggers/LogoutTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/LogoutTrigger.js +16 -0
- package/dist/development/components/triggers/LogoutTrigger.js.map +1 -0
- package/dist/development/components/triggers/RemoveProjectMemberTrigger.cjs +17 -0
- package/dist/development/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/RemoveProjectMemberTrigger.js +17 -0
- package/dist/development/components/triggers/RemoveProjectMemberTrigger.js.map +1 -0
- package/dist/development/components/triggers/TenantActionTrigger.cjs +37 -0
- package/dist/development/components/triggers/TenantActionTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/TenantActionTrigger.js +37 -0
- package/dist/development/components/triggers/TenantActionTrigger.js.map +1 -0
- package/dist/development/contexts.cjs +34 -0
- package/dist/development/contexts.cjs.map +1 -0
- package/dist/development/contexts.js +34 -0
- package/dist/development/contexts.js.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs +30 -0
- package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.js +13 -0
- package/dist/development/hooks/mutations/apiKey/useCreateApiKeyMutation.js.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs +30 -0
- package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js +13 -0
- package/dist/development/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs +30 -0
- package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.js +13 -0
- package/dist/development/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs +29 -0
- package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.js +12 -0
- package/dist/development/hooks/mutations/apiKey/useDisableApiKeyMutation.js.map +1 -0
- package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.cjs +29 -0
- package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.js +12 -0
- package/dist/development/hooks/mutations/auth/useChangeMyPasswordMutation.js.map +1 -0
- package/dist/development/hooks/mutations/auth/useSignInMutation.cjs +33 -0
- package/dist/development/hooks/mutations/auth/useSignInMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/auth/useSignInMutation.js +16 -0
- package/dist/development/hooks/mutations/auth/useSignInMutation.js.map +1 -0
- package/dist/development/hooks/mutations/auth/useSignOutMutation.cjs +29 -0
- package/dist/development/hooks/mutations/auth/useSignOutMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/auth/useSignOutMutation.js +12 -0
- package/dist/development/hooks/mutations/auth/useSignOutMutation.js.map +1 -0
- package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.cjs +31 -0
- package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.js +14 -0
- package/dist/development/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -0
- package/dist/development/hooks/mutations/idp/useSignInIdpMutation.cjs +33 -0
- package/dist/development/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/idp/useSignInIdpMutation.js +16 -0
- package/dist/development/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -0
- package/dist/development/hooks/mutations/invite/useInviteMutation.cjs +30 -0
- package/dist/development/hooks/mutations/invite/useInviteMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/invite/useInviteMutation.js +13 -0
- package/dist/development/hooks/mutations/invite/useInviteMutation.js.map +1 -0
- package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.cjs +29 -0
- package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.js +12 -0
- package/dist/development/hooks/mutations/memberships/useAddProjectMemberMutation.js.map +1 -0
- package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs +29 -0
- package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.js +12 -0
- package/dist/development/hooks/mutations/memberships/useRemoveProjectMemberMutation.js.map +1 -0
- package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs +29 -0
- package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.js +12 -0
- package/dist/development/hooks/mutations/memberships/useUpdateProjectMemberMutation.js.map +1 -0
- package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.cjs +29 -0
- package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.js +12 -0
- package/dist/development/hooks/mutations/otp/useConfirmOtpMutation.js.map +1 -0
- package/dist/development/hooks/mutations/otp/useDisableOtpMutation.cjs +29 -0
- package/dist/development/hooks/mutations/otp/useDisableOtpMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/otp/useDisableOtpMutation.js +12 -0
- package/dist/development/hooks/mutations/otp/useDisableOtpMutation.js.map +1 -0
- package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.cjs +30 -0
- package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.js +13 -0
- package/dist/development/hooks/mutations/otp/usePrepareOtpMutation.js.map +1 -0
- package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs +32 -0
- package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js +15 -0
- package/dist/development/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js.map +1 -0
- package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.cjs +32 -0
- package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -0
- package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.js +15 -0
- package/dist/development/hooks/mutations/passwordReset/useResetPasswordMutation.js.map +1 -0
- package/dist/development/hooks/queries/useMeQuery.cjs +33 -0
- package/dist/development/hooks/queries/useMeQuery.cjs.map +1 -0
- package/dist/development/hooks/queries/useMeQuery.js +16 -0
- package/dist/development/hooks/queries/useMeQuery.js.map +1 -0
- package/dist/development/hooks/queries/useProjectMembersQuery.cjs +47 -0
- package/dist/development/hooks/queries/useProjectMembersQuery.cjs.map +1 -0
- package/dist/development/hooks/queries/useProjectMembersQuery.js +30 -0
- package/dist/development/hooks/queries/useProjectMembersQuery.js.map +1 -0
- package/dist/development/hooks/queries/useProjectMembershipsQuery.cjs +34 -0
- package/dist/development/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -0
- package/dist/development/hooks/queries/useProjectMembershipsQuery.js +17 -0
- package/dist/development/hooks/queries/useProjectMembershipsQuery.js.map +1 -0
- package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.cjs +36 -0
- package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -0
- package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.js +19 -0
- package/dist/development/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -0
- package/dist/development/hooks/useFetchIdentity.cjs +52 -0
- package/dist/development/hooks/useFetchIdentity.cjs.map +1 -0
- package/dist/development/hooks/useFetchIdentity.js +52 -0
- package/dist/development/hooks/useFetchIdentity.js.map +1 -0
- package/dist/development/hooks/useLogout.cjs +10 -0
- package/dist/development/hooks/useLogout.cjs.map +1 -0
- package/dist/development/hooks/useLogout.js +10 -0
- package/dist/development/hooks/useLogout.js.map +1 -0
- package/dist/development/hooks/useTenantApi.cjs +11 -4
- package/dist/development/hooks/useTenantApi.cjs.map +1 -1
- package/dist/development/hooks/useTenantApi.js +12 -5
- package/dist/development/hooks/useTenantApi.js.map +1 -1
- package/dist/development/hooks/useTenantMutation.cjs +33 -0
- package/dist/development/hooks/useTenantMutation.cjs.map +1 -0
- package/dist/development/hooks/useTenantMutation.js +33 -0
- package/dist/development/hooks/useTenantMutation.js.map +1 -0
- package/dist/development/hooks/useTenantQueryLoader.cjs +36 -0
- package/dist/development/hooks/useTenantQueryLoader.cjs.map +1 -0
- package/dist/development/hooks/useTenantQueryLoader.js +36 -0
- package/dist/development/hooks/useTenantQueryLoader.js.map +1 -0
- package/dist/development/index.cjs +130 -0
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +132 -2
- package/dist/development/index.js.map +1 -1
- package/dist/development/internal/hooks/useHandleIDPResponse.cjs +51 -0
- package/dist/development/internal/hooks/useHandleIDPResponse.cjs.map +1 -0
- package/dist/development/internal/hooks/useHandleIDPResponse.js +51 -0
- package/dist/development/internal/hooks/useHandleIDPResponse.js.map +1 -0
- package/dist/development/internal/hooks/useIDPAutoInit.cjs +19 -0
- package/dist/development/internal/hooks/useIDPAutoInit.cjs.map +1 -0
- package/dist/development/internal/hooks/useIDPAutoInit.js +19 -0
- package/dist/development/internal/hooks/useIDPAutoInit.js.map +1 -0
- package/dist/development/internal/hooks/useIDPStateStore.cjs +19 -0
- package/dist/development/internal/hooks/useIDPStateStore.cjs.map +1 -0
- package/dist/development/internal/hooks/useIDPStateStore.js +19 -0
- package/dist/development/internal/hooks/useIDPStateStore.js.map +1 -0
- package/dist/development/internal/hooks/useInitIDPRedirect.cjs +44 -0
- package/dist/development/internal/hooks/useInitIDPRedirect.cjs.map +1 -0
- package/dist/development/internal/hooks/useInitIDPRedirect.js +44 -0
- package/dist/development/internal/hooks/useInitIDPRedirect.js.map +1 -0
- package/dist/development/internal/hooks/useLogoutInternal.cjs +35 -0
- package/dist/development/internal/hooks/useLogoutInternal.cjs.map +1 -0
- package/dist/development/internal/hooks/useLogoutInternal.js +35 -0
- package/dist/development/internal/hooks/useLogoutInternal.js.map +1 -0
- package/dist/development/internal/hooks/useRedirectToBacklink.cjs +31 -0
- package/dist/development/internal/hooks/useRedirectToBacklink.cjs.map +1 -0
- package/dist/development/internal/hooks/useRedirectToBacklink.js +31 -0
- package/dist/development/internal/hooks/useRedirectToBacklink.js.map +1 -0
- package/dist/development/internal/utils/getBaseHref.cjs +8 -0
- package/dist/development/internal/utils/getBaseHref.cjs.map +1 -0
- package/dist/development/internal/utils/getBaseHref.js +8 -0
- package/dist/development/internal/utils/getBaseHref.js.map +1 -0
- package/dist/production/components/IdentityProvider.cjs +26 -0
- package/dist/production/components/IdentityProvider.cjs.map +1 -0
- package/dist/production/components/IdentityProvider.js +26 -0
- package/dist/production/components/IdentityProvider.js.map +1 -0
- package/dist/production/components/IdentityState.cjs +10 -0
- package/dist/production/components/IdentityState.cjs.map +1 -0
- package/dist/production/components/IdentityState.js +10 -0
- package/dist/production/components/IdentityState.js.map +1 -0
- package/dist/production/components/forms/ChangeMyPasswordForm.cjs +51 -0
- package/dist/production/components/forms/ChangeMyPasswordForm.cjs.map +1 -0
- package/dist/production/components/forms/ChangeMyPasswordForm.js +51 -0
- package/dist/production/components/forms/ChangeMyPasswordForm.js.map +1 -0
- package/dist/production/components/forms/CreateApiKeyForm.cjs +49 -0
- package/dist/production/components/forms/CreateApiKeyForm.cjs.map +1 -0
- package/dist/production/components/forms/CreateApiKeyForm.js +49 -0
- package/dist/production/components/forms/CreateApiKeyForm.js.map +1 -0
- package/dist/production/components/forms/CreateSessionTokenForm.cjs +42 -0
- package/dist/production/components/forms/CreateSessionTokenForm.cjs.map +1 -0
- package/dist/production/components/forms/CreateSessionTokenForm.js +42 -0
- package/dist/production/components/forms/CreateSessionTokenForm.js.map +1 -0
- package/dist/production/components/forms/InviteForm.cjs +54 -0
- package/dist/production/components/forms/InviteForm.cjs.map +1 -0
- package/dist/production/components/forms/InviteForm.js +54 -0
- package/dist/production/components/forms/InviteForm.js.map +1 -0
- package/dist/production/components/forms/LoginForm.cjs +77 -0
- package/dist/production/components/forms/LoginForm.cjs.map +1 -0
- package/dist/production/components/forms/LoginForm.js +77 -0
- package/dist/production/components/forms/LoginForm.js.map +1 -0
- package/dist/production/components/forms/OtpConfirmForm.cjs +41 -0
- package/dist/production/components/forms/OtpConfirmForm.cjs.map +1 -0
- package/dist/production/components/forms/OtpConfirmForm.js +41 -0
- package/dist/production/components/forms/OtpConfirmForm.js.map +1 -0
- package/dist/production/components/forms/OtpPrepareForm.cjs +28 -0
- package/dist/production/components/forms/OtpPrepareForm.cjs.map +1 -0
- package/dist/production/components/forms/OtpPrepareForm.js +28 -0
- package/dist/production/components/forms/OtpPrepareForm.js.map +1 -0
- package/dist/production/components/forms/PasswordResetForm.cjs +54 -0
- package/dist/production/components/forms/PasswordResetForm.cjs.map +1 -0
- package/dist/production/components/forms/PasswordResetForm.js +54 -0
- package/dist/production/components/forms/PasswordResetForm.js.map +1 -0
- package/dist/production/components/forms/PasswordResetRequestForm.cjs +41 -0
- package/dist/production/components/forms/PasswordResetRequestForm.cjs.map +1 -0
- package/dist/production/components/forms/PasswordResetRequestForm.js +41 -0
- package/dist/production/components/forms/PasswordResetRequestForm.js.map +1 -0
- package/dist/production/components/forms/TenantForm.cjs +83 -0
- package/dist/production/components/forms/TenantForm.cjs.map +1 -0
- package/dist/production/components/forms/TenantForm.js +83 -0
- package/dist/production/components/forms/TenantForm.js.map +1 -0
- package/dist/production/components/forms/UpdateProjectMemberForm.cjs +56 -0
- package/dist/production/components/forms/UpdateProjectMemberForm.cjs.map +1 -0
- package/dist/production/components/forms/UpdateProjectMemberForm.js +56 -0
- package/dist/production/components/forms/UpdateProjectMemberForm.js.map +1 -0
- package/dist/production/components/idp/IDP.cjs +48 -0
- package/dist/production/components/idp/IDP.cjs.map +1 -0
- package/dist/production/components/idp/IDP.js +48 -0
- package/dist/production/components/idp/IDP.js.map +1 -0
- package/dist/production/components/idp/IDPInitTrigger.cjs +12 -0
- package/dist/production/components/idp/IDPInitTrigger.cjs.map +1 -0
- package/dist/production/components/idp/IDPInitTrigger.js +12 -0
- package/dist/production/components/idp/IDPInitTrigger.js.map +1 -0
- package/dist/production/components/idp/IDPState.cjs +10 -0
- package/dist/production/components/idp/IDPState.cjs.map +1 -0
- package/dist/production/components/idp/IDPState.js +10 -0
- package/dist/production/components/idp/IDPState.js.map +1 -0
- package/dist/production/components/triggers/DisableOtpTrigger.cjs +24 -0
- package/dist/production/components/triggers/DisableOtpTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/DisableOtpTrigger.js +24 -0
- package/dist/production/components/triggers/DisableOtpTrigger.js.map +1 -0
- package/dist/production/components/triggers/LogoutTrigger.cjs +12 -0
- package/dist/production/components/triggers/LogoutTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/LogoutTrigger.js +12 -0
- package/dist/production/components/triggers/LogoutTrigger.js.map +1 -0
- package/dist/production/components/triggers/RemoveProjectMemberTrigger.cjs +13 -0
- package/dist/production/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/RemoveProjectMemberTrigger.js +13 -0
- package/dist/production/components/triggers/RemoveProjectMemberTrigger.js.map +1 -0
- package/dist/production/components/triggers/TenantActionTrigger.cjs +33 -0
- package/dist/production/components/triggers/TenantActionTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/TenantActionTrigger.js +33 -0
- package/dist/production/components/triggers/TenantActionTrigger.js.map +1 -0
- package/dist/production/contexts.cjs +34 -0
- package/dist/production/contexts.cjs.map +1 -0
- package/dist/production/contexts.js +34 -0
- package/dist/production/contexts.js.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs +30 -0
- package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.js +13 -0
- package/dist/production/hooks/mutations/apiKey/useCreateApiKeyMutation.js.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs +30 -0
- package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js +13 -0
- package/dist/production/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.js.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs +30 -0
- package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.js +13 -0
- package/dist/production/hooks/mutations/apiKey/useCreateSessionTokenMutation.js.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs +29 -0
- package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.js +12 -0
- package/dist/production/hooks/mutations/apiKey/useDisableApiKeyMutation.js.map +1 -0
- package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.cjs +29 -0
- package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.js +12 -0
- package/dist/production/hooks/mutations/auth/useChangeMyPasswordMutation.js.map +1 -0
- package/dist/production/hooks/mutations/auth/useSignInMutation.cjs +33 -0
- package/dist/production/hooks/mutations/auth/useSignInMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/auth/useSignInMutation.js +16 -0
- package/dist/production/hooks/mutations/auth/useSignInMutation.js.map +1 -0
- package/dist/production/hooks/mutations/auth/useSignOutMutation.cjs +29 -0
- package/dist/production/hooks/mutations/auth/useSignOutMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/auth/useSignOutMutation.js +12 -0
- package/dist/production/hooks/mutations/auth/useSignOutMutation.js.map +1 -0
- package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.cjs +31 -0
- package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.js +14 -0
- package/dist/production/hooks/mutations/idp/useInitSignInIDPMutation.js.map +1 -0
- package/dist/production/hooks/mutations/idp/useSignInIdpMutation.cjs +33 -0
- package/dist/production/hooks/mutations/idp/useSignInIdpMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/idp/useSignInIdpMutation.js +16 -0
- package/dist/production/hooks/mutations/idp/useSignInIdpMutation.js.map +1 -0
- package/dist/production/hooks/mutations/invite/useInviteMutation.cjs +30 -0
- package/dist/production/hooks/mutations/invite/useInviteMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/invite/useInviteMutation.js +13 -0
- package/dist/production/hooks/mutations/invite/useInviteMutation.js.map +1 -0
- package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.cjs +29 -0
- package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.js +12 -0
- package/dist/production/hooks/mutations/memberships/useAddProjectMemberMutation.js.map +1 -0
- package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs +29 -0
- package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.js +12 -0
- package/dist/production/hooks/mutations/memberships/useRemoveProjectMemberMutation.js.map +1 -0
- package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs +29 -0
- package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.js +12 -0
- package/dist/production/hooks/mutations/memberships/useUpdateProjectMemberMutation.js.map +1 -0
- package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.cjs +29 -0
- package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.js +12 -0
- package/dist/production/hooks/mutations/otp/useConfirmOtpMutation.js.map +1 -0
- package/dist/production/hooks/mutations/otp/useDisableOtpMutation.cjs +29 -0
- package/dist/production/hooks/mutations/otp/useDisableOtpMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/otp/useDisableOtpMutation.js +12 -0
- package/dist/production/hooks/mutations/otp/useDisableOtpMutation.js.map +1 -0
- package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.cjs +30 -0
- package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.js +13 -0
- package/dist/production/hooks/mutations/otp/usePrepareOtpMutation.js.map +1 -0
- package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs +32 -0
- package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js +15 -0
- package/dist/production/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js.map +1 -0
- package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.cjs +32 -0
- package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.cjs.map +1 -0
- package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.js +15 -0
- package/dist/production/hooks/mutations/passwordReset/useResetPasswordMutation.js.map +1 -0
- package/dist/production/hooks/queries/useMeQuery.cjs +33 -0
- package/dist/production/hooks/queries/useMeQuery.cjs.map +1 -0
- package/dist/production/hooks/queries/useMeQuery.js +16 -0
- package/dist/production/hooks/queries/useMeQuery.js.map +1 -0
- package/dist/production/hooks/queries/useProjectMembersQuery.cjs +47 -0
- package/dist/production/hooks/queries/useProjectMembersQuery.cjs.map +1 -0
- package/dist/production/hooks/queries/useProjectMembersQuery.js +30 -0
- package/dist/production/hooks/queries/useProjectMembersQuery.js.map +1 -0
- package/dist/production/hooks/queries/useProjectMembershipsQuery.cjs +34 -0
- package/dist/production/hooks/queries/useProjectMembershipsQuery.cjs.map +1 -0
- package/dist/production/hooks/queries/useProjectMembershipsQuery.js +17 -0
- package/dist/production/hooks/queries/useProjectMembershipsQuery.js.map +1 -0
- package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.cjs +36 -0
- package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.cjs.map +1 -0
- package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.js +19 -0
- package/dist/production/hooks/queries/useProjectRolesDefinitionQuery.js.map +1 -0
- package/dist/production/hooks/useFetchIdentity.cjs +52 -0
- package/dist/production/hooks/useFetchIdentity.cjs.map +1 -0
- package/dist/production/hooks/useFetchIdentity.js +52 -0
- package/dist/production/hooks/useFetchIdentity.js.map +1 -0
- package/dist/production/hooks/useLogout.cjs +10 -0
- package/dist/production/hooks/useLogout.cjs.map +1 -0
- package/dist/production/hooks/useLogout.js +10 -0
- package/dist/production/hooks/useLogout.js.map +1 -0
- package/dist/production/hooks/useTenantApi.cjs +11 -4
- package/dist/production/hooks/useTenantApi.cjs.map +1 -1
- package/dist/production/hooks/useTenantApi.js +12 -5
- package/dist/production/hooks/useTenantApi.js.map +1 -1
- package/dist/production/hooks/useTenantMutation.cjs +33 -0
- package/dist/production/hooks/useTenantMutation.cjs.map +1 -0
- package/dist/production/hooks/useTenantMutation.js +33 -0
- package/dist/production/hooks/useTenantMutation.js.map +1 -0
- package/dist/production/hooks/useTenantQueryLoader.cjs +36 -0
- package/dist/production/hooks/useTenantQueryLoader.cjs.map +1 -0
- package/dist/production/hooks/useTenantQueryLoader.js +36 -0
- package/dist/production/hooks/useTenantQueryLoader.js.map +1 -0
- package/dist/production/index.cjs +130 -0
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +132 -2
- package/dist/production/index.js.map +1 -1
- package/dist/production/internal/hooks/useHandleIDPResponse.cjs +51 -0
- package/dist/production/internal/hooks/useHandleIDPResponse.cjs.map +1 -0
- package/dist/production/internal/hooks/useHandleIDPResponse.js +51 -0
- package/dist/production/internal/hooks/useHandleIDPResponse.js.map +1 -0
- package/dist/production/internal/hooks/useIDPAutoInit.cjs +19 -0
- package/dist/production/internal/hooks/useIDPAutoInit.cjs.map +1 -0
- package/dist/production/internal/hooks/useIDPAutoInit.js +19 -0
- package/dist/production/internal/hooks/useIDPAutoInit.js.map +1 -0
- package/dist/production/internal/hooks/useIDPStateStore.cjs +19 -0
- package/dist/production/internal/hooks/useIDPStateStore.cjs.map +1 -0
- package/dist/production/internal/hooks/useIDPStateStore.js +19 -0
- package/dist/production/internal/hooks/useIDPStateStore.js.map +1 -0
- package/dist/production/internal/hooks/useInitIDPRedirect.cjs +44 -0
- package/dist/production/internal/hooks/useInitIDPRedirect.cjs.map +1 -0
- package/dist/production/internal/hooks/useInitIDPRedirect.js +44 -0
- package/dist/production/internal/hooks/useInitIDPRedirect.js.map +1 -0
- package/dist/production/internal/hooks/useLogoutInternal.cjs +35 -0
- package/dist/production/internal/hooks/useLogoutInternal.cjs.map +1 -0
- package/dist/production/internal/hooks/useLogoutInternal.js +35 -0
- package/dist/production/internal/hooks/useLogoutInternal.js.map +1 -0
- package/dist/production/internal/hooks/useRedirectToBacklink.cjs +31 -0
- package/dist/production/internal/hooks/useRedirectToBacklink.cjs.map +1 -0
- package/dist/production/internal/hooks/useRedirectToBacklink.js +31 -0
- package/dist/production/internal/hooks/useRedirectToBacklink.js.map +1 -0
- package/dist/production/internal/utils/getBaseHref.cjs +8 -0
- package/dist/production/internal/utils/getBaseHref.cjs.map +1 -0
- package/dist/production/internal/utils/getBaseHref.js +8 -0
- package/dist/production/internal/utils/getBaseHref.js.map +1 -0
- package/dist/types/components/IdentityProvider.d.ts +6 -0
- package/dist/types/components/IdentityProvider.d.ts.map +1 -0
- package/dist/types/components/IdentityState.d.ts +8 -0
- package/dist/types/components/IdentityState.d.ts.map +1 -0
- package/dist/types/components/forms/ChangeMyPasswordForm.d.ts +19 -0
- package/dist/types/components/forms/ChangeMyPasswordForm.d.ts.map +1 -0
- package/dist/types/components/forms/CreateApiKeyForm.d.ts +23 -0
- package/dist/types/components/forms/CreateApiKeyForm.d.ts.map +1 -0
- package/dist/types/components/forms/CreateSessionTokenForm.d.ts +22 -0
- package/dist/types/components/forms/CreateSessionTokenForm.d.ts.map +1 -0
- package/dist/types/components/forms/InviteForm.d.ts +25 -0
- package/dist/types/components/forms/InviteForm.d.ts.map +1 -0
- package/dist/types/components/forms/LoginForm.d.ts +20 -0
- package/dist/types/components/forms/LoginForm.d.ts.map +1 -0
- package/dist/types/components/forms/OtpConfirmForm.d.ts +17 -0
- package/dist/types/components/forms/OtpConfirmForm.d.ts.map +1 -0
- package/dist/types/components/forms/OtpPrepareForm.d.ts +19 -0
- package/dist/types/components/forms/OtpPrepareForm.d.ts.map +1 -0
- package/dist/types/components/forms/PasswordResetForm.d.ts +20 -0
- package/dist/types/components/forms/PasswordResetForm.d.ts.map +1 -0
- package/dist/types/components/forms/PasswordResetRequestForm.d.ts +17 -0
- package/dist/types/components/forms/PasswordResetRequestForm.d.ts.map +1 -0
- package/dist/types/components/forms/TenantForm.d.ts +37 -0
- package/dist/types/components/forms/TenantForm.d.ts.map +1 -0
- package/dist/types/components/forms/UpdateProjectMemberForm.d.ts +19 -0
- package/dist/types/components/forms/UpdateProjectMemberForm.d.ts.map +1 -0
- package/dist/types/components/forms/index.d.ts +11 -0
- package/dist/types/components/forms/index.d.ts.map +1 -0
- package/dist/types/components/idp/IDP.d.ts +10 -0
- package/dist/types/components/idp/IDP.d.ts.map +1 -0
- package/dist/types/components/idp/IDPInitTrigger.d.ts +7 -0
- package/dist/types/components/idp/IDPInitTrigger.d.ts.map +1 -0
- package/dist/types/components/idp/IDPState.d.ts +8 -0
- package/dist/types/components/idp/IDPState.d.ts.map +1 -0
- package/dist/types/components/idp/index.d.ts +4 -0
- package/dist/types/components/idp/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +6 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/triggers/DisableOtpTrigger.d.ts +8 -0
- package/dist/types/components/triggers/DisableOtpTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/LogoutTrigger.d.ts +5 -0
- package/dist/types/components/triggers/LogoutTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/RemoveProjectMemberTrigger.d.ts +9 -0
- package/dist/types/components/triggers/RemoveProjectMemberTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/TenantActionTrigger.d.ts +22 -0
- package/dist/types/components/triggers/TenantActionTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/index.d.ts +4 -0
- package/dist/types/components/triggers/index.d.ts.map +1 -0
- package/dist/types/contexts.d.ts +20 -0
- package/dist/types/contexts.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +6 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/mutations/apiKey/index.d.ts +5 -0
- package/dist/types/hooks/mutations/apiKey/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/apiKey/useCreateApiKeyMutation.d.ts +83 -0
- package/dist/types/hooks/mutations/apiKey/useCreateApiKeyMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.d.ts +73 -0
- package/dist/types/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/apiKey/useCreateSessionTokenMutation.d.ts +65 -0
- package/dist/types/hooks/mutations/apiKey/useCreateSessionTokenMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/apiKey/useDisableApiKeyMutation.d.ts +21 -0
- package/dist/types/hooks/mutations/apiKey/useDisableApiKeyMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/auth/index.d.ts +4 -0
- package/dist/types/hooks/mutations/auth/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts +21 -0
- package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts +69 -0
- package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/auth/useSignOutMutation.d.ts +21 -0
- package/dist/types/hooks/mutations/auth/useSignOutMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/idp/index.d.ts +3 -0
- package/dist/types/hooks/mutations/idp/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/idp/useInitSignInIDPMutation.d.ts +17 -0
- package/dist/types/hooks/mutations/idp/useInitSignInIDPMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts +76 -0
- package/dist/types/hooks/mutations/idp/useSignInIdpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/index.d.ts +8 -0
- package/dist/types/hooks/mutations/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/invite/index.d.ts +2 -0
- package/dist/types/hooks/mutations/invite/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/invite/useInviteMutation.d.ts +103 -0
- package/dist/types/hooks/mutations/invite/useInviteMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/memberships/index.d.ts +4 -0
- package/dist/types/hooks/mutations/memberships/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/memberships/useAddProjectMemberMutation.d.ts +33 -0
- package/dist/types/hooks/mutations/memberships/useAddProjectMemberMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/memberships/useRemoveProjectMemberMutation.d.ts +23 -0
- package/dist/types/hooks/mutations/memberships/useRemoveProjectMemberMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/memberships/useUpdateProjectMemberMutation.d.ts +33 -0
- package/dist/types/hooks/mutations/memberships/useUpdateProjectMemberMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/otp/index.d.ts +4 -0
- package/dist/types/hooks/mutations/otp/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/otp/useConfirmOtpMutation.d.ts +21 -0
- package/dist/types/hooks/mutations/otp/useConfirmOtpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/otp/useDisableOtpMutation.d.ts +17 -0
- package/dist/types/hooks/mutations/otp/useDisableOtpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/otp/usePrepareOtpMutation.d.ts +25 -0
- package/dist/types/hooks/mutations/otp/usePrepareOtpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/passwordReset/index.d.ts +3 -0
- package/dist/types/hooks/mutations/passwordReset/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.d.ts +23 -0
- package/dist/types/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts +23 -0
- package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts.map +1 -0
- package/dist/types/hooks/queries/index.d.ts +5 -0
- package/dist/types/hooks/queries/index.d.ts.map +1 -0
- package/dist/types/hooks/queries/useMeQuery.d.ts +52 -0
- package/dist/types/hooks/queries/useMeQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useProjectMembersQuery.d.ts +43 -0
- package/dist/types/hooks/queries/useProjectMembersQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useProjectMembershipsQuery.d.ts +20 -0
- package/dist/types/hooks/queries/useProjectMembershipsQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useProjectRolesDefinitionQuery.d.ts +66 -0
- package/dist/types/hooks/queries/useProjectRolesDefinitionQuery.d.ts.map +1 -0
- package/dist/types/hooks/useFetchIdentity.d.ts +6 -0
- package/dist/types/hooks/useFetchIdentity.d.ts.map +1 -0
- package/dist/types/hooks/useLogout.d.ts +4 -0
- package/dist/types/hooks/useLogout.d.ts.map +1 -0
- package/dist/types/hooks/useTenantApi.d.ts +7 -2
- package/dist/types/hooks/useTenantApi.d.ts.map +1 -1
- package/dist/types/hooks/useTenantMutation.d.ts +25 -0
- package/dist/types/hooks/useTenantMutation.d.ts.map +1 -0
- package/dist/types/hooks/useTenantQueryLoader.d.ts +17 -0
- package/dist/types/hooks/useTenantQueryLoader.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/internal/hooks/useHandleIDPResponse.d.ts +10 -0
- package/dist/types/internal/hooks/useHandleIDPResponse.d.ts.map +1 -0
- package/dist/types/internal/hooks/useIDPAutoInit.d.ts +2 -0
- package/dist/types/internal/hooks/useIDPAutoInit.d.ts.map +1 -0
- package/dist/types/internal/hooks/useIDPStateStore.d.ts +9 -0
- package/dist/types/internal/hooks/useIDPStateStore.d.ts.map +1 -0
- package/dist/types/internal/hooks/useInitIDPRedirect.d.ts +15 -0
- package/dist/types/internal/hooks/useInitIDPRedirect.d.ts.map +1 -0
- package/dist/types/internal/hooks/useLogoutInternal.d.ts +4 -0
- package/dist/types/internal/hooks/useLogoutInternal.d.ts.map +1 -0
- package/dist/types/internal/hooks/useRedirectToBacklink.d.ts +4 -0
- package/dist/types/internal/hooks/useRedirectToBacklink.d.ts.map +1 -0
- package/dist/types/internal/utils/getBaseHref.d.ts +2 -0
- package/dist/types/internal/utils/getBaseHref.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/Identity.d.ts +19 -0
- package/dist/types/types/Identity.d.ts.map +1 -0
- package/dist/types/types/IdentityMethods.d.ts +5 -0
- package/dist/types/types/IdentityMethods.d.ts.map +1 -0
- package/dist/types/types/IdentityStateValue.d.ts +2 -0
- package/dist/types/types/IdentityStateValue.d.ts.map +1 -0
- package/dist/types/types/forms.d.ts +18 -0
- package/dist/types/types/forms.d.ts.map +1 -0
- package/dist/types/types/idp.d.ts +30 -0
- package/dist/types/types/idp.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +6 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +6 -2
- package/src/components/IdentityProvider.tsx +39 -0
- package/src/components/IdentityState.tsx +14 -0
- package/src/components/forms/ChangeMyPasswordForm.tsx +75 -0
- package/src/components/forms/CreateApiKeyForm.tsx +72 -0
- package/src/components/forms/CreateSessionTokenForm.tsx +64 -0
- package/src/components/forms/InviteForm.tsx +79 -0
- package/src/components/forms/LoginForm.tsx +110 -0
- package/src/components/forms/OtpConfirmForm.tsx +61 -0
- package/src/components/forms/OtpPrepareForm.tsx +45 -0
- package/src/components/forms/PasswordResetForm.tsx +80 -0
- package/src/components/forms/PasswordResetRequestForm.tsx +64 -0
- package/src/components/forms/TenantForm.tsx +116 -0
- package/src/components/forms/UpdateProjectMemberForm.tsx +77 -0
- package/src/components/forms/index.ts +10 -0
- package/src/components/idp/IDP.tsx +65 -0
- package/src/components/idp/IDPInitTrigger.tsx +17 -0
- package/src/components/idp/IDPState.tsx +14 -0
- package/src/components/idp/index.ts +3 -0
- package/src/components/index.ts +5 -0
- package/src/components/triggers/DisableOtpTrigger.tsx +25 -0
- package/src/components/triggers/LogoutTrigger.tsx +10 -0
- package/src/components/triggers/RemoveProjectMemberTrigger.tsx +18 -0
- package/src/components/triggers/TenantActionTrigger.tsx +41 -0
- package/src/components/triggers/index.ts +3 -0
- package/src/contexts.ts +34 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/mutations/apiKey/index.ts +4 -0
- package/src/hooks/mutations/apiKey/useCreateApiKeyMutation.tsx +19 -0
- package/src/hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.tsx +19 -0
- package/src/hooks/mutations/apiKey/useCreateSessionTokenMutation.tsx +19 -0
- package/src/hooks/mutations/apiKey/useDisableApiKeyMutation.tsx +14 -0
- package/src/hooks/mutations/auth/index.ts +3 -0
- package/src/hooks/mutations/auth/useChangeMyPasswordMutation.ts +14 -0
- package/src/hooks/mutations/auth/useSignInMutation.ts +25 -0
- package/src/hooks/mutations/auth/useSignOutMutation.ts +12 -0
- package/src/hooks/mutations/idp/index.ts +2 -0
- package/src/hooks/mutations/idp/useInitSignInIDPMutation.ts +29 -0
- package/src/hooks/mutations/idp/useSignInIdpMutation.ts +35 -0
- package/src/hooks/mutations/index.ts +7 -0
- package/src/hooks/mutations/invite/index.ts +1 -0
- package/src/hooks/mutations/invite/useInviteMutation.tsx +20 -0
- package/src/hooks/mutations/memberships/index.ts +3 -0
- package/src/hooks/mutations/memberships/useAddProjectMemberMutation.ts +13 -0
- package/src/hooks/mutations/memberships/useRemoveProjectMemberMutation.ts +13 -0
- package/src/hooks/mutations/memberships/useUpdateProjectMemberMutation.ts +13 -0
- package/src/hooks/mutations/otp/index.ts +3 -0
- package/src/hooks/mutations/otp/useConfirmOtpMutation.ts +13 -0
- package/src/hooks/mutations/otp/useDisableOtpMutation.ts +10 -0
- package/src/hooks/mutations/otp/usePrepareOtpMutation.ts +16 -0
- package/src/hooks/mutations/passwordReset/index.ts +2 -0
- package/src/hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.ts +17 -0
- package/src/hooks/mutations/passwordReset/useResetPasswordMutation.ts +17 -0
- package/src/hooks/queries/index.ts +4 -0
- package/src/hooks/queries/useMeQuery.ts +23 -0
- package/src/hooks/queries/useProjectMembersQuery.ts +43 -0
- package/src/hooks/queries/useProjectMembershipsQuery.ts +25 -0
- package/src/hooks/queries/useProjectRolesDefinitionQuery.ts +34 -0
- package/src/hooks/useFetchIdentity.ts +55 -0
- package/src/hooks/useLogout.ts +7 -0
- package/src/hooks/useTenantApi.ts +18 -6
- package/src/hooks/useTenantMutation.ts +45 -0
- package/src/hooks/useTenantQueryLoader.ts +49 -0
- package/src/index.ts +3 -0
- package/src/internal/hooks/useHandleIDPResponse.ts +64 -0
- package/src/internal/hooks/useIDPAutoInit.ts +18 -0
- package/src/internal/hooks/useIDPStateStore.ts +18 -0
- package/src/internal/hooks/useInitIDPRedirect.ts +48 -0
- package/src/internal/hooks/useLogoutInternal.ts +35 -0
- package/src/internal/hooks/useRedirectToBacklink.ts +42 -0
- package/src/internal/utils/getBaseHref.ts +4 -0
- package/src/tsconfig.json +1 -0
- package/src/types/Identity.ts +20 -0
- package/src/types/IdentityMethods.ts +4 -0
- package/src/types/IdentityStateValue.ts +6 -0
- package/src/types/forms.ts +26 -0
- package/src/types/idp.ts +25 -0
- package/src/types/index.ts +5 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const TenantForm = require("./TenantForm.cjs");
|
|
6
|
+
const contexts = require("../../contexts.cjs");
|
|
7
|
+
const useCreateResetPasswordRequestMutation = require("../../hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.cjs");
|
|
8
|
+
const usePasswordResetRequestForm = contexts.useForm;
|
|
9
|
+
const PasswordResetRequestForm = ({ children, onSuccess }) => {
|
|
10
|
+
const createResetRequest = useCreateResetPasswordRequestMutation.useCreateResetPasswordRequestMutation();
|
|
11
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
12
|
+
TenantForm.TenantForm,
|
|
13
|
+
{
|
|
14
|
+
onSuccess,
|
|
15
|
+
errorMapping: errorToField,
|
|
16
|
+
initialValues: react.useMemo(() => ({
|
|
17
|
+
email: ""
|
|
18
|
+
}), []),
|
|
19
|
+
validate: ({ values }) => {
|
|
20
|
+
if (!values.email) {
|
|
21
|
+
return [{ code: "FIELD_REQUIRED", field: "email" }];
|
|
22
|
+
} else if (!values.email.match(/^.+@.+$/)) {
|
|
23
|
+
return [{ code: "INVALID_VALUE", field: "email" }];
|
|
24
|
+
}
|
|
25
|
+
return [];
|
|
26
|
+
},
|
|
27
|
+
execute: react.useCallback(async ({ values }) => {
|
|
28
|
+
return await createResetRequest({
|
|
29
|
+
email: values.email
|
|
30
|
+
});
|
|
31
|
+
}, [createResetRequest]),
|
|
32
|
+
children
|
|
33
|
+
},
|
|
34
|
+
void 0,
|
|
35
|
+
false,
|
|
36
|
+
{
|
|
37
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/PasswordResetRequestForm.tsx",
|
|
38
|
+
lineNumber: 37,
|
|
39
|
+
columnNumber: 3
|
|
40
|
+
},
|
|
41
|
+
void 0
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
const errorToField = {
|
|
45
|
+
PERSON_NOT_FOUND: "email"
|
|
46
|
+
};
|
|
47
|
+
exports.PasswordResetRequestForm = PasswordResetRequestForm;
|
|
48
|
+
exports.usePasswordResetRequestForm = usePasswordResetRequestForm;
|
|
49
|
+
//# sourceMappingURL=PasswordResetRequestForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordResetRequestForm.cjs","sources":["../../../../src/components/forms/PasswordResetRequestForm.tsx"],"sourcesContent":["import { ReactElement, useCallback, useMemo } from 'react'\nimport * as TenantApi from '@contember/graphql-client-tenant'\nimport { CreatePasswordResetRequestErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types/forms'\nimport { useForm } from '../../contexts'\nimport { useCreateResetPasswordRequestMutation } from '../../hooks'\n\nexport type PasswordResetRequestFormValues = {\n\temail: string\n}\n\nexport type PasswordResetRequestFormErrorCode =\n\t| CreatePasswordResetRequestErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'UNKNOWN_ERROR'\n\nexport type PasswordResetRequestFormState = FormState\n\nexport type PasswordResetRequestFormError = FormError<PasswordResetRequestFormValues, PasswordResetRequestFormErrorCode>\n\nexport type PasswordResetRequestFormContextValue = FormContextValue<PasswordResetRequestFormValues, PasswordResetRequestFormErrorCode>\n\n\nexport interface PasswordResetRequestFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const usePasswordResetRequestForm = useForm as () => PasswordResetRequestFormContextValue\n\nexport const PasswordResetRequestForm = ({ children, onSuccess }: PasswordResetRequestFormProps) => {\n\n\tconst createResetRequest = useCreateResetPasswordRequestMutation()\n\treturn (\n\t\t<TenantForm<PasswordResetRequestFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={useMemo(() => ({\n\t\t\t\temail: '',\n\t\t\t}), [])}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tif (!values.email) {\n\t\t\t\t\treturn [{ code: 'FIELD_REQUIRED', field: 'email' }]\n\t\t\t\t} else if (!values.email.match(/^.+@.+$/)) {\n\t\t\t\t\treturn [{ code: 'INVALID_VALUE', field: 'email' }]\n\t\t\t\t}\n\t\t\t\treturn []\n\t\t\t}}\n\t\t\texecute={useCallback(async ({ values }) => {\n\t\t\t\treturn await createResetRequest({\n\t\t\t\t\temail: values.email,\n\t\t\t\t})\n\t\t\t}, [createResetRequest])}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Record<TenantApi.CreatePasswordResetRequestErrorCode, keyof PasswordResetRequestFormValues | undefined> = {\n\tPERSON_NOT_FOUND: 'email',\n}\n"],"names":["useForm","useCreateResetPasswordRequestMutation","jsxDEV","TenantForm","useMemo","useCallback","this"],"mappings":";;;;;;;AA8BO,MAAM,8BAA8BA,SAAA;AAEpC,MAAM,2BAA2B,CAAC,EAAE,UAAU,gBAA+C;AAEnG,QAAM,qBAAqBC,sCAAAA;AAE1B,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAeC,cAAQ,OAAO;AAAA,QAC7B,OAAO;AAAA,MACR,IAAI,CAAA,CAAE;AAAA,MACN,UAAU,CAAC,EAAE,aAAa;AACrB,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,CAAC,EAAE,MAAM,kBAAkB,OAAO,QAAS,CAAA;AAAA,mBACxC,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AAC1C,iBAAO,CAAC,EAAE,MAAM,iBAAiB,OAAO,QAAS,CAAA;AAAA,QAClD;AACA,eAAO;MACR;AAAA,MACA,SAASC,MAAA,YAAY,OAAO,EAAE,aAAa;AAC1C,eAAO,MAAM,mBAAmB;AAAA,UAC/B,OAAO,OAAO;AAAA,QAAA,CACd;AAAA,MAAA,GACC,CAAC,kBAAkB,CAAC;AAAA,MAEtB;AAAA,IAAA;AAAA,IApBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAwBF;AACA,MAAM,eAAwH;AAAA,EAC7H,kBAAkB;AACnB;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useMemo, useCallback } from "react";
|
|
3
|
+
import { TenantForm } from "./TenantForm.js";
|
|
4
|
+
import { useForm } from "../../contexts.js";
|
|
5
|
+
import { useCreateResetPasswordRequestMutation } from "../../hooks/mutations/passwordReset/useCreateResetPasswordRequestMutation.js";
|
|
6
|
+
const usePasswordResetRequestForm = useForm;
|
|
7
|
+
const PasswordResetRequestForm = ({ children, onSuccess }) => {
|
|
8
|
+
const createResetRequest = useCreateResetPasswordRequestMutation();
|
|
9
|
+
return /* @__PURE__ */ jsxDEV(
|
|
10
|
+
TenantForm,
|
|
11
|
+
{
|
|
12
|
+
onSuccess,
|
|
13
|
+
errorMapping: errorToField,
|
|
14
|
+
initialValues: useMemo(() => ({
|
|
15
|
+
email: ""
|
|
16
|
+
}), []),
|
|
17
|
+
validate: ({ values }) => {
|
|
18
|
+
if (!values.email) {
|
|
19
|
+
return [{ code: "FIELD_REQUIRED", field: "email" }];
|
|
20
|
+
} else if (!values.email.match(/^.+@.+$/)) {
|
|
21
|
+
return [{ code: "INVALID_VALUE", field: "email" }];
|
|
22
|
+
}
|
|
23
|
+
return [];
|
|
24
|
+
},
|
|
25
|
+
execute: useCallback(async ({ values }) => {
|
|
26
|
+
return await createResetRequest({
|
|
27
|
+
email: values.email
|
|
28
|
+
});
|
|
29
|
+
}, [createResetRequest]),
|
|
30
|
+
children
|
|
31
|
+
},
|
|
32
|
+
void 0,
|
|
33
|
+
false,
|
|
34
|
+
{
|
|
35
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/PasswordResetRequestForm.tsx",
|
|
36
|
+
lineNumber: 37,
|
|
37
|
+
columnNumber: 3
|
|
38
|
+
},
|
|
39
|
+
void 0
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
const errorToField = {
|
|
43
|
+
PERSON_NOT_FOUND: "email"
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
PasswordResetRequestForm,
|
|
47
|
+
usePasswordResetRequestForm
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=PasswordResetRequestForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordResetRequestForm.js","sources":["../../../../src/components/forms/PasswordResetRequestForm.tsx"],"sourcesContent":["import { ReactElement, useCallback, useMemo } from 'react'\nimport * as TenantApi from '@contember/graphql-client-tenant'\nimport { CreatePasswordResetRequestErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types/forms'\nimport { useForm } from '../../contexts'\nimport { useCreateResetPasswordRequestMutation } from '../../hooks'\n\nexport type PasswordResetRequestFormValues = {\n\temail: string\n}\n\nexport type PasswordResetRequestFormErrorCode =\n\t| CreatePasswordResetRequestErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'UNKNOWN_ERROR'\n\nexport type PasswordResetRequestFormState = FormState\n\nexport type PasswordResetRequestFormError = FormError<PasswordResetRequestFormValues, PasswordResetRequestFormErrorCode>\n\nexport type PasswordResetRequestFormContextValue = FormContextValue<PasswordResetRequestFormValues, PasswordResetRequestFormErrorCode>\n\n\nexport interface PasswordResetRequestFormProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n}\n\nexport const usePasswordResetRequestForm = useForm as () => PasswordResetRequestFormContextValue\n\nexport const PasswordResetRequestForm = ({ children, onSuccess }: PasswordResetRequestFormProps) => {\n\n\tconst createResetRequest = useCreateResetPasswordRequestMutation()\n\treturn (\n\t\t<TenantForm<PasswordResetRequestFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={useMemo(() => ({\n\t\t\t\temail: '',\n\t\t\t}), [])}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tif (!values.email) {\n\t\t\t\t\treturn [{ code: 'FIELD_REQUIRED', field: 'email' }]\n\t\t\t\t} else if (!values.email.match(/^.+@.+$/)) {\n\t\t\t\t\treturn [{ code: 'INVALID_VALUE', field: 'email' }]\n\t\t\t\t}\n\t\t\t\treturn []\n\t\t\t}}\n\t\t\texecute={useCallback(async ({ values }) => {\n\t\t\t\treturn await createResetRequest({\n\t\t\t\t\temail: values.email,\n\t\t\t\t})\n\t\t\t}, [createResetRequest])}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n\n}\nconst errorToField: Record<TenantApi.CreatePasswordResetRequestErrorCode, keyof PasswordResetRequestFormValues | undefined> = {\n\tPERSON_NOT_FOUND: 'email',\n}\n"],"names":["this"],"mappings":";;;;;AA8BO,MAAM,8BAA8B;AAEpC,MAAM,2BAA2B,CAAC,EAAE,UAAU,gBAA+C;AAEnG,QAAM,qBAAqB;AAE1B,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe,QAAQ,OAAO;AAAA,QAC7B,OAAO;AAAA,MACR,IAAI,CAAA,CAAE;AAAA,MACN,UAAU,CAAC,EAAE,aAAa;AACrB,YAAA,CAAC,OAAO,OAAO;AAClB,iBAAO,CAAC,EAAE,MAAM,kBAAkB,OAAO,QAAS,CAAA;AAAA,mBACxC,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AAC1C,iBAAO,CAAC,EAAE,MAAM,iBAAiB,OAAO,QAAS,CAAA;AAAA,QAClD;AACA,eAAO;MACR;AAAA,MACA,SAAS,YAAY,OAAO,EAAE,aAAa;AAC1C,eAAO,MAAM,mBAAmB;AAAA,UAC/B,OAAO,OAAO;AAAA,QAAA,CACd;AAAA,MAAA,GACC,CAAC,kBAAkB,CAAC;AAAA,MAEtB;AAAA,IAAA;AAAA,IApBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAwBF;AACA,MAAM,eAAwH;AAAA,EAC7H,kBAAkB;AACnB;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const reactSlot = require("@radix-ui/react-slot");
|
|
6
|
+
const contexts = require("../../contexts.cjs");
|
|
7
|
+
const reactUtils = require("@contember/react-utils");
|
|
8
|
+
const SlotForm = reactSlot.Slot;
|
|
9
|
+
const TenantForm = ({
|
|
10
|
+
children,
|
|
11
|
+
initialValues,
|
|
12
|
+
loading,
|
|
13
|
+
errorMapping,
|
|
14
|
+
validate: validateIn,
|
|
15
|
+
execute: executeIn,
|
|
16
|
+
onSuccess: onSuccessIn,
|
|
17
|
+
onChange: onChangeIn
|
|
18
|
+
}) => {
|
|
19
|
+
const [values, setValues] = react.useState(initialValues);
|
|
20
|
+
const [errors, setErrors] = react.useState([]);
|
|
21
|
+
const [state, setState] = react.useState(loading ? "loading" : "initial");
|
|
22
|
+
react.useEffect(() => {
|
|
23
|
+
if (loading) {
|
|
24
|
+
setState("loading");
|
|
25
|
+
}
|
|
26
|
+
}, [loading]);
|
|
27
|
+
react.useEffect(() => {
|
|
28
|
+
if (state === "loading" && !loading) {
|
|
29
|
+
setValues(initialValues);
|
|
30
|
+
setState("initial");
|
|
31
|
+
}
|
|
32
|
+
}, [initialValues, loading, state]);
|
|
33
|
+
const validate = reactUtils.useReferentiallyStableCallback(validateIn || (() => void 0));
|
|
34
|
+
const onSuccess = reactUtils.useReferentiallyStableCallback(onSuccessIn || (() => void 0));
|
|
35
|
+
const execute = reactUtils.useReferentiallyStableCallback(executeIn);
|
|
36
|
+
const submit = reactUtils.useReferentiallyStableCallback(async (event) => {
|
|
37
|
+
event?.preventDefault();
|
|
38
|
+
const errors2 = validate?.({ values, state }) ?? [];
|
|
39
|
+
setErrors(errors2);
|
|
40
|
+
if (errors2.length > 0) {
|
|
41
|
+
setState("error");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
setState("submitting");
|
|
45
|
+
try {
|
|
46
|
+
const response = await execute({ values, state });
|
|
47
|
+
if (!response.ok) {
|
|
48
|
+
const error = response.error;
|
|
49
|
+
setState(response.state ?? "error");
|
|
50
|
+
setErrors([{
|
|
51
|
+
code: error || "UNKNOWN_ERROR",
|
|
52
|
+
developerMessage: response.developerMessage,
|
|
53
|
+
field: errorMapping && error && error in errorMapping ? errorMapping[error] : void 0
|
|
54
|
+
}]);
|
|
55
|
+
} else {
|
|
56
|
+
setState("success");
|
|
57
|
+
setValues(initialValues);
|
|
58
|
+
onSuccess?.({ result: "result" in response ? response.result : void 0 });
|
|
59
|
+
}
|
|
60
|
+
} catch (e) {
|
|
61
|
+
console.error(e);
|
|
62
|
+
setState("error");
|
|
63
|
+
setErrors([{
|
|
64
|
+
code: "UNKNOWN_ERROR",
|
|
65
|
+
developerMessage: typeof e === "string" ? e : e && typeof e === "object" && "message" in e && typeof e.message === "string" ? e.message : void 0
|
|
66
|
+
}]);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const onChange = reactUtils.useReferentiallyStableCallback(onChangeIn || (() => void 0));
|
|
70
|
+
react.useEffect(() => {
|
|
71
|
+
onChange?.({ values, state, submit });
|
|
72
|
+
}, [onChange, state, submit, values]);
|
|
73
|
+
const setValue = react.useCallback((field, value) => setValues((values2) => ({ ...values2, [field]: value })), []);
|
|
74
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.FormContext.Provider, { value: {
|
|
75
|
+
values,
|
|
76
|
+
setValues,
|
|
77
|
+
state,
|
|
78
|
+
errors,
|
|
79
|
+
setValue
|
|
80
|
+
}, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(SlotForm, { onSubmit: submit, children }, void 0, false, {
|
|
81
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/TenantForm.tsx",
|
|
82
|
+
lineNumber: 111,
|
|
83
|
+
columnNumber: 4
|
|
84
|
+
}, void 0) }, void 0, false, {
|
|
85
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/TenantForm.tsx",
|
|
86
|
+
lineNumber: 104,
|
|
87
|
+
columnNumber: 3
|
|
88
|
+
}, void 0);
|
|
89
|
+
};
|
|
90
|
+
exports.TenantForm = TenantForm;
|
|
91
|
+
//# sourceMappingURL=TenantForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantForm.cjs","sources":["../../../../src/components/forms/TenantForm.tsx"],"sourcesContent":["import { ComponentType, ReactElement, useCallback, useEffect, useState } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { FormContextValue } from '../../types/forms'\nimport { FormContext } from '../../contexts'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nconst SlotForm = Slot as ComponentType<React.FormHTMLAttributes<HTMLFormElement>>\n\n\ntype ExecuteResult<T extends FormContextValue<any, any, any>, OkResult = undefined> =\n\t| ({ ok: true } & (OkResult extends undefined ? {} : { result: OkResult }))\n\t| { ok: false, error?: T['errors'][number]['code'], developerMessage?: string, state?: T['state'] }\n\nexport interface TenantFormProps<T extends FormContextValue<any, any, any>, OkResult = undefined> {\n\tchildren: ReactElement\n\tloading?: boolean\n\tinitialValues: T['values']\n\terrorMapping?: Partial<Record<T['errors'][number]['code'], keyof T['values']>>\n\tvalidate?: (args: { values: T['values'], state: T['state'] }) => T['errors'] | undefined\n\texecute: (args: { values: T['values'], state: T['state'] }) => Promise<ExecuteResult<T, OkResult>>\n\tonSuccess?: (args: { result: OkResult }) => void\n\tonChange?: (args: { values: T['values'], state: T['state'], submit: () => Promise<void> }) => void\n}\n\nexport const TenantForm = <T extends FormContextValue<any, any, any>, OkResult = undefined>({\n\tchildren,\n\tinitialValues,\n\tloading,\n\terrorMapping,\n\tvalidate: validateIn,\n\texecute: executeIn,\n\tonSuccess: onSuccessIn,\n\tonChange: onChangeIn,\n}: TenantFormProps<T, OkResult>) => {\n\tconst [values, setValues] = useState<T['values']>(initialValues)\n\n\tconst [errors, setErrors] = useState<T['errors']>([])\n\tconst [state, setState] = useState<T['state']>(loading ? 'loading' : 'initial')\n\n\tuseEffect(() => {\n\t\tif (loading) {\n\t\t\tsetState('loading')\n\t\t}\n\t}, [loading])\n\n\tuseEffect(() => {\n\t\tif (state === 'loading' && !loading) {\n\t\t\tsetValues(initialValues)\n\t\t\tsetState('initial')\n\t\t}\n\t}, [initialValues, loading, state])\n\n\tconst validate = useReferentiallyStableCallback(validateIn || (() => undefined))\n\tconst onSuccess = useReferentiallyStableCallback(onSuccessIn || (() => undefined))\n\tconst execute = useReferentiallyStableCallback(executeIn)\n\n\tconst submit = useReferentiallyStableCallback(async (event?: React.FormEvent) => {\n\t\tevent?.preventDefault()\n\t\tconst errors = validate?.({ values, state }) ?? []\n\t\tsetErrors(errors)\n\n\t\tif (errors.length > 0) {\n\t\t\tsetState('error')\n\t\t\treturn\n\t\t}\n\n\t\tsetState('submitting')\n\n\t\ttry {\n\t\t\tconst response = await execute({ values, state })\n\n\t\t\tif (!response.ok) {\n\t\t\t\tconst error = response.error\n\t\t\t\tsetState(response.state ?? 'error')\n\t\t\t\tsetErrors([{\n\t\t\t\t\tcode: error || 'UNKNOWN_ERROR',\n\t\t\t\t\tdeveloperMessage: response.developerMessage,\n\t\t\t\t\tfield: errorMapping && error && error in errorMapping ? errorMapping[error] : undefined,\n\t\t\t\t}])\n\t\t\t} else {\n\t\t\t\tsetState('success')\n\t\t\t\tsetValues(initialValues)\n\t\t\t\tonSuccess?.({ result: 'result' in response ? response.result : undefined as OkResult })\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\tsetState('error')\n\t\t\tsetErrors([{\n\t\t\t\tcode: 'UNKNOWN_ERROR',\n\t\t\t\tdeveloperMessage: typeof e === 'string' ? e : (e && typeof e === 'object' && 'message' in e && typeof e.message === 'string') ? e.message : undefined,\n\t\t\t}])\n\t\t}\n\t})\n\n\n\tconst onChange = useReferentiallyStableCallback(onChangeIn || (() => undefined))\n\tuseEffect(() => {\n\t\tonChange?.({ values, state, submit })\n\t}, [onChange, state, submit, values])\n\n\tconst setValue = useCallback((field: string, value: string) => setValues(values => ({ ...values, [field]: value })), [])\n\n\treturn (\n\t\t<FormContext.Provider value={{\n\t\t\tvalues,\n\t\t\tsetValues,\n\t\t\tstate,\n\t\t\terrors,\n\t\t\tsetValue: setValue,\n\t\t} as unknown as T}>\n\t\t\t<SlotForm onSubmit={submit}>\n\t\t\t\t{children}\n\t\t\t</SlotForm>\n\t\t</FormContext.Provider>\n\t)\n}\n"],"names":["Slot","useState","useEffect","useReferentiallyStableCallback","errors","useCallback","values","jsxDEV","FormContext","this"],"mappings":";;;;;;;AAMA,MAAM,WAAWA,UAAAA;AAkBV,MAAM,aAAa,CAAkE;AAAA,EAC3F;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AACX,MAAoC;AACnC,QAAM,CAAC,QAAQ,SAAS,IAAIC,eAAsB,aAAa;AAE/D,QAAM,CAAC,QAAQ,SAAS,IAAIA,MAAA,SAAsB,CAAE,CAAA;AACpD,QAAM,CAAC,OAAO,QAAQ,IAAIA,MAAqB,SAAA,UAAU,YAAY,SAAS;AAE9EC,QAAAA,UAAU,MAAM;AACf,QAAI,SAAS;AACZ,eAAS,SAAS;AAAA,IACnB;AAAA,EAAA,GACE,CAAC,OAAO,CAAC;AAEZA,QAAAA,UAAU,MAAM;AACX,QAAA,UAAU,aAAa,CAAC,SAAS;AACpC,gBAAU,aAAa;AACvB,eAAS,SAAS;AAAA,IACnB;AAAA,EACE,GAAA,CAAC,eAAe,SAAS,KAAK,CAAC;AAElC,QAAM,WAAWC,WAAAA,+BAA+B,eAAe,MAAM,OAAU;AAC/E,QAAM,YAAYA,WAAAA,+BAA+B,gBAAgB,MAAM,OAAU;AAC3E,QAAA,UAAUA,0CAA+B,SAAS;AAElD,QAAA,SAASA,0CAA+B,OAAO,UAA4B;AAChF,WAAO,eAAe;AACtB,UAAMC,UAAS,WAAW,EAAE,QAAQ,MAAM,CAAC,KAAK;AAChD,cAAUA,OAAM;AAEZA,QAAAA,QAAO,SAAS,GAAG;AACtB,eAAS,OAAO;AAChB;AAAA,IACD;AAEA,aAAS,YAAY;AAEjB,QAAA;AACH,YAAM,WAAW,MAAM,QAAQ,EAAE,QAAQ,MAAO,CAAA;AAE5C,UAAA,CAAC,SAAS,IAAI;AACjB,cAAM,QAAQ,SAAS;AACd,iBAAA,SAAS,SAAS,OAAO;AAClC,kBAAU,CAAC;AAAA,UACV,MAAM,SAAS;AAAA,UACf,kBAAkB,SAAS;AAAA,UAC3B,OAAO,gBAAgB,SAAS,SAAS,eAAe,aAAa,KAAK,IAAI;AAAA,QAC9E,CAAA,CAAC;AAAA,MAAA,OACI;AACN,iBAAS,SAAS;AAClB,kBAAU,aAAa;AACvB,oBAAY,EAAE,QAAQ,YAAY,WAAW,SAAS,SAAS,QAAuB;AAAA,MACvF;AAAA,aACQ,GAAG;AACX,cAAQ,MAAM,CAAC;AACf,eAAS,OAAO;AAChB,gBAAU,CAAC;AAAA,QACV,MAAM;AAAA,QACN,kBAAkB,OAAO,MAAM,WAAW,IAAK,KAAK,OAAO,MAAM,YAAY,aAAa,KAAK,OAAO,EAAE,YAAY,WAAY,EAAE,UAAU;AAAA,MAC5I,CAAA,CAAC;AAAA,IACH;AAAA,EAAA,CACA;AAGD,QAAM,WAAWD,WAAAA,+BAA+B,eAAe,MAAM,OAAU;AAC/ED,QAAAA,UAAU,MAAM;AACf,eAAW,EAAE,QAAQ,OAAO,OAAQ,CAAA;AAAA,KAClC,CAAC,UAAU,OAAO,QAAQ,MAAM,CAAC;AAEpC,QAAM,WAAWG,MAAAA,YAAY,CAAC,OAAe,UAAkB,UAAU,CAAAC,aAAW,EAAE,GAAGA,SAAQ,CAAC,KAAK,GAAG,QAAQ,GAAG,CAAA,CAAE;AAEvH,SACEC,qCAAAC,SAAAA,YAAY,UAAZ,EAAqB,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAEA,UAAAD,qCAAC,UAAS,EAAA,UAAU,QAClB,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAE,MAEA,EATD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAUA,GAAAA,MAAA;AAEF;;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback } from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { FormContext } from "../../contexts.js";
|
|
5
|
+
import { useReferentiallyStableCallback } from "@contember/react-utils";
|
|
6
|
+
const SlotForm = Slot;
|
|
7
|
+
const TenantForm = ({
|
|
8
|
+
children,
|
|
9
|
+
initialValues,
|
|
10
|
+
loading,
|
|
11
|
+
errorMapping,
|
|
12
|
+
validate: validateIn,
|
|
13
|
+
execute: executeIn,
|
|
14
|
+
onSuccess: onSuccessIn,
|
|
15
|
+
onChange: onChangeIn
|
|
16
|
+
}) => {
|
|
17
|
+
const [values, setValues] = useState(initialValues);
|
|
18
|
+
const [errors, setErrors] = useState([]);
|
|
19
|
+
const [state, setState] = useState(loading ? "loading" : "initial");
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (loading) {
|
|
22
|
+
setState("loading");
|
|
23
|
+
}
|
|
24
|
+
}, [loading]);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (state === "loading" && !loading) {
|
|
27
|
+
setValues(initialValues);
|
|
28
|
+
setState("initial");
|
|
29
|
+
}
|
|
30
|
+
}, [initialValues, loading, state]);
|
|
31
|
+
const validate = useReferentiallyStableCallback(validateIn || (() => void 0));
|
|
32
|
+
const onSuccess = useReferentiallyStableCallback(onSuccessIn || (() => void 0));
|
|
33
|
+
const execute = useReferentiallyStableCallback(executeIn);
|
|
34
|
+
const submit = useReferentiallyStableCallback(async (event) => {
|
|
35
|
+
event?.preventDefault();
|
|
36
|
+
const errors2 = validate?.({ values, state }) ?? [];
|
|
37
|
+
setErrors(errors2);
|
|
38
|
+
if (errors2.length > 0) {
|
|
39
|
+
setState("error");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
setState("submitting");
|
|
43
|
+
try {
|
|
44
|
+
const response = await execute({ values, state });
|
|
45
|
+
if (!response.ok) {
|
|
46
|
+
const error = response.error;
|
|
47
|
+
setState(response.state ?? "error");
|
|
48
|
+
setErrors([{
|
|
49
|
+
code: error || "UNKNOWN_ERROR",
|
|
50
|
+
developerMessage: response.developerMessage,
|
|
51
|
+
field: errorMapping && error && error in errorMapping ? errorMapping[error] : void 0
|
|
52
|
+
}]);
|
|
53
|
+
} else {
|
|
54
|
+
setState("success");
|
|
55
|
+
setValues(initialValues);
|
|
56
|
+
onSuccess?.({ result: "result" in response ? response.result : void 0 });
|
|
57
|
+
}
|
|
58
|
+
} catch (e) {
|
|
59
|
+
console.error(e);
|
|
60
|
+
setState("error");
|
|
61
|
+
setErrors([{
|
|
62
|
+
code: "UNKNOWN_ERROR",
|
|
63
|
+
developerMessage: typeof e === "string" ? e : e && typeof e === "object" && "message" in e && typeof e.message === "string" ? e.message : void 0
|
|
64
|
+
}]);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const onChange = useReferentiallyStableCallback(onChangeIn || (() => void 0));
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
onChange?.({ values, state, submit });
|
|
70
|
+
}, [onChange, state, submit, values]);
|
|
71
|
+
const setValue = useCallback((field, value) => setValues((values2) => ({ ...values2, [field]: value })), []);
|
|
72
|
+
return /* @__PURE__ */ jsxDEV(FormContext.Provider, { value: {
|
|
73
|
+
values,
|
|
74
|
+
setValues,
|
|
75
|
+
state,
|
|
76
|
+
errors,
|
|
77
|
+
setValue
|
|
78
|
+
}, children: /* @__PURE__ */ jsxDEV(SlotForm, { onSubmit: submit, children }, void 0, false, {
|
|
79
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/TenantForm.tsx",
|
|
80
|
+
lineNumber: 111,
|
|
81
|
+
columnNumber: 4
|
|
82
|
+
}, void 0) }, void 0, false, {
|
|
83
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/TenantForm.tsx",
|
|
84
|
+
lineNumber: 104,
|
|
85
|
+
columnNumber: 3
|
|
86
|
+
}, void 0);
|
|
87
|
+
};
|
|
88
|
+
export {
|
|
89
|
+
TenantForm
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=TenantForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TenantForm.js","sources":["../../../../src/components/forms/TenantForm.tsx"],"sourcesContent":["import { ComponentType, ReactElement, useCallback, useEffect, useState } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { FormContextValue } from '../../types/forms'\nimport { FormContext } from '../../contexts'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nconst SlotForm = Slot as ComponentType<React.FormHTMLAttributes<HTMLFormElement>>\n\n\ntype ExecuteResult<T extends FormContextValue<any, any, any>, OkResult = undefined> =\n\t| ({ ok: true } & (OkResult extends undefined ? {} : { result: OkResult }))\n\t| { ok: false, error?: T['errors'][number]['code'], developerMessage?: string, state?: T['state'] }\n\nexport interface TenantFormProps<T extends FormContextValue<any, any, any>, OkResult = undefined> {\n\tchildren: ReactElement\n\tloading?: boolean\n\tinitialValues: T['values']\n\terrorMapping?: Partial<Record<T['errors'][number]['code'], keyof T['values']>>\n\tvalidate?: (args: { values: T['values'], state: T['state'] }) => T['errors'] | undefined\n\texecute: (args: { values: T['values'], state: T['state'] }) => Promise<ExecuteResult<T, OkResult>>\n\tonSuccess?: (args: { result: OkResult }) => void\n\tonChange?: (args: { values: T['values'], state: T['state'], submit: () => Promise<void> }) => void\n}\n\nexport const TenantForm = <T extends FormContextValue<any, any, any>, OkResult = undefined>({\n\tchildren,\n\tinitialValues,\n\tloading,\n\terrorMapping,\n\tvalidate: validateIn,\n\texecute: executeIn,\n\tonSuccess: onSuccessIn,\n\tonChange: onChangeIn,\n}: TenantFormProps<T, OkResult>) => {\n\tconst [values, setValues] = useState<T['values']>(initialValues)\n\n\tconst [errors, setErrors] = useState<T['errors']>([])\n\tconst [state, setState] = useState<T['state']>(loading ? 'loading' : 'initial')\n\n\tuseEffect(() => {\n\t\tif (loading) {\n\t\t\tsetState('loading')\n\t\t}\n\t}, [loading])\n\n\tuseEffect(() => {\n\t\tif (state === 'loading' && !loading) {\n\t\t\tsetValues(initialValues)\n\t\t\tsetState('initial')\n\t\t}\n\t}, [initialValues, loading, state])\n\n\tconst validate = useReferentiallyStableCallback(validateIn || (() => undefined))\n\tconst onSuccess = useReferentiallyStableCallback(onSuccessIn || (() => undefined))\n\tconst execute = useReferentiallyStableCallback(executeIn)\n\n\tconst submit = useReferentiallyStableCallback(async (event?: React.FormEvent) => {\n\t\tevent?.preventDefault()\n\t\tconst errors = validate?.({ values, state }) ?? []\n\t\tsetErrors(errors)\n\n\t\tif (errors.length > 0) {\n\t\t\tsetState('error')\n\t\t\treturn\n\t\t}\n\n\t\tsetState('submitting')\n\n\t\ttry {\n\t\t\tconst response = await execute({ values, state })\n\n\t\t\tif (!response.ok) {\n\t\t\t\tconst error = response.error\n\t\t\t\tsetState(response.state ?? 'error')\n\t\t\t\tsetErrors([{\n\t\t\t\t\tcode: error || 'UNKNOWN_ERROR',\n\t\t\t\t\tdeveloperMessage: response.developerMessage,\n\t\t\t\t\tfield: errorMapping && error && error in errorMapping ? errorMapping[error] : undefined,\n\t\t\t\t}])\n\t\t\t} else {\n\t\t\t\tsetState('success')\n\t\t\t\tsetValues(initialValues)\n\t\t\t\tonSuccess?.({ result: 'result' in response ? response.result : undefined as OkResult })\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\tsetState('error')\n\t\t\tsetErrors([{\n\t\t\t\tcode: 'UNKNOWN_ERROR',\n\t\t\t\tdeveloperMessage: typeof e === 'string' ? e : (e && typeof e === 'object' && 'message' in e && typeof e.message === 'string') ? e.message : undefined,\n\t\t\t}])\n\t\t}\n\t})\n\n\n\tconst onChange = useReferentiallyStableCallback(onChangeIn || (() => undefined))\n\tuseEffect(() => {\n\t\tonChange?.({ values, state, submit })\n\t}, [onChange, state, submit, values])\n\n\tconst setValue = useCallback((field: string, value: string) => setValues(values => ({ ...values, [field]: value })), [])\n\n\treturn (\n\t\t<FormContext.Provider value={{\n\t\t\tvalues,\n\t\t\tsetValues,\n\t\t\tstate,\n\t\t\terrors,\n\t\t\tsetValue: setValue,\n\t\t} as unknown as T}>\n\t\t\t<SlotForm onSubmit={submit}>\n\t\t\t\t{children}\n\t\t\t</SlotForm>\n\t\t</FormContext.Provider>\n\t)\n}\n"],"names":["errors","values","this"],"mappings":";;;;;AAMA,MAAM,WAAW;AAkBV,MAAM,aAAa,CAAkE;AAAA,EAC3F;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,WAAW;AAAA,EACX,UAAU;AACX,MAAoC;AACnC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAsB,aAAa;AAE/D,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAsB,CAAE,CAAA;AACpD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAqB,UAAU,YAAY,SAAS;AAE9E,YAAU,MAAM;AACf,QAAI,SAAS;AACZ,eAAS,SAAS;AAAA,IACnB;AAAA,EAAA,GACE,CAAC,OAAO,CAAC;AAEZ,YAAU,MAAM;AACX,QAAA,UAAU,aAAa,CAAC,SAAS;AACpC,gBAAU,aAAa;AACvB,eAAS,SAAS;AAAA,IACnB;AAAA,EACE,GAAA,CAAC,eAAe,SAAS,KAAK,CAAC;AAElC,QAAM,WAAW,+BAA+B,eAAe,MAAM,OAAU;AAC/E,QAAM,YAAY,+BAA+B,gBAAgB,MAAM,OAAU;AAC3E,QAAA,UAAU,+BAA+B,SAAS;AAElD,QAAA,SAAS,+BAA+B,OAAO,UAA4B;AAChF,WAAO,eAAe;AACtB,UAAMA,UAAS,WAAW,EAAE,QAAQ,MAAM,CAAC,KAAK;AAChD,cAAUA,OAAM;AAEZA,QAAAA,QAAO,SAAS,GAAG;AACtB,eAAS,OAAO;AAChB;AAAA,IACD;AAEA,aAAS,YAAY;AAEjB,QAAA;AACH,YAAM,WAAW,MAAM,QAAQ,EAAE,QAAQ,MAAO,CAAA;AAE5C,UAAA,CAAC,SAAS,IAAI;AACjB,cAAM,QAAQ,SAAS;AACd,iBAAA,SAAS,SAAS,OAAO;AAClC,kBAAU,CAAC;AAAA,UACV,MAAM,SAAS;AAAA,UACf,kBAAkB,SAAS;AAAA,UAC3B,OAAO,gBAAgB,SAAS,SAAS,eAAe,aAAa,KAAK,IAAI;AAAA,QAC9E,CAAA,CAAC;AAAA,MAAA,OACI;AACN,iBAAS,SAAS;AAClB,kBAAU,aAAa;AACvB,oBAAY,EAAE,QAAQ,YAAY,WAAW,SAAS,SAAS,QAAuB;AAAA,MACvF;AAAA,aACQ,GAAG;AACX,cAAQ,MAAM,CAAC;AACf,eAAS,OAAO;AAChB,gBAAU,CAAC;AAAA,QACV,MAAM;AAAA,QACN,kBAAkB,OAAO,MAAM,WAAW,IAAK,KAAK,OAAO,MAAM,YAAY,aAAa,KAAK,OAAO,EAAE,YAAY,WAAY,EAAE,UAAU;AAAA,MAC5I,CAAA,CAAC;AAAA,IACH;AAAA,EAAA,CACA;AAGD,QAAM,WAAW,+BAA+B,eAAe,MAAM,OAAU;AAC/E,YAAU,MAAM;AACf,eAAW,EAAE,QAAQ,OAAO,OAAQ,CAAA;AAAA,KAClC,CAAC,UAAU,OAAO,QAAQ,MAAM,CAAC;AAEpC,QAAM,WAAW,YAAY,CAAC,OAAe,UAAkB,UAAU,CAAAC,aAAW,EAAE,GAAGA,SAAQ,CAAC,KAAK,GAAG,QAAQ,GAAG,CAAA,CAAE;AAEvH,SACE,uBAAA,YAAY,UAAZ,EAAqB,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAEA,UAAA,uBAAC,UAAS,EAAA,UAAU,QAClB,SADF,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAAC,MAEA,EATD,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAUA,GAAAA,MAAA;AAEF;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const TenantForm = require("./TenantForm.cjs");
|
|
6
|
+
const contexts = require("../../contexts.cjs");
|
|
7
|
+
const useUpdateProjectMemberMutation = require("../../hooks/mutations/memberships/useUpdateProjectMemberMutation.cjs");
|
|
8
|
+
const useTenantQueryLoader = require("../../hooks/useTenantQueryLoader.cjs");
|
|
9
|
+
const useProjectMembershipsQuery = require("../../hooks/queries/useProjectMembershipsQuery.cjs");
|
|
10
|
+
const useUpdateProjectMemberForm = contexts.useForm;
|
|
11
|
+
const UpdateProjectMemberForm = ({ children, onSuccess, identityId, projectSlug }) => {
|
|
12
|
+
const updateProjectMember = useUpdateProjectMemberMutation.useUpdateProjectMemberMutation();
|
|
13
|
+
const [state] = useTenantQueryLoader.useTenantQueryLoader(useProjectMembershipsQuery.useProjectMembershipsQuery(), { projectSlug, identityId });
|
|
14
|
+
const [memberships, setMemberships] = react.useState();
|
|
15
|
+
react.useEffect(() => {
|
|
16
|
+
setMemberships(state.state === "success" ? state.data : void 0);
|
|
17
|
+
}, [state]);
|
|
18
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
19
|
+
TenantForm.TenantForm,
|
|
20
|
+
{
|
|
21
|
+
onSuccess,
|
|
22
|
+
loading: memberships === void 0,
|
|
23
|
+
initialValues: memberships ? { memberships } : { memberships: [] },
|
|
24
|
+
onChange: ({ values, submit }) => {
|
|
25
|
+
setMemberships(values?.memberships);
|
|
26
|
+
},
|
|
27
|
+
validate: ({ values }) => {
|
|
28
|
+
const errors = [];
|
|
29
|
+
if (values.memberships.length === 0) {
|
|
30
|
+
errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
|
|
31
|
+
}
|
|
32
|
+
return errors;
|
|
33
|
+
},
|
|
34
|
+
execute: async ({ values }) => {
|
|
35
|
+
return await updateProjectMember({
|
|
36
|
+
identityId,
|
|
37
|
+
projectSlug,
|
|
38
|
+
memberships: values.memberships
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
errorMapping: errorToField,
|
|
42
|
+
children
|
|
43
|
+
},
|
|
44
|
+
void 0,
|
|
45
|
+
false,
|
|
46
|
+
{
|
|
47
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/UpdateProjectMemberForm.tsx",
|
|
48
|
+
lineNumber: 42,
|
|
49
|
+
columnNumber: 3
|
|
50
|
+
},
|
|
51
|
+
void 0
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
const errorToField = {
|
|
55
|
+
INVALID_MEMBERSHIP: "memberships",
|
|
56
|
+
PROJECT_NOT_FOUND: void 0,
|
|
57
|
+
ROLE_NOT_FOUND: "memberships",
|
|
58
|
+
VARIABLE_EMPTY: "memberships",
|
|
59
|
+
VARIABLE_NOT_FOUND: "memberships",
|
|
60
|
+
NOT_MEMBER: void 0
|
|
61
|
+
};
|
|
62
|
+
exports.UpdateProjectMemberForm = UpdateProjectMemberForm;
|
|
63
|
+
exports.useUpdateProjectMemberForm = useUpdateProjectMemberForm;
|
|
64
|
+
//# sourceMappingURL=UpdateProjectMemberForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateProjectMemberForm.cjs","sources":["../../../../src/components/forms/UpdateProjectMemberForm.tsx"],"sourcesContent":["import { ReactElement, useEffect, useState } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { UpdateProjectMemberErrorCode, MembershipInput } from '@contember/graphql-client-tenant'\nimport { useProjectMembershipsQuery, useTenantQueryLoader, useUpdateProjectMemberMutation } from '../../hooks'\n\nexport type UpdateProjectMemberFormValues = {\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type UpdateProjectMemberFormErrorCode =\n\t| UpdateProjectMemberErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type UpdateProjectMemberFormState = FormState\n\nexport type UpdateProjectMemberFormError = FormError<UpdateProjectMemberFormValues, UpdateProjectMemberFormErrorCode>\n\nexport type UpdateProjectMemberFormContextValue = FormContextValue<UpdateProjectMemberFormValues, UpdateProjectMemberFormErrorCode>\n\nexport interface UpdateProjectMemberFormProps {\n\tchildren: ReactElement\n\tidentityId: string\n\tprojectSlug: string\n\tonSuccess?: (args: { }) => void\n}\n\nexport const useUpdateProjectMemberForm = useForm as () => UpdateProjectMemberFormContextValue\n\nexport const UpdateProjectMemberForm = ({ children, onSuccess, identityId, projectSlug }: UpdateProjectMemberFormProps) => {\n\tconst updateProjectMember = useUpdateProjectMemberMutation()\n\tconst [state] = useTenantQueryLoader(useProjectMembershipsQuery(), { projectSlug, identityId })\n\tconst [memberships, setMemberships] = useState<readonly MembershipInput[]>()\n\n\tuseEffect(() => {\n\t\tsetMemberships(state.state === 'success' ? state.data : undefined)\n\t}, [state])\n\n\treturn (\n\t\t<TenantForm<UpdateProjectMemberFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\tloading={memberships === undefined}\n\t\t\tinitialValues={memberships ? { memberships } : { memberships: [] }}\n\t\t\tonChange={({ values, submit }) => {\n\t\t\t\tsetMemberships(values?.memberships)\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: UpdateProjectMemberFormError[] = []\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 updateProjectMember({\n\t\t\t\t\tidentityId,\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<UpdateProjectMemberErrorCode, keyof UpdateProjectMemberFormValues | 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\tNOT_MEMBER: undefined,\n}\n"],"names":["useForm","useUpdateProjectMemberMutation","useTenantQueryLoader","useProjectMembershipsQuery","useState","useEffect","jsxDEV","TenantForm","this"],"mappings":";;;;;;;;;AA6BO,MAAM,6BAA6BA,SAAA;AAEnC,MAAM,0BAA0B,CAAC,EAAE,UAAU,WAAW,YAAY,kBAAgD;AAC1H,QAAM,sBAAsBC,+BAAAA;AACtB,QAAA,CAAC,KAAK,IAAIC,0CAAqBC,2BAAAA,2BAA8B,GAAA,EAAE,aAAa,WAAA,CAAY;AAC9F,QAAM,CAAC,aAAa,cAAc,IAAIC,MAAqC,SAAA;AAE3EC,QAAAA,UAAU,MAAM;AACf,mBAAe,MAAM,UAAU,YAAY,MAAM,OAAO,MAAS;AAAA,EAAA,GAC/D,CAAC,KAAK,CAAC;AAGT,SAAAC,8BAAA;AAAA,IAACC,WAAA;AAAA,IAAA;AAAA,MACA;AAAA,MACA,SAAS,gBAAgB;AAAA,MACzB,eAAe,cAAc,EAAE,gBAAgB,EAAE,aAAa,CAAA,EAAG;AAAA,MACjE,UAAU,CAAC,EAAE,QAAQ,aAAa;AACjC,uBAAe,QAAQ,WAAW;AAAA,MACnC;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAyC,CAAA;AAC3C,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,oBAAoB;AAAA,UAChC;AAAA,UACA;AAAA,UACA,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IAvBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AA0BF;AAEA,MAAM,eAAsG;AAAA,EAC3G,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,YAAY;AACb;;;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { TenantForm } from "./TenantForm.js";
|
|
4
|
+
import { useForm } from "../../contexts.js";
|
|
5
|
+
import { useUpdateProjectMemberMutation } from "../../hooks/mutations/memberships/useUpdateProjectMemberMutation.js";
|
|
6
|
+
import { useTenantQueryLoader } from "../../hooks/useTenantQueryLoader.js";
|
|
7
|
+
import { useProjectMembershipsQuery } from "../../hooks/queries/useProjectMembershipsQuery.js";
|
|
8
|
+
const useUpdateProjectMemberForm = useForm;
|
|
9
|
+
const UpdateProjectMemberForm = ({ children, onSuccess, identityId, projectSlug }) => {
|
|
10
|
+
const updateProjectMember = useUpdateProjectMemberMutation();
|
|
11
|
+
const [state] = useTenantQueryLoader(useProjectMembershipsQuery(), { projectSlug, identityId });
|
|
12
|
+
const [memberships, setMemberships] = useState();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setMemberships(state.state === "success" ? state.data : void 0);
|
|
15
|
+
}, [state]);
|
|
16
|
+
return /* @__PURE__ */ jsxDEV(
|
|
17
|
+
TenantForm,
|
|
18
|
+
{
|
|
19
|
+
onSuccess,
|
|
20
|
+
loading: memberships === void 0,
|
|
21
|
+
initialValues: memberships ? { memberships } : { memberships: [] },
|
|
22
|
+
onChange: ({ values, submit }) => {
|
|
23
|
+
setMemberships(values?.memberships);
|
|
24
|
+
},
|
|
25
|
+
validate: ({ values }) => {
|
|
26
|
+
const errors = [];
|
|
27
|
+
if (values.memberships.length === 0) {
|
|
28
|
+
errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
|
|
29
|
+
}
|
|
30
|
+
return errors;
|
|
31
|
+
},
|
|
32
|
+
execute: async ({ values }) => {
|
|
33
|
+
return await updateProjectMember({
|
|
34
|
+
identityId,
|
|
35
|
+
projectSlug,
|
|
36
|
+
memberships: values.memberships
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
errorMapping: errorToField,
|
|
40
|
+
children
|
|
41
|
+
},
|
|
42
|
+
void 0,
|
|
43
|
+
false,
|
|
44
|
+
{
|
|
45
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/forms/UpdateProjectMemberForm.tsx",
|
|
46
|
+
lineNumber: 42,
|
|
47
|
+
columnNumber: 3
|
|
48
|
+
},
|
|
49
|
+
void 0
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
const errorToField = {
|
|
53
|
+
INVALID_MEMBERSHIP: "memberships",
|
|
54
|
+
PROJECT_NOT_FOUND: void 0,
|
|
55
|
+
ROLE_NOT_FOUND: "memberships",
|
|
56
|
+
VARIABLE_EMPTY: "memberships",
|
|
57
|
+
VARIABLE_NOT_FOUND: "memberships",
|
|
58
|
+
NOT_MEMBER: void 0
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
UpdateProjectMemberForm,
|
|
62
|
+
useUpdateProjectMemberForm
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=UpdateProjectMemberForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateProjectMemberForm.js","sources":["../../../../src/components/forms/UpdateProjectMemberForm.tsx"],"sourcesContent":["import { ReactElement, useEffect, useState } from 'react'\nimport { TenantForm } from './TenantForm'\nimport { FormContextValue, FormError, FormState } from '../../types'\nimport { useForm } from '../../contexts'\nimport { UpdateProjectMemberErrorCode, MembershipInput } from '@contember/graphql-client-tenant'\nimport { useProjectMembershipsQuery, useTenantQueryLoader, useUpdateProjectMemberMutation } from '../../hooks'\n\nexport type UpdateProjectMemberFormValues = {\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type UpdateProjectMemberFormErrorCode =\n\t| UpdateProjectMemberErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type UpdateProjectMemberFormState = FormState\n\nexport type UpdateProjectMemberFormError = FormError<UpdateProjectMemberFormValues, UpdateProjectMemberFormErrorCode>\n\nexport type UpdateProjectMemberFormContextValue = FormContextValue<UpdateProjectMemberFormValues, UpdateProjectMemberFormErrorCode>\n\nexport interface UpdateProjectMemberFormProps {\n\tchildren: ReactElement\n\tidentityId: string\n\tprojectSlug: string\n\tonSuccess?: (args: { }) => void\n}\n\nexport const useUpdateProjectMemberForm = useForm as () => UpdateProjectMemberFormContextValue\n\nexport const UpdateProjectMemberForm = ({ children, onSuccess, identityId, projectSlug }: UpdateProjectMemberFormProps) => {\n\tconst updateProjectMember = useUpdateProjectMemberMutation()\n\tconst [state] = useTenantQueryLoader(useProjectMembershipsQuery(), { projectSlug, identityId })\n\tconst [memberships, setMemberships] = useState<readonly MembershipInput[]>()\n\n\tuseEffect(() => {\n\t\tsetMemberships(state.state === 'success' ? state.data : undefined)\n\t}, [state])\n\n\treturn (\n\t\t<TenantForm<UpdateProjectMemberFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\tloading={memberships === undefined}\n\t\t\tinitialValues={memberships ? { memberships } : { memberships: [] }}\n\t\t\tonChange={({ values, submit }) => {\n\t\t\t\tsetMemberships(values?.memberships)\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: UpdateProjectMemberFormError[] = []\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 updateProjectMember({\n\t\t\t\t\tidentityId,\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<UpdateProjectMemberErrorCode, keyof UpdateProjectMemberFormValues | 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\tNOT_MEMBER: undefined,\n}\n"],"names":["this"],"mappings":";;;;;;;AA6BO,MAAM,6BAA6B;AAEnC,MAAM,0BAA0B,CAAC,EAAE,UAAU,WAAW,YAAY,kBAAgD;AAC1H,QAAM,sBAAsB;AACtB,QAAA,CAAC,KAAK,IAAI,qBAAqB,2BAA8B,GAAA,EAAE,aAAa,WAAA,CAAY;AAC9F,QAAM,CAAC,aAAa,cAAc,IAAI,SAAqC;AAE3E,YAAU,MAAM;AACf,mBAAe,MAAM,UAAU,YAAY,MAAM,OAAO,MAAS;AAAA,EAAA,GAC/D,CAAC,KAAK,CAAC;AAGT,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,SAAS,gBAAgB;AAAA,MACzB,eAAe,cAAc,EAAE,gBAAgB,EAAE,aAAa,CAAA,EAAG;AAAA,MACjE,UAAU,CAAC,EAAE,QAAQ,aAAa;AACjC,uBAAe,QAAQ,WAAW;AAAA,MACnC;AAAA,MACA,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAyC,CAAA;AAC3C,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,oBAAoB;AAAA,UAChC;AAAA,UACA;AAAA,UACA,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IAvBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA0BF;AAEA,MAAM,eAAsG;AAAA,EAC3G,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,YAAY;AACb;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const contexts = require("../../contexts.cjs");
|
|
6
|
+
const useHandleIDPResponse = require("../../internal/hooks/useHandleIDPResponse.cjs");
|
|
7
|
+
const useIDPAutoInit = require("../../internal/hooks/useIDPAutoInit.cjs");
|
|
8
|
+
const useInitIDPRedirect = require("../../internal/hooks/useInitIDPRedirect.cjs");
|
|
9
|
+
const IDP = ({ children, onResponseError, onInitError, onLogin }) => {
|
|
10
|
+
const hasOauthResponse = react.useMemo(() => {
|
|
11
|
+
const params = new URLSearchParams(window.location.search);
|
|
12
|
+
return params.has("state") && (params.has("code") || params.has("id_token"));
|
|
13
|
+
}, []);
|
|
14
|
+
const autoInit = useIDPAutoInit.useIDPAutoInitProvider();
|
|
15
|
+
const [state, setState] = react.useState(() => {
|
|
16
|
+
if (hasOauthResponse) {
|
|
17
|
+
return { type: "processing_response" };
|
|
18
|
+
}
|
|
19
|
+
if (autoInit) {
|
|
20
|
+
return { type: "processing_init" };
|
|
21
|
+
}
|
|
22
|
+
return { type: "nothing" };
|
|
23
|
+
});
|
|
24
|
+
useHandleIDPResponse.useHandleIDPResponse({ hasOauthResponse, setState, onLogin });
|
|
25
|
+
const initRedirect = useInitIDPRedirect.useInitIDPRedirect({ setState });
|
|
26
|
+
const isFirstRender = react.useRef(true);
|
|
27
|
+
react.useEffect(() => {
|
|
28
|
+
if (!autoInit) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!isFirstRender.current) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
isFirstRender.current = false;
|
|
35
|
+
initRedirect({ provider: autoInit });
|
|
36
|
+
}, [autoInit, initRedirect]);
|
|
37
|
+
react.useEffect(() => {
|
|
38
|
+
if (state.type === "init_failed" && onInitError) {
|
|
39
|
+
onInitError(state.error);
|
|
40
|
+
}
|
|
41
|
+
if (state.type === "response_failed" && onResponseError) {
|
|
42
|
+
onResponseError(state.error);
|
|
43
|
+
}
|
|
44
|
+
}, [onInitError, onResponseError, state]);
|
|
45
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.IDPStateContextProvider.Provider, { value: state, children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(contexts.IDPMethodsContextProvider.Provider, { value: { initRedirect }, children }, void 0, false, {
|
|
46
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/idp/IDP.tsx",
|
|
47
|
+
lineNumber: 59,
|
|
48
|
+
columnNumber: 4
|
|
49
|
+
}, void 0) }, void 0, false, {
|
|
50
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/idp/IDP.tsx",
|
|
51
|
+
lineNumber: 58,
|
|
52
|
+
columnNumber: 3
|
|
53
|
+
}, void 0);
|
|
54
|
+
};
|
|
55
|
+
exports.IDP = IDP;
|
|
56
|
+
//# sourceMappingURL=IDP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDP.cjs","sources":["../../../../src/components/idp/IDP.tsx"],"sourcesContent":["import { ReactNode, useEffect, useMemo, useRef, useState } from 'react'\nimport { IDPMethodsContextProvider, IDPStateContextProvider } from '../../contexts'\nimport { IDPInitError, IDPResponseError, IDPStateValue } from '../../types/idp'\nimport { useHandleIDPResponse } from '../../internal/hooks/useHandleIDPResponse'\nimport { useIDPAutoInitProvider } from '../../internal/hooks/useIDPAutoInit'\nimport { useInitIDPRedirect } from '../../internal/hooks/useInitIDPRedirect'\n\nexport interface IDPProps {\n\tchildren: ReactNode\n\tonLogin?: () => void\n\tonInitError?: (error: IDPInitError) => void\n\tonResponseError?: (error: IDPResponseError) => void\n}\n\nexport const IDP = ({ children, onResponseError, onInitError, onLogin }: IDPProps) => {\n\tconst hasOauthResponse = useMemo(() => {\n\t\tconst params = new URLSearchParams(window.location.search)\n\t\treturn params.has('state') && (params.has('code') || params.has('id_token'))\n\t}, [])\n\n\tconst autoInit = useIDPAutoInitProvider()\n\tconst [state, setState] = useState<IDPStateValue>(() => {\n\t\tif (hasOauthResponse) {\n\t\t\treturn { type: 'processing_response' }\n\t\t}\n\t\tif (autoInit) {\n\t\t\treturn { type: 'processing_init' }\n\t\t}\n\t\treturn { type: 'nothing' }\n\t})\n\tuseHandleIDPResponse({ hasOauthResponse, setState, onLogin })\n\n\tconst initRedirect = useInitIDPRedirect({ setState })\n\n\tconst isFirstRender = useRef(true)\n\tuseEffect(() => {\n\t\tif (!autoInit) {\n\t\t\treturn\n\t\t}\n\t\tif (!isFirstRender.current) {\n\t\t\treturn\n\t\t}\n\t\tisFirstRender.current = false\n\t\tinitRedirect({ provider: autoInit })\n\t}, [autoInit, initRedirect])\n\n\tuseEffect(() => {\n\t\tif (state.type === 'init_failed' && onInitError) {\n\t\t\tonInitError(state.error)\n\t\t}\n\t\tif (state.type === 'response_failed' && onResponseError) {\n\t\t\tonResponseError(state.error)\n\t\t}\n\t}, [onInitError, onResponseError, state])\n\n\n\treturn (\n\t\t<IDPStateContextProvider.Provider value={state}>\n\t\t\t<IDPMethodsContextProvider.Provider value={{ initRedirect }}>\n\t\t\t\t{children}\n\t\t\t</IDPMethodsContextProvider.Provider>\n\t\t</IDPStateContextProvider.Provider>\n\t)\n\n}\n"],"names":["useMemo","useIDPAutoInitProvider","useState","useHandleIDPResponse","useInitIDPRedirect","useRef","useEffect","jsxDEV","IDPStateContextProvider","IDPMethodsContextProvider","this"],"mappings":";;;;;;;;AAcO,MAAM,MAAM,CAAC,EAAE,UAAU,iBAAiB,aAAa,cAAwB;AAC/E,QAAA,mBAAmBA,MAAAA,QAAQ,MAAM;AACtC,UAAM,SAAS,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAClD,WAAA,OAAO,IAAI,OAAO,MAAM,OAAO,IAAI,MAAM,KAAK,OAAO,IAAI,UAAU;AAAA,EAC3E,GAAG,CAAE,CAAA;AAEL,QAAM,WAAWC,eAAAA;AACjB,QAAM,CAAC,OAAO,QAAQ,IAAIC,eAAwB,MAAM;AACvD,QAAI,kBAAkB;AACd,aAAA,EAAE,MAAM;IAChB;AACA,QAAI,UAAU;AACN,aAAA,EAAE,MAAM;IAChB;AACO,WAAA,EAAE,MAAM;EAAU,CACzB;AACDC,uBAAAA,qBAAqB,EAAE,kBAAkB,UAAU,QAAS,CAAA;AAE5D,QAAM,eAAeC,mBAAAA,mBAAmB,EAAE,SAAU,CAAA;AAE9C,QAAA,gBAAgBC,aAAO,IAAI;AACjCC,QAAAA,UAAU,MAAM;AACf,QAAI,CAAC,UAAU;AACd;AAAA,IACD;AACI,QAAA,CAAC,cAAc,SAAS;AAC3B;AAAA,IACD;AACA,kBAAc,UAAU;AACX,iBAAA,EAAE,UAAU,SAAA,CAAU;AAAA,EAAA,GACjC,CAAC,UAAU,YAAY,CAAC;AAE3BA,QAAAA,UAAU,MAAM;AACX,QAAA,MAAM,SAAS,iBAAiB,aAAa;AAChD,kBAAY,MAAM,KAAK;AAAA,IACxB;AACI,QAAA,MAAM,SAAS,qBAAqB,iBAAiB;AACxD,sBAAgB,MAAM,KAAK;AAAA,IAC5B;AAAA,EACE,GAAA,CAAC,aAAa,iBAAiB,KAAK,CAAC;AAGxC,SACEC,8BAAAA,OAAAC,SAAAA,wBAAwB,UAAxB,EAAiC,OAAO,OACxC,UAAAD,qCAACE,SAAAA,0BAA0B,UAA1B,EAAmC,OAAO,EAAE,aAAA,GAC3C,YADF,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,EAIA,GAAAA,MAAA;AAGF;;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useMemo, useState, useRef, useEffect } from "react";
|
|
3
|
+
import { IDPStateContextProvider, IDPMethodsContextProvider } from "../../contexts.js";
|
|
4
|
+
import { useHandleIDPResponse } from "../../internal/hooks/useHandleIDPResponse.js";
|
|
5
|
+
import { useIDPAutoInitProvider } from "../../internal/hooks/useIDPAutoInit.js";
|
|
6
|
+
import { useInitIDPRedirect } from "../../internal/hooks/useInitIDPRedirect.js";
|
|
7
|
+
const IDP = ({ children, onResponseError, onInitError, onLogin }) => {
|
|
8
|
+
const hasOauthResponse = useMemo(() => {
|
|
9
|
+
const params = new URLSearchParams(window.location.search);
|
|
10
|
+
return params.has("state") && (params.has("code") || params.has("id_token"));
|
|
11
|
+
}, []);
|
|
12
|
+
const autoInit = useIDPAutoInitProvider();
|
|
13
|
+
const [state, setState] = useState(() => {
|
|
14
|
+
if (hasOauthResponse) {
|
|
15
|
+
return { type: "processing_response" };
|
|
16
|
+
}
|
|
17
|
+
if (autoInit) {
|
|
18
|
+
return { type: "processing_init" };
|
|
19
|
+
}
|
|
20
|
+
return { type: "nothing" };
|
|
21
|
+
});
|
|
22
|
+
useHandleIDPResponse({ hasOauthResponse, setState, onLogin });
|
|
23
|
+
const initRedirect = useInitIDPRedirect({ setState });
|
|
24
|
+
const isFirstRender = useRef(true);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!autoInit) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (!isFirstRender.current) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
isFirstRender.current = false;
|
|
33
|
+
initRedirect({ provider: autoInit });
|
|
34
|
+
}, [autoInit, initRedirect]);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (state.type === "init_failed" && onInitError) {
|
|
37
|
+
onInitError(state.error);
|
|
38
|
+
}
|
|
39
|
+
if (state.type === "response_failed" && onResponseError) {
|
|
40
|
+
onResponseError(state.error);
|
|
41
|
+
}
|
|
42
|
+
}, [onInitError, onResponseError, state]);
|
|
43
|
+
return /* @__PURE__ */ jsxDEV(IDPStateContextProvider.Provider, { value: state, children: /* @__PURE__ */ jsxDEV(IDPMethodsContextProvider.Provider, { value: { initRedirect }, children }, void 0, false, {
|
|
44
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/idp/IDP.tsx",
|
|
45
|
+
lineNumber: 59,
|
|
46
|
+
columnNumber: 4
|
|
47
|
+
}, void 0) }, void 0, false, {
|
|
48
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/idp/IDP.tsx",
|
|
49
|
+
lineNumber: 58,
|
|
50
|
+
columnNumber: 3
|
|
51
|
+
}, void 0);
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
IDP
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=IDP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDP.js","sources":["../../../../src/components/idp/IDP.tsx"],"sourcesContent":["import { ReactNode, useEffect, useMemo, useRef, useState } from 'react'\nimport { IDPMethodsContextProvider, IDPStateContextProvider } from '../../contexts'\nimport { IDPInitError, IDPResponseError, IDPStateValue } from '../../types/idp'\nimport { useHandleIDPResponse } from '../../internal/hooks/useHandleIDPResponse'\nimport { useIDPAutoInitProvider } from '../../internal/hooks/useIDPAutoInit'\nimport { useInitIDPRedirect } from '../../internal/hooks/useInitIDPRedirect'\n\nexport interface IDPProps {\n\tchildren: ReactNode\n\tonLogin?: () => void\n\tonInitError?: (error: IDPInitError) => void\n\tonResponseError?: (error: IDPResponseError) => void\n}\n\nexport const IDP = ({ children, onResponseError, onInitError, onLogin }: IDPProps) => {\n\tconst hasOauthResponse = useMemo(() => {\n\t\tconst params = new URLSearchParams(window.location.search)\n\t\treturn params.has('state') && (params.has('code') || params.has('id_token'))\n\t}, [])\n\n\tconst autoInit = useIDPAutoInitProvider()\n\tconst [state, setState] = useState<IDPStateValue>(() => {\n\t\tif (hasOauthResponse) {\n\t\t\treturn { type: 'processing_response' }\n\t\t}\n\t\tif (autoInit) {\n\t\t\treturn { type: 'processing_init' }\n\t\t}\n\t\treturn { type: 'nothing' }\n\t})\n\tuseHandleIDPResponse({ hasOauthResponse, setState, onLogin })\n\n\tconst initRedirect = useInitIDPRedirect({ setState })\n\n\tconst isFirstRender = useRef(true)\n\tuseEffect(() => {\n\t\tif (!autoInit) {\n\t\t\treturn\n\t\t}\n\t\tif (!isFirstRender.current) {\n\t\t\treturn\n\t\t}\n\t\tisFirstRender.current = false\n\t\tinitRedirect({ provider: autoInit })\n\t}, [autoInit, initRedirect])\n\n\tuseEffect(() => {\n\t\tif (state.type === 'init_failed' && onInitError) {\n\t\t\tonInitError(state.error)\n\t\t}\n\t\tif (state.type === 'response_failed' && onResponseError) {\n\t\t\tonResponseError(state.error)\n\t\t}\n\t}, [onInitError, onResponseError, state])\n\n\n\treturn (\n\t\t<IDPStateContextProvider.Provider value={state}>\n\t\t\t<IDPMethodsContextProvider.Provider value={{ initRedirect }}>\n\t\t\t\t{children}\n\t\t\t</IDPMethodsContextProvider.Provider>\n\t\t</IDPStateContextProvider.Provider>\n\t)\n\n}\n"],"names":["this"],"mappings":";;;;;;AAcO,MAAM,MAAM,CAAC,EAAE,UAAU,iBAAiB,aAAa,cAAwB;AAC/E,QAAA,mBAAmB,QAAQ,MAAM;AACtC,UAAM,SAAS,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAClD,WAAA,OAAO,IAAI,OAAO,MAAM,OAAO,IAAI,MAAM,KAAK,OAAO,IAAI,UAAU;AAAA,EAC3E,GAAG,CAAE,CAAA;AAEL,QAAM,WAAW;AACjB,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,MAAM;AACvD,QAAI,kBAAkB;AACd,aAAA,EAAE,MAAM;IAChB;AACA,QAAI,UAAU;AACN,aAAA,EAAE,MAAM;IAChB;AACO,WAAA,EAAE,MAAM;EAAU,CACzB;AACD,uBAAqB,EAAE,kBAAkB,UAAU,QAAS,CAAA;AAE5D,QAAM,eAAe,mBAAmB,EAAE,SAAU,CAAA;AAE9C,QAAA,gBAAgB,OAAO,IAAI;AACjC,YAAU,MAAM;AACf,QAAI,CAAC,UAAU;AACd;AAAA,IACD;AACI,QAAA,CAAC,cAAc,SAAS;AAC3B;AAAA,IACD;AACA,kBAAc,UAAU;AACX,iBAAA,EAAE,UAAU,SAAA,CAAU;AAAA,EAAA,GACjC,CAAC,UAAU,YAAY,CAAC;AAE3B,YAAU,MAAM;AACX,QAAA,MAAM,SAAS,iBAAiB,aAAa;AAChD,kBAAY,MAAM,KAAK;AAAA,IACxB;AACI,QAAA,MAAM,SAAS,qBAAqB,iBAAiB;AACxD,sBAAgB,MAAM,KAAK;AAAA,IAC5B;AAAA,EACE,GAAA,CAAC,aAAa,iBAAiB,KAAK,CAAC;AAGxC,SACE,uBAAA,wBAAwB,UAAxB,EAAiC,OAAO,OACxC,UAAA,uBAAC,0BAA0B,UAA1B,EAAmC,OAAO,EAAE,aAAA,GAC3C,YADF,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,EAIA,GAAAA,MAAA;AAGF;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const reactSlot = require("@radix-ui/react-slot");
|
|
5
|
+
const contexts = require("../../contexts.cjs");
|
|
6
|
+
const SlotButton = reactSlot.Slot;
|
|
7
|
+
const IDPInitTrigger = ({ identityProvider, ...props }) => {
|
|
8
|
+
const initIdp = contexts.useIDPMethods().initRedirect;
|
|
9
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(SlotButton, { onClick: () => initIdp({ provider: identityProvider }), ...props }, void 0, false, {
|
|
10
|
+
fileName: "/__w/interface/interface/packages/react-client-tenant/src/components/idp/IDPInitTrigger.tsx",
|
|
11
|
+
lineNumber: 15,
|
|
12
|
+
columnNumber: 3
|
|
13
|
+
}, void 0);
|
|
14
|
+
};
|
|
15
|
+
exports.IDPInitTrigger = IDPInitTrigger;
|
|
16
|
+
//# sourceMappingURL=IDPInitTrigger.cjs.map
|