@contember/react-client-tenant 2.2.0-alpha.3 → 2.2.0-alpha.5
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/CLAUDE.md +40 -0
- package/dist/development/index.cjs +123 -0
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +123 -0
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/components/forms/AddProjectMemberForm.cjs +59 -0
- package/dist/development/src/components/forms/AddProjectMemberForm.cjs.map +1 -0
- package/dist/development/src/components/forms/AddProjectMemberForm.js +59 -0
- package/dist/development/src/components/forms/AddProjectMemberForm.js.map +1 -0
- package/dist/development/src/components/forms/ChangeMyProfileForm.cjs +58 -0
- package/dist/development/src/components/forms/ChangeMyProfileForm.cjs.map +1 -0
- package/dist/development/src/components/forms/ChangeMyProfileForm.js +58 -0
- package/dist/development/src/components/forms/ChangeMyProfileForm.js.map +1 -0
- package/dist/development/src/components/forms/ChangePasswordForm.cjs +57 -0
- package/dist/development/src/components/forms/ChangePasswordForm.cjs.map +1 -0
- package/dist/development/src/components/forms/ChangePasswordForm.js +57 -0
- package/dist/development/src/components/forms/ChangePasswordForm.js.map +1 -0
- package/dist/development/src/components/forms/ChangeProfileForm.cjs +54 -0
- package/dist/development/src/components/forms/ChangeProfileForm.cjs.map +1 -0
- package/dist/development/src/components/forms/ChangeProfileForm.js +54 -0
- package/dist/development/src/components/forms/ChangeProfileForm.js.map +1 -0
- package/dist/development/src/components/forms/CreateGlobalApiKeyForm.cjs +53 -0
- package/dist/development/src/components/forms/CreateGlobalApiKeyForm.cjs.map +1 -0
- package/dist/development/src/components/forms/CreateGlobalApiKeyForm.js +53 -0
- package/dist/development/src/components/forms/CreateGlobalApiKeyForm.js.map +1 -0
- package/dist/development/src/components/forms/EmailOtpConfirmForm.cjs +51 -0
- package/dist/development/src/components/forms/EmailOtpConfirmForm.cjs.map +1 -0
- package/dist/development/src/components/forms/EmailOtpConfirmForm.js +51 -0
- package/dist/development/src/components/forms/EmailOtpConfirmForm.js.map +1 -0
- package/dist/development/src/components/forms/InviteForm.cjs +23 -3
- package/dist/development/src/components/forms/InviteForm.cjs.map +1 -1
- package/dist/development/src/components/forms/InviteForm.js +23 -3
- package/dist/development/src/components/forms/InviteForm.js.map +1 -1
- package/dist/development/src/components/forms/LoginForm.cjs +5 -3
- package/dist/development/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/development/src/components/forms/LoginForm.js +5 -3
- package/dist/development/src/components/forms/LoginForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInForm.cjs +5 -3
- package/dist/development/src/components/forms/PasswordlessSignInForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInForm.js +5 -3
- package/dist/development/src/components/forms/PasswordlessSignInForm.js.map +1 -1
- package/dist/development/src/components/forms/SetProjectSecretForm.cjs +53 -0
- package/dist/development/src/components/forms/SetProjectSecretForm.cjs.map +1 -0
- package/dist/development/src/components/forms/SetProjectSecretForm.js +53 -0
- package/dist/development/src/components/forms/SetProjectSecretForm.js.map +1 -0
- package/dist/development/src/components/forms/SignUpForm.cjs +66 -0
- package/dist/development/src/components/forms/SignUpForm.cjs.map +1 -0
- package/dist/development/src/components/forms/SignUpForm.js +66 -0
- package/dist/development/src/components/forms/SignUpForm.js.map +1 -0
- package/dist/development/src/components/forms/TenantForm.cjs +8 -4
- package/dist/development/src/components/forms/TenantForm.cjs.map +1 -1
- package/dist/development/src/components/forms/TenantForm.js +8 -4
- package/dist/development/src/components/forms/TenantForm.js.map +1 -1
- package/dist/development/src/components/triggers/DisableEmailOtpTrigger.cjs +32 -0
- package/dist/development/src/components/triggers/DisableEmailOtpTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/DisableEmailOtpTrigger.js +32 -0
- package/dist/development/src/components/triggers/DisableEmailOtpTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/DisableMyPasswordlessTrigger.cjs +32 -0
- package/dist/development/src/components/triggers/DisableMyPasswordlessTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/DisableMyPasswordlessTrigger.js +32 -0
- package/dist/development/src/components/triggers/DisableMyPasswordlessTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/DisableOtpTrigger.cjs +1 -1
- package/dist/development/src/components/triggers/DisableOtpTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/DisableOtpTrigger.js +1 -1
- package/dist/development/src/components/triggers/DisableOtpTrigger.js.map +1 -1
- package/dist/development/src/components/triggers/DisablePersonTrigger.cjs +17 -0
- package/dist/development/src/components/triggers/DisablePersonTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/DisablePersonTrigger.js +17 -0
- package/dist/development/src/components/triggers/DisablePersonTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/EnableMyPasswordlessTrigger.cjs +32 -0
- package/dist/development/src/components/triggers/EnableMyPasswordlessTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/EnableMyPasswordlessTrigger.js +32 -0
- package/dist/development/src/components/triggers/EnableMyPasswordlessTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/EnablePersonTrigger.cjs +17 -0
- package/dist/development/src/components/triggers/EnablePersonTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/EnablePersonTrigger.js +17 -0
- package/dist/development/src/components/triggers/EnablePersonTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/ForceSignOutPersonTrigger.cjs +17 -0
- package/dist/development/src/components/triggers/ForceSignOutPersonTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/ForceSignOutPersonTrigger.js +17 -0
- package/dist/development/src/components/triggers/ForceSignOutPersonTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/InitEmailOtpTrigger.cjs +16 -0
- package/dist/development/src/components/triggers/InitEmailOtpTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/InitEmailOtpTrigger.js +16 -0
- package/dist/development/src/components/triggers/InitEmailOtpTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/RegenerateBackupCodesTrigger.cjs +26 -0
- package/dist/development/src/components/triggers/RegenerateBackupCodesTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/RegenerateBackupCodesTrigger.js +26 -0
- package/dist/development/src/components/triggers/RegenerateBackupCodesTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.cjs +1 -1
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.js +1 -1
- package/dist/development/src/components/triggers/RemoveProjectMemberTrigger.js.map +1 -1
- package/dist/development/src/components/triggers/ResetPersonMfaTrigger.cjs +17 -0
- package/dist/development/src/components/triggers/ResetPersonMfaTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/ResetPersonMfaTrigger.js +17 -0
- package/dist/development/src/components/triggers/ResetPersonMfaTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/RevokeSessionTrigger.cjs +17 -0
- package/dist/development/src/components/triggers/RevokeSessionTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/RevokeSessionTrigger.js +17 -0
- package/dist/development/src/components/triggers/RevokeSessionTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/TenantActionTrigger.cjs +7 -3
- package/dist/development/src/components/triggers/TenantActionTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/TenantActionTrigger.js +7 -3
- package/dist/development/src/components/triggers/TenantActionTrigger.js.map +1 -1
- package/dist/development/src/hooks/mutations/auth/useSignUpMutation.cjs +30 -0
- package/dist/development/src/hooks/mutations/auth/useSignUpMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/auth/useSignUpMutation.js +13 -0
- package/dist/development/src/hooks/mutations/auth/useSignUpMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.cjs +30 -0
- package/dist/development/src/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.js +13 -0
- package/dist/development/src/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/emailOtp/useDisableEmailOtpMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/emailOtp/useDisableEmailOtpMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/emailOtp/useDisableEmailOtpMutation.js +12 -0
- package/dist/development/src/hooks/mutations/emailOtp/useDisableEmailOtpMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/emailOtp/useInitEmailOtpMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/emailOtp/useInitEmailOtpMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/emailOtp/useInitEmailOtpMutation.js +12 -0
- package/dist/development/src/hooks/mutations/emailOtp/useInitEmailOtpMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.cjs +30 -0
- package/dist/development/src/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.js +13 -0
- package/dist/development/src/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.cjs +30 -0
- package/dist/development/src/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.js +13 -0
- package/dist/development/src/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.js +12 -0
- package/dist/development/src/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/invite/useUnmanagedInviteMutation.cjs +30 -0
- package/dist/development/src/hooks/mutations/invite/useUnmanagedInviteMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/invite/useUnmanagedInviteMutation.js +13 -0
- package/dist/development/src/hooks/mutations/invite/useUnmanagedInviteMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/otp/useRegenerateBackupCodesMutation.cjs +30 -0
- package/dist/development/src/hooks/mutations/otp/useRegenerateBackupCodesMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/otp/useRegenerateBackupCodesMutation.js +13 -0
- package/dist/development/src/hooks/mutations/otp/useRegenerateBackupCodesMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/person/useChangePasswordMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/person/useChangePasswordMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/person/useChangePasswordMutation.js +12 -0
- package/dist/development/src/hooks/mutations/person/useChangePasswordMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/person/useDisablePersonMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/person/useDisablePersonMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/person/useDisablePersonMutation.js +12 -0
- package/dist/development/src/hooks/mutations/person/useDisablePersonMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/person/useEnablePersonMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/person/useEnablePersonMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/person/useEnablePersonMutation.js +12 -0
- package/dist/development/src/hooks/mutations/person/useEnablePersonMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/person/useForceSignOutPersonMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/person/useForceSignOutPersonMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/person/useForceSignOutPersonMutation.js +12 -0
- package/dist/development/src/hooks/mutations/person/useForceSignOutPersonMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/person/useResetPersonMfaMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/person/useResetPersonMfaMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/person/useResetPersonMfaMutation.js +12 -0
- package/dist/development/src/hooks/mutations/person/useResetPersonMfaMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/project/useSetProjectSecretMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/project/useSetProjectSecretMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/project/useSetProjectSecretMutation.js +12 -0
- package/dist/development/src/hooks/mutations/project/useSetProjectSecretMutation.js.map +1 -0
- package/dist/development/src/hooks/mutations/session/useRevokeSessionMutation.cjs +29 -0
- package/dist/development/src/hooks/mutations/session/useRevokeSessionMutation.cjs.map +1 -0
- package/dist/development/src/hooks/mutations/session/useRevokeSessionMutation.js +12 -0
- package/dist/development/src/hooks/mutations/session/useRevokeSessionMutation.js.map +1 -0
- package/dist/development/src/hooks/queries/useAuthLogQuery.cjs +39 -0
- package/dist/development/src/hooks/queries/useAuthLogQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useAuthLogQuery.js +22 -0
- package/dist/development/src/hooks/queries/useAuthLogQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/useAuthPoliciesQuery.cjs +32 -0
- package/dist/development/src/hooks/queries/useAuthPoliciesQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useAuthPoliciesQuery.js +15 -0
- package/dist/development/src/hooks/queries/useAuthPoliciesQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/useConfigurationQuery.cjs +33 -0
- package/dist/development/src/hooks/queries/useConfigurationQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useConfigurationQuery.js +16 -0
- package/dist/development/src/hooks/queries/useConfigurationQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/useGlobalApiKeysQuery.cjs +32 -0
- package/dist/development/src/hooks/queries/useGlobalApiKeysQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useGlobalApiKeysQuery.js +15 -0
- package/dist/development/src/hooks/queries/useGlobalApiKeysQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/useIdentityProvidersQuery.cjs +32 -0
- package/dist/development/src/hooks/queries/useIdentityProvidersQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useIdentityProvidersQuery.js +15 -0
- package/dist/development/src/hooks/queries/useIdentityProvidersQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/useMailTemplatesQuery.cjs +32 -0
- package/dist/development/src/hooks/queries/useMailTemplatesQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useMailTemplatesQuery.js +15 -0
- package/dist/development/src/hooks/queries/useMailTemplatesQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/useMeQuery.cjs +4 -2
- package/dist/development/src/hooks/queries/useMeQuery.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useMeQuery.js +4 -2
- package/dist/development/src/hooks/queries/useMeQuery.js.map +1 -1
- package/dist/development/src/hooks/queries/useMyIdentityProvidersQuery.cjs +38 -0
- package/dist/development/src/hooks/queries/useMyIdentityProvidersQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useMyIdentityProvidersQuery.js +21 -0
- package/dist/development/src/hooks/queries/useMyIdentityProvidersQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/useMySessionsQuery.cjs +34 -0
- package/dist/development/src/hooks/queries/useMySessionsQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useMySessionsQuery.js +17 -0
- package/dist/development/src/hooks/queries/useMySessionsQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/usePersonQuery.cjs +40 -0
- package/dist/development/src/hooks/queries/usePersonQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/usePersonQuery.js +23 -0
- package/dist/development/src/hooks/queries/usePersonQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/usePersonSessionsQuery.cjs +39 -0
- package/dist/development/src/hooks/queries/usePersonSessionsQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/usePersonSessionsQuery.js +22 -0
- package/dist/development/src/hooks/queries/usePersonSessionsQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/usePersonsQuery.cjs +45 -0
- package/dist/development/src/hooks/queries/usePersonsQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/usePersonsQuery.js +28 -0
- package/dist/development/src/hooks/queries/usePersonsQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/useProjectApiKeysQuery.cjs +49 -0
- package/dist/development/src/hooks/queries/useProjectApiKeysQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useProjectApiKeysQuery.js +32 -0
- package/dist/development/src/hooks/queries/useProjectApiKeysQuery.js.map +1 -0
- package/dist/development/src/hooks/queries/useProjectMembersQuery.cjs +1 -1
- package/dist/development/src/hooks/queries/useProjectMembersQuery.cjs.map +1 -1
- package/dist/development/src/hooks/queries/useProjectMembersQuery.js +1 -1
- package/dist/development/src/hooks/queries/useProjectMembersQuery.js.map +1 -1
- package/dist/development/src/hooks/queries/useProjectSecretsQuery.cjs +45 -0
- package/dist/development/src/hooks/queries/useProjectSecretsQuery.cjs.map +1 -0
- package/dist/development/src/hooks/queries/useProjectSecretsQuery.js +28 -0
- package/dist/development/src/hooks/queries/useProjectSecretsQuery.js.map +1 -0
- package/dist/development/src/hooks/useFetchIdentity.cjs +17 -3
- package/dist/development/src/hooks/useFetchIdentity.cjs.map +1 -1
- package/dist/development/src/hooks/useFetchIdentity.js +17 -3
- package/dist/development/src/hooks/useFetchIdentity.js.map +1 -1
- package/dist/development/src/types/forbidden.cjs +16 -0
- package/dist/development/src/types/forbidden.cjs.map +1 -0
- package/dist/development/src/types/forbidden.js +16 -0
- package/dist/development/src/types/forbidden.js.map +1 -0
- package/dist/production/index.cjs +123 -0
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +123 -0
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/components/forms/AddProjectMemberForm.cjs +51 -0
- package/dist/production/src/components/forms/AddProjectMemberForm.cjs.map +1 -0
- package/dist/production/src/components/forms/AddProjectMemberForm.js +51 -0
- package/dist/production/src/components/forms/AddProjectMemberForm.js.map +1 -0
- package/dist/production/src/components/forms/ChangeMyProfileForm.cjs +50 -0
- package/dist/production/src/components/forms/ChangeMyProfileForm.cjs.map +1 -0
- package/dist/production/src/components/forms/ChangeMyProfileForm.js +50 -0
- package/dist/production/src/components/forms/ChangeMyProfileForm.js.map +1 -0
- package/dist/production/src/components/forms/ChangePasswordForm.cjs +49 -0
- package/dist/production/src/components/forms/ChangePasswordForm.cjs.map +1 -0
- package/dist/production/src/components/forms/ChangePasswordForm.js +49 -0
- package/dist/production/src/components/forms/ChangePasswordForm.js.map +1 -0
- package/dist/production/src/components/forms/ChangeProfileForm.cjs +46 -0
- package/dist/production/src/components/forms/ChangeProfileForm.cjs.map +1 -0
- package/dist/production/src/components/forms/ChangeProfileForm.js +46 -0
- package/dist/production/src/components/forms/ChangeProfileForm.js.map +1 -0
- package/dist/production/src/components/forms/CreateGlobalApiKeyForm.cjs +45 -0
- package/dist/production/src/components/forms/CreateGlobalApiKeyForm.cjs.map +1 -0
- package/dist/production/src/components/forms/CreateGlobalApiKeyForm.js +45 -0
- package/dist/production/src/components/forms/CreateGlobalApiKeyForm.js.map +1 -0
- package/dist/production/src/components/forms/EmailOtpConfirmForm.cjs +43 -0
- package/dist/production/src/components/forms/EmailOtpConfirmForm.cjs.map +1 -0
- package/dist/production/src/components/forms/EmailOtpConfirmForm.js +43 -0
- package/dist/production/src/components/forms/EmailOtpConfirmForm.js.map +1 -0
- package/dist/production/src/components/forms/InviteForm.cjs +22 -2
- package/dist/production/src/components/forms/InviteForm.cjs.map +1 -1
- package/dist/production/src/components/forms/InviteForm.js +22 -2
- package/dist/production/src/components/forms/InviteForm.js.map +1 -1
- package/dist/production/src/components/forms/LoginForm.cjs +4 -2
- package/dist/production/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/production/src/components/forms/LoginForm.js +4 -2
- package/dist/production/src/components/forms/LoginForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInForm.cjs +4 -2
- package/dist/production/src/components/forms/PasswordlessSignInForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInForm.js +4 -2
- package/dist/production/src/components/forms/PasswordlessSignInForm.js.map +1 -1
- package/dist/production/src/components/forms/SetProjectSecretForm.cjs +45 -0
- package/dist/production/src/components/forms/SetProjectSecretForm.cjs.map +1 -0
- package/dist/production/src/components/forms/SetProjectSecretForm.js +45 -0
- package/dist/production/src/components/forms/SetProjectSecretForm.js.map +1 -0
- package/dist/production/src/components/forms/SignUpForm.cjs +58 -0
- package/dist/production/src/components/forms/SignUpForm.cjs.map +1 -0
- package/dist/production/src/components/forms/SignUpForm.js +58 -0
- package/dist/production/src/components/forms/SignUpForm.js.map +1 -0
- package/dist/production/src/components/forms/TenantForm.cjs +6 -2
- package/dist/production/src/components/forms/TenantForm.cjs.map +1 -1
- package/dist/production/src/components/forms/TenantForm.js +6 -2
- package/dist/production/src/components/forms/TenantForm.js.map +1 -1
- package/dist/production/src/components/triggers/DisableEmailOtpTrigger.cjs +24 -0
- package/dist/production/src/components/triggers/DisableEmailOtpTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/DisableEmailOtpTrigger.js +24 -0
- package/dist/production/src/components/triggers/DisableEmailOtpTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/DisableMyPasswordlessTrigger.cjs +24 -0
- package/dist/production/src/components/triggers/DisableMyPasswordlessTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/DisableMyPasswordlessTrigger.js +24 -0
- package/dist/production/src/components/triggers/DisableMyPasswordlessTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/DisableOtpTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/DisableOtpTrigger.js.map +1 -1
- package/dist/production/src/components/triggers/DisablePersonTrigger.cjs +13 -0
- package/dist/production/src/components/triggers/DisablePersonTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/DisablePersonTrigger.js +13 -0
- package/dist/production/src/components/triggers/DisablePersonTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/EnableMyPasswordlessTrigger.cjs +24 -0
- package/dist/production/src/components/triggers/EnableMyPasswordlessTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/EnableMyPasswordlessTrigger.js +24 -0
- package/dist/production/src/components/triggers/EnableMyPasswordlessTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/EnablePersonTrigger.cjs +13 -0
- package/dist/production/src/components/triggers/EnablePersonTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/EnablePersonTrigger.js +13 -0
- package/dist/production/src/components/triggers/EnablePersonTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/ForceSignOutPersonTrigger.cjs +13 -0
- package/dist/production/src/components/triggers/ForceSignOutPersonTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/ForceSignOutPersonTrigger.js +13 -0
- package/dist/production/src/components/triggers/ForceSignOutPersonTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/InitEmailOtpTrigger.cjs +12 -0
- package/dist/production/src/components/triggers/InitEmailOtpTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/InitEmailOtpTrigger.js +12 -0
- package/dist/production/src/components/triggers/InitEmailOtpTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/RegenerateBackupCodesTrigger.cjs +18 -0
- package/dist/production/src/components/triggers/RegenerateBackupCodesTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/RegenerateBackupCodesTrigger.js +18 -0
- package/dist/production/src/components/triggers/RegenerateBackupCodesTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/RemoveProjectMemberTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/RemoveProjectMemberTrigger.js.map +1 -1
- package/dist/production/src/components/triggers/ResetPersonMfaTrigger.cjs +13 -0
- package/dist/production/src/components/triggers/ResetPersonMfaTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/ResetPersonMfaTrigger.js +13 -0
- package/dist/production/src/components/triggers/ResetPersonMfaTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/RevokeSessionTrigger.cjs +13 -0
- package/dist/production/src/components/triggers/RevokeSessionTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/RevokeSessionTrigger.js +13 -0
- package/dist/production/src/components/triggers/RevokeSessionTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/TenantActionTrigger.cjs +6 -2
- package/dist/production/src/components/triggers/TenantActionTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/TenantActionTrigger.js +6 -2
- package/dist/production/src/components/triggers/TenantActionTrigger.js.map +1 -1
- package/dist/production/src/hooks/mutations/auth/useSignUpMutation.cjs +30 -0
- package/dist/production/src/hooks/mutations/auth/useSignUpMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/auth/useSignUpMutation.js +13 -0
- package/dist/production/src/hooks/mutations/auth/useSignUpMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.cjs +30 -0
- package/dist/production/src/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.js +13 -0
- package/dist/production/src/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/emailOtp/useDisableEmailOtpMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/emailOtp/useDisableEmailOtpMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/emailOtp/useDisableEmailOtpMutation.js +12 -0
- package/dist/production/src/hooks/mutations/emailOtp/useDisableEmailOtpMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/emailOtp/useInitEmailOtpMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/emailOtp/useInitEmailOtpMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/emailOtp/useInitEmailOtpMutation.js +12 -0
- package/dist/production/src/hooks/mutations/emailOtp/useInitEmailOtpMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.cjs +30 -0
- package/dist/production/src/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.js +13 -0
- package/dist/production/src/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.cjs +30 -0
- package/dist/production/src/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.js +13 -0
- package/dist/production/src/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.js +12 -0
- package/dist/production/src/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/invite/useUnmanagedInviteMutation.cjs +30 -0
- package/dist/production/src/hooks/mutations/invite/useUnmanagedInviteMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/invite/useUnmanagedInviteMutation.js +13 -0
- package/dist/production/src/hooks/mutations/invite/useUnmanagedInviteMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/otp/useRegenerateBackupCodesMutation.cjs +30 -0
- package/dist/production/src/hooks/mutations/otp/useRegenerateBackupCodesMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/otp/useRegenerateBackupCodesMutation.js +13 -0
- package/dist/production/src/hooks/mutations/otp/useRegenerateBackupCodesMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/person/useChangePasswordMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/person/useChangePasswordMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/person/useChangePasswordMutation.js +12 -0
- package/dist/production/src/hooks/mutations/person/useChangePasswordMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/person/useDisablePersonMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/person/useDisablePersonMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/person/useDisablePersonMutation.js +12 -0
- package/dist/production/src/hooks/mutations/person/useDisablePersonMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/person/useEnablePersonMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/person/useEnablePersonMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/person/useEnablePersonMutation.js +12 -0
- package/dist/production/src/hooks/mutations/person/useEnablePersonMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/person/useForceSignOutPersonMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/person/useForceSignOutPersonMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/person/useForceSignOutPersonMutation.js +12 -0
- package/dist/production/src/hooks/mutations/person/useForceSignOutPersonMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/person/useResetPersonMfaMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/person/useResetPersonMfaMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/person/useResetPersonMfaMutation.js +12 -0
- package/dist/production/src/hooks/mutations/person/useResetPersonMfaMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/project/useSetProjectSecretMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/project/useSetProjectSecretMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/project/useSetProjectSecretMutation.js +12 -0
- package/dist/production/src/hooks/mutations/project/useSetProjectSecretMutation.js.map +1 -0
- package/dist/production/src/hooks/mutations/session/useRevokeSessionMutation.cjs +29 -0
- package/dist/production/src/hooks/mutations/session/useRevokeSessionMutation.cjs.map +1 -0
- package/dist/production/src/hooks/mutations/session/useRevokeSessionMutation.js +12 -0
- package/dist/production/src/hooks/mutations/session/useRevokeSessionMutation.js.map +1 -0
- package/dist/production/src/hooks/queries/useAuthLogQuery.cjs +39 -0
- package/dist/production/src/hooks/queries/useAuthLogQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useAuthLogQuery.js +22 -0
- package/dist/production/src/hooks/queries/useAuthLogQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/useAuthPoliciesQuery.cjs +32 -0
- package/dist/production/src/hooks/queries/useAuthPoliciesQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useAuthPoliciesQuery.js +15 -0
- package/dist/production/src/hooks/queries/useAuthPoliciesQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/useConfigurationQuery.cjs +33 -0
- package/dist/production/src/hooks/queries/useConfigurationQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useConfigurationQuery.js +16 -0
- package/dist/production/src/hooks/queries/useConfigurationQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/useGlobalApiKeysQuery.cjs +32 -0
- package/dist/production/src/hooks/queries/useGlobalApiKeysQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useGlobalApiKeysQuery.js +15 -0
- package/dist/production/src/hooks/queries/useGlobalApiKeysQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/useIdentityProvidersQuery.cjs +32 -0
- package/dist/production/src/hooks/queries/useIdentityProvidersQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useIdentityProvidersQuery.js +15 -0
- package/dist/production/src/hooks/queries/useIdentityProvidersQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/useMailTemplatesQuery.cjs +32 -0
- package/dist/production/src/hooks/queries/useMailTemplatesQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useMailTemplatesQuery.js +15 -0
- package/dist/production/src/hooks/queries/useMailTemplatesQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/useMeQuery.cjs +4 -2
- package/dist/production/src/hooks/queries/useMeQuery.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useMeQuery.js +4 -2
- package/dist/production/src/hooks/queries/useMeQuery.js.map +1 -1
- package/dist/production/src/hooks/queries/useMyIdentityProvidersQuery.cjs +38 -0
- package/dist/production/src/hooks/queries/useMyIdentityProvidersQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useMyIdentityProvidersQuery.js +21 -0
- package/dist/production/src/hooks/queries/useMyIdentityProvidersQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/useMySessionsQuery.cjs +34 -0
- package/dist/production/src/hooks/queries/useMySessionsQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useMySessionsQuery.js +17 -0
- package/dist/production/src/hooks/queries/useMySessionsQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/usePersonQuery.cjs +40 -0
- package/dist/production/src/hooks/queries/usePersonQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/usePersonQuery.js +23 -0
- package/dist/production/src/hooks/queries/usePersonQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/usePersonSessionsQuery.cjs +39 -0
- package/dist/production/src/hooks/queries/usePersonSessionsQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/usePersonSessionsQuery.js +22 -0
- package/dist/production/src/hooks/queries/usePersonSessionsQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/usePersonsQuery.cjs +45 -0
- package/dist/production/src/hooks/queries/usePersonsQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/usePersonsQuery.js +28 -0
- package/dist/production/src/hooks/queries/usePersonsQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/useProjectApiKeysQuery.cjs +49 -0
- package/dist/production/src/hooks/queries/useProjectApiKeysQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useProjectApiKeysQuery.js +32 -0
- package/dist/production/src/hooks/queries/useProjectApiKeysQuery.js.map +1 -0
- package/dist/production/src/hooks/queries/useProjectMembersQuery.cjs +1 -1
- package/dist/production/src/hooks/queries/useProjectMembersQuery.cjs.map +1 -1
- package/dist/production/src/hooks/queries/useProjectMembersQuery.js +1 -1
- package/dist/production/src/hooks/queries/useProjectMembersQuery.js.map +1 -1
- package/dist/production/src/hooks/queries/useProjectSecretsQuery.cjs +45 -0
- package/dist/production/src/hooks/queries/useProjectSecretsQuery.cjs.map +1 -0
- package/dist/production/src/hooks/queries/useProjectSecretsQuery.js +28 -0
- package/dist/production/src/hooks/queries/useProjectSecretsQuery.js.map +1 -0
- package/dist/production/src/hooks/useFetchIdentity.cjs +17 -3
- package/dist/production/src/hooks/useFetchIdentity.cjs.map +1 -1
- package/dist/production/src/hooks/useFetchIdentity.js +17 -3
- package/dist/production/src/hooks/useFetchIdentity.js.map +1 -1
- package/dist/production/src/types/forbidden.cjs +16 -0
- package/dist/production/src/types/forbidden.cjs.map +1 -0
- package/dist/production/src/types/forbidden.js +16 -0
- package/dist/production/src/types/forbidden.js.map +1 -0
- package/dist/types/components/IdentityState.d.ts.map +1 -1
- package/dist/types/components/forms/AddProjectMemberForm.d.ts +20 -0
- package/dist/types/components/forms/AddProjectMemberForm.d.ts.map +1 -0
- package/dist/types/components/forms/ChangeMyPasswordForm.d.ts.map +1 -1
- package/dist/types/components/forms/ChangeMyProfileForm.d.ts +20 -0
- package/dist/types/components/forms/ChangeMyProfileForm.d.ts.map +1 -0
- package/dist/types/components/forms/ChangePasswordForm.d.ts +19 -0
- package/dist/types/components/forms/ChangePasswordForm.d.ts.map +1 -0
- package/dist/types/components/forms/ChangeProfileForm.d.ts +21 -0
- package/dist/types/components/forms/ChangeProfileForm.d.ts.map +1 -0
- package/dist/types/components/forms/ConfirmEmailChangeForm.d.ts.map +1 -1
- package/dist/types/components/forms/CreateApiKeyForm.d.ts.map +1 -1
- package/dist/types/components/forms/CreateGlobalApiKeyForm.d.ts +22 -0
- package/dist/types/components/forms/CreateGlobalApiKeyForm.d.ts.map +1 -0
- package/dist/types/components/forms/CreateSessionTokenForm.d.ts.map +1 -1
- package/dist/types/components/forms/EmailOtpConfirmForm.d.ts +21 -0
- package/dist/types/components/forms/EmailOtpConfirmForm.d.ts.map +1 -0
- package/dist/types/components/forms/InviteForm.d.ts +12 -1
- package/dist/types/components/forms/InviteForm.d.ts.map +1 -1
- package/dist/types/components/forms/LoginForm.d.ts +2 -0
- package/dist/types/components/forms/LoginForm.d.ts.map +1 -1
- package/dist/types/components/forms/OtpConfirmForm.d.ts.map +1 -1
- package/dist/types/components/forms/OtpPrepareForm.d.ts.map +1 -1
- package/dist/types/components/forms/PasswordResetForm.d.ts.map +1 -1
- package/dist/types/components/forms/PasswordResetRequestForm.d.ts.map +1 -1
- package/dist/types/components/forms/PasswordlessSignInForm.d.ts +2 -0
- package/dist/types/components/forms/PasswordlessSignInForm.d.ts.map +1 -1
- package/dist/types/components/forms/PasswordlessSignInInitForm.d.ts.map +1 -1
- package/dist/types/components/forms/RequestEmailVerificationForm.d.ts.map +1 -1
- package/dist/types/components/forms/SetProjectSecretForm.d.ts +19 -0
- package/dist/types/components/forms/SetProjectSecretForm.d.ts.map +1 -0
- package/dist/types/components/forms/SignUpForm.d.ts +31 -0
- package/dist/types/components/forms/SignUpForm.d.ts.map +1 -0
- package/dist/types/components/forms/TenantForm.d.ts.map +1 -1
- package/dist/types/components/forms/UpdateProjectMemberForm.d.ts.map +1 -1
- package/dist/types/components/forms/VerifyEmailForm.d.ts.map +1 -1
- package/dist/types/components/forms/index.d.ts +8 -0
- package/dist/types/components/forms/index.d.ts.map +1 -1
- package/dist/types/components/idp/IDP.d.ts.map +1 -1
- package/dist/types/components/idp/IDPInitTrigger.d.ts.map +1 -1
- package/dist/types/components/idp/IDPState.d.ts.map +1 -1
- package/dist/types/components/triggers/DisableEmailOtpTrigger.d.ts +10 -0
- package/dist/types/components/triggers/DisableEmailOtpTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/DisableMyPasswordlessTrigger.d.ts +10 -0
- package/dist/types/components/triggers/DisableMyPasswordlessTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/DisableOtpTrigger.d.ts +3 -1
- package/dist/types/components/triggers/DisableOtpTrigger.d.ts.map +1 -1
- package/dist/types/components/triggers/DisablePersonTrigger.d.ts +11 -0
- package/dist/types/components/triggers/DisablePersonTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/EnableMyPasswordlessTrigger.d.ts +10 -0
- package/dist/types/components/triggers/EnableMyPasswordlessTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/EnablePersonTrigger.d.ts +11 -0
- package/dist/types/components/triggers/EnablePersonTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/ForceSignOutPersonTrigger.d.ts +11 -0
- package/dist/types/components/triggers/ForceSignOutPersonTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/InitEmailOtpTrigger.d.ts +10 -0
- package/dist/types/components/triggers/InitEmailOtpTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/LogoutTrigger.d.ts.map +1 -1
- package/dist/types/components/triggers/RegenerateBackupCodesTrigger.d.ts +14 -0
- package/dist/types/components/triggers/RegenerateBackupCodesTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/RemoveProjectMemberTrigger.d.ts +3 -1
- package/dist/types/components/triggers/RemoveProjectMemberTrigger.d.ts.map +1 -1
- package/dist/types/components/triggers/ResetPersonMfaTrigger.d.ts +11 -0
- package/dist/types/components/triggers/ResetPersonMfaTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/RevokeSessionTrigger.d.ts +11 -0
- package/dist/types/components/triggers/RevokeSessionTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/TenantActionTrigger.d.ts +7 -4
- package/dist/types/components/triggers/TenantActionTrigger.d.ts.map +1 -1
- package/dist/types/components/triggers/index.d.ts +11 -0
- package/dist/types/components/triggers/index.d.ts.map +1 -1
- package/dist/types/hooks/mutations/auth/index.d.ts +1 -0
- package/dist/types/hooks/mutations/auth/index.d.ts.map +1 -1
- package/dist/types/hooks/mutations/auth/useSignUpMutation.d.ts +95 -0
- package/dist/types/hooks/mutations/auth/useSignUpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/emailOtp/index.d.ts +4 -0
- package/dist/types/hooks/mutations/emailOtp/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.d.ts +31 -0
- package/dist/types/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/emailOtp/useDisableEmailOtpMutation.d.ts +15 -0
- package/dist/types/hooks/mutations/emailOtp/useDisableEmailOtpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/emailOtp/useInitEmailOtpMutation.d.ts +15 -0
- package/dist/types/hooks/mutations/emailOtp/useInitEmailOtpMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/identity/index.d.ts +3 -0
- package/dist/types/hooks/mutations/identity/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.d.ts +51 -0
- package/dist/types/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.d.ts +51 -0
- package/dist/types/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/idp/index.d.ts +1 -0
- package/dist/types/hooks/mutations/idp/index.d.ts.map +1 -1
- package/dist/types/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.d.ts +19 -0
- package/dist/types/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/index.d.ts +5 -0
- package/dist/types/hooks/mutations/index.d.ts.map +1 -1
- package/dist/types/hooks/mutations/invite/index.d.ts +1 -0
- package/dist/types/hooks/mutations/invite/index.d.ts.map +1 -1
- package/dist/types/hooks/mutations/invite/useUnmanagedInviteMutation.d.ts +104 -0
- package/dist/types/hooks/mutations/invite/useUnmanagedInviteMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/otp/index.d.ts +1 -0
- package/dist/types/hooks/mutations/otp/index.d.ts.map +1 -1
- package/dist/types/hooks/mutations/otp/useRegenerateBackupCodesMutation.d.ts +27 -0
- package/dist/types/hooks/mutations/otp/useRegenerateBackupCodesMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/person/index.d.ts +6 -0
- package/dist/types/hooks/mutations/person/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/person/useChangePasswordMutation.d.ts +25 -0
- package/dist/types/hooks/mutations/person/useChangePasswordMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/person/useDisablePersonMutation.d.ts +19 -0
- package/dist/types/hooks/mutations/person/useDisablePersonMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/person/useEnablePersonMutation.d.ts +19 -0
- package/dist/types/hooks/mutations/person/useEnablePersonMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/person/useForceSignOutPersonMutation.d.ts +21 -0
- package/dist/types/hooks/mutations/person/useForceSignOutPersonMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/person/useResetPersonMfaMutation.d.ts +19 -0
- package/dist/types/hooks/mutations/person/useResetPersonMfaMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/project/index.d.ts +2 -0
- package/dist/types/hooks/mutations/project/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/project/useSetProjectSecretMutation.d.ts +23 -0
- package/dist/types/hooks/mutations/project/useSetProjectSecretMutation.d.ts.map +1 -0
- package/dist/types/hooks/mutations/session/index.d.ts +2 -0
- package/dist/types/hooks/mutations/session/index.d.ts.map +1 -0
- package/dist/types/hooks/mutations/session/useRevokeSessionMutation.d.ts +19 -0
- package/dist/types/hooks/mutations/session/useRevokeSessionMutation.d.ts.map +1 -0
- package/dist/types/hooks/queries/index.d.ts +13 -0
- package/dist/types/hooks/queries/index.d.ts.map +1 -1
- package/dist/types/hooks/queries/useAuthLogQuery.d.ts +48 -0
- package/dist/types/hooks/queries/useAuthLogQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useAuthPoliciesQuery.d.ts +35 -0
- package/dist/types/hooks/queries/useAuthPoliciesQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useConfigurationQuery.d.ts +139 -0
- package/dist/types/hooks/queries/useConfigurationQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useGlobalApiKeysQuery.d.ts +30 -0
- package/dist/types/hooks/queries/useGlobalApiKeysQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useIdentityProvidersQuery.d.ts +41 -0
- package/dist/types/hooks/queries/useIdentityProvidersQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useMailTemplatesQuery.d.ts +30 -0
- package/dist/types/hooks/queries/useMailTemplatesQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useMeQuery.d.ts +42 -0
- package/dist/types/hooks/queries/useMeQuery.d.ts.map +1 -1
- package/dist/types/hooks/queries/useMyIdentityProvidersQuery.d.ts +22 -0
- package/dist/types/hooks/queries/useMyIdentityProvidersQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useMySessionsQuery.d.ts +28 -0
- package/dist/types/hooks/queries/useMySessionsQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/usePersonQuery.d.ts +99 -0
- package/dist/types/hooks/queries/usePersonQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/usePersonSessionsQuery.d.ts +31 -0
- package/dist/types/hooks/queries/usePersonSessionsQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/usePersonsQuery.d.ts +41 -0
- package/dist/types/hooks/queries/usePersonsQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useProjectApiKeysQuery.d.ts +55 -0
- package/dist/types/hooks/queries/useProjectApiKeysQuery.d.ts.map +1 -0
- package/dist/types/hooks/queries/useProjectMembersQuery.d.ts +4 -0
- package/dist/types/hooks/queries/useProjectMembersQuery.d.ts.map +1 -1
- package/dist/types/hooks/queries/useProjectMembershipsQuery.d.ts.map +1 -1
- package/dist/types/hooks/queries/useProjectRolesDefinitionQuery.d.ts +19 -19
- package/dist/types/hooks/queries/useProjectRolesDefinitionQuery.d.ts.map +1 -1
- package/dist/types/hooks/queries/useProjectSecretsQuery.d.ts +17 -0
- package/dist/types/hooks/queries/useProjectSecretsQuery.d.ts.map +1 -0
- package/dist/types/hooks/useFetchIdentity.d.ts.map +1 -1
- package/dist/types/hooks/useLogout.d.ts.map +1 -1
- package/dist/types/hooks/usePasswordlessOtpActivator.d.ts.map +1 -1
- package/dist/types/hooks/useTenantApi.d.ts +1 -1
- package/dist/types/hooks/useTenantApi.d.ts.map +1 -1
- package/dist/types/hooks/useTenantMutation.d.ts.map +1 -1
- package/dist/types/hooks/useTenantQueryLoader.d.ts.map +1 -1
- package/dist/types/internal/hooks/useHandleIDPResponse.d.ts.map +1 -1
- package/dist/types/internal/hooks/useInitIDPRedirect.d.ts.map +1 -1
- package/dist/types/internal/hooks/useLogoutInternal.d.ts.map +1 -1
- package/dist/types/internal/hooks/useRedirectToBacklink.d.ts +1 -1
- package/dist/types/internal/hooks/useRedirectToBacklink.d.ts.map +1 -1
- package/dist/types/internal/utils/hashing.d.ts.map +1 -1
- package/dist/types/internal/utils/randomInt.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/Identity.d.ts +42 -3
- package/dist/types/types/Identity.d.ts.map +1 -1
- package/dist/types/types/forbidden.d.ts +21 -0
- package/dist/types/types/forbidden.d.ts.map +1 -0
- package/dist/types/types/forms.d.ts +6 -1
- package/dist/types/types/forms.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/components/forms/AddProjectMemberForm.tsx +74 -0
- package/src/components/forms/ChangeMyProfileForm.tsx +73 -0
- package/src/components/forms/ChangePasswordForm.tsx +73 -0
- package/src/components/forms/ChangeProfileForm.tsx +70 -0
- package/src/components/forms/CreateGlobalApiKeyForm.tsx +67 -0
- package/src/components/forms/EmailOtpConfirmForm.tsx +64 -0
- package/src/components/forms/InviteForm.tsx +36 -2
- package/src/components/forms/LoginForm.tsx +6 -1
- package/src/components/forms/PasswordlessSignInForm.tsx +6 -1
- package/src/components/forms/SetProjectSecretForm.tsx +67 -0
- package/src/components/forms/SignUpForm.tsx +91 -0
- package/src/components/forms/TenantForm.tsx +6 -2
- package/src/components/forms/index.ts +8 -0
- package/src/components/triggers/DisableEmailOtpTrigger.tsx +27 -0
- package/src/components/triggers/DisableMyPasswordlessTrigger.tsx +27 -0
- package/src/components/triggers/DisableOtpTrigger.tsx +3 -2
- package/src/components/triggers/DisablePersonTrigger.tsx +18 -0
- package/src/components/triggers/EnableMyPasswordlessTrigger.tsx +27 -0
- package/src/components/triggers/EnablePersonTrigger.tsx +18 -0
- package/src/components/triggers/ForceSignOutPersonTrigger.tsx +18 -0
- package/src/components/triggers/InitEmailOtpTrigger.tsx +17 -0
- package/src/components/triggers/RegenerateBackupCodesTrigger.tsx +22 -0
- package/src/components/triggers/RemoveProjectMemberTrigger.tsx +3 -2
- package/src/components/triggers/ResetPersonMfaTrigger.tsx +18 -0
- package/src/components/triggers/RevokeSessionTrigger.tsx +18 -0
- package/src/components/triggers/TenantActionTrigger.tsx +11 -3
- package/src/components/triggers/index.ts +11 -0
- package/src/hooks/mutations/auth/index.ts +1 -0
- package/src/hooks/mutations/auth/useSignUpMutation.ts +28 -0
- package/src/hooks/mutations/emailOtp/index.ts +3 -0
- package/src/hooks/mutations/emailOtp/useConfirmEmailOtpMutation.ts +19 -0
- package/src/hooks/mutations/emailOtp/useDisableEmailOtpMutation.ts +13 -0
- package/src/hooks/mutations/emailOtp/useInitEmailOtpMutation.ts +13 -0
- package/src/hooks/mutations/identity/index.ts +2 -0
- package/src/hooks/mutations/identity/useAddGlobalIdentityRolesMutation.ts +19 -0
- package/src/hooks/mutations/identity/useRemoveGlobalIdentityRolesMutation.ts +19 -0
- package/src/hooks/mutations/idp/index.ts +1 -0
- package/src/hooks/mutations/idp/useDisconnectMyIdentityProviderMutation.tsx +13 -0
- package/src/hooks/mutations/index.ts +5 -0
- package/src/hooks/mutations/invite/index.ts +1 -0
- package/src/hooks/mutations/invite/useUnmanagedInviteMutation.tsx +25 -0
- package/src/hooks/mutations/otp/index.ts +1 -0
- package/src/hooks/mutations/otp/useRegenerateBackupCodesMutation.ts +19 -0
- package/src/hooks/mutations/person/index.ts +5 -0
- package/src/hooks/mutations/person/useChangePasswordMutation.ts +14 -0
- package/src/hooks/mutations/person/useDisablePersonMutation.ts +13 -0
- package/src/hooks/mutations/person/useEnablePersonMutation.ts +13 -0
- package/src/hooks/mutations/person/useForceSignOutPersonMutation.ts +13 -0
- package/src/hooks/mutations/person/useResetPersonMfaMutation.ts +13 -0
- package/src/hooks/mutations/project/index.ts +1 -0
- package/src/hooks/mutations/project/useSetProjectSecretMutation.ts +13 -0
- package/src/hooks/mutations/session/index.ts +1 -0
- package/src/hooks/mutations/session/useRevokeSessionMutation.ts +13 -0
- package/src/hooks/queries/index.ts +13 -0
- package/src/hooks/queries/useAuthLogQuery.ts +28 -0
- package/src/hooks/queries/useAuthPoliciesQuery.ts +26 -0
- package/src/hooks/queries/useConfigurationQuery.ts +42 -0
- package/src/hooks/queries/useGlobalApiKeysQuery.ts +19 -0
- package/src/hooks/queries/useIdentityProvidersQuery.ts +31 -0
- package/src/hooks/queries/useMailTemplatesQuery.ts +25 -0
- package/src/hooks/queries/useMeQuery.ts +6 -2
- package/src/hooks/queries/useMyIdentityProvidersQuery.ts +25 -0
- package/src/hooks/queries/useMySessionsQuery.ts +19 -0
- package/src/hooks/queries/usePersonQuery.ts +35 -0
- package/src/hooks/queries/usePersonSessionsQuery.ts +27 -0
- package/src/hooks/queries/usePersonsQuery.ts +37 -0
- package/src/hooks/queries/useProjectApiKeysQuery.ts +43 -0
- package/src/hooks/queries/useProjectMembersQuery.ts +1 -1
- package/src/hooks/queries/useProjectSecretsQuery.ts +33 -0
- package/src/hooks/useFetchIdentity.ts +18 -3
- package/src/tsconfig.json +1 -0
- package/src/types/Identity.ts +44 -3
- package/src/types/forbidden.ts +31 -0
- package/src/types/forms.ts +6 -1
- package/src/types/index.ts +1 -0
- package/tests/TenantForm.test.tsx +54 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const TenantForm = require("./TenantForm.cjs");
|
|
5
|
+
const contexts = require("../../contexts.cjs");
|
|
6
|
+
const useSetProjectSecretMutation = require("../../hooks/mutations/project/useSetProjectSecretMutation.cjs");
|
|
7
|
+
const useSetProjectSecretForm = contexts.useForm;
|
|
8
|
+
const SetProjectSecretForm = ({ children, onSuccess, projectSlug }) => {
|
|
9
|
+
const setProjectSecret = useSetProjectSecretMutation.useSetProjectSecretMutation();
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
errorMapping: errorToField,
|
|
15
|
+
initialValues: {
|
|
16
|
+
key: "",
|
|
17
|
+
value: ""
|
|
18
|
+
},
|
|
19
|
+
validate: ({ values }) => {
|
|
20
|
+
const errors = [];
|
|
21
|
+
if (!values.key) {
|
|
22
|
+
errors.push({ code: "FIELD_REQUIRED", field: "key" });
|
|
23
|
+
}
|
|
24
|
+
if (!values.value) {
|
|
25
|
+
errors.push({ code: "FIELD_REQUIRED", field: "value" });
|
|
26
|
+
}
|
|
27
|
+
return errors;
|
|
28
|
+
},
|
|
29
|
+
execute: async ({ values }) => {
|
|
30
|
+
return await setProjectSecret({
|
|
31
|
+
projectSlug,
|
|
32
|
+
key: values.key,
|
|
33
|
+
value: values.value
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
children
|
|
37
|
+
},
|
|
38
|
+
void 0,
|
|
39
|
+
false,
|
|
40
|
+
{
|
|
41
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/SetProjectSecretForm.tsx",
|
|
42
|
+
lineNumber: 35,
|
|
43
|
+
columnNumber: 3
|
|
44
|
+
},
|
|
45
|
+
void 0
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
const errorToField = {
|
|
49
|
+
PROJECT_NOT_FOUND: void 0
|
|
50
|
+
};
|
|
51
|
+
exports.SetProjectSecretForm = SetProjectSecretForm;
|
|
52
|
+
exports.useSetProjectSecretForm = useSetProjectSecretForm;
|
|
53
|
+
//# sourceMappingURL=SetProjectSecretForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetProjectSecretForm.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/forms/SetProjectSecretForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { SetProjectSecretErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm } from '../../contexts.js'\nimport { useSetProjectSecretMutation } from '../../hooks/index.js'\n\nexport type SetProjectSecretFormValues = {\n\tkey: string\n\tvalue: string\n}\n\nexport type SetProjectSecretFormErrorCode =\n\t| SetProjectSecretErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'UNKNOWN_ERROR'\n\nexport type SetProjectSecretFormState = FormState\n\nexport type SetProjectSecretFormError = FormError<SetProjectSecretFormValues, SetProjectSecretFormErrorCode>\n\nexport type SetProjectSecretFormContextValue = FormContextValue<SetProjectSecretFormValues, SetProjectSecretFormErrorCode>\n\nexport interface SetProjectSecretFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tonSuccess?: () => void\n}\n\nexport const useSetProjectSecretForm = useForm as () => SetProjectSecretFormContextValue\n\nexport const SetProjectSecretForm = ({ children, onSuccess, projectSlug }: SetProjectSecretFormProps) => {\n\tconst setProjectSecret = useSetProjectSecretMutation()\n\treturn (\n\t\t<TenantForm<SetProjectSecretFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\tkey: '',\n\t\t\t\tvalue: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: SetProjectSecretFormError[] = []\n\t\t\t\tif (!values.key) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'key' })\n\t\t\t\t}\n\t\t\t\tif (!values.value) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'value' })\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 setProjectSecret({\n\t\t\t\t\tprojectSlug,\n\t\t\t\t\tkey: values.key,\n\t\t\t\t\tvalue: values.value,\n\t\t\t\t})\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<SetProjectSecretErrorCode, keyof SetProjectSecretFormValues | undefined> = {\n\tPROJECT_NOT_FOUND: undefined,\n}\n"],"names":["useForm","useSetProjectSecretMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA6BO,MAAM,0BAA0BA,SAAAA;AAEhC,MAAM,uBAAuB,CAAC,EAAE,UAAU,WAAW,kBAA6C;AACxG,QAAM,mBAAmBC,4BAAAA,4BAAA;AACzB,SACCC,8BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,KAAK;AAAA,QACL,OAAO;AAAA,MAAA;AAAA,MAER,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAsC,CAAA;AAC5C,YAAI,CAAC,OAAO,KAAK;AAChB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,OAAO;AAAA,QACrD;AACA,YAAI,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,iBAAiB;AAAA,UAC7B;AAAA,UACA,KAAK,OAAO;AAAA,UACZ,OAAO,OAAO;AAAA,QAAA,CACd;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IAzBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AA4BF;AAEA,MAAM,eAAgG;AAAA,EACrG,mBAAmB;AACpB;;;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { useSetProjectSecretMutation } from "../../hooks/mutations/project/useSetProjectSecretMutation.js";
|
|
5
|
+
const useSetProjectSecretForm = useForm;
|
|
6
|
+
const SetProjectSecretForm = ({ children, onSuccess, projectSlug }) => {
|
|
7
|
+
const setProjectSecret = useSetProjectSecretMutation();
|
|
8
|
+
return /* @__PURE__ */ jsxDEV(
|
|
9
|
+
TenantForm,
|
|
10
|
+
{
|
|
11
|
+
onSuccess,
|
|
12
|
+
errorMapping: errorToField,
|
|
13
|
+
initialValues: {
|
|
14
|
+
key: "",
|
|
15
|
+
value: ""
|
|
16
|
+
},
|
|
17
|
+
validate: ({ values }) => {
|
|
18
|
+
const errors = [];
|
|
19
|
+
if (!values.key) {
|
|
20
|
+
errors.push({ code: "FIELD_REQUIRED", field: "key" });
|
|
21
|
+
}
|
|
22
|
+
if (!values.value) {
|
|
23
|
+
errors.push({ code: "FIELD_REQUIRED", field: "value" });
|
|
24
|
+
}
|
|
25
|
+
return errors;
|
|
26
|
+
},
|
|
27
|
+
execute: async ({ values }) => {
|
|
28
|
+
return await setProjectSecret({
|
|
29
|
+
projectSlug,
|
|
30
|
+
key: values.key,
|
|
31
|
+
value: values.value
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
children
|
|
35
|
+
},
|
|
36
|
+
void 0,
|
|
37
|
+
false,
|
|
38
|
+
{
|
|
39
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/SetProjectSecretForm.tsx",
|
|
40
|
+
lineNumber: 35,
|
|
41
|
+
columnNumber: 3
|
|
42
|
+
},
|
|
43
|
+
void 0
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
const errorToField = {
|
|
47
|
+
PROJECT_NOT_FOUND: void 0
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
SetProjectSecretForm,
|
|
51
|
+
useSetProjectSecretForm
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=SetProjectSecretForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetProjectSecretForm.js","sources":["../../../../../../packages/react-client-tenant/src/components/forms/SetProjectSecretForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { SetProjectSecretErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm } from '../../contexts.js'\nimport { useSetProjectSecretMutation } from '../../hooks/index.js'\n\nexport type SetProjectSecretFormValues = {\n\tkey: string\n\tvalue: string\n}\n\nexport type SetProjectSecretFormErrorCode =\n\t| SetProjectSecretErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'UNKNOWN_ERROR'\n\nexport type SetProjectSecretFormState = FormState\n\nexport type SetProjectSecretFormError = FormError<SetProjectSecretFormValues, SetProjectSecretFormErrorCode>\n\nexport type SetProjectSecretFormContextValue = FormContextValue<SetProjectSecretFormValues, SetProjectSecretFormErrorCode>\n\nexport interface SetProjectSecretFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tonSuccess?: () => void\n}\n\nexport const useSetProjectSecretForm = useForm as () => SetProjectSecretFormContextValue\n\nexport const SetProjectSecretForm = ({ children, onSuccess, projectSlug }: SetProjectSecretFormProps) => {\n\tconst setProjectSecret = useSetProjectSecretMutation()\n\treturn (\n\t\t<TenantForm<SetProjectSecretFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\tkey: '',\n\t\t\t\tvalue: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: SetProjectSecretFormError[] = []\n\t\t\t\tif (!values.key) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'key' })\n\t\t\t\t}\n\t\t\t\tif (!values.value) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'value' })\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 setProjectSecret({\n\t\t\t\t\tprojectSlug,\n\t\t\t\t\tkey: values.key,\n\t\t\t\t\tvalue: values.value,\n\t\t\t\t})\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<SetProjectSecretErrorCode, keyof SetProjectSecretFormValues | undefined> = {\n\tPROJECT_NOT_FOUND: undefined,\n}\n"],"names":["this"],"mappings":";;;;AA6BO,MAAM,0BAA0B;AAEhC,MAAM,uBAAuB,CAAC,EAAE,UAAU,WAAW,kBAA6C;AACxG,QAAM,mBAAmB,4BAAA;AACzB,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,KAAK;AAAA,QACL,OAAO;AAAA,MAAA;AAAA,MAER,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAsC,CAAA;AAC5C,YAAI,CAAC,OAAO,KAAK;AAChB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,OAAO;AAAA,QACrD;AACA,YAAI,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,iBAAiB;AAAA,UAC7B;AAAA,UACA,KAAK,OAAO;AAAA,UACZ,OAAO,OAAO;AAAA,QAAA,CACd;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IAzBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA4BF;AAEA,MAAM,eAAgG;AAAA,EACrG,mBAAmB;AACpB;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
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 useSignUpMutation = require("../../hooks/mutations/auth/useSignUpMutation.cjs");
|
|
8
|
+
const useSignUpForm = contexts.useForm;
|
|
9
|
+
const SignUpForm = ({ children, onSuccess, roles, captchaToken }) => {
|
|
10
|
+
const signUp = useSignUpMutation.useSignUpMutation();
|
|
11
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
12
|
+
TenantForm.TenantForm,
|
|
13
|
+
{
|
|
14
|
+
onSuccess,
|
|
15
|
+
errorMapping: errorToField,
|
|
16
|
+
initialValues: React.useMemo(() => ({
|
|
17
|
+
email: "",
|
|
18
|
+
password: "",
|
|
19
|
+
passwordConfirmation: "",
|
|
20
|
+
name: ""
|
|
21
|
+
}), []),
|
|
22
|
+
validate: ({ values }) => {
|
|
23
|
+
const errors = [];
|
|
24
|
+
if (!values.email) {
|
|
25
|
+
errors.push({ code: "FIELD_REQUIRED", field: "email" });
|
|
26
|
+
} else if (!values.email.match(/^.+@.+$/)) {
|
|
27
|
+
errors.push({ code: "INVALID_VALUE", field: "email" });
|
|
28
|
+
}
|
|
29
|
+
if (!values.password) {
|
|
30
|
+
errors.push({ code: "FIELD_REQUIRED", field: "password" });
|
|
31
|
+
} else if (values.password !== values.passwordConfirmation) {
|
|
32
|
+
errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
|
|
33
|
+
}
|
|
34
|
+
return errors;
|
|
35
|
+
},
|
|
36
|
+
execute: React.useCallback(async ({ values }) => {
|
|
37
|
+
return await signUp({
|
|
38
|
+
email: values.email,
|
|
39
|
+
password: values.password,
|
|
40
|
+
name: values.name || void 0,
|
|
41
|
+
roles,
|
|
42
|
+
captchaToken
|
|
43
|
+
});
|
|
44
|
+
}, [signUp, roles, captchaToken]),
|
|
45
|
+
children
|
|
46
|
+
},
|
|
47
|
+
void 0,
|
|
48
|
+
false,
|
|
49
|
+
{
|
|
50
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/SignUpForm.tsx",
|
|
51
|
+
lineNumber: 46,
|
|
52
|
+
columnNumber: 3
|
|
53
|
+
},
|
|
54
|
+
void 0
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
const errorToField = {
|
|
58
|
+
EMAIL_ALREADY_EXISTS: "email",
|
|
59
|
+
INVALID_EMAIL_FORMAT: "email",
|
|
60
|
+
TOO_WEAK: "password",
|
|
61
|
+
INVALID_CAPTCHA: void 0,
|
|
62
|
+
RATE_LIMIT_EXCEEDED: void 0
|
|
63
|
+
};
|
|
64
|
+
exports.SignUpForm = SignUpForm;
|
|
65
|
+
exports.useSignUpForm = useSignUpForm;
|
|
66
|
+
//# sourceMappingURL=SignUpForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignUpForm.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/forms/SignUpForm.tsx"],"sourcesContent":["import { ReactElement, useCallback, useMemo } from 'react'\nimport { SignUpErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/forms.js'\nimport { useForm } from '../../contexts.js'\nimport { SignUpMutationResult, useSignUpMutation } from '../../hooks/index.js'\n\nexport type SignUpFormValues = {\n\temail: string\n\tpassword: string\n\tpasswordConfirmation: string\n\tname: string\n}\n\nexport type SignUpFormErrorCode =\n\t| SignUpErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type SignUpFormState = FormState\n\nexport type SignUpFormError = FormError<SignUpFormValues, SignUpFormErrorCode>\n\nexport type SignUpFormContextValue = FormContextValue<SignUpFormValues, SignUpFormErrorCode>\n\nexport interface SignUpFormProps {\n\tchildren: ReactElement\n\t/** Tenant roles for the new identity. Only a caller allowed to grant them may pass this. */\n\troles?: readonly string[]\n\tcaptchaToken?: string\n\tonSuccess?: (args: { result: SignUpMutationResult }) => void\n}\n\nexport const useSignUpForm = useForm as () => SignUpFormContextValue\n\n/**\n * Open registration. Note that `signUp` only creates the account — it does not\n * sign anyone in, so a host app usually follows a success with `LoginForm` or,\n * when e-mail verification is required, with a \"check your inbox\" screen.\n */\nexport const SignUpForm = ({ children, onSuccess, roles, captchaToken }: SignUpFormProps) => {\n\tconst signUp = useSignUpMutation()\n\treturn (\n\t\t<TenantForm<SignUpFormContextValue, SignUpMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={useMemo(() => ({\n\t\t\t\temail: '',\n\t\t\t\tpassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t\tname: '',\n\t\t\t}), [])}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: SignUpFormError[] = []\n\t\t\t\tif (!values.email) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'email' })\n\t\t\t\t} else if (!values.email.match(/^.+@.+$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'email' })\n\t\t\t\t}\n\t\t\t\tif (!values.password) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'password' })\n\t\t\t\t} else if (values.password !== values.passwordConfirmation) {\n\t\t\t\t\t// Strength is the server's call (config.password) — only the typo check is ours.\n\t\t\t\t\terrors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={useCallback(async ({ values }) => {\n\t\t\t\treturn await signUp({\n\t\t\t\t\temail: values.email,\n\t\t\t\t\tpassword: values.password,\n\t\t\t\t\tname: values.name || undefined,\n\t\t\t\t\troles,\n\t\t\t\t\tcaptchaToken,\n\t\t\t\t})\n\t\t\t}, [signUp, roles, captchaToken])}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<SignUpErrorCode, keyof SignUpFormValues | undefined> = {\n\tEMAIL_ALREADY_EXISTS: 'email',\n\tINVALID_EMAIL_FORMAT: 'email',\n\tTOO_WEAK: 'password',\n\tINVALID_CAPTCHA: undefined,\n\tRATE_LIMIT_EXCEEDED: undefined,\n}\n"],"names":["useForm","useSignUpMutation","jsxDEV","TenantForm","useMemo","useCallback","this"],"mappings":";;;;;;;AAmCO,MAAM,gBAAgBA,SAAAA;AAOtB,MAAM,aAAa,CAAC,EAAE,UAAU,WAAW,OAAO,mBAAoC;AAC5F,QAAM,SAASC,kBAAAA,kBAAA;AACf,SACCC,8BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAeC,MAAAA,QAAQ,OAAO;AAAA,QAC7B,OAAO;AAAA,QACP,UAAU;AAAA,QACV,sBAAsB;AAAA,QACtB,MAAM;AAAA,MAAA,IACH,CAAA,CAAE;AAAA,MACN,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAA4B,CAAA;AAClC,YAAI,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD,WAAW,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AAC1C,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,SAAS;AAAA,QACtD;AACA,YAAI,CAAC,OAAO,UAAU;AACrB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAC1D,WAAW,OAAO,aAAa,OAAO,sBAAsB;AAE3D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAASC,MAAAA,YAAY,OAAO,EAAE,aAAa;AAC1C,eAAO,MAAM,OAAO;AAAA,UACnB,OAAO,OAAO;AAAA,UACd,UAAU,OAAO;AAAA,UACjB,MAAM,OAAO,QAAQ;AAAA,UACrB;AAAA,UACA;AAAA,QAAA,CACA;AAAA,MACF,GAAG,CAAC,QAAQ,OAAO,YAAY,CAAC;AAAA,MAE/B;AAAA,IAAA;AAAA,IAlCF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAqCF;AAEA,MAAM,eAA4E;AAAA,EACjF,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,qBAAqB;AACtB;;;"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
|
+
import { TenantForm } from "./TenantForm.js";
|
|
4
|
+
import { useForm } from "../../contexts.js";
|
|
5
|
+
import { useSignUpMutation } from "../../hooks/mutations/auth/useSignUpMutation.js";
|
|
6
|
+
const useSignUpForm = useForm;
|
|
7
|
+
const SignUpForm = ({ children, onSuccess, roles, captchaToken }) => {
|
|
8
|
+
const signUp = useSignUpMutation();
|
|
9
|
+
return /* @__PURE__ */ jsxDEV(
|
|
10
|
+
TenantForm,
|
|
11
|
+
{
|
|
12
|
+
onSuccess,
|
|
13
|
+
errorMapping: errorToField,
|
|
14
|
+
initialValues: useMemo(() => ({
|
|
15
|
+
email: "",
|
|
16
|
+
password: "",
|
|
17
|
+
passwordConfirmation: "",
|
|
18
|
+
name: ""
|
|
19
|
+
}), []),
|
|
20
|
+
validate: ({ values }) => {
|
|
21
|
+
const errors = [];
|
|
22
|
+
if (!values.email) {
|
|
23
|
+
errors.push({ code: "FIELD_REQUIRED", field: "email" });
|
|
24
|
+
} else if (!values.email.match(/^.+@.+$/)) {
|
|
25
|
+
errors.push({ code: "INVALID_VALUE", field: "email" });
|
|
26
|
+
}
|
|
27
|
+
if (!values.password) {
|
|
28
|
+
errors.push({ code: "FIELD_REQUIRED", field: "password" });
|
|
29
|
+
} else if (values.password !== values.passwordConfirmation) {
|
|
30
|
+
errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
|
|
31
|
+
}
|
|
32
|
+
return errors;
|
|
33
|
+
},
|
|
34
|
+
execute: useCallback(async ({ values }) => {
|
|
35
|
+
return await signUp({
|
|
36
|
+
email: values.email,
|
|
37
|
+
password: values.password,
|
|
38
|
+
name: values.name || void 0,
|
|
39
|
+
roles,
|
|
40
|
+
captchaToken
|
|
41
|
+
});
|
|
42
|
+
}, [signUp, roles, captchaToken]),
|
|
43
|
+
children
|
|
44
|
+
},
|
|
45
|
+
void 0,
|
|
46
|
+
false,
|
|
47
|
+
{
|
|
48
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/SignUpForm.tsx",
|
|
49
|
+
lineNumber: 46,
|
|
50
|
+
columnNumber: 3
|
|
51
|
+
},
|
|
52
|
+
void 0
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
const errorToField = {
|
|
56
|
+
EMAIL_ALREADY_EXISTS: "email",
|
|
57
|
+
INVALID_EMAIL_FORMAT: "email",
|
|
58
|
+
TOO_WEAK: "password",
|
|
59
|
+
INVALID_CAPTCHA: void 0,
|
|
60
|
+
RATE_LIMIT_EXCEEDED: void 0
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
SignUpForm,
|
|
64
|
+
useSignUpForm
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=SignUpForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignUpForm.js","sources":["../../../../../../packages/react-client-tenant/src/components/forms/SignUpForm.tsx"],"sourcesContent":["import { ReactElement, useCallback, useMemo } from 'react'\nimport { SignUpErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/forms.js'\nimport { useForm } from '../../contexts.js'\nimport { SignUpMutationResult, useSignUpMutation } from '../../hooks/index.js'\n\nexport type SignUpFormValues = {\n\temail: string\n\tpassword: string\n\tpasswordConfirmation: string\n\tname: string\n}\n\nexport type SignUpFormErrorCode =\n\t| SignUpErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type SignUpFormState = FormState\n\nexport type SignUpFormError = FormError<SignUpFormValues, SignUpFormErrorCode>\n\nexport type SignUpFormContextValue = FormContextValue<SignUpFormValues, SignUpFormErrorCode>\n\nexport interface SignUpFormProps {\n\tchildren: ReactElement\n\t/** Tenant roles for the new identity. Only a caller allowed to grant them may pass this. */\n\troles?: readonly string[]\n\tcaptchaToken?: string\n\tonSuccess?: (args: { result: SignUpMutationResult }) => void\n}\n\nexport const useSignUpForm = useForm as () => SignUpFormContextValue\n\n/**\n * Open registration. Note that `signUp` only creates the account — it does not\n * sign anyone in, so a host app usually follows a success with `LoginForm` or,\n * when e-mail verification is required, with a \"check your inbox\" screen.\n */\nexport const SignUpForm = ({ children, onSuccess, roles, captchaToken }: SignUpFormProps) => {\n\tconst signUp = useSignUpMutation()\n\treturn (\n\t\t<TenantForm<SignUpFormContextValue, SignUpMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={useMemo(() => ({\n\t\t\t\temail: '',\n\t\t\t\tpassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t\tname: '',\n\t\t\t}), [])}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: SignUpFormError[] = []\n\t\t\t\tif (!values.email) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'email' })\n\t\t\t\t} else if (!values.email.match(/^.+@.+$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'email' })\n\t\t\t\t}\n\t\t\t\tif (!values.password) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'password' })\n\t\t\t\t} else if (values.password !== values.passwordConfirmation) {\n\t\t\t\t\t// Strength is the server's call (config.password) — only the typo check is ours.\n\t\t\t\t\terrors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={useCallback(async ({ values }) => {\n\t\t\t\treturn await signUp({\n\t\t\t\t\temail: values.email,\n\t\t\t\t\tpassword: values.password,\n\t\t\t\t\tname: values.name || undefined,\n\t\t\t\t\troles,\n\t\t\t\t\tcaptchaToken,\n\t\t\t\t})\n\t\t\t}, [signUp, roles, captchaToken])}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<SignUpErrorCode, keyof SignUpFormValues | undefined> = {\n\tEMAIL_ALREADY_EXISTS: 'email',\n\tINVALID_EMAIL_FORMAT: 'email',\n\tTOO_WEAK: 'password',\n\tINVALID_CAPTCHA: undefined,\n\tRATE_LIMIT_EXCEEDED: undefined,\n}\n"],"names":["this"],"mappings":";;;;;AAmCO,MAAM,gBAAgB;AAOtB,MAAM,aAAa,CAAC,EAAE,UAAU,WAAW,OAAO,mBAAoC;AAC5F,QAAM,SAAS,kBAAA;AACf,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe,QAAQ,OAAO;AAAA,QAC7B,OAAO;AAAA,QACP,UAAU;AAAA,QACV,sBAAsB;AAAA,QACtB,MAAM;AAAA,MAAA,IACH,CAAA,CAAE;AAAA,MACN,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAA4B,CAAA;AAClC,YAAI,CAAC,OAAO,OAAO;AAClB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,SAAS;AAAA,QACvD,WAAW,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AAC1C,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,SAAS;AAAA,QACtD;AACA,YAAI,CAAC,OAAO,UAAU;AACrB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAC1D,WAAW,OAAO,aAAa,OAAO,sBAAsB;AAE3D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,YAAY,OAAO,EAAE,aAAa;AAC1C,eAAO,MAAM,OAAO;AAAA,UACnB,OAAO,OAAO;AAAA,UACd,UAAU,OAAO;AAAA,UACjB,MAAM,OAAO,QAAQ;AAAA,UACrB;AAAA,UACA;AAAA,QAAA,CACA;AAAA,MACF,GAAG,CAAC,QAAQ,OAAO,YAAY,CAAC;AAAA,MAE/B;AAAA,IAAA;AAAA,IAlCF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAqCF;AAEA,MAAM,eAA4E;AAAA,EACjF,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,qBAAqB;AACtB;"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const reactSlot = require("@radix-ui/react-slot");
|
|
6
|
+
const forbidden = require("../../types/forbidden.cjs");
|
|
6
7
|
const contexts = require("../../contexts.cjs");
|
|
7
8
|
const reactUtils = require("@contember/react-utils");
|
|
8
9
|
const SlotForm = reactSlot.Slot;
|
|
@@ -58,10 +59,13 @@ const TenantForm = ({
|
|
|
58
59
|
onSuccess?.({ result: "result" in response ? response.result : void 0 });
|
|
59
60
|
}
|
|
60
61
|
} catch (e) {
|
|
61
|
-
|
|
62
|
+
const code = forbidden.toFormErrorCode(e);
|
|
63
|
+
if (code !== "FORBIDDEN") {
|
|
64
|
+
console.error(e);
|
|
65
|
+
}
|
|
62
66
|
setState("error");
|
|
63
67
|
setErrors([{
|
|
64
|
-
code
|
|
68
|
+
code,
|
|
65
69
|
developerMessage: typeof e === "string" ? e : e && typeof e === "object" && "message" in e && typeof e.message === "string" ? e.message : void 0
|
|
66
70
|
}]);
|
|
67
71
|
}
|
|
@@ -83,7 +87,7 @@ const TenantForm = ({
|
|
|
83
87
|
},
|
|
84
88
|
children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(SlotForm, { onSubmit: submit, children }, void 0, false, {
|
|
85
89
|
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/TenantForm.tsx",
|
|
86
|
-
lineNumber:
|
|
90
|
+
lineNumber: 119,
|
|
87
91
|
columnNumber: 4
|
|
88
92
|
}, void 0)
|
|
89
93
|
},
|
|
@@ -91,7 +95,7 @@ const TenantForm = ({
|
|
|
91
95
|
false,
|
|
92
96
|
{
|
|
93
97
|
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/TenantForm.tsx",
|
|
94
|
-
lineNumber:
|
|
98
|
+
lineNumber: 110,
|
|
95
99
|
columnNumber: 3
|
|
96
100
|
},
|
|
97
101
|
void 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TenantForm.cjs","sources":["../../../../../../packages/react-client-tenant/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.js'\nimport { FormContext } from '../../contexts.js'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nconst SlotForm = Slot as ComponentType<React.FormHTMLAttributes<HTMLFormElement>>\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
|
|
1
|
+
{"version":3,"file":"TenantForm.cjs","sources":["../../../../../../packages/react-client-tenant/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.js'\nimport { toFormErrorCode } from '../../types/forbidden.js'\nimport { FormContext } from '../../contexts.js'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nconst SlotForm = Slot as ComponentType<React.FormHTMLAttributes<HTMLFormElement>>\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\tconst code = toFormErrorCode(e)\n\t\t\tif (code !== 'FORBIDDEN') {\n\t\t\t\tconsole.error(e)\n\t\t\t}\n\t\t\tsetState('error')\n\t\t\tsetErrors([{\n\t\t\t\tcode,\n\t\t\t\tdeveloperMessage: typeof e === 'string'\n\t\t\t\t\t? e\n\t\t\t\t\t: (e && typeof e === 'object' && 'message' in e && typeof e.message === 'string')\n\t\t\t\t\t? e.message\n\t\t\t\t\t: undefined,\n\t\t\t}])\n\t\t}\n\t})\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\n\t\t\tvalue={{\n\t\t\t\tvalues,\n\t\t\t\tsetValues,\n\t\t\t\tstate,\n\t\t\t\terrors,\n\t\t\t\tsetValue: setValue,\n\t\t\t} as unknown as T}\n\t\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","toFormErrorCode","useCallback","values","jsxDEV","FormContext","this"],"mappings":";;;;;;;;AAOA,MAAM,WAAWA,UAAAA;AAiBV,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,MAAAA,SAAsB,aAAa;AAE/D,QAAM,CAAC,QAAQ,SAAS,IAAIA,MAAAA,SAAsB,CAAA,CAAE;AACpD,QAAM,CAAC,OAAO,QAAQ,IAAIA,MAAAA,SAAqB,UAAU,YAAY,SAAS;AAE9EC,QAAAA,UAAU,MAAM;AACf,QAAI,SAAS;AACZ,eAAS,SAAS;AAAA,IACnB;AAAA,EACD,GAAG,CAAC,OAAO,CAAC;AAEZA,QAAAA,UAAU,MAAM;AACf,QAAI,UAAU,aAAa,CAAC,SAAS;AACpC,gBAAU,aAAa;AACvB,eAAS,SAAS;AAAA,IACnB;AAAA,EACD,GAAG,CAAC,eAAe,SAAS,KAAK,CAAC;AAElC,QAAM,WAAWC,WAAAA,+BAA+B,eAAe,MAAM,OAAU;AAC/E,QAAM,YAAYA,WAAAA,+BAA+B,gBAAgB,MAAM,OAAU;AACjF,QAAM,UAAUA,WAAAA,+BAA+B,SAAS;AAExD,QAAM,SAASA,0CAA+B,OAAO,UAA4B;AAChF,WAAO,eAAA;AACP,UAAMC,UAAS,WAAW,EAAE,QAAQ,MAAA,CAAO,KAAK,CAAA;AAChD,cAAUA,OAAM;AAEhB,QAAIA,QAAO,SAAS,GAAG;AACtB,eAAS,OAAO;AAChB;AAAA,IACD;AAEA,aAAS,YAAY;AAErB,QAAI;AACH,YAAM,WAAW,MAAM,QAAQ,EAAE,QAAQ,OAAO;AAEhD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,QAAQ,SAAS;AACvB,iBAAS,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,QAAA,CAC9E,CAAC;AAAA,MACH,OAAO;AACN,iBAAS,SAAS;AAClB,kBAAU,aAAa;AACvB,oBAAY,EAAE,QAAQ,YAAY,WAAW,SAAS,SAAS,QAAuB;AAAA,MACvF;AAAA,IACD,SAAS,GAAG;AACX,YAAM,OAAOC,UAAAA,gBAAgB,CAAC;AAC9B,UAAI,SAAS,aAAa;AACzB,gBAAQ,MAAM,CAAC;AAAA,MAChB;AACA,eAAS,OAAO;AAChB,gBAAU,CAAC;AAAA,QACV;AAAA,QACA,kBAAkB,OAAO,MAAM,WAC5B,IACC,KAAK,OAAO,MAAM,YAAY,aAAa,KAAK,OAAO,EAAE,YAAY,WACtE,EAAE,UACF;AAAA,MAAA,CACH,CAAC;AAAA,IACH;AAAA,EACD,CAAC;AAED,QAAM,WAAWF,WAAAA,+BAA+B,eAAe,MAAM,OAAU;AAC/ED,QAAAA,UAAU,MAAM;AACf,eAAW,EAAE,QAAQ,OAAO,OAAA,CAAQ;AAAA,EACrC,GAAG,CAAC,UAAU,OAAO,QAAQ,MAAM,CAAC;AAEpC,QAAM,WAAWI,MAAAA,YAAY,CAAC,OAAe,UAAkB,UAAU,CAAAC,aAAW,EAAE,GAAGA,SAAQ,CAAC,KAAK,GAAG,QAAQ,GAAG,CAAA,CAAE;AAEvH,SACCC,8BAAAA;AAAAA,IAACC,SAAAA,YAAY;AAAA,IAAZ;AAAA,MACA,OAAO;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGD,UAAAD,8BAAAA,OAAC,UAAA,EAAS,UAAU,QAClB,SAAA,GADF,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAE,MAEA;AAAA,IAAA;AAAA,IAXD;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAcF;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
2
|
import { useState, useEffect, useCallback } from "react";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { toFormErrorCode } from "../../types/forbidden.js";
|
|
4
5
|
import { FormContext } from "../../contexts.js";
|
|
5
6
|
import { useReferentiallyStableCallback } from "@contember/react-utils";
|
|
6
7
|
const SlotForm = Slot;
|
|
@@ -56,10 +57,13 @@ const TenantForm = ({
|
|
|
56
57
|
onSuccess?.({ result: "result" in response ? response.result : void 0 });
|
|
57
58
|
}
|
|
58
59
|
} catch (e) {
|
|
59
|
-
|
|
60
|
+
const code = toFormErrorCode(e);
|
|
61
|
+
if (code !== "FORBIDDEN") {
|
|
62
|
+
console.error(e);
|
|
63
|
+
}
|
|
60
64
|
setState("error");
|
|
61
65
|
setErrors([{
|
|
62
|
-
code
|
|
66
|
+
code,
|
|
63
67
|
developerMessage: typeof e === "string" ? e : e && typeof e === "object" && "message" in e && typeof e.message === "string" ? e.message : void 0
|
|
64
68
|
}]);
|
|
65
69
|
}
|
|
@@ -81,7 +85,7 @@ const TenantForm = ({
|
|
|
81
85
|
},
|
|
82
86
|
children: /* @__PURE__ */ jsxDEV(SlotForm, { onSubmit: submit, children }, void 0, false, {
|
|
83
87
|
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/TenantForm.tsx",
|
|
84
|
-
lineNumber:
|
|
88
|
+
lineNumber: 119,
|
|
85
89
|
columnNumber: 4
|
|
86
90
|
}, void 0)
|
|
87
91
|
},
|
|
@@ -89,7 +93,7 @@ const TenantForm = ({
|
|
|
89
93
|
false,
|
|
90
94
|
{
|
|
91
95
|
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/TenantForm.tsx",
|
|
92
|
-
lineNumber:
|
|
96
|
+
lineNumber: 110,
|
|
93
97
|
columnNumber: 3
|
|
94
98
|
},
|
|
95
99
|
void 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TenantForm.js","sources":["../../../../../../packages/react-client-tenant/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.js'\nimport { FormContext } from '../../contexts.js'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nconst SlotForm = Slot as ComponentType<React.FormHTMLAttributes<HTMLFormElement>>\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
|
|
1
|
+
{"version":3,"file":"TenantForm.js","sources":["../../../../../../packages/react-client-tenant/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.js'\nimport { toFormErrorCode } from '../../types/forbidden.js'\nimport { FormContext } from '../../contexts.js'\nimport { useReferentiallyStableCallback } from '@contember/react-utils'\n\nconst SlotForm = Slot as ComponentType<React.FormHTMLAttributes<HTMLFormElement>>\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\tconst code = toFormErrorCode(e)\n\t\t\tif (code !== 'FORBIDDEN') {\n\t\t\t\tconsole.error(e)\n\t\t\t}\n\t\t\tsetState('error')\n\t\t\tsetErrors([{\n\t\t\t\tcode,\n\t\t\t\tdeveloperMessage: typeof e === 'string'\n\t\t\t\t\t? e\n\t\t\t\t\t: (e && typeof e === 'object' && 'message' in e && typeof e.message === 'string')\n\t\t\t\t\t? e.message\n\t\t\t\t\t: undefined,\n\t\t\t}])\n\t\t}\n\t})\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\n\t\t\tvalue={{\n\t\t\t\tvalues,\n\t\t\t\tsetValues,\n\t\t\t\tstate,\n\t\t\t\terrors,\n\t\t\t\tsetValue: setValue,\n\t\t\t} as unknown as T}\n\t\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":";;;;;;AAOA,MAAM,WAAW;AAiBV,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,CAAA,CAAE;AACpD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAqB,UAAU,YAAY,SAAS;AAE9E,YAAU,MAAM;AACf,QAAI,SAAS;AACZ,eAAS,SAAS;AAAA,IACnB;AAAA,EACD,GAAG,CAAC,OAAO,CAAC;AAEZ,YAAU,MAAM;AACf,QAAI,UAAU,aAAa,CAAC,SAAS;AACpC,gBAAU,aAAa;AACvB,eAAS,SAAS;AAAA,IACnB;AAAA,EACD,GAAG,CAAC,eAAe,SAAS,KAAK,CAAC;AAElC,QAAM,WAAW,+BAA+B,eAAe,MAAM,OAAU;AAC/E,QAAM,YAAY,+BAA+B,gBAAgB,MAAM,OAAU;AACjF,QAAM,UAAU,+BAA+B,SAAS;AAExD,QAAM,SAAS,+BAA+B,OAAO,UAA4B;AAChF,WAAO,eAAA;AACP,UAAMA,UAAS,WAAW,EAAE,QAAQ,MAAA,CAAO,KAAK,CAAA;AAChD,cAAUA,OAAM;AAEhB,QAAIA,QAAO,SAAS,GAAG;AACtB,eAAS,OAAO;AAChB;AAAA,IACD;AAEA,aAAS,YAAY;AAErB,QAAI;AACH,YAAM,WAAW,MAAM,QAAQ,EAAE,QAAQ,OAAO;AAEhD,UAAI,CAAC,SAAS,IAAI;AACjB,cAAM,QAAQ,SAAS;AACvB,iBAAS,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,QAAA,CAC9E,CAAC;AAAA,MACH,OAAO;AACN,iBAAS,SAAS;AAClB,kBAAU,aAAa;AACvB,oBAAY,EAAE,QAAQ,YAAY,WAAW,SAAS,SAAS,QAAuB;AAAA,MACvF;AAAA,IACD,SAAS,GAAG;AACX,YAAM,OAAO,gBAAgB,CAAC;AAC9B,UAAI,SAAS,aAAa;AACzB,gBAAQ,MAAM,CAAC;AAAA,MAChB;AACA,eAAS,OAAO;AAChB,gBAAU,CAAC;AAAA,QACV;AAAA,QACA,kBAAkB,OAAO,MAAM,WAC5B,IACC,KAAK,OAAO,MAAM,YAAY,aAAa,KAAK,OAAO,EAAE,YAAY,WACtE,EAAE,UACF;AAAA,MAAA,CACH,CAAC;AAAA,IACH;AAAA,EACD,CAAC;AAED,QAAM,WAAW,+BAA+B,eAAe,MAAM,OAAU;AAC/E,YAAU,MAAM;AACf,eAAW,EAAE,QAAQ,OAAO,OAAA,CAAQ;AAAA,EACrC,GAAG,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,SACC;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACA,OAAO;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGD,UAAA,uBAAC,UAAA,EAAS,UAAU,QAClB,SAAA,GADF,QAAA,OAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA,GAAAC,MAEA;AAAA,IAAA;AAAA,IAXD;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AAcF;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 TenantActionTrigger = require("./TenantActionTrigger.cjs");
|
|
6
|
+
const contexts = require("../../contexts.cjs");
|
|
7
|
+
const useDisableEmailOtpMutation = require("../../hooks/mutations/emailOtp/useDisableEmailOtpMutation.cjs");
|
|
8
|
+
const DisableEmailOtpTrigger = ({ onSuccess, ...props }) => {
|
|
9
|
+
const disableEmailOtp = useDisableEmailOtpMutation.useDisableEmailOtpMutation();
|
|
10
|
+
const { refreshIdentity } = contexts.useIdentityMethods();
|
|
11
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
12
|
+
TenantActionTrigger.TenantActionTrigger,
|
|
13
|
+
{
|
|
14
|
+
execute: React.useCallback(() => disableEmailOtp({}), [disableEmailOtp]),
|
|
15
|
+
onSuccess: () => {
|
|
16
|
+
refreshIdentity();
|
|
17
|
+
onSuccess?.();
|
|
18
|
+
},
|
|
19
|
+
...props
|
|
20
|
+
},
|
|
21
|
+
void 0,
|
|
22
|
+
false,
|
|
23
|
+
{
|
|
24
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/triggers/DisableEmailOtpTrigger.tsx",
|
|
25
|
+
lineNumber: 18,
|
|
26
|
+
columnNumber: 3
|
|
27
|
+
},
|
|
28
|
+
void 0
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
exports.DisableEmailOtpTrigger = DisableEmailOtpTrigger;
|
|
32
|
+
//# sourceMappingURL=DisableEmailOtpTrigger.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisableEmailOtpTrigger.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/triggers/DisableEmailOtpTrigger.tsx"],"sourcesContent":["import { ReactElement, useCallback } from 'react'\nimport { DisableEmailOtpErrorCode } from '@contember/graphql-client-tenant'\nimport { useDisableEmailOtpMutation } from '../../hooks/index.js'\nimport { TenantActionErrorArgs, TenantActionTrigger } from './TenantActionTrigger.js'\nimport { useIdentityMethods } from '../../contexts.js'\n\nexport interface DisableEmailOtpTriggerProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n\tonError?: (args: TenantActionErrorArgs<DisableEmailOtpErrorCode>) => void\n}\n\nexport const DisableEmailOtpTrigger = ({ onSuccess, ...props }: DisableEmailOtpTriggerProps) => {\n\tconst disableEmailOtp = useDisableEmailOtpMutation()\n\tconst { refreshIdentity } = useIdentityMethods()\n\n\treturn (\n\t\t<TenantActionTrigger\n\t\t\texecute={useCallback(() => disableEmailOtp({}), [disableEmailOtp])}\n\t\t\tonSuccess={() => {\n\t\t\t\trefreshIdentity()\n\t\t\t\tonSuccess?.()\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n"],"names":["useDisableEmailOtpMutation","useIdentityMethods","jsxDEV","TenantActionTrigger","useCallback","this"],"mappings":";;;;;;;AAYO,MAAM,yBAAyB,CAAC,EAAE,WAAW,GAAG,YAAyC;AAC/F,QAAM,kBAAkBA,2BAAAA,2BAAA;AACxB,QAAM,EAAE,gBAAA,IAAoBC,4BAAA;AAE5B,SACCC,8BAAAA;AAAAA,IAACC,oBAAAA;AAAAA,IAAA;AAAA,MACA,SAASC,MAAAA,YAAY,MAAM,gBAAgB,CAAA,CAAE,GAAG,CAAC,eAAe,CAAC;AAAA,MACjE,WAAW,MAAM;AAChB,wBAAA;AACA,oBAAA;AAAA,MACD;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,IANL;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AASF;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { TenantActionTrigger } from "./TenantActionTrigger.js";
|
|
4
|
+
import { useIdentityMethods } from "../../contexts.js";
|
|
5
|
+
import { useDisableEmailOtpMutation } from "../../hooks/mutations/emailOtp/useDisableEmailOtpMutation.js";
|
|
6
|
+
const DisableEmailOtpTrigger = ({ onSuccess, ...props }) => {
|
|
7
|
+
const disableEmailOtp = useDisableEmailOtpMutation();
|
|
8
|
+
const { refreshIdentity } = useIdentityMethods();
|
|
9
|
+
return /* @__PURE__ */ jsxDEV(
|
|
10
|
+
TenantActionTrigger,
|
|
11
|
+
{
|
|
12
|
+
execute: useCallback(() => disableEmailOtp({}), [disableEmailOtp]),
|
|
13
|
+
onSuccess: () => {
|
|
14
|
+
refreshIdentity();
|
|
15
|
+
onSuccess?.();
|
|
16
|
+
},
|
|
17
|
+
...props
|
|
18
|
+
},
|
|
19
|
+
void 0,
|
|
20
|
+
false,
|
|
21
|
+
{
|
|
22
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/triggers/DisableEmailOtpTrigger.tsx",
|
|
23
|
+
lineNumber: 18,
|
|
24
|
+
columnNumber: 3
|
|
25
|
+
},
|
|
26
|
+
void 0
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
DisableEmailOtpTrigger
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=DisableEmailOtpTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisableEmailOtpTrigger.js","sources":["../../../../../../packages/react-client-tenant/src/components/triggers/DisableEmailOtpTrigger.tsx"],"sourcesContent":["import { ReactElement, useCallback } from 'react'\nimport { DisableEmailOtpErrorCode } from '@contember/graphql-client-tenant'\nimport { useDisableEmailOtpMutation } from '../../hooks/index.js'\nimport { TenantActionErrorArgs, TenantActionTrigger } from './TenantActionTrigger.js'\nimport { useIdentityMethods } from '../../contexts.js'\n\nexport interface DisableEmailOtpTriggerProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n\tonError?: (args: TenantActionErrorArgs<DisableEmailOtpErrorCode>) => void\n}\n\nexport const DisableEmailOtpTrigger = ({ onSuccess, ...props }: DisableEmailOtpTriggerProps) => {\n\tconst disableEmailOtp = useDisableEmailOtpMutation()\n\tconst { refreshIdentity } = useIdentityMethods()\n\n\treturn (\n\t\t<TenantActionTrigger\n\t\t\texecute={useCallback(() => disableEmailOtp({}), [disableEmailOtp])}\n\t\t\tonSuccess={() => {\n\t\t\t\trefreshIdentity()\n\t\t\t\tonSuccess?.()\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n"],"names":["this"],"mappings":";;;;;AAYO,MAAM,yBAAyB,CAAC,EAAE,WAAW,GAAG,YAAyC;AAC/F,QAAM,kBAAkB,2BAAA;AACxB,QAAM,EAAE,gBAAA,IAAoB,mBAAA;AAE5B,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,SAAS,YAAY,MAAM,gBAAgB,CAAA,CAAE,GAAG,CAAC,eAAe,CAAC;AAAA,MACjE,WAAW,MAAM;AAChB,wBAAA;AACA,oBAAA;AAAA,MACD;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,IANL;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AASF;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 TenantActionTrigger = require("./TenantActionTrigger.cjs");
|
|
6
|
+
const contexts = require("../../contexts.cjs");
|
|
7
|
+
const useDisableMyPasswordlessMutation = require("../../hooks/mutations/passwordless/useDisableMyPasswordlessMutation.cjs");
|
|
8
|
+
const DisableMyPasswordlessTrigger = ({ onSuccess, ...props }) => {
|
|
9
|
+
const disablePasswordless = useDisableMyPasswordlessMutation.useDisableMyPasswordlessMutation();
|
|
10
|
+
const { refreshIdentity } = contexts.useIdentityMethods();
|
|
11
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
12
|
+
TenantActionTrigger.TenantActionTrigger,
|
|
13
|
+
{
|
|
14
|
+
execute: React.useCallback(() => disablePasswordless({}), [disablePasswordless]),
|
|
15
|
+
onSuccess: () => {
|
|
16
|
+
refreshIdentity();
|
|
17
|
+
onSuccess?.();
|
|
18
|
+
},
|
|
19
|
+
...props
|
|
20
|
+
},
|
|
21
|
+
void 0,
|
|
22
|
+
false,
|
|
23
|
+
{
|
|
24
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/triggers/DisableMyPasswordlessTrigger.tsx",
|
|
25
|
+
lineNumber: 18,
|
|
26
|
+
columnNumber: 3
|
|
27
|
+
},
|
|
28
|
+
void 0
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
exports.DisableMyPasswordlessTrigger = DisableMyPasswordlessTrigger;
|
|
32
|
+
//# sourceMappingURL=DisableMyPasswordlessTrigger.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisableMyPasswordlessTrigger.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/triggers/DisableMyPasswordlessTrigger.tsx"],"sourcesContent":["import { ReactElement, useCallback } from 'react'\nimport { ToggleMyPasswordlessErrorCode } from '@contember/graphql-client-tenant'\nimport { useDisableMyPasswordlessMutation } from '../../hooks/index.js'\nimport { TenantActionErrorArgs, TenantActionTrigger } from './TenantActionTrigger.js'\nimport { useIdentityMethods } from '../../contexts.js'\n\nexport interface DisableMyPasswordlessTriggerProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n\tonError?: (args: TenantActionErrorArgs<ToggleMyPasswordlessErrorCode>) => void\n}\n\nexport const DisableMyPasswordlessTrigger = ({ onSuccess, ...props }: DisableMyPasswordlessTriggerProps) => {\n\tconst disablePasswordless = useDisableMyPasswordlessMutation()\n\tconst { refreshIdentity } = useIdentityMethods()\n\n\treturn (\n\t\t<TenantActionTrigger\n\t\t\texecute={useCallback(() => disablePasswordless({}), [disablePasswordless])}\n\t\t\tonSuccess={() => {\n\t\t\t\trefreshIdentity()\n\t\t\t\tonSuccess?.()\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n"],"names":["useDisableMyPasswordlessMutation","useIdentityMethods","jsxDEV","TenantActionTrigger","useCallback","this"],"mappings":";;;;;;;AAYO,MAAM,+BAA+B,CAAC,EAAE,WAAW,GAAG,YAA+C;AAC3G,QAAM,sBAAsBA,iCAAAA,iCAAA;AAC5B,QAAM,EAAE,gBAAA,IAAoBC,4BAAA;AAE5B,SACCC,8BAAAA;AAAAA,IAACC,oBAAAA;AAAAA,IAAA;AAAA,MACA,SAASC,MAAAA,YAAY,MAAM,oBAAoB,CAAA,CAAE,GAAG,CAAC,mBAAmB,CAAC;AAAA,MACzE,WAAW,MAAM;AAChB,wBAAA;AACA,oBAAA;AAAA,MACD;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,IANL;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AASF;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { TenantActionTrigger } from "./TenantActionTrigger.js";
|
|
4
|
+
import { useIdentityMethods } from "../../contexts.js";
|
|
5
|
+
import { useDisableMyPasswordlessMutation } from "../../hooks/mutations/passwordless/useDisableMyPasswordlessMutation.js";
|
|
6
|
+
const DisableMyPasswordlessTrigger = ({ onSuccess, ...props }) => {
|
|
7
|
+
const disablePasswordless = useDisableMyPasswordlessMutation();
|
|
8
|
+
const { refreshIdentity } = useIdentityMethods();
|
|
9
|
+
return /* @__PURE__ */ jsxDEV(
|
|
10
|
+
TenantActionTrigger,
|
|
11
|
+
{
|
|
12
|
+
execute: useCallback(() => disablePasswordless({}), [disablePasswordless]),
|
|
13
|
+
onSuccess: () => {
|
|
14
|
+
refreshIdentity();
|
|
15
|
+
onSuccess?.();
|
|
16
|
+
},
|
|
17
|
+
...props
|
|
18
|
+
},
|
|
19
|
+
void 0,
|
|
20
|
+
false,
|
|
21
|
+
{
|
|
22
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/triggers/DisableMyPasswordlessTrigger.tsx",
|
|
23
|
+
lineNumber: 18,
|
|
24
|
+
columnNumber: 3
|
|
25
|
+
},
|
|
26
|
+
void 0
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
DisableMyPasswordlessTrigger
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=DisableMyPasswordlessTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisableMyPasswordlessTrigger.js","sources":["../../../../../../packages/react-client-tenant/src/components/triggers/DisableMyPasswordlessTrigger.tsx"],"sourcesContent":["import { ReactElement, useCallback } from 'react'\nimport { ToggleMyPasswordlessErrorCode } from '@contember/graphql-client-tenant'\nimport { useDisableMyPasswordlessMutation } from '../../hooks/index.js'\nimport { TenantActionErrorArgs, TenantActionTrigger } from './TenantActionTrigger.js'\nimport { useIdentityMethods } from '../../contexts.js'\n\nexport interface DisableMyPasswordlessTriggerProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n\tonError?: (args: TenantActionErrorArgs<ToggleMyPasswordlessErrorCode>) => void\n}\n\nexport const DisableMyPasswordlessTrigger = ({ onSuccess, ...props }: DisableMyPasswordlessTriggerProps) => {\n\tconst disablePasswordless = useDisableMyPasswordlessMutation()\n\tconst { refreshIdentity } = useIdentityMethods()\n\n\treturn (\n\t\t<TenantActionTrigger\n\t\t\texecute={useCallback(() => disablePasswordless({}), [disablePasswordless])}\n\t\t\tonSuccess={() => {\n\t\t\t\trefreshIdentity()\n\t\t\t\tonSuccess?.()\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n"],"names":["this"],"mappings":";;;;;AAYO,MAAM,+BAA+B,CAAC,EAAE,WAAW,GAAG,YAA+C;AAC3G,QAAM,sBAAsB,iCAAA;AAC5B,QAAM,EAAE,gBAAA,IAAoB,mBAAA;AAE5B,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,SAAS,YAAY,MAAM,oBAAoB,CAAA,CAAE,GAAG,CAAC,mBAAmB,CAAC;AAAA,MACzE,WAAW,MAAM;AAChB,wBAAA;AACA,oBAAA;AAAA,MACD;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,IANL;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AASF;"}
|
|
@@ -22,7 +22,7 @@ const DisableOtpTrigger = ({ onSuccess, ...props }) => {
|
|
|
22
22
|
false,
|
|
23
23
|
{
|
|
24
24
|
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/triggers/DisableOtpTrigger.tsx",
|
|
25
|
-
lineNumber:
|
|
25
|
+
lineNumber: 18,
|
|
26
26
|
columnNumber: 3
|
|
27
27
|
},
|
|
28
28
|
void 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisableOtpTrigger.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/triggers/DisableOtpTrigger.tsx"],"sourcesContent":["import { ReactElement, useCallback } from 'react'\nimport { useDisableOtpMutation } from '../../hooks/index.js'\nimport { TenantActionTrigger } from './TenantActionTrigger.js'\nimport { useIdentityMethods } from '../../contexts.js'\n\nexport interface DisableOtpTriggerProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n\tonError?: (
|
|
1
|
+
{"version":3,"file":"DisableOtpTrigger.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/triggers/DisableOtpTrigger.tsx"],"sourcesContent":["import { ReactElement, useCallback } from 'react'\nimport { DisableOtpErrorCode } from '@contember/graphql-client-tenant'\nimport { useDisableOtpMutation } from '../../hooks/index.js'\nimport { TenantActionErrorArgs, TenantActionTrigger } from './TenantActionTrigger.js'\nimport { useIdentityMethods } from '../../contexts.js'\n\nexport interface DisableOtpTriggerProps {\n\tchildren: ReactElement\n\tonSuccess?: () => void\n\tonError?: (args: TenantActionErrorArgs<DisableOtpErrorCode>) => void\n}\n\nexport const DisableOtpTrigger = ({ onSuccess, ...props }: DisableOtpTriggerProps) => {\n\tconst disableOtp = useDisableOtpMutation()\n\tconst { refreshIdentity } = useIdentityMethods()\n\n\treturn (\n\t\t<TenantActionTrigger\n\t\t\texecute={useCallback(() => disableOtp({}), [disableOtp])}\n\t\t\tonSuccess={() => {\n\t\t\t\trefreshIdentity()\n\t\t\t\tonSuccess?.()\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t)\n}\n"],"names":["useDisableOtpMutation","useIdentityMethods","jsxDEV","TenantActionTrigger","useCallback","this"],"mappings":";;;;;;;AAYO,MAAM,oBAAoB,CAAC,EAAE,WAAW,GAAG,YAAoC;AACrF,QAAM,aAAaA,sBAAAA,sBAAA;AACnB,QAAM,EAAE,gBAAA,IAAoBC,4BAAA;AAE5B,SACCC,8BAAAA;AAAAA,IAACC,oBAAAA;AAAAA,IAAA;AAAA,MACA,SAASC,MAAAA,YAAY,MAAM,WAAW,CAAA,CAAE,GAAG,CAAC,UAAU,CAAC;AAAA,MACvD,WAAW,MAAM;AAChB,wBAAA;AACA,oBAAA;AAAA,MACD;AAAA,MACC,GAAG;AAAA,IAAA;AAAA,IANL;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AASF;;"}
|
|
@@ -20,7 +20,7 @@ const DisableOtpTrigger = ({ onSuccess, ...props }) => {
|
|
|
20
20
|
false,
|
|
21
21
|
{
|
|
22
22
|
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/triggers/DisableOtpTrigger.tsx",
|
|
23
|
-
lineNumber:
|
|
23
|
+
lineNumber: 18,
|
|
24
24
|
columnNumber: 3
|
|
25
25
|
},
|
|
26
26
|
void 0
|