@contember/react-client-tenant 2.2.0-alpha.3 → 2.2.0-alpha.6
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 +7 -3
- package/dist/development/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/development/src/components/forms/LoginForm.js +7 -3
- package/dist/development/src/components/forms/LoginForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInForm.cjs +7 -4
- package/dist/development/src/components/forms/PasswordlessSignInForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInForm.js +7 -4
- package/dist/development/src/components/forms/PasswordlessSignInForm.js.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.cjs +2 -1
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.cjs.map +1 -1
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.js +2 -1
- package/dist/development/src/components/forms/PasswordlessSignInInitForm.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 +6 -2
- package/dist/production/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/production/src/components/forms/LoginForm.js +6 -2
- package/dist/production/src/components/forms/LoginForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInForm.cjs +6 -3
- package/dist/production/src/components/forms/PasswordlessSignInForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInForm.js +6 -3
- package/dist/production/src/components/forms/PasswordlessSignInForm.js.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.cjs +2 -1
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.cjs.map +1 -1
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.js +2 -1
- package/dist/production/src/components/forms/PasswordlessSignInInitForm.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 +43 -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 +8 -1
- package/src/components/forms/PasswordlessSignInForm.tsx +7 -1
- package/src/components/forms/PasswordlessSignInInitForm.tsx +1 -0
- 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,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const TenantForm = require("./TenantForm.cjs");
|
|
5
|
+
const contexts = require("../../contexts.cjs");
|
|
6
|
+
const useAddProjectMemberMutation = require("../../hooks/mutations/memberships/useAddProjectMemberMutation.cjs");
|
|
7
|
+
const useAddProjectMemberForm = contexts.useForm;
|
|
8
|
+
const AddProjectMemberForm = ({ children, onSuccess, projectSlug, initialMemberships }) => {
|
|
9
|
+
const addProjectMember = useAddProjectMemberMutation.useAddProjectMemberMutation();
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
initialValues: {
|
|
15
|
+
identityId: "",
|
|
16
|
+
memberships: initialMemberships || []
|
|
17
|
+
},
|
|
18
|
+
validate: ({ values }) => {
|
|
19
|
+
const errors = [];
|
|
20
|
+
if (!values.identityId) {
|
|
21
|
+
errors.push({ code: "FIELD_REQUIRED", field: "identityId" });
|
|
22
|
+
}
|
|
23
|
+
if (values.memberships.length === 0) {
|
|
24
|
+
errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
|
|
25
|
+
}
|
|
26
|
+
return errors;
|
|
27
|
+
},
|
|
28
|
+
execute: async ({ values }) => {
|
|
29
|
+
return await addProjectMember({
|
|
30
|
+
projectSlug,
|
|
31
|
+
identityId: values.identityId,
|
|
32
|
+
memberships: values.memberships
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
errorMapping: errorToField,
|
|
36
|
+
children
|
|
37
|
+
},
|
|
38
|
+
void 0,
|
|
39
|
+
false,
|
|
40
|
+
{
|
|
41
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/AddProjectMemberForm.tsx",
|
|
42
|
+
lineNumber: 36,
|
|
43
|
+
columnNumber: 3
|
|
44
|
+
},
|
|
45
|
+
void 0
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
const errorToField = {
|
|
49
|
+
ALREADY_MEMBER: "identityId",
|
|
50
|
+
IDENTITY_NOT_FOUND: "identityId",
|
|
51
|
+
INVALID_MEMBERSHIP: "memberships",
|
|
52
|
+
PROJECT_NOT_FOUND: void 0,
|
|
53
|
+
ROLE_NOT_FOUND: "memberships",
|
|
54
|
+
VARIABLE_EMPTY: "memberships",
|
|
55
|
+
VARIABLE_NOT_FOUND: "memberships"
|
|
56
|
+
};
|
|
57
|
+
exports.AddProjectMemberForm = AddProjectMemberForm;
|
|
58
|
+
exports.useAddProjectMemberForm = useAddProjectMemberForm;
|
|
59
|
+
//# sourceMappingURL=AddProjectMemberForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddProjectMemberForm.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/forms/AddProjectMemberForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm } from '../../contexts.js'\nimport { AddProjectMemberErrorCode, MembershipInput } from '@contember/graphql-client-tenant'\nimport { useAddProjectMemberMutation } from '../../hooks/index.js'\n\nexport type AddProjectMemberFormValues = {\n\tidentityId: string\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type AddProjectMemberFormErrorCode =\n\t| AddProjectMemberErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type AddProjectMemberFormState = FormState\n\nexport type AddProjectMemberFormError = FormError<AddProjectMemberFormValues, AddProjectMemberFormErrorCode>\n\nexport type AddProjectMemberFormContextValue = FormContextValue<AddProjectMemberFormValues, AddProjectMemberFormErrorCode>\n\nexport interface AddProjectMemberFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tinitialMemberships?: readonly MembershipInput[]\n\tonSuccess?: (args: {}) => void\n}\n\nexport const useAddProjectMemberForm = useForm as () => AddProjectMemberFormContextValue\n\nexport const AddProjectMemberForm = ({ children, onSuccess, projectSlug, initialMemberships }: AddProjectMemberFormProps) => {\n\tconst addProjectMember = useAddProjectMemberMutation()\n\treturn (\n\t\t<TenantForm<AddProjectMemberFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\tidentityId: '',\n\t\t\t\tmemberships: initialMemberships || [],\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: AddProjectMemberFormError[] = []\n\t\t\t\tif (!values.identityId) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'identityId' })\n\t\t\t\t}\n\t\t\t\tif (values.memberships.length === 0) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'memberships' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await addProjectMember({\n\t\t\t\t\tprojectSlug,\n\t\t\t\t\tidentityId: values.identityId,\n\t\t\t\t\tmemberships: values.memberships,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<AddProjectMemberErrorCode, keyof AddProjectMemberFormValues | undefined> = {\n\tALREADY_MEMBER: 'identityId',\n\tIDENTITY_NOT_FOUND: 'identityId',\n\tINVALID_MEMBERSHIP: 'memberships',\n\tPROJECT_NOT_FOUND: undefined,\n\tROLE_NOT_FOUND: 'memberships',\n\tVARIABLE_EMPTY: 'memberships',\n\tVARIABLE_NOT_FOUND: 'memberships',\n}\n"],"names":["useForm","useAddProjectMemberMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA8BO,MAAM,0BAA0BA,SAAAA;AAEhC,MAAM,uBAAuB,CAAC,EAAE,UAAU,WAAW,aAAa,yBAAoD;AAC5H,QAAM,mBAAmBC,4BAAAA,4BAAA;AACzB,SACCC,8BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,YAAY;AAAA,QACZ,aAAa,sBAAsB,CAAA;AAAA,MAAC;AAAA,MAErC,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAsC,CAAA;AAC5C,YAAI,CAAC,OAAO,YAAY;AACvB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,cAAc;AAAA,QAC5D;AACA,YAAI,OAAO,YAAY,WAAW,GAAG;AACpC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,iBAAiB;AAAA,UAC7B;AAAA,UACA,YAAY,OAAO;AAAA,UACnB,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IAzBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AA4BF;AAEA,MAAM,eAAgG;AAAA,EACrG,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AACrB;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { useAddProjectMemberMutation } from "../../hooks/mutations/memberships/useAddProjectMemberMutation.js";
|
|
5
|
+
const useAddProjectMemberForm = useForm;
|
|
6
|
+
const AddProjectMemberForm = ({ children, onSuccess, projectSlug, initialMemberships }) => {
|
|
7
|
+
const addProjectMember = useAddProjectMemberMutation();
|
|
8
|
+
return /* @__PURE__ */ jsxDEV(
|
|
9
|
+
TenantForm,
|
|
10
|
+
{
|
|
11
|
+
onSuccess,
|
|
12
|
+
initialValues: {
|
|
13
|
+
identityId: "",
|
|
14
|
+
memberships: initialMemberships || []
|
|
15
|
+
},
|
|
16
|
+
validate: ({ values }) => {
|
|
17
|
+
const errors = [];
|
|
18
|
+
if (!values.identityId) {
|
|
19
|
+
errors.push({ code: "FIELD_REQUIRED", field: "identityId" });
|
|
20
|
+
}
|
|
21
|
+
if (values.memberships.length === 0) {
|
|
22
|
+
errors.push({ code: "FIELD_REQUIRED", field: "memberships" });
|
|
23
|
+
}
|
|
24
|
+
return errors;
|
|
25
|
+
},
|
|
26
|
+
execute: async ({ values }) => {
|
|
27
|
+
return await addProjectMember({
|
|
28
|
+
projectSlug,
|
|
29
|
+
identityId: values.identityId,
|
|
30
|
+
memberships: values.memberships
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
errorMapping: errorToField,
|
|
34
|
+
children
|
|
35
|
+
},
|
|
36
|
+
void 0,
|
|
37
|
+
false,
|
|
38
|
+
{
|
|
39
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/AddProjectMemberForm.tsx",
|
|
40
|
+
lineNumber: 36,
|
|
41
|
+
columnNumber: 3
|
|
42
|
+
},
|
|
43
|
+
void 0
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
const errorToField = {
|
|
47
|
+
ALREADY_MEMBER: "identityId",
|
|
48
|
+
IDENTITY_NOT_FOUND: "identityId",
|
|
49
|
+
INVALID_MEMBERSHIP: "memberships",
|
|
50
|
+
PROJECT_NOT_FOUND: void 0,
|
|
51
|
+
ROLE_NOT_FOUND: "memberships",
|
|
52
|
+
VARIABLE_EMPTY: "memberships",
|
|
53
|
+
VARIABLE_NOT_FOUND: "memberships"
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
AddProjectMemberForm,
|
|
57
|
+
useAddProjectMemberForm
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=AddProjectMemberForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddProjectMemberForm.js","sources":["../../../../../../packages/react-client-tenant/src/components/forms/AddProjectMemberForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm } from '../../contexts.js'\nimport { AddProjectMemberErrorCode, MembershipInput } from '@contember/graphql-client-tenant'\nimport { useAddProjectMemberMutation } from '../../hooks/index.js'\n\nexport type AddProjectMemberFormValues = {\n\tidentityId: string\n\tmemberships: readonly MembershipInput[]\n}\n\nexport type AddProjectMemberFormErrorCode =\n\t| AddProjectMemberErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type AddProjectMemberFormState = FormState\n\nexport type AddProjectMemberFormError = FormError<AddProjectMemberFormValues, AddProjectMemberFormErrorCode>\n\nexport type AddProjectMemberFormContextValue = FormContextValue<AddProjectMemberFormValues, AddProjectMemberFormErrorCode>\n\nexport interface AddProjectMemberFormProps {\n\tchildren: ReactElement\n\tprojectSlug: string\n\tinitialMemberships?: readonly MembershipInput[]\n\tonSuccess?: (args: {}) => void\n}\n\nexport const useAddProjectMemberForm = useForm as () => AddProjectMemberFormContextValue\n\nexport const AddProjectMemberForm = ({ children, onSuccess, projectSlug, initialMemberships }: AddProjectMemberFormProps) => {\n\tconst addProjectMember = useAddProjectMemberMutation()\n\treturn (\n\t\t<TenantForm<AddProjectMemberFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\tidentityId: '',\n\t\t\t\tmemberships: initialMemberships || [],\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: AddProjectMemberFormError[] = []\n\t\t\t\tif (!values.identityId) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'identityId' })\n\t\t\t\t}\n\t\t\t\tif (values.memberships.length === 0) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'memberships' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await addProjectMember({\n\t\t\t\t\tprojectSlug,\n\t\t\t\t\tidentityId: values.identityId,\n\t\t\t\t\tmemberships: values.memberships,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<AddProjectMemberErrorCode, keyof AddProjectMemberFormValues | undefined> = {\n\tALREADY_MEMBER: 'identityId',\n\tIDENTITY_NOT_FOUND: 'identityId',\n\tINVALID_MEMBERSHIP: 'memberships',\n\tPROJECT_NOT_FOUND: undefined,\n\tROLE_NOT_FOUND: 'memberships',\n\tVARIABLE_EMPTY: 'memberships',\n\tVARIABLE_NOT_FOUND: 'memberships',\n}\n"],"names":["this"],"mappings":";;;;AA8BO,MAAM,0BAA0B;AAEhC,MAAM,uBAAuB,CAAC,EAAE,UAAU,WAAW,aAAa,yBAAoD;AAC5H,QAAM,mBAAmB,4BAAA;AACzB,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,YAAY;AAAA,QACZ,aAAa,sBAAsB,CAAA;AAAA,MAAC;AAAA,MAErC,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAsC,CAAA;AAC5C,YAAI,CAAC,OAAO,YAAY;AACvB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,cAAc;AAAA,QAC5D;AACA,YAAI,OAAO,YAAY,WAAW,GAAG;AACpC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,iBAAiB;AAAA,UAC7B;AAAA,UACA,YAAY,OAAO;AAAA,UACnB,aAAa,OAAO;AAAA,QAAA,CACpB;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IAzBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA4BF;AAEA,MAAM,eAAgG;AAAA,EACrG,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AACrB;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 useChangeMyProfile = require("../../hooks/mutations/profile/useChangeMyProfile.cjs");
|
|
8
|
+
const useChangeMyProfileForm = contexts.useForm;
|
|
9
|
+
const ChangeMyProfileForm = ({ children, onSuccess, initialValues }) => {
|
|
10
|
+
const changeMyProfile = useChangeMyProfile.useChangeMyProfileMutation();
|
|
11
|
+
const { refreshIdentity } = contexts.useIdentityMethods();
|
|
12
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
13
|
+
TenantForm.TenantForm,
|
|
14
|
+
{
|
|
15
|
+
onSuccess: async () => {
|
|
16
|
+
await refreshIdentity();
|
|
17
|
+
onSuccess?.();
|
|
18
|
+
},
|
|
19
|
+
errorMapping: errorToField,
|
|
20
|
+
initialValues: React.useMemo(() => ({
|
|
21
|
+
email: initialValues?.email ?? "",
|
|
22
|
+
name: initialValues?.name ?? ""
|
|
23
|
+
}), [initialValues?.email, initialValues?.name]),
|
|
24
|
+
validate: ({ values }) => {
|
|
25
|
+
const errors = [];
|
|
26
|
+
if (values.email && !values.email.match(/^.+@.+$/)) {
|
|
27
|
+
errors.push({ code: "INVALID_VALUE", field: "email" });
|
|
28
|
+
}
|
|
29
|
+
return errors;
|
|
30
|
+
},
|
|
31
|
+
execute: async ({ values }) => {
|
|
32
|
+
return await changeMyProfile({
|
|
33
|
+
// An empty e-mail means "leave unchanged"; an empty name clears it (the API maps '' to null).
|
|
34
|
+
email: values.email || void 0,
|
|
35
|
+
name: values.name
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
children
|
|
39
|
+
},
|
|
40
|
+
void 0,
|
|
41
|
+
false,
|
|
42
|
+
{
|
|
43
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/ChangeMyProfileForm.tsx",
|
|
44
|
+
lineNumber: 38,
|
|
45
|
+
columnNumber: 3
|
|
46
|
+
},
|
|
47
|
+
void 0
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
const errorToField = {
|
|
51
|
+
INVALID_EMAIL_FORMAT: "email",
|
|
52
|
+
EMAIL_ALREADY_EXISTS: "email",
|
|
53
|
+
NOT_A_PERSON: void 0,
|
|
54
|
+
RATE_LIMIT_EXCEEDED: void 0
|
|
55
|
+
};
|
|
56
|
+
exports.ChangeMyProfileForm = ChangeMyProfileForm;
|
|
57
|
+
exports.useChangeMyProfileForm = useChangeMyProfileForm;
|
|
58
|
+
//# sourceMappingURL=ChangeMyProfileForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangeMyProfileForm.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/forms/ChangeMyProfileForm.tsx"],"sourcesContent":["import { ReactElement, useMemo } from 'react'\nimport { ChangeMyProfileErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm, useIdentityMethods } from '../../contexts.js'\nimport { useChangeMyProfileMutation } from '../../hooks/index.js'\n\nexport type ChangeMyProfileFormValues = {\n\temail: string\n\tname: string\n}\n\nexport type ChangeMyProfileFormErrorCode =\n\t| ChangeMyProfileErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangeMyProfileFormState = FormState\n\nexport type ChangeMyProfileFormError = FormError<ChangeMyProfileFormValues, ChangeMyProfileFormErrorCode>\n\nexport type ChangeMyProfileFormContextValue = FormContextValue<ChangeMyProfileFormValues, ChangeMyProfileFormErrorCode>\n\nexport interface ChangeMyProfileFormProps {\n\tchildren: ReactElement\n\t/** Prefill the fields, typically from `useIdentity()`. */\n\tinitialValues?: Partial<ChangeMyProfileFormValues>\n\tonSuccess?: () => void\n}\n\nexport const useChangeMyProfileForm = useForm as () => ChangeMyProfileFormContextValue\n\nexport const ChangeMyProfileForm = ({ children, onSuccess, initialValues }: ChangeMyProfileFormProps) => {\n\tconst changeMyProfile = useChangeMyProfileMutation()\n\tconst { refreshIdentity } = useIdentityMethods()\n\treturn (\n\t\t<TenantForm<ChangeMyProfileFormContextValue>\n\t\t\tonSuccess={async () => {\n\t\t\t\tawait refreshIdentity()\n\t\t\t\tonSuccess?.()\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={useMemo(() => ({\n\t\t\t\temail: initialValues?.email ?? '',\n\t\t\t\tname: initialValues?.name ?? '',\n\t\t\t}), [initialValues?.email, initialValues?.name])}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangeMyProfileFormError[] = []\n\t\t\t\tif (values.email && !values.email.match(/^.+@.+$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'email' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await changeMyProfile({\n\t\t\t\t\t// An empty e-mail means \"leave unchanged\"; an empty name clears it (the API maps '' to null).\n\t\t\t\t\temail: values.email || undefined,\n\t\t\t\t\tname: values.name,\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<ChangeMyProfileErrorCode, keyof ChangeMyProfileFormValues | undefined> = {\n\tINVALID_EMAIL_FORMAT: 'email',\n\tEMAIL_ALREADY_EXISTS: 'email',\n\tNOT_A_PERSON: undefined,\n\tRATE_LIMIT_EXCEEDED: undefined,\n}\n"],"names":["useForm","useChangeMyProfileMutation","useIdentityMethods","jsxDEV","TenantForm","useMemo","this"],"mappings":";;;;;;;AA+BO,MAAM,yBAAyBA,SAAAA;AAE/B,MAAM,sBAAsB,CAAC,EAAE,UAAU,WAAW,oBAA8C;AACxG,QAAM,kBAAkBC,mBAAAA,2BAAA;AACxB,QAAM,EAAE,gBAAA,IAAoBC,4BAAA;AAC5B,SACCC,8BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACA,WAAW,YAAY;AACtB,cAAM,gBAAA;AACN,oBAAA;AAAA,MACD;AAAA,MACA,cAAc;AAAA,MACd,eAAeC,MAAAA,QAAQ,OAAO;AAAA,QAC7B,OAAO,eAAe,SAAS;AAAA,QAC/B,MAAM,eAAe,QAAQ;AAAA,MAAA,IAC1B,CAAC,eAAe,OAAO,eAAe,IAAI,CAAC;AAAA,MAC/C,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAqC,CAAA;AAC3C,YAAI,OAAO,SAAS,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AACnD,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,SAAS;AAAA,QACtD;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,gBAAgB;AAAA;AAAA,UAE5B,OAAO,OAAO,SAAS;AAAA,UACvB,MAAM,OAAO;AAAA,QAAA,CACb;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,eAA8F;AAAA,EACnG,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,cAAc;AAAA,EACd,qBAAqB;AACtB;;;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { TenantForm } from "./TenantForm.js";
|
|
4
|
+
import { useForm, useIdentityMethods } from "../../contexts.js";
|
|
5
|
+
import { useChangeMyProfileMutation } from "../../hooks/mutations/profile/useChangeMyProfile.js";
|
|
6
|
+
const useChangeMyProfileForm = useForm;
|
|
7
|
+
const ChangeMyProfileForm = ({ children, onSuccess, initialValues }) => {
|
|
8
|
+
const changeMyProfile = useChangeMyProfileMutation();
|
|
9
|
+
const { refreshIdentity } = useIdentityMethods();
|
|
10
|
+
return /* @__PURE__ */ jsxDEV(
|
|
11
|
+
TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess: async () => {
|
|
14
|
+
await refreshIdentity();
|
|
15
|
+
onSuccess?.();
|
|
16
|
+
},
|
|
17
|
+
errorMapping: errorToField,
|
|
18
|
+
initialValues: useMemo(() => ({
|
|
19
|
+
email: initialValues?.email ?? "",
|
|
20
|
+
name: initialValues?.name ?? ""
|
|
21
|
+
}), [initialValues?.email, initialValues?.name]),
|
|
22
|
+
validate: ({ values }) => {
|
|
23
|
+
const errors = [];
|
|
24
|
+
if (values.email && !values.email.match(/^.+@.+$/)) {
|
|
25
|
+
errors.push({ code: "INVALID_VALUE", field: "email" });
|
|
26
|
+
}
|
|
27
|
+
return errors;
|
|
28
|
+
},
|
|
29
|
+
execute: async ({ values }) => {
|
|
30
|
+
return await changeMyProfile({
|
|
31
|
+
// An empty e-mail means "leave unchanged"; an empty name clears it (the API maps '' to null).
|
|
32
|
+
email: values.email || void 0,
|
|
33
|
+
name: values.name
|
|
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/ChangeMyProfileForm.tsx",
|
|
42
|
+
lineNumber: 38,
|
|
43
|
+
columnNumber: 3
|
|
44
|
+
},
|
|
45
|
+
void 0
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
const errorToField = {
|
|
49
|
+
INVALID_EMAIL_FORMAT: "email",
|
|
50
|
+
EMAIL_ALREADY_EXISTS: "email",
|
|
51
|
+
NOT_A_PERSON: void 0,
|
|
52
|
+
RATE_LIMIT_EXCEEDED: void 0
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
ChangeMyProfileForm,
|
|
56
|
+
useChangeMyProfileForm
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=ChangeMyProfileForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangeMyProfileForm.js","sources":["../../../../../../packages/react-client-tenant/src/components/forms/ChangeMyProfileForm.tsx"],"sourcesContent":["import { ReactElement, useMemo } from 'react'\nimport { ChangeMyProfileErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm, useIdentityMethods } from '../../contexts.js'\nimport { useChangeMyProfileMutation } from '../../hooks/index.js'\n\nexport type ChangeMyProfileFormValues = {\n\temail: string\n\tname: string\n}\n\nexport type ChangeMyProfileFormErrorCode =\n\t| ChangeMyProfileErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangeMyProfileFormState = FormState\n\nexport type ChangeMyProfileFormError = FormError<ChangeMyProfileFormValues, ChangeMyProfileFormErrorCode>\n\nexport type ChangeMyProfileFormContextValue = FormContextValue<ChangeMyProfileFormValues, ChangeMyProfileFormErrorCode>\n\nexport interface ChangeMyProfileFormProps {\n\tchildren: ReactElement\n\t/** Prefill the fields, typically from `useIdentity()`. */\n\tinitialValues?: Partial<ChangeMyProfileFormValues>\n\tonSuccess?: () => void\n}\n\nexport const useChangeMyProfileForm = useForm as () => ChangeMyProfileFormContextValue\n\nexport const ChangeMyProfileForm = ({ children, onSuccess, initialValues }: ChangeMyProfileFormProps) => {\n\tconst changeMyProfile = useChangeMyProfileMutation()\n\tconst { refreshIdentity } = useIdentityMethods()\n\treturn (\n\t\t<TenantForm<ChangeMyProfileFormContextValue>\n\t\t\tonSuccess={async () => {\n\t\t\t\tawait refreshIdentity()\n\t\t\t\tonSuccess?.()\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={useMemo(() => ({\n\t\t\t\temail: initialValues?.email ?? '',\n\t\t\t\tname: initialValues?.name ?? '',\n\t\t\t}), [initialValues?.email, initialValues?.name])}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangeMyProfileFormError[] = []\n\t\t\t\tif (values.email && !values.email.match(/^.+@.+$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'email' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await changeMyProfile({\n\t\t\t\t\t// An empty e-mail means \"leave unchanged\"; an empty name clears it (the API maps '' to null).\n\t\t\t\t\temail: values.email || undefined,\n\t\t\t\t\tname: values.name,\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<ChangeMyProfileErrorCode, keyof ChangeMyProfileFormValues | undefined> = {\n\tINVALID_EMAIL_FORMAT: 'email',\n\tEMAIL_ALREADY_EXISTS: 'email',\n\tNOT_A_PERSON: undefined,\n\tRATE_LIMIT_EXCEEDED: undefined,\n}\n"],"names":["this"],"mappings":";;;;;AA+BO,MAAM,yBAAyB;AAE/B,MAAM,sBAAsB,CAAC,EAAE,UAAU,WAAW,oBAA8C;AACxG,QAAM,kBAAkB,2BAAA;AACxB,QAAM,EAAE,gBAAA,IAAoB,mBAAA;AAC5B,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,WAAW,YAAY;AACtB,cAAM,gBAAA;AACN,oBAAA;AAAA,MACD;AAAA,MACA,cAAc;AAAA,MACd,eAAe,QAAQ,OAAO;AAAA,QAC7B,OAAO,eAAe,SAAS;AAAA,QAC/B,MAAM,eAAe,QAAQ;AAAA,MAAA,IAC1B,CAAC,eAAe,OAAO,eAAe,IAAI,CAAC;AAAA,MAC/C,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAqC,CAAA;AAC3C,YAAI,OAAO,SAAS,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AACnD,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,SAAS;AAAA,QACtD;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,gBAAgB;AAAA;AAAA,UAE5B,OAAO,OAAO,SAAS;AAAA,UACvB,MAAM,OAAO;AAAA,QAAA,CACb;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,eAA8F;AAAA,EACnG,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,cAAc;AAAA,EACd,qBAAqB;AACtB;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxDevRuntime = require("react/jsx-dev-runtime");
|
|
4
|
+
const TenantForm = require("./TenantForm.cjs");
|
|
5
|
+
const contexts = require("../../contexts.cjs");
|
|
6
|
+
const useChangePasswordMutation = require("../../hooks/mutations/person/useChangePasswordMutation.cjs");
|
|
7
|
+
const useChangePasswordForm = contexts.useForm;
|
|
8
|
+
const ChangePasswordForm = ({ children, onSuccess, personId }) => {
|
|
9
|
+
const changePassword = useChangePasswordMutation.useChangePasswordMutation();
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
errorMapping: errorToField,
|
|
15
|
+
initialValues: {
|
|
16
|
+
password: "",
|
|
17
|
+
passwordConfirmation: ""
|
|
18
|
+
},
|
|
19
|
+
validate: ({ values }) => {
|
|
20
|
+
const errors = [];
|
|
21
|
+
if (!values.password) {
|
|
22
|
+
errors.push({ code: "FIELD_REQUIRED", field: "password" });
|
|
23
|
+
} else if (values.password.length < 6) {
|
|
24
|
+
errors.push({ code: "INVALID_VALUE", field: "password" });
|
|
25
|
+
} else if (!values.passwordConfirmation) {
|
|
26
|
+
errors.push({ code: "FIELD_REQUIRED", field: "passwordConfirmation" });
|
|
27
|
+
} else if (values.password !== values.passwordConfirmation) {
|
|
28
|
+
errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
|
|
29
|
+
}
|
|
30
|
+
return errors;
|
|
31
|
+
},
|
|
32
|
+
execute: async ({ values }) => {
|
|
33
|
+
return await changePassword({
|
|
34
|
+
personId,
|
|
35
|
+
password: values.password
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
children
|
|
39
|
+
},
|
|
40
|
+
void 0,
|
|
41
|
+
false,
|
|
42
|
+
{
|
|
43
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/ChangePasswordForm.tsx",
|
|
44
|
+
lineNumber: 37,
|
|
45
|
+
columnNumber: 3
|
|
46
|
+
},
|
|
47
|
+
void 0
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
const errorToField = {
|
|
51
|
+
PASSWORD_MISMATCH: "passwordConfirmation",
|
|
52
|
+
TOO_WEAK: "password",
|
|
53
|
+
PERSON_NOT_FOUND: void 0
|
|
54
|
+
};
|
|
55
|
+
exports.ChangePasswordForm = ChangePasswordForm;
|
|
56
|
+
exports.useChangePasswordForm = useChangePasswordForm;
|
|
57
|
+
//# sourceMappingURL=ChangePasswordForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangePasswordForm.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/forms/ChangePasswordForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { ChangePasswordErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm } from '../../contexts.js'\nimport { useChangePasswordMutation } from '../../hooks/index.js'\n\nexport type ChangePasswordFormValues = {\n\tpassword: string\n\tpasswordConfirmation: string\n}\n\nexport type ChangePasswordFormErrorCode =\n\t| ChangePasswordErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangePasswordFormState = FormState\n\nexport type ChangePasswordFormError = FormError<ChangePasswordFormValues, ChangePasswordFormErrorCode>\n\nexport type ChangePasswordFormContextValue = FormContextValue<ChangePasswordFormValues, ChangePasswordFormErrorCode>\n\nexport interface ChangePasswordFormProps {\n\tchildren: ReactElement\n\tpersonId: string\n\tonSuccess?: () => void\n}\n\nexport const useChangePasswordForm = useForm as () => ChangePasswordFormContextValue\n\nexport const ChangePasswordForm = ({ children, onSuccess, personId }: ChangePasswordFormProps) => {\n\tconst changePassword = useChangePasswordMutation()\n\treturn (\n\t\t<TenantForm<ChangePasswordFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\tpassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangePasswordFormError[] = []\n\t\t\t\tif (!values.password) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'password' })\n\t\t\t\t} else if (values.password.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'password' })\n\t\t\t\t} else if (!values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'passwordConfirmation' })\n\t\t\t\t} else if (values.password !== values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await changePassword({\n\t\t\t\t\tpersonId,\n\t\t\t\t\tpassword: values.password,\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: Partial<Record<ChangePasswordFormErrorCode, keyof ChangePasswordFormValues | undefined>> = {\n\tPASSWORD_MISMATCH: 'passwordConfirmation',\n\tTOO_WEAK: 'password',\n\tPERSON_NOT_FOUND: undefined,\n}\n"],"names":["useForm","useChangePasswordMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA+BO,MAAM,wBAAwBA,SAAAA;AAE9B,MAAM,qBAAqB,CAAC,EAAE,UAAU,WAAW,eAAwC;AACjG,QAAM,iBAAiBC,0BAAAA,0BAAA;AACvB,SACCC,8BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,UAAU;AAAA,QACV,sBAAsB;AAAA,MAAA;AAAA,MAEvB,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAoC,CAAA;AAC1C,YAAI,CAAC,OAAO,UAAU;AACrB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAC1D,WAAW,OAAO,SAAS,SAAS,GAAG;AACtC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,YAAY;AAAA,QACzD,WAAW,CAAC,OAAO,sBAAsB;AACxC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,wBAAwB;AAAA,QACtE,WAAW,OAAO,aAAa,OAAO,sBAAsB;AAC3D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,eAAe;AAAA,UAC3B;AAAA,UACA,UAAU,OAAO;AAAA,QAAA,CACjB;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IA3BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AA8BF;AAEA,MAAM,eAAyG;AAAA,EAC9G,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,kBAAkB;AACnB;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { TenantForm } from "./TenantForm.js";
|
|
3
|
+
import { useForm } from "../../contexts.js";
|
|
4
|
+
import { useChangePasswordMutation } from "../../hooks/mutations/person/useChangePasswordMutation.js";
|
|
5
|
+
const useChangePasswordForm = useForm;
|
|
6
|
+
const ChangePasswordForm = ({ children, onSuccess, personId }) => {
|
|
7
|
+
const changePassword = useChangePasswordMutation();
|
|
8
|
+
return /* @__PURE__ */ jsxDEV(
|
|
9
|
+
TenantForm,
|
|
10
|
+
{
|
|
11
|
+
onSuccess,
|
|
12
|
+
errorMapping: errorToField,
|
|
13
|
+
initialValues: {
|
|
14
|
+
password: "",
|
|
15
|
+
passwordConfirmation: ""
|
|
16
|
+
},
|
|
17
|
+
validate: ({ values }) => {
|
|
18
|
+
const errors = [];
|
|
19
|
+
if (!values.password) {
|
|
20
|
+
errors.push({ code: "FIELD_REQUIRED", field: "password" });
|
|
21
|
+
} else if (values.password.length < 6) {
|
|
22
|
+
errors.push({ code: "INVALID_VALUE", field: "password" });
|
|
23
|
+
} else if (!values.passwordConfirmation) {
|
|
24
|
+
errors.push({ code: "FIELD_REQUIRED", field: "passwordConfirmation" });
|
|
25
|
+
} else if (values.password !== values.passwordConfirmation) {
|
|
26
|
+
errors.push({ code: "PASSWORD_MISMATCH", field: "passwordConfirmation" });
|
|
27
|
+
}
|
|
28
|
+
return errors;
|
|
29
|
+
},
|
|
30
|
+
execute: async ({ values }) => {
|
|
31
|
+
return await changePassword({
|
|
32
|
+
personId,
|
|
33
|
+
password: values.password
|
|
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/ChangePasswordForm.tsx",
|
|
42
|
+
lineNumber: 37,
|
|
43
|
+
columnNumber: 3
|
|
44
|
+
},
|
|
45
|
+
void 0
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
const errorToField = {
|
|
49
|
+
PASSWORD_MISMATCH: "passwordConfirmation",
|
|
50
|
+
TOO_WEAK: "password",
|
|
51
|
+
PERSON_NOT_FOUND: void 0
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
ChangePasswordForm,
|
|
55
|
+
useChangePasswordForm
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=ChangePasswordForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangePasswordForm.js","sources":["../../../../../../packages/react-client-tenant/src/components/forms/ChangePasswordForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { ChangePasswordErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm } from '../../contexts.js'\nimport { useChangePasswordMutation } from '../../hooks/index.js'\n\nexport type ChangePasswordFormValues = {\n\tpassword: string\n\tpasswordConfirmation: string\n}\n\nexport type ChangePasswordFormErrorCode =\n\t| ChangePasswordErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'PASSWORD_MISMATCH'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangePasswordFormState = FormState\n\nexport type ChangePasswordFormError = FormError<ChangePasswordFormValues, ChangePasswordFormErrorCode>\n\nexport type ChangePasswordFormContextValue = FormContextValue<ChangePasswordFormValues, ChangePasswordFormErrorCode>\n\nexport interface ChangePasswordFormProps {\n\tchildren: ReactElement\n\tpersonId: string\n\tonSuccess?: () => void\n}\n\nexport const useChangePasswordForm = useForm as () => ChangePasswordFormContextValue\n\nexport const ChangePasswordForm = ({ children, onSuccess, personId }: ChangePasswordFormProps) => {\n\tconst changePassword = useChangePasswordMutation()\n\treturn (\n\t\t<TenantForm<ChangePasswordFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={{\n\t\t\t\tpassword: '',\n\t\t\t\tpasswordConfirmation: '',\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangePasswordFormError[] = []\n\t\t\t\tif (!values.password) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'password' })\n\t\t\t\t} else if (values.password.length < 6) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'password' })\n\t\t\t\t} else if (!values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'passwordConfirmation' })\n\t\t\t\t} else if (values.password !== values.passwordConfirmation) {\n\t\t\t\t\terrors.push({ code: 'PASSWORD_MISMATCH', field: 'passwordConfirmation' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await changePassword({\n\t\t\t\t\tpersonId,\n\t\t\t\t\tpassword: values.password,\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: Partial<Record<ChangePasswordFormErrorCode, keyof ChangePasswordFormValues | undefined>> = {\n\tPASSWORD_MISMATCH: 'passwordConfirmation',\n\tTOO_WEAK: 'password',\n\tPERSON_NOT_FOUND: undefined,\n}\n"],"names":["this"],"mappings":";;;;AA+BO,MAAM,wBAAwB;AAE9B,MAAM,qBAAqB,CAAC,EAAE,UAAU,WAAW,eAAwC;AACjG,QAAM,iBAAiB,0BAAA;AACvB,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe;AAAA,QACd,UAAU;AAAA,QACV,sBAAsB;AAAA,MAAA;AAAA,MAEvB,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAoC,CAAA;AAC1C,YAAI,CAAC,OAAO,UAAU;AACrB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,YAAY;AAAA,QAC1D,WAAW,OAAO,SAAS,SAAS,GAAG;AACtC,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,YAAY;AAAA,QACzD,WAAW,CAAC,OAAO,sBAAsB;AACxC,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,wBAAwB;AAAA,QACtE,WAAW,OAAO,aAAa,OAAO,sBAAsB;AAC3D,iBAAO,KAAK,EAAE,MAAM,qBAAqB,OAAO,wBAAwB;AAAA,QACzE;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,eAAe;AAAA,UAC3B;AAAA,UACA,UAAU,OAAO;AAAA,QAAA,CACjB;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IA3BF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA8BF;AAEA,MAAM,eAAyG;AAAA,EAC9G,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,kBAAkB;AACnB;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 useChangeProfile = require("../../hooks/mutations/profile/useChangeProfile.cjs");
|
|
8
|
+
const useChangeProfileForm = contexts.useForm;
|
|
9
|
+
const ChangeProfileForm = ({ children, onSuccess, personId, initialValues }) => {
|
|
10
|
+
const changeProfile = useChangeProfile.useChangeProfileMutation();
|
|
11
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
12
|
+
TenantForm.TenantForm,
|
|
13
|
+
{
|
|
14
|
+
onSuccess,
|
|
15
|
+
errorMapping: errorToField,
|
|
16
|
+
initialValues: React.useMemo(() => ({
|
|
17
|
+
email: initialValues?.email ?? "",
|
|
18
|
+
name: initialValues?.name ?? ""
|
|
19
|
+
}), [initialValues?.email, initialValues?.name]),
|
|
20
|
+
validate: ({ values }) => {
|
|
21
|
+
const errors = [];
|
|
22
|
+
if (values.email && !values.email.match(/^.+@.+$/)) {
|
|
23
|
+
errors.push({ code: "INVALID_VALUE", field: "email" });
|
|
24
|
+
}
|
|
25
|
+
return errors;
|
|
26
|
+
},
|
|
27
|
+
execute: async ({ values }) => {
|
|
28
|
+
return await changeProfile({
|
|
29
|
+
personId,
|
|
30
|
+
// An empty e-mail means "leave unchanged"; an empty name clears it (the API maps '' to null).
|
|
31
|
+
email: values.email || void 0,
|
|
32
|
+
name: values.name
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
children
|
|
36
|
+
},
|
|
37
|
+
void 0,
|
|
38
|
+
false,
|
|
39
|
+
{
|
|
40
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/ChangeProfileForm.tsx",
|
|
41
|
+
lineNumber: 38,
|
|
42
|
+
columnNumber: 3
|
|
43
|
+
},
|
|
44
|
+
void 0
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
const errorToField = {
|
|
48
|
+
INVALID_EMAIL_FORMAT: "email",
|
|
49
|
+
EMAIL_ALREADY_EXISTS: "email",
|
|
50
|
+
PERSON_NOT_FOUND: void 0
|
|
51
|
+
};
|
|
52
|
+
exports.ChangeProfileForm = ChangeProfileForm;
|
|
53
|
+
exports.useChangeProfileForm = useChangeProfileForm;
|
|
54
|
+
//# sourceMappingURL=ChangeProfileForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangeProfileForm.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/forms/ChangeProfileForm.tsx"],"sourcesContent":["import { ReactElement, useMemo } from 'react'\nimport { ChangeProfileErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm } from '../../contexts.js'\nimport { useChangeProfileMutation } from '../../hooks/index.js'\n\nexport type ChangeProfileFormValues = {\n\temail: string\n\tname: string\n}\n\nexport type ChangeProfileFormErrorCode =\n\t| ChangeProfileErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangeProfileFormState = FormState\n\nexport type ChangeProfileFormError = FormError<ChangeProfileFormValues, ChangeProfileFormErrorCode>\n\nexport type ChangeProfileFormContextValue = FormContextValue<ChangeProfileFormValues, ChangeProfileFormErrorCode>\n\nexport interface ChangeProfileFormProps {\n\tchildren: ReactElement\n\tpersonId: string\n\t/** Prefill the fields, typically from `usePersonQuery()`. */\n\tinitialValues?: Partial<ChangeProfileFormValues>\n\tonSuccess?: () => void\n}\n\nexport const useChangeProfileForm = useForm as () => ChangeProfileFormContextValue\n\nexport const ChangeProfileForm = ({ children, onSuccess, personId, initialValues }: ChangeProfileFormProps) => {\n\tconst changeProfile = useChangeProfileMutation()\n\treturn (\n\t\t<TenantForm<ChangeProfileFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={useMemo(() => ({\n\t\t\t\temail: initialValues?.email ?? '',\n\t\t\t\tname: initialValues?.name ?? '',\n\t\t\t}), [initialValues?.email, initialValues?.name])}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangeProfileFormError[] = []\n\t\t\t\tif (values.email && !values.email.match(/^.+@.+$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'email' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await changeProfile({\n\t\t\t\t\tpersonId,\n\t\t\t\t\t// An empty e-mail means \"leave unchanged\"; an empty name clears it (the API maps '' to null).\n\t\t\t\t\temail: values.email || undefined,\n\t\t\t\t\tname: values.name,\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<ChangeProfileErrorCode, keyof ChangeProfileFormValues | undefined> = {\n\tINVALID_EMAIL_FORMAT: 'email',\n\tEMAIL_ALREADY_EXISTS: 'email',\n\tPERSON_NOT_FOUND: undefined,\n}\n"],"names":["useForm","useChangeProfileMutation","jsxDEV","TenantForm","useMemo","this"],"mappings":";;;;;;;AAgCO,MAAM,uBAAuBA,SAAAA;AAE7B,MAAM,oBAAoB,CAAC,EAAE,UAAU,WAAW,UAAU,oBAA4C;AAC9G,QAAM,gBAAgBC,iBAAAA,yBAAA;AACtB,SACCC,8BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAeC,MAAAA,QAAQ,OAAO;AAAA,QAC7B,OAAO,eAAe,SAAS;AAAA,QAC/B,MAAM,eAAe,QAAQ;AAAA,MAAA,IAC1B,CAAC,eAAe,OAAO,eAAe,IAAI,CAAC;AAAA,MAC/C,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAmC,CAAA;AACzC,YAAI,OAAO,SAAS,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AACnD,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,SAAS;AAAA,QACtD;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,cAAc;AAAA,UAC1B;AAAA;AAAA,UAEA,OAAO,OAAO,SAAS;AAAA,UACvB,MAAM,OAAO;AAAA,QAAA,CACb;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IAvBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AA0BF;AAEA,MAAM,eAA0F;AAAA,EAC/F,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,kBAAkB;AACnB;;;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { TenantForm } from "./TenantForm.js";
|
|
4
|
+
import { useForm } from "../../contexts.js";
|
|
5
|
+
import { useChangeProfileMutation } from "../../hooks/mutations/profile/useChangeProfile.js";
|
|
6
|
+
const useChangeProfileForm = useForm;
|
|
7
|
+
const ChangeProfileForm = ({ children, onSuccess, personId, initialValues }) => {
|
|
8
|
+
const changeProfile = useChangeProfileMutation();
|
|
9
|
+
return /* @__PURE__ */ jsxDEV(
|
|
10
|
+
TenantForm,
|
|
11
|
+
{
|
|
12
|
+
onSuccess,
|
|
13
|
+
errorMapping: errorToField,
|
|
14
|
+
initialValues: useMemo(() => ({
|
|
15
|
+
email: initialValues?.email ?? "",
|
|
16
|
+
name: initialValues?.name ?? ""
|
|
17
|
+
}), [initialValues?.email, initialValues?.name]),
|
|
18
|
+
validate: ({ values }) => {
|
|
19
|
+
const errors = [];
|
|
20
|
+
if (values.email && !values.email.match(/^.+@.+$/)) {
|
|
21
|
+
errors.push({ code: "INVALID_VALUE", field: "email" });
|
|
22
|
+
}
|
|
23
|
+
return errors;
|
|
24
|
+
},
|
|
25
|
+
execute: async ({ values }) => {
|
|
26
|
+
return await changeProfile({
|
|
27
|
+
personId,
|
|
28
|
+
// An empty e-mail means "leave unchanged"; an empty name clears it (the API maps '' to null).
|
|
29
|
+
email: values.email || void 0,
|
|
30
|
+
name: values.name
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
children
|
|
34
|
+
},
|
|
35
|
+
void 0,
|
|
36
|
+
false,
|
|
37
|
+
{
|
|
38
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/ChangeProfileForm.tsx",
|
|
39
|
+
lineNumber: 38,
|
|
40
|
+
columnNumber: 3
|
|
41
|
+
},
|
|
42
|
+
void 0
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
const errorToField = {
|
|
46
|
+
INVALID_EMAIL_FORMAT: "email",
|
|
47
|
+
EMAIL_ALREADY_EXISTS: "email",
|
|
48
|
+
PERSON_NOT_FOUND: void 0
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
ChangeProfileForm,
|
|
52
|
+
useChangeProfileForm
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=ChangeProfileForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangeProfileForm.js","sources":["../../../../../../packages/react-client-tenant/src/components/forms/ChangeProfileForm.tsx"],"sourcesContent":["import { ReactElement, useMemo } from 'react'\nimport { ChangeProfileErrorCode } from '@contember/graphql-client-tenant'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm } from '../../contexts.js'\nimport { useChangeProfileMutation } from '../../hooks/index.js'\n\nexport type ChangeProfileFormValues = {\n\temail: string\n\tname: string\n}\n\nexport type ChangeProfileFormErrorCode =\n\t| ChangeProfileErrorCode\n\t| 'FIELD_REQUIRED'\n\t| 'INVALID_VALUE'\n\t| 'UNKNOWN_ERROR'\n\nexport type ChangeProfileFormState = FormState\n\nexport type ChangeProfileFormError = FormError<ChangeProfileFormValues, ChangeProfileFormErrorCode>\n\nexport type ChangeProfileFormContextValue = FormContextValue<ChangeProfileFormValues, ChangeProfileFormErrorCode>\n\nexport interface ChangeProfileFormProps {\n\tchildren: ReactElement\n\tpersonId: string\n\t/** Prefill the fields, typically from `usePersonQuery()`. */\n\tinitialValues?: Partial<ChangeProfileFormValues>\n\tonSuccess?: () => void\n}\n\nexport const useChangeProfileForm = useForm as () => ChangeProfileFormContextValue\n\nexport const ChangeProfileForm = ({ children, onSuccess, personId, initialValues }: ChangeProfileFormProps) => {\n\tconst changeProfile = useChangeProfileMutation()\n\treturn (\n\t\t<TenantForm<ChangeProfileFormContextValue>\n\t\t\tonSuccess={onSuccess}\n\t\t\terrorMapping={errorToField}\n\t\t\tinitialValues={useMemo(() => ({\n\t\t\t\temail: initialValues?.email ?? '',\n\t\t\t\tname: initialValues?.name ?? '',\n\t\t\t}), [initialValues?.email, initialValues?.name])}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: ChangeProfileFormError[] = []\n\t\t\t\tif (values.email && !values.email.match(/^.+@.+$/)) {\n\t\t\t\t\terrors.push({ code: 'INVALID_VALUE', field: 'email' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await changeProfile({\n\t\t\t\t\tpersonId,\n\t\t\t\t\t// An empty e-mail means \"leave unchanged\"; an empty name clears it (the API maps '' to null).\n\t\t\t\t\temail: values.email || undefined,\n\t\t\t\t\tname: values.name,\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<ChangeProfileErrorCode, keyof ChangeProfileFormValues | undefined> = {\n\tINVALID_EMAIL_FORMAT: 'email',\n\tEMAIL_ALREADY_EXISTS: 'email',\n\tPERSON_NOT_FOUND: undefined,\n}\n"],"names":["this"],"mappings":";;;;;AAgCO,MAAM,uBAAuB;AAE7B,MAAM,oBAAoB,CAAC,EAAE,UAAU,WAAW,UAAU,oBAA4C;AAC9G,QAAM,gBAAgB,yBAAA;AACtB,SACC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA;AAAA,MACA,cAAc;AAAA,MACd,eAAe,QAAQ,OAAO;AAAA,QAC7B,OAAO,eAAe,SAAS;AAAA,QAC/B,MAAM,eAAe,QAAQ;AAAA,MAAA,IAC1B,CAAC,eAAe,OAAO,eAAe,IAAI,CAAC;AAAA,MAC/C,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAmC,CAAA;AACzC,YAAI,OAAO,SAAS,CAAC,OAAO,MAAM,MAAM,SAAS,GAAG;AACnD,iBAAO,KAAK,EAAE,MAAM,iBAAiB,OAAO,SAAS;AAAA,QACtD;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,cAAc;AAAA,UAC1B;AAAA;AAAA,UAEA,OAAO,OAAO,SAAS;AAAA,UACvB,MAAM,OAAO;AAAA,QAAA,CACb;AAAA,MACF;AAAA,MAEC;AAAA,IAAA;AAAA,IAvBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA0BF;AAEA,MAAM,eAA0F;AAAA,EAC/F,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,kBAAkB;AACnB;"}
|
|
@@ -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 useCreateGlobalApiKeyMutation = require("../../hooks/mutations/apiKey/useCreateGlobalApiKeyMutation.cjs");
|
|
7
|
+
const useCreateGlobalApiKeyForm = contexts.useForm;
|
|
8
|
+
const CreateGlobalApiKeyForm = ({ children, onSuccess, initialRoles }) => {
|
|
9
|
+
const createGlobalApiKey = useCreateGlobalApiKeyMutation.useCreateGlobalApiKeyMutation();
|
|
10
|
+
return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
|
|
11
|
+
TenantForm.TenantForm,
|
|
12
|
+
{
|
|
13
|
+
onSuccess,
|
|
14
|
+
initialValues: {
|
|
15
|
+
description: "",
|
|
16
|
+
roles: initialRoles || []
|
|
17
|
+
},
|
|
18
|
+
validate: ({ values }) => {
|
|
19
|
+
const errors = [];
|
|
20
|
+
if (!values.description) {
|
|
21
|
+
errors.push({ code: "FIELD_REQUIRED", field: "description" });
|
|
22
|
+
}
|
|
23
|
+
return errors;
|
|
24
|
+
},
|
|
25
|
+
execute: async ({ values }) => {
|
|
26
|
+
return await createGlobalApiKey({
|
|
27
|
+
description: values.description,
|
|
28
|
+
roles: values.roles
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
errorMapping: errorToField,
|
|
32
|
+
children
|
|
33
|
+
},
|
|
34
|
+
void 0,
|
|
35
|
+
false,
|
|
36
|
+
{
|
|
37
|
+
fileName: "/home/runner/work/contember/contember/packages/react-client-tenant/src/components/forms/CreateGlobalApiKeyForm.tsx",
|
|
38
|
+
lineNumber: 35,
|
|
39
|
+
columnNumber: 3
|
|
40
|
+
},
|
|
41
|
+
void 0
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
const errorToField = {
|
|
45
|
+
INVALID_MEMBERSHIP: void 0,
|
|
46
|
+
PROJECT_NOT_FOUND: void 0,
|
|
47
|
+
ROLE_NOT_FOUND: "roles",
|
|
48
|
+
VARIABLE_EMPTY: void 0,
|
|
49
|
+
VARIABLE_NOT_FOUND: void 0
|
|
50
|
+
};
|
|
51
|
+
exports.CreateGlobalApiKeyForm = CreateGlobalApiKeyForm;
|
|
52
|
+
exports.useCreateGlobalApiKeyForm = useCreateGlobalApiKeyForm;
|
|
53
|
+
//# sourceMappingURL=CreateGlobalApiKeyForm.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateGlobalApiKeyForm.cjs","sources":["../../../../../../packages/react-client-tenant/src/components/forms/CreateGlobalApiKeyForm.tsx"],"sourcesContent":["import { ReactElement } from 'react'\nimport { TenantForm } from './TenantForm.js'\nimport { FormContextValue, FormError, FormState } from '../../types/index.js'\nimport { useForm } from '../../contexts.js'\nimport { CreateApiKeyErrorCode } from '@contember/graphql-client-tenant'\nimport { CreateGlobalApiKeyMutationResult, useCreateGlobalApiKeyMutation } from '../../hooks/index.js'\n\nexport type CreateGlobalApiKeyFormValues = {\n\tdescription: string\n\troles: readonly string[]\n}\n\nexport type CreateGlobalApiKeyFormErrorCode =\n\t| CreateApiKeyErrorCode\n\t| 'UNKNOWN_ERROR'\n\t| 'FIELD_REQUIRED'\n\nexport type CreateGlobalApiKeyFormState = FormState\n\nexport type CreateGlobalApiKeyFormError = FormError<CreateGlobalApiKeyFormValues, CreateGlobalApiKeyFormErrorCode>\n\nexport type CreateGlobalApiKeyFormContextValue = FormContextValue<CreateGlobalApiKeyFormValues, CreateGlobalApiKeyFormErrorCode>\n\nexport interface CreateGlobalApiKeyFormProps {\n\tchildren: ReactElement\n\tinitialRoles?: readonly string[]\n\tonSuccess?: (args: { result: CreateGlobalApiKeyMutationResult }) => void\n}\n\nexport const useCreateGlobalApiKeyForm = useForm as () => CreateGlobalApiKeyFormContextValue\n\nexport const CreateGlobalApiKeyForm = ({ children, onSuccess, initialRoles }: CreateGlobalApiKeyFormProps) => {\n\tconst createGlobalApiKey = useCreateGlobalApiKeyMutation()\n\treturn (\n\t\t<TenantForm<CreateGlobalApiKeyFormContextValue, CreateGlobalApiKeyMutationResult>\n\t\t\tonSuccess={onSuccess}\n\t\t\tinitialValues={{\n\t\t\t\tdescription: '',\n\t\t\t\troles: initialRoles || [],\n\t\t\t}}\n\t\t\tvalidate={({ values }) => {\n\t\t\t\tconst errors: CreateGlobalApiKeyFormError[] = []\n\t\t\t\tif (!values.description) {\n\t\t\t\t\terrors.push({ code: 'FIELD_REQUIRED', field: 'description' })\n\t\t\t\t}\n\t\t\t\treturn errors\n\t\t\t}}\n\t\t\texecute={async ({ values }) => {\n\t\t\t\treturn await createGlobalApiKey({\n\t\t\t\t\tdescription: values.description,\n\t\t\t\t\troles: values.roles,\n\t\t\t\t})\n\t\t\t}}\n\t\t\terrorMapping={errorToField}\n\t\t>\n\t\t\t{children}\n\t\t</TenantForm>\n\t)\n}\n\nconst errorToField: Record<CreateApiKeyErrorCode, keyof CreateGlobalApiKeyFormValues | undefined> = {\n\tINVALID_MEMBERSHIP: undefined,\n\tPROJECT_NOT_FOUND: undefined,\n\tROLE_NOT_FOUND: 'roles',\n\tVARIABLE_EMPTY: undefined,\n\tVARIABLE_NOT_FOUND: undefined,\n}\n"],"names":["useForm","useCreateGlobalApiKeyMutation","jsxDEV","TenantForm","this"],"mappings":";;;;;;AA6BO,MAAM,4BAA4BA,SAAAA;AAElC,MAAM,yBAAyB,CAAC,EAAE,UAAU,WAAW,mBAAgD;AAC7G,QAAM,qBAAqBC,8BAAAA,8BAAA;AAC3B,SACCC,8BAAAA;AAAAA,IAACC,WAAAA;AAAAA,IAAA;AAAA,MACA;AAAA,MACA,eAAe;AAAA,QACd,aAAa;AAAA,QACb,OAAO,gBAAgB,CAAA;AAAA,MAAC;AAAA,MAEzB,UAAU,CAAC,EAAE,aAAa;AACzB,cAAM,SAAwC,CAAA;AAC9C,YAAI,CAAC,OAAO,aAAa;AACxB,iBAAO,KAAK,EAAE,MAAM,kBAAkB,OAAO,eAAe;AAAA,QAC7D;AACA,eAAO;AAAA,MACR;AAAA,MACA,SAAS,OAAO,EAAE,aAAa;AAC9B,eAAO,MAAM,mBAAmB;AAAA,UAC/B,aAAa,OAAO;AAAA,UACpB,OAAO,OAAO;AAAA,QAAA,CACd;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MAEb;AAAA,IAAA;AAAA,IArBF;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAC;AAAAA,EAAA;AAwBF;AAEA,MAAM,eAA8F;AAAA,EACnG,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,oBAAoB;AACrB;;;"}
|