@greatapps/common 1.1.170 → 1.1.173
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/package.json +1 -1
- package/src/modules/auth/schema.ts +1 -0
- package/src/modules/auth/services/auth.service.ts +1 -0
- package/dist/components/account/AccountModals.mjs +0 -18
- package/dist/components/account/AccountModals.mjs.map +0 -1
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -132
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +0 -45
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +0 -45
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +0 -1
- package/dist/components/account/DeleteAccountModal.mjs +0 -123
- package/dist/components/account/DeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +0 -67
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +0 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +0 -42
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +0 -190
- package/dist/components/account/TwoFactorAuthModal.mjs.map +0 -1
- package/dist/components/account/constants.mjs +0 -29
- package/dist/components/account/constants.mjs.map +0 -1
- package/dist/components/account/hooks/useChangeEmailForm.mjs +0 -53
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +0 -1
- package/dist/components/account/hooks/useChangePasswordForm.mjs +0 -47
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +0 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs +0 -64
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +0 -1
- package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -33
- package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +0 -54
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +0 -1
- package/dist/components/account/hooks/useOtpVerification.mjs +0 -94
- package/dist/components/account/hooks/useOtpVerification.mjs.map +0 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +0 -80
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +0 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +0 -180
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +0 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +0 -64
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +0 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +0 -182
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +0 -1
- package/dist/components/account/sections/MyProfileSection.mjs +0 -303
- package/dist/components/account/sections/MyProfileSection.mjs.map +0 -1
- package/dist/components/account/sections/PreferencesSection.mjs +0 -250
- package/dist/components/account/sections/PreferencesSection.mjs.map +0 -1
- package/dist/components/account/sections/SecuritySection.mjs +0 -147
- package/dist/components/account/sections/SecuritySection.mjs.map +0 -1
- package/dist/components/handlers/SearchParamsHandler.mjs +0 -24
- package/dist/components/handlers/SearchParamsHandler.mjs.map +0 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +0 -115
- package/dist/components/layouts/AppMobileNavBar.mjs.map +0 -1
- package/dist/components/layouts/AppNavBar.mjs +0 -49
- package/dist/components/layouts/AppNavBar.mjs.map +0 -1
- package/dist/components/layouts/MainLayout.mjs +0 -60
- package/dist/components/layouts/MainLayout.mjs.map +0 -1
- package/dist/components/layouts/MdSideBarNavigation.mjs +0 -54
- package/dist/components/layouts/MdSideBarNavigation.mjs.map +0 -1
- package/dist/components/layouts/NavBar.mjs +0 -132
- package/dist/components/layouts/NavBar.mjs.map +0 -1
- package/dist/components/layouts/NavBarItem.mjs +0 -23
- package/dist/components/layouts/NavBarItem.mjs.map +0 -1
- package/dist/components/layouts/NotificationsPopover.mjs +0 -97
- package/dist/components/layouts/NotificationsPopover.mjs.map +0 -1
- package/dist/components/layouts/ProfilePopover.mjs +0 -149
- package/dist/components/layouts/ProfilePopover.mjs.map +0 -1
- package/dist/components/layouts/SideBarNavigation.mjs +0 -22
- package/dist/components/layouts/SideBarNavigation.mjs.map +0 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +0 -230
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +0 -1
- package/dist/components/modals/ModalManager.mjs +0 -19
- package/dist/components/modals/ModalManager.mjs.map +0 -1
- package/dist/components/modals/Modals.mjs +0 -20
- package/dist/components/modals/Modals.mjs.map +0 -1
- package/dist/components/navigation/AppNavigation.mjs +0 -30
- package/dist/components/navigation/AppNavigation.mjs.map +0 -1
- package/dist/components/navigation/AppNavigationContext.mjs +0 -13
- package/dist/components/navigation/AppNavigationContext.mjs.map +0 -1
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs +0 -59
- package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +0 -1
- package/dist/components/navigation/NavItem.mjs +0 -35
- package/dist/components/navigation/NavItem.mjs.map +0 -1
- package/dist/components/navigation/NavItemsContext.mjs +0 -16
- package/dist/components/navigation/NavItemsContext.mjs.map +0 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +0 -128
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +0 -1
- package/dist/components/navigation/shells/DesktopShell.mjs +0 -11
- package/dist/components/navigation/shells/DesktopShell.mjs.map +0 -1
- package/dist/components/navigation/shells/MdShell.mjs +0 -11
- package/dist/components/navigation/shells/MdShell.mjs.map +0 -1
- package/dist/components/navigation/shells/MobileShell.mjs +0 -27
- package/dist/components/navigation/shells/MobileShell.mjs.map +0 -1
- package/dist/components/navigation/shells/TabsMobileShell.mjs +0 -59
- package/dist/components/navigation/shells/TabsMobileShell.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +0 -30
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/NavItems.mjs +0 -25
- package/dist/components/navigation/subcomponents/NavItems.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs +0 -25
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +0 -130
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +0 -1
- package/dist/components/navigation/types.mjs +0 -1
- package/dist/components/navigation/types.mjs.map +0 -1
- package/dist/components/pages/notifications/Notifications.mjs +0 -156
- package/dist/components/pages/notifications/Notifications.mjs.map +0 -1
- package/dist/components/ui/buttons/Button.mjs +0 -52
- package/dist/components/ui/buttons/Button.mjs.map +0 -1
- package/dist/components/ui/buttons/CancelButton.mjs +0 -17
- package/dist/components/ui/buttons/CancelButton.mjs.map +0 -1
- package/dist/components/ui/buttons/CopyButton.mjs +0 -42
- package/dist/components/ui/buttons/CopyButton.mjs.map +0 -1
- package/dist/components/ui/data-display/Accordion.mjs +0 -76
- package/dist/components/ui/data-display/Accordion.mjs.map +0 -1
- package/dist/components/ui/data-display/Badge.mjs +0 -42
- package/dist/components/ui/data-display/Badge.mjs.map +0 -1
- package/dist/components/ui/data-display/Card.mjs +0 -92
- package/dist/components/ui/data-display/Card.mjs.map +0 -1
- package/dist/components/ui/data-display/Pagination.mjs +0 -118
- package/dist/components/ui/data-display/Pagination.mjs.map +0 -1
- package/dist/components/ui/data-display/ScrollArea.mjs +0 -62
- package/dist/components/ui/data-display/ScrollArea.mjs.map +0 -1
- package/dist/components/ui/data-display/Separator.mjs +0 -28
- package/dist/components/ui/data-display/Separator.mjs.map +0 -1
- package/dist/components/ui/data-display/Table.mjs +0 -116
- package/dist/components/ui/data-display/Table.mjs.map +0 -1
- package/dist/components/ui/data-display/Tabs.mjs +0 -69
- package/dist/components/ui/data-display/Tabs.mjs.map +0 -1
- package/dist/components/ui/data-display/UserAvatar.mjs +0 -49
- package/dist/components/ui/data-display/UserAvatar.mjs.map +0 -1
- package/dist/components/ui/feedback/CircularProgress.mjs +0 -71
- package/dist/components/ui/feedback/CircularProgress.mjs.map +0 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +0 -50
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +0 -1
- package/dist/components/ui/feedback/LoadingOverlay.mjs +0 -19
- package/dist/components/ui/feedback/LoadingOverlay.mjs.map +0 -1
- package/dist/components/ui/feedback/Progress.mjs +0 -37
- package/dist/components/ui/feedback/Progress.mjs.map +0 -1
- package/dist/components/ui/feedback/Toast.mjs +0 -77
- package/dist/components/ui/feedback/Toast.mjs.map +0 -1
- package/dist/components/ui/form/Calendar.mjs +0 -204
- package/dist/components/ui/form/Calendar.mjs.map +0 -1
- package/dist/components/ui/form/Checkbox.mjs +0 -33
- package/dist/components/ui/form/Checkbox.mjs.map +0 -1
- package/dist/components/ui/form/ComboboxField.mjs +0 -130
- package/dist/components/ui/form/ComboboxField.mjs.map +0 -1
- package/dist/components/ui/form/DatePicker.mjs +0 -82
- package/dist/components/ui/form/DatePicker.mjs.map +0 -1
- package/dist/components/ui/form/DateRangePicker.mjs +0 -92
- package/dist/components/ui/form/DateRangePicker.mjs.map +0 -1
- package/dist/components/ui/form/FormField.mjs +0 -103
- package/dist/components/ui/form/FormField.mjs.map +0 -1
- package/dist/components/ui/form/Input.mjs +0 -21
- package/dist/components/ui/form/Input.mjs.map +0 -1
- package/dist/components/ui/form/InputOtp.mjs +0 -70
- package/dist/components/ui/form/InputOtp.mjs.map +0 -1
- package/dist/components/ui/form/PhoneInput.mjs +0 -78
- package/dist/components/ui/form/PhoneInput.mjs.map +0 -1
- package/dist/components/ui/form/RadioGroup.mjs +0 -37
- package/dist/components/ui/form/RadioGroup.mjs.map +0 -1
- package/dist/components/ui/form/Select.mjs +0 -179
- package/dist/components/ui/form/Select.mjs.map +0 -1
- package/dist/components/ui/form/SelectField.mjs +0 -80
- package/dist/components/ui/form/SelectField.mjs.map +0 -1
- package/dist/components/ui/form/Switch.mjs +0 -33
- package/dist/components/ui/form/Switch.mjs.map +0 -1
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs +0 -40
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +0 -1
- package/dist/components/ui/form/TextAreaField.mjs +0 -56
- package/dist/components/ui/form/TextAreaField.mjs.map +0 -1
- package/dist/components/ui/form/Textarea.mjs +0 -20
- package/dist/components/ui/form/Textarea.mjs.map +0 -1
- package/dist/components/ui/overlay/Command.mjs +0 -178
- package/dist/components/ui/overlay/Command.mjs.map +0 -1
- package/dist/components/ui/overlay/Dialog.mjs +0 -142
- package/dist/components/ui/overlay/Dialog.mjs.map +0 -1
- package/dist/components/ui/overlay/Popover.mjs +0 -46
- package/dist/components/ui/overlay/Popover.mjs.map +0 -1
- package/dist/components/ui/overlay/Sheet.mjs +0 -142
- package/dist/components/ui/overlay/Sheet.mjs.map +0 -1
- package/dist/components/ui/overlay/Tooltip.mjs +0 -57
- package/dist/components/ui/overlay/Tooltip.mjs.map +0 -1
- package/dist/components/widgets/notifications/NotificationCard.mjs +0 -54
- package/dist/components/widgets/notifications/NotificationCard.mjs.map +0 -1
- package/dist/enums/AccountSectionType.mjs +0 -11
- package/dist/enums/AccountSectionType.mjs.map +0 -1
- package/dist/hooks/copy-to-clipboard.hook.mjs +0 -52
- package/dist/hooks/copy-to-clipboard.hook.mjs.map +0 -1
- package/dist/hooks/useCountdownTimer.mjs +0 -29
- package/dist/hooks/useCountdownTimer.mjs.map +0 -1
- package/dist/hooks/useDebounce.mjs +0 -19
- package/dist/hooks/useDebounce.mjs.map +0 -1
- package/dist/hooks/useDebounceState.mjs +0 -12
- package/dist/hooks/useDebounceState.mjs.map +0 -1
- package/dist/hooks/useDebouncedEffect.mjs +0 -44
- package/dist/hooks/useDebouncedEffect.mjs.map +0 -1
- package/dist/hooks/useIsMobile.mjs +0 -18
- package/dist/hooks/useIsMobile.mjs.map +0 -1
- package/dist/hooks/usePasswordVisibility.mjs +0 -13
- package/dist/hooks/usePasswordVisibility.mjs.map +0 -1
- package/dist/index.mjs +0 -457
- package/dist/index.mjs.map +0 -1
- package/dist/infra/api/client.mjs +0 -136
- package/dist/infra/api/client.mjs.map +0 -1
- package/dist/infra/api/types.mjs +0 -31
- package/dist/infra/api/types.mjs.map +0 -1
- package/dist/infra/utils/client-info.mjs +0 -27
- package/dist/infra/utils/client-info.mjs.map +0 -1
- package/dist/infra/utils/clsx.mjs +0 -9
- package/dist/infra/utils/clsx.mjs.map +0 -1
- package/dist/infra/utils/params.mjs +0 -21
- package/dist/infra/utils/params.mjs.map +0 -1
- package/dist/infra/utils/parser.mjs +0 -24
- package/dist/infra/utils/parser.mjs.map +0 -1
- package/dist/infra/utils/percentage.mjs +0 -20
- package/dist/infra/utils/percentage.mjs.map +0 -1
- package/dist/middleware.mjs +0 -10
- package/dist/middleware.mjs.map +0 -1
- package/dist/middlewares/chain.mjs +0 -37
- package/dist/middlewares/chain.mjs.map +0 -1
- package/dist/middlewares/create-auth-middleware.mjs +0 -28
- package/dist/middlewares/create-auth-middleware.mjs.map +0 -1
- package/dist/middlewares/types.mjs +0 -11
- package/dist/middlewares/types.mjs.map +0 -1
- package/dist/modules/accounts/actions/account-management.action.mjs +0 -82
- package/dist/modules/accounts/actions/account-management.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/find-current-account.action.mjs +0 -10
- package/dist/modules/accounts/actions/find-current-account.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/list-currencies.action.mjs +0 -10
- package/dist/modules/accounts/actions/list-currencies.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/list-timezones.action.mjs +0 -10
- package/dist/modules/accounts/actions/list-timezones.action.mjs.map +0 -1
- package/dist/modules/accounts/hooks/current-account.hook.mjs +0 -24
- package/dist/modules/accounts/hooks/current-account.hook.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useAccountManagement.mjs +0 -71
- package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useCurrencies.mjs +0 -17
- package/dist/modules/accounts/hooks/useCurrencies.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useTimezones.mjs +0 -17
- package/dist/modules/accounts/hooks/useTimezones.mjs.map +0 -1
- package/dist/modules/accounts/services/account.service.mjs +0 -180
- package/dist/modules/accounts/services/account.service.mjs.map +0 -1
- package/dist/modules/accounts/services/currency.service.mjs +0 -24
- package/dist/modules/accounts/services/currency.service.mjs.map +0 -1
- package/dist/modules/accounts/services/timezone.service.mjs +0 -65
- package/dist/modules/accounts/services/timezone.service.mjs.map +0 -1
- package/dist/modules/accounts/services/two-factor.service.mjs +0 -77
- package/dist/modules/accounts/services/two-factor.service.mjs.map +0 -1
- package/dist/modules/accounts/types.mjs +0 -1
- package/dist/modules/accounts/types.mjs.map +0 -1
- package/dist/modules/auth/actions/login.action.mjs +0 -14
- package/dist/modules/auth/actions/login.action.mjs.map +0 -1
- package/dist/modules/auth/actions/logout.action.mjs +0 -14
- package/dist/modules/auth/actions/logout.action.mjs.map +0 -1
- package/dist/modules/auth/actions/register.action.mjs +0 -14
- package/dist/modules/auth/actions/register.action.mjs.map +0 -1
- package/dist/modules/auth/actions/validate-session.action.mjs +0 -60
- package/dist/modules/auth/actions/validate-session.action.mjs.map +0 -1
- package/dist/modules/auth/actions/verify-two-factor.action.mjs +0 -17
- package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +0 -1
- package/dist/modules/auth/hooks/login.hook.mjs +0 -13
- package/dist/modules/auth/hooks/login.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/logout.hook.mjs +0 -13
- package/dist/modules/auth/hooks/logout.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/register.hook.mjs +0 -13
- package/dist/modules/auth/hooks/register.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/useUserQuery.mjs +0 -63
- package/dist/modules/auth/hooks/useUserQuery.mjs.map +0 -1
- package/dist/modules/auth/schema.mjs +0 -1
- package/dist/modules/auth/schema.mjs.map +0 -1
- package/dist/modules/auth/services/auth.service.mjs +0 -293
- package/dist/modules/auth/services/auth.service.mjs.map +0 -1
- package/dist/modules/auth/utils/get-user-context.mjs +0 -24
- package/dist/modules/auth/utils/get-user-context.mjs.map +0 -1
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs +0 -10
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +0 -1
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs +0 -76
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs.map +0 -1
- package/dist/modules/ia-credits/services/ia-credits.service.mjs +0 -31
- package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +0 -1
- package/dist/modules/ia-credits/types.mjs +0 -25
- package/dist/modules/ia-credits/types.mjs.map +0 -1
- package/dist/modules/projects/actions/add-project-user.action.mjs +0 -10
- package/dist/modules/projects/actions/add-project-user.action.mjs.map +0 -1
- package/dist/modules/projects/actions/list-available-users.action.mjs +0 -10
- package/dist/modules/projects/actions/list-available-users.action.mjs.map +0 -1
- package/dist/modules/projects/actions/list-project-users.action.mjs +0 -10
- package/dist/modules/projects/actions/list-project-users.action.mjs.map +0 -1
- package/dist/modules/projects/actions/remove-project-user.action.mjs +0 -10
- package/dist/modules/projects/actions/remove-project-user.action.mjs.map +0 -1
- package/dist/modules/projects/hooks/list-available-users.hook.mjs +0 -34
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +0 -1
- package/dist/modules/projects/hooks/list-project-users.hook.mjs +0 -34
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +0 -1
- package/dist/modules/projects/services/project-users.service.mjs +0 -78
- package/dist/modules/projects/services/project-users.service.mjs.map +0 -1
- package/dist/modules/projects/types.mjs +0 -22
- package/dist/modules/projects/types.mjs.map +0 -1
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs +0 -10
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +0 -1
- package/dist/modules/subscriptions/constants/addons.constants.mjs +0 -12
- package/dist/modules/subscriptions/constants/addons.constants.mjs.map +0 -1
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs +0 -20
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +0 -1
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs +0 -18
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +0 -1
- package/dist/modules/subscriptions/services/subscriptions.service.mjs +0 -32
- package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +0 -1
- package/dist/modules/subscriptions/types.mjs +0 -57
- package/dist/modules/subscriptions/types.mjs.map +0 -1
- package/dist/modules/users/action/find-user-by-id.action.mjs +0 -10
- package/dist/modules/users/action/find-user-by-id.action.mjs.map +0 -1
- package/dist/modules/users/action/list-messages.action.mjs +0 -13
- package/dist/modules/users/action/list-messages.action.mjs.map +0 -1
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +0 -10
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +0 -1
- package/dist/modules/users/action/mark-message-as-read.action.mjs +0 -10
- package/dist/modules/users/action/mark-message-as-read.action.mjs.map +0 -1
- package/dist/modules/users/hooks/messages.hook.mjs +0 -57
- package/dist/modules/users/hooks/messages.hook.mjs.map +0 -1
- package/dist/modules/users/schema/messages.schema.mjs +0 -21
- package/dist/modules/users/schema/messages.schema.mjs.map +0 -1
- package/dist/modules/users/schema.mjs +0 -11
- package/dist/modules/users/schema.mjs.map +0 -1
- package/dist/modules/users/services/messages.service.mjs +0 -35
- package/dist/modules/users/services/messages.service.mjs.map +0 -1
- package/dist/modules/users/services/user.service.mjs +0 -50
- package/dist/modules/users/services/user.service.mjs.map +0 -1
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs +0 -15
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs.map +0 -1
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs +0 -21
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +0 -1
- package/dist/modules/whitelabel/schema.mjs +0 -1
- package/dist/modules/whitelabel/schema.mjs.map +0 -1
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs +0 -81
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs.map +0 -1
- package/dist/modules/whitelabel/services/whitelabel.service.mjs +0 -61
- package/dist/modules/whitelabel/services/whitelabel.service.mjs.map +0 -1
- package/dist/modules/whitelabel/styles-schema.mjs +0 -1
- package/dist/modules/whitelabel/styles-schema.mjs.map +0 -1
- package/dist/providers/auth.provider.mjs +0 -100
- package/dist/providers/auth.provider.mjs.map +0 -1
- package/dist/providers/query.provider.mjs +0 -99
- package/dist/providers/query.provider.mjs.map +0 -1
- package/dist/providers/whitelabel.provider.mjs +0 -31
- package/dist/providers/whitelabel.provider.mjs.map +0 -1
- package/dist/server.mjs +0 -84
- package/dist/server.mjs.map +0 -1
- package/dist/store/useAccountModals.mjs +0 -18
- package/dist/store/useAccountModals.mjs.map +0 -1
- package/dist/store/useMdSidebarStore.mjs +0 -11
- package/dist/store/useMdSidebarStore.mjs.map +0 -1
- package/dist/store/useMobileNavbarSheet.mjs +0 -14
- package/dist/store/useMobileNavbarSheet.mjs.map +0 -1
- package/dist/store/useModalManager.mjs +0 -75
- package/dist/store/useModalManager.mjs.map +0 -1
- package/dist/utils/browser/clipboard.mjs +0 -36
- package/dist/utils/browser/clipboard.mjs.map +0 -1
- package/dist/utils/file/index.mjs +0 -9
- package/dist/utils/file/index.mjs.map +0 -1
- package/dist/utils/format/masks.mjs +0 -56
- package/dist/utils/format/masks.mjs.map +0 -1
- package/dist/utils/intl/locales.mjs +0 -12
- package/dist/utils/intl/locales.mjs.map +0 -1
- package/dist/utils/safeServerAction.mjs +0 -16
- package/dist/utils/safeServerAction.mjs.map +0 -1
- package/dist/utils/validators/account.mjs +0 -26
- package/dist/utils/validators/account.mjs.map +0 -1
- package/dist/utils/validators/common.mjs +0 -47
- package/dist/utils/validators/common.mjs.map +0 -1
- package/dist/utils/withAction.mjs +0 -13
- package/dist/utils/withAction.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/infra/api/types.ts"],"sourcesContent":["import z from 'zod';\r\n\r\nexport const PaginationParamsSchema = z.object({\r\n page: z.number().min(1).optional().default(20),\r\n limit: z.number().optional().default(20),\r\n});\r\n\r\nexport interface PaginationParams extends z.infer<typeof PaginationParamsSchema> {}\r\n\r\nexport const SearchParamsSchema = z.object({\r\n search: z.string().optional(),\r\n});\r\n\r\nexport interface SearchParams extends z.infer<typeof SearchParamsSchema> {}\r\n\r\nexport const SortParamsSchema = z.object({\r\n sort: z.string().optional(),\r\n});\r\n\r\nexport interface SortParams extends z.infer<typeof SortParamsSchema> {}\r\n\r\nexport interface ApiSuccessResult<T> {\r\n status: 1;\r\n data?: T;\r\n}\r\n\r\nexport interface ApiPaginatedSuccessResult<T> extends Omit<ApiSuccessResult<T>, 'data'> {\r\n data: T[];\r\n total: number;\r\n}\r\n\r\nexport interface ApiErrorResult {\r\n status: 0;\r\n message: string;\r\n}\r\n\r\nexport type ApiActionResult<T> = ApiSuccessResult<T> | ApiErrorResult;\r\nexport type ApiPaginatedActionResult<T> = ApiPaginatedSuccessResult<T> | ApiErrorResult;\r\n\r\nexport interface SuccessResult<T> {\r\n success: true;\r\n data?: T;\r\n total?: number;\r\n}\r\n\r\nexport interface PaginatedSuccessResult<T> extends Omit<SuccessResult<T>, 'data'> {\r\n data: T[];\r\n total: number;\r\n}\r\n\r\nexport interface ErrorResult {\r\n success: false;\r\n error?: string;\r\n}\r\n\r\nexport type ActionResult<T> = SuccessResult<T> | ErrorResult;\r\nexport type PaginatedActionResult<T> = PaginatedSuccessResult<T> | ErrorResult;\r\n\r\nexport class ApiError extends Error {\r\n public readonly code: string;\r\n public readonly statusCode: number;\r\n\r\n constructor(message: string, code: string = 'UNKNOWN_ERROR', statusCode: number = 500) {\r\n super(message);\r\n this.name = 'ApiError';\r\n this.code = code;\r\n this.statusCode = statusCode;\r\n }\r\n\r\n static isApiError(error: unknown): error is ApiError {\r\n return error instanceof ApiError;\r\n }\r\n}\r\n\r\nexport interface ApiResponse<T = unknown> {\r\n status: 0 | 1;\r\n message?: string;\r\n data?: T;\r\n}\r\n"],"mappings":"AAAA,OAAO,OAAO;AAEP,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE;AAAA,EAC7C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE;AACzC,CAAC;AAIM,MAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,QAAQ,EAAE,OAAO,EAAE,SAAS;AAC9B,CAAC;AAIM,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,MAAM,EAAE,OAAO,EAAE,SAAS;AAC5B,CAAC;AAyCM,MAAM,iBAAiB,MAAM;AAAA,EAClB;AAAA,EACA;AAAA,EAEhB,YAAY,SAAiB,OAAe,iBAAiB,aAAqB,KAAK;AACrF,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,aAAa;AAAA,EACpB;AAAA,EAEA,OAAO,WAAW,OAAmC;AACnD,WAAO,iBAAiB;AAAA,EAC1B;AACF;","names":[]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { headers } from "next/headers";
|
|
2
|
-
async function getClientInfoFromRequest(request) {
|
|
3
|
-
let headerStore;
|
|
4
|
-
if (request) {
|
|
5
|
-
headerStore = request.headers;
|
|
6
|
-
} else {
|
|
7
|
-
const nextHeaders = await headers();
|
|
8
|
-
headerStore = nextHeaders;
|
|
9
|
-
}
|
|
10
|
-
return {
|
|
11
|
-
location: {
|
|
12
|
-
continent: headerStore.get("cf-ipcountry") || headerStore.get("x-vercel-ip-country") || "Unknown",
|
|
13
|
-
country: headerStore.get("x-vercel-ip-country") || "Unknown",
|
|
14
|
-
region: headerStore.get("x-vercel-ip-country-region") || "Unknown",
|
|
15
|
-
city: headerStore.get("x-vercel-ip-city") || "Unknown",
|
|
16
|
-
latitude: headerStore.get("x-vercel-ip-latitude") || "0",
|
|
17
|
-
longitude: headerStore.get("x-vercel-ip-longitude") || "0"
|
|
18
|
-
},
|
|
19
|
-
ip: headerStore.get("cf-connecting-ip") || headerStore.get("x-forwarded-for") || headerStore.get("x-real-ip") || "Unknown",
|
|
20
|
-
timezone: headerStore.get("cf-timezone") || "America/Sao_Paulo",
|
|
21
|
-
agent: headerStore.get("user-agent") || "Unknown"
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
getClientInfoFromRequest
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=client-info.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/infra/utils/client-info.ts"],"sourcesContent":["import { headers } from 'next/headers';\r\nimport { NextRequest } from 'next/server';\r\nimport { ClientInfo } from '../../modules/auth/schema';\r\n\r\nexport async function getClientInfoFromRequest(request?: NextRequest): Promise<ClientInfo> {\r\n let headerStore: Headers;\r\n\r\n if (request) {\r\n // Middleware context\r\n headerStore = request.headers;\r\n } else {\r\n // Server action context\r\n const nextHeaders = await headers();\r\n headerStore = nextHeaders as unknown as Headers;\r\n }\r\n\r\n return {\r\n location: {\r\n continent:\r\n headerStore.get('cf-ipcountry') || headerStore.get('x-vercel-ip-country') || 'Unknown',\r\n country: headerStore.get('x-vercel-ip-country') || 'Unknown',\r\n region: headerStore.get('x-vercel-ip-country-region') || 'Unknown',\r\n city: headerStore.get('x-vercel-ip-city') || 'Unknown',\r\n latitude: headerStore.get('x-vercel-ip-latitude') || '0',\r\n longitude: headerStore.get('x-vercel-ip-longitude') || '0',\r\n },\r\n ip:\r\n headerStore.get('cf-connecting-ip') ||\r\n headerStore.get('x-forwarded-for') ||\r\n headerStore.get('x-real-ip') ||\r\n 'Unknown',\r\n timezone: headerStore.get('cf-timezone') || 'America/Sao_Paulo',\r\n agent: headerStore.get('user-agent') || 'Unknown',\r\n };\r\n}\r\n"],"mappings":"AAAA,SAAS,eAAe;AAIxB,eAAsB,yBAAyB,SAA4C;AACzF,MAAI;AAEJ,MAAI,SAAS;AAEX,kBAAc,QAAQ;AAAA,EACxB,OAAO;AAEL,UAAM,cAAc,MAAM,QAAQ;AAClC,kBAAc;AAAA,EAChB;AAEA,SAAO;AAAA,IACL,UAAU;AAAA,MACR,WACE,YAAY,IAAI,cAAc,KAAK,YAAY,IAAI,qBAAqB,KAAK;AAAA,MAC/E,SAAS,YAAY,IAAI,qBAAqB,KAAK;AAAA,MACnD,QAAQ,YAAY,IAAI,4BAA4B,KAAK;AAAA,MACzD,MAAM,YAAY,IAAI,kBAAkB,KAAK;AAAA,MAC7C,UAAU,YAAY,IAAI,sBAAsB,KAAK;AAAA,MACrD,WAAW,YAAY,IAAI,uBAAuB,KAAK;AAAA,IACzD;AAAA,IACA,IACE,YAAY,IAAI,kBAAkB,KAClC,YAAY,IAAI,iBAAiB,KACjC,YAAY,IAAI,WAAW,KAC3B;AAAA,IACF,UAAU,YAAY,IAAI,aAAa,KAAK;AAAA,IAC5C,OAAO,YAAY,IAAI,YAAY,KAAK;AAAA,EAC1C;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/infra/utils/clsx.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":"AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;","names":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
function buildQueryParams(params) {
|
|
2
|
-
if (!params) {
|
|
3
|
-
return "";
|
|
4
|
-
}
|
|
5
|
-
const queryParams = new URLSearchParams();
|
|
6
|
-
for (const [key, value] of Object.entries(params)) {
|
|
7
|
-
if (value === null || value === void 0 || value === "") {
|
|
8
|
-
continue;
|
|
9
|
-
}
|
|
10
|
-
if (Array.isArray(value)) {
|
|
11
|
-
queryParams.set(key, value.join(","));
|
|
12
|
-
} else {
|
|
13
|
-
queryParams.set(key, value.toString());
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return queryParams.toString();
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
buildQueryParams
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=params.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/infra/utils/params.ts"],"sourcesContent":["export function buildQueryParams(\r\n params?: Record<\r\n string,\r\n string | number | boolean | Date | null | undefined | string[] | number[] | boolean[] | Date[]\r\n >\r\n) {\r\n if (!params) {\r\n return '';\r\n }\r\n\r\n const queryParams = new URLSearchParams();\r\n\r\n for (const [key, value] of Object.entries(params)) {\r\n if (value === null || value === undefined || value === '') {\r\n continue;\r\n }\r\n\r\n if (Array.isArray(value)) {\r\n queryParams.set(key, value.join(','));\r\n } else {\r\n\r\n queryParams.set(key, value.toString());\r\n }\r\n }\r\n\r\n return queryParams.toString();\r\n}\r\n"],"mappings":"AAAO,SAAS,iBACd,QAIA;AACA,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AAEA,QAAM,cAAc,IAAI,gBAAgB;AAExC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,QAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,IAAI;AACzD;AAAA,IACF;AAEA,QAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,kBAAY,IAAI,KAAK,MAAM,KAAK,GAAG,CAAC;AAAA,IACtC,OAAO;AAEL,kBAAY,IAAI,KAAK,MAAM,SAAS,CAAC;AAAA,IACvC;AAAA,EACF;AAEA,SAAO,YAAY,SAAS;AAC9B;","names":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
function parseSchema(schema, data) {
|
|
2
|
-
if (Array.isArray(data)) {
|
|
3
|
-
return data.map((item) => schema.parse(item));
|
|
4
|
-
}
|
|
5
|
-
return schema.parse(data);
|
|
6
|
-
}
|
|
7
|
-
function parseResult(schema, result) {
|
|
8
|
-
if (!result.data) return result;
|
|
9
|
-
if (Array.isArray(result.data)) {
|
|
10
|
-
return {
|
|
11
|
-
...result,
|
|
12
|
-
data: result.data.map((item) => schema.parse(item))
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
...result,
|
|
17
|
-
data: schema.parse(result.data)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
parseResult,
|
|
22
|
-
parseSchema
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=parser.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/infra/utils/parser.ts"],"sourcesContent":["import z, { ZodTypeAny } from \"zod\";\nimport { PaginatedSuccessResult, SuccessResult } from \"../api/types\";\n\n/* Overloads */\nexport function parseSchema<T extends ZodTypeAny>(\n schema: T,\n data: unknown[]\n): z.infer<T>[];\n\nexport function parseSchema<T extends ZodTypeAny>(\n schema: T,\n data: unknown\n): z.infer<T>;\n\nexport function parseSchema<T extends ZodTypeAny>(\n schema: T,\n data: unknown | unknown[]\n) {\n if (Array.isArray(data)) {\n return data.map(item => schema.parse(item));\n }\n\n return schema.parse(data);\n}\n\nexport function parseResult<T extends ZodTypeAny>(\n schema: T,\n result: PaginatedSuccessResult<unknown>\n): PaginatedSuccessResult<z.infer<T>>;\n\nexport function parseResult<T extends ZodTypeAny>(\n schema: T,\n result: SuccessResult<unknown>\n): SuccessResult<z.infer<T>>;\n\nexport function parseResult<T extends ZodTypeAny>(\n schema: T,\n result: SuccessResult<unknown> | PaginatedSuccessResult<unknown>\n) {\n if (!result.data) return result;\n\n if (Array.isArray(result.data)) {\n return {\n ...result,\n data: result.data.map(item => schema.parse(item)),\n };\n }\n\n return {\n ...result,\n data: schema.parse(result.data),\n };\n}"],"mappings":"AAcO,SAAS,YACZ,QACA,MACF;AACE,MAAI,MAAM,QAAQ,IAAI,GAAG;AACrB,WAAO,KAAK,IAAI,UAAQ,OAAO,MAAM,IAAI,CAAC;AAAA,EAC9C;AAEA,SAAO,OAAO,MAAM,IAAI;AAC5B;AAYO,SAAS,YACZ,QACA,QACF;AACE,MAAI,CAAC,OAAO,KAAM,QAAO;AAEzB,MAAI,MAAM,QAAQ,OAAO,IAAI,GAAG;AAC5B,WAAO;AAAA,MACH,GAAG;AAAA,MACH,MAAM,OAAO,KAAK,IAAI,UAAQ,OAAO,MAAM,IAAI,CAAC;AAAA,IACpD;AAAA,EACJ;AAEA,SAAO;AAAA,IACH,GAAG;AAAA,IACH,MAAM,OAAO,MAAM,OAAO,IAAI;AAAA,EAClC;AACJ;","names":[]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const calculatePercentage = (current, total) => {
|
|
2
|
-
if (total === 0) return 0;
|
|
3
|
-
return current / total * 100;
|
|
4
|
-
};
|
|
5
|
-
const calculateCircumference = (radius) => {
|
|
6
|
-
return 2 * Math.PI * radius;
|
|
7
|
-
};
|
|
8
|
-
const calculateCircularProgressOffset = (percentage, circumference) => {
|
|
9
|
-
return circumference - percentage / 100 * circumference;
|
|
10
|
-
};
|
|
11
|
-
const calculateRadius = (size, strokeWidth) => {
|
|
12
|
-
return (size - strokeWidth) / 2;
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
calculateCircularProgressOffset,
|
|
16
|
-
calculateCircumference,
|
|
17
|
-
calculatePercentage,
|
|
18
|
-
calculateRadius
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=percentage.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/infra/utils/percentage.ts"],"sourcesContent":["/**\n * Calcula percentual de um valor em relação ao total\n * @param current - Valor atual\n * @param total - Valor total\n * @returns Percentual (0-100)\n */\nexport const calculatePercentage = (current: number, total: number): number => {\n if (total === 0) return 0;\n return (current / total) * 100;\n};\n\n/**\n * Calcula a circunferência de um círculo\n * @param radius - Raio do círculo\n * @returns Circunferência\n */\nexport const calculateCircumference = (radius: number): number => {\n return 2 * Math.PI * radius;\n};\n\n/**\n * Calcula o offset para circular progress\n * @param percentage - Percentual de progresso (0-100)\n * @param circumference - Circunferência do círculo\n * @returns Valor do offset\n */\nexport const calculateCircularProgressOffset = (\n percentage: number,\n circumference: number\n): number => {\n return circumference - (percentage / 100) * circumference;\n};\n\n/**\n * Calcula raio de círculo baseado no tamanho e stroke\n * @param size - Tamanho total\n * @param strokeWidth - Largura do stroke\n * @returns Raio calculado\n */\nexport const calculateRadius = (size: number, strokeWidth: number): number => {\n return (size - strokeWidth) / 2;\n};\n"],"mappings":"AAMO,MAAM,sBAAsB,CAAC,SAAiB,UAA0B;AAC7E,MAAI,UAAU,EAAG,QAAO;AACxB,SAAQ,UAAU,QAAS;AAC7B;AAOO,MAAM,yBAAyB,CAAC,WAA2B;AAChE,SAAO,IAAI,KAAK,KAAK;AACvB;AAQO,MAAM,kCAAkC,CAC7C,YACA,kBACW;AACX,SAAO,gBAAiB,aAAa,MAAO;AAC9C;AAQO,MAAM,kBAAkB,CAAC,MAAc,gBAAgC;AAC5E,UAAQ,OAAO,eAAe;AAChC;","names":[]}
|
package/dist/middleware.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createAuthMiddleware } from "./middlewares/create-auth-middleware";
|
|
2
|
-
import { createMiddlewareChain } from "./middlewares/chain";
|
|
3
|
-
import { continueChain, stopChain } from "./middlewares/types";
|
|
4
|
-
export {
|
|
5
|
-
continueChain,
|
|
6
|
-
createAuthMiddleware,
|
|
7
|
-
createMiddlewareChain,
|
|
8
|
-
stopChain
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=middleware.mjs.map
|
package/dist/middleware.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/middleware.ts"],"sourcesContent":["export { createAuthMiddleware } from './middlewares/create-auth-middleware';\nexport { createMiddlewareChain } from './middlewares/chain';\nexport type { MiddlewareConfig, MiddlewareFunction, MiddlewareResult } from './middlewares/types';\nexport { continueChain, stopChain } from './middlewares/types';\n"],"mappings":"AAAA,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AAEtC,SAAS,eAAe,iBAAiB;","names":[]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
|
-
function shouldProcessPath(pathname, config) {
|
|
3
|
-
const { excludePaths, includePaths } = config;
|
|
4
|
-
if (excludePaths?.length) {
|
|
5
|
-
const isExcluded = excludePaths.some(
|
|
6
|
-
(path) => pathname === path || pathname.startsWith(`${path}/`)
|
|
7
|
-
);
|
|
8
|
-
if (isExcluded) return false;
|
|
9
|
-
}
|
|
10
|
-
if (includePaths?.length) {
|
|
11
|
-
return includePaths.some((path) => pathname === path || pathname.startsWith(`${path}/`));
|
|
12
|
-
}
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
function createMiddlewareChain(middlewares) {
|
|
16
|
-
return async function chainedMiddleware(request) {
|
|
17
|
-
const { pathname } = request.nextUrl;
|
|
18
|
-
let currentRequest = request;
|
|
19
|
-
for (const middleware of middlewares) {
|
|
20
|
-
if (!shouldProcessPath(pathname, middleware)) {
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
const result = await middleware.handler(currentRequest);
|
|
24
|
-
if (result.type === "response") {
|
|
25
|
-
return result.response;
|
|
26
|
-
}
|
|
27
|
-
if (result.request) {
|
|
28
|
-
currentRequest = result.request;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return NextResponse.next();
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export {
|
|
35
|
-
createMiddlewareChain
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=chain.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/middlewares/chain.ts"],"sourcesContent":["import { NextRequest, NextResponse } from 'next/server';\r\n\r\nimport { MiddlewareConfig } from './types';\r\n\r\nfunction shouldProcessPath(pathname: string, config: MiddlewareConfig): boolean {\r\n const { excludePaths, includePaths } = config;\r\n\r\n if (excludePaths?.length) {\r\n const isExcluded = excludePaths.some(\r\n (path) => pathname === path || pathname.startsWith(`${path}/`)\r\n );\r\n if (isExcluded) return false;\r\n }\r\n\r\n if (includePaths?.length) {\r\n return includePaths.some((path) => pathname === path || pathname.startsWith(`${path}/`));\r\n }\r\n\r\n return true;\r\n}\r\n\r\nexport function createMiddlewareChain(middlewares: MiddlewareConfig[]) {\r\n return async function chainedMiddleware(request: NextRequest): Promise<NextResponse> {\r\n const { pathname } = request.nextUrl;\r\n let currentRequest = request;\r\n\r\n for (const middleware of middlewares) {\r\n if (!shouldProcessPath(pathname, middleware)) {\r\n continue;\r\n }\r\n\r\n const result = await middleware.handler(currentRequest);\r\n\r\n if (result.type === 'response') {\r\n return result.response;\r\n }\r\n\r\n if (result.request) {\r\n currentRequest = result.request;\r\n }\r\n }\r\n\r\n return NextResponse.next();\r\n };\r\n}\r\n"],"mappings":"AAAA,SAAsB,oBAAoB;AAI1C,SAAS,kBAAkB,UAAkB,QAAmC;AAC9E,QAAM,EAAE,cAAc,aAAa,IAAI;AAEvC,MAAI,cAAc,QAAQ;AACxB,UAAM,aAAa,aAAa;AAAA,MAC9B,CAAC,SAAS,aAAa,QAAQ,SAAS,WAAW,GAAG,IAAI,GAAG;AAAA,IAC/D;AACA,QAAI,WAAY,QAAO;AAAA,EACzB;AAEA,MAAI,cAAc,QAAQ;AACxB,WAAO,aAAa,KAAK,CAAC,SAAS,aAAa,QAAQ,SAAS,WAAW,GAAG,IAAI,GAAG,CAAC;AAAA,EACzF;AAEA,SAAO;AACT;AAEO,SAAS,sBAAsB,aAAiC;AACrE,SAAO,eAAe,kBAAkB,SAA6C;AACnF,UAAM,EAAE,SAAS,IAAI,QAAQ;AAC7B,QAAI,iBAAiB;AAErB,eAAW,cAAc,aAAa;AACpC,UAAI,CAAC,kBAAkB,UAAU,UAAU,GAAG;AAC5C;AAAA,MACF;AAEA,YAAM,SAAS,MAAM,WAAW,QAAQ,cAAc;AAEtD,UAAI,OAAO,SAAS,YAAY;AAC9B,eAAO,OAAO;AAAA,MAChB;AAEA,UAAI,OAAO,SAAS;AAClB,yBAAiB,OAAO;AAAA,MAC1B;AAAA,IACF;AAEA,WAAO,aAAa,KAAK;AAAA,EAC3B;AACF;","names":[]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
|
-
import { continueChain, stopChain } from "./types";
|
|
3
|
-
function isRouteEquals(pathname, routes) {
|
|
4
|
-
return routes.some((route) => pathname === route || pathname.startsWith(`${route}/`));
|
|
5
|
-
}
|
|
6
|
-
function createAuthMiddleware(options) {
|
|
7
|
-
return (request) => {
|
|
8
|
-
const { pathname } = request.nextUrl;
|
|
9
|
-
const token = process.env.DUMMY_AUTH_TOKEN || request.cookies.get("greatapps")?.value;
|
|
10
|
-
const isPublicRoute = isRouteEquals(pathname, options?.publicRoutes || []);
|
|
11
|
-
const isAuthRoute = isRouteEquals(pathname, options?.authRoutes || []);
|
|
12
|
-
if (token && isAuthRoute) {
|
|
13
|
-
return stopChain(NextResponse.redirect(new URL("/", request.url)));
|
|
14
|
-
}
|
|
15
|
-
if (!token && !isPublicRoute && !isAuthRoute) {
|
|
16
|
-
const loginUrl = new URL("/login", request.url);
|
|
17
|
-
if (pathname !== "/") {
|
|
18
|
-
loginUrl.searchParams.set("redirect", pathname);
|
|
19
|
-
}
|
|
20
|
-
return stopChain(NextResponse.redirect(loginUrl));
|
|
21
|
-
}
|
|
22
|
-
return continueChain();
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export {
|
|
26
|
-
createAuthMiddleware
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=create-auth-middleware.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/middlewares/create-auth-middleware.ts"],"sourcesContent":["import { NextRequest, NextResponse } from 'next/server';\r\n\r\nimport { continueChain, MiddlewareConfig, MiddlewareFunction, MiddlewareResult, stopChain } from './types';\r\n\r\nfunction isRouteEquals(pathname: string, routes: string[]): boolean {\r\n return routes.some((route) => pathname === route || pathname.startsWith(`${route}/`));\r\n}\r\n\r\ninterface CreateAuthMiddlewareOptions {\r\n publicRoutes?: string[];\r\n authRoutes?: string[];\r\n}\r\n\r\nexport function createAuthMiddleware(options?: CreateAuthMiddlewareOptions): MiddlewareFunction {\r\n return (request: NextRequest) => {\r\n const { pathname } = request.nextUrl;\r\n const token = process.env.DUMMY_AUTH_TOKEN || request.cookies.get('greatapps')?.value;\r\n const isPublicRoute = isRouteEquals(pathname, options?.publicRoutes || []);\r\n const isAuthRoute = isRouteEquals(pathname, options?.authRoutes || []);\r\n\r\n if (token && isAuthRoute) {\r\n return stopChain(NextResponse.redirect(new URL('/', request.url)));\r\n }\r\n\r\n if (!token && !isPublicRoute && !isAuthRoute) {\r\n const loginUrl = new URL('/login', request.url);\r\n\r\n if (pathname !== '/') {\r\n loginUrl.searchParams.set('redirect', pathname);\r\n }\r\n\r\n return stopChain(NextResponse.redirect(loginUrl));\r\n }\r\n\r\n return continueChain();\r\n }\r\n}"],"mappings":"AAAA,SAAsB,oBAAoB;AAE1C,SAAS,eAAuE,iBAAiB;AAEjG,SAAS,cAAc,UAAkB,QAA2B;AAClE,SAAO,OAAO,KAAK,CAAC,UAAU,aAAa,SAAS,SAAS,WAAW,GAAG,KAAK,GAAG,CAAC;AACtF;AAOO,SAAS,qBAAqB,SAA2D;AAC9F,SAAO,CAAC,YAAyB;AAC/B,UAAM,EAAE,SAAS,IAAI,QAAQ;AAC7B,UAAM,QAAQ,QAAQ,IAAI,oBAAoB,QAAQ,QAAQ,IAAI,WAAW,GAAG;AAChF,UAAM,gBAAgB,cAAc,UAAU,SAAS,gBAAgB,CAAC,CAAC;AACzE,UAAM,cAAc,cAAc,UAAU,SAAS,cAAc,CAAC,CAAC;AAErE,QAAI,SAAS,aAAa;AACxB,aAAO,UAAU,aAAa,SAAS,IAAI,IAAI,KAAK,QAAQ,GAAG,CAAC,CAAC;AAAA,IACnE;AAEA,QAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,aAAa;AAC5C,YAAM,WAAW,IAAI,IAAI,UAAU,QAAQ,GAAG;AAE9C,UAAI,aAAa,KAAK;AACpB,iBAAS,aAAa,IAAI,YAAY,QAAQ;AAAA,MAChD;AAEA,aAAO,UAAU,aAAa,SAAS,QAAQ,CAAC;AAAA,IAClD;AAEA,WAAO,cAAc;AAAA,EACvB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/middlewares/types.ts"],"sourcesContent":["import { NextRequest, NextResponse } from 'next/server';\r\n\r\nexport type MiddlewareResult =\r\n | { type: 'response'; response: NextResponse }\r\n | { type: 'next'; request?: NextRequest };\r\n\r\nexport type MiddlewareFunction = (\r\n request: NextRequest\r\n) => MiddlewareResult | Promise<MiddlewareResult>;\r\n\r\nexport interface MiddlewareConfig {\r\n name: string;\r\n handler: MiddlewareFunction;\r\n excludePaths?: string[];\r\n includePaths?: string[];\r\n}\r\n\r\nexport function continueChain(request?: NextRequest): MiddlewareResult {\r\n return { type: 'next', request };\r\n}\r\n\r\nexport function stopChain(response: NextResponse): MiddlewareResult {\r\n return { type: 'response', response };\r\n}\r\n"],"mappings":"AAiBO,SAAS,cAAc,SAAyC;AACrE,SAAO,EAAE,MAAM,QAAQ,QAAQ;AACjC;AAEO,SAAS,UAAU,UAA0C;AAClE,SAAO,EAAE,MAAM,YAAY,SAAS;AACtC;","names":[]}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { accountService } from "../services/account.service";
|
|
4
|
-
import { twoFactorService } from "../services/two-factor.service";
|
|
5
|
-
async function listAccountUsersAction(params) {
|
|
6
|
-
return safeServerAction(async () => {
|
|
7
|
-
const { users, total } = await accountService.listAccountUsers(params);
|
|
8
|
-
return { data: users, total };
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
async function updateUserAction(user) {
|
|
12
|
-
return safeServerAction(() => accountService.updateAccountUser(user));
|
|
13
|
-
}
|
|
14
|
-
async function updateAccountUserByIdAction(userId, user) {
|
|
15
|
-
return safeServerAction(() => accountService.updateAccountUserById(userId, user));
|
|
16
|
-
}
|
|
17
|
-
async function updateAccountAction(data) {
|
|
18
|
-
return safeServerAction(() => accountService.updateAccount(data));
|
|
19
|
-
}
|
|
20
|
-
async function deleteAccountUserAction(userId) {
|
|
21
|
-
return safeServerAction(() => accountService.deleteAccountUser(userId));
|
|
22
|
-
}
|
|
23
|
-
async function deleteAccountAction() {
|
|
24
|
-
return safeServerAction(() => accountService.deleteAccount());
|
|
25
|
-
}
|
|
26
|
-
async function createAccountUserAction(user) {
|
|
27
|
-
return safeServerAction(() => accountService.createAccountUser(user));
|
|
28
|
-
}
|
|
29
|
-
async function changePasswordAction(data) {
|
|
30
|
-
return safeServerAction(() => accountService.changePassword(data));
|
|
31
|
-
}
|
|
32
|
-
async function requestEmailChangeAction(newEmail) {
|
|
33
|
-
return safeServerAction(() => accountService.requestContactReset("email", newEmail));
|
|
34
|
-
}
|
|
35
|
-
async function confirmEmailChangeAction(token, newEmail) {
|
|
36
|
-
return safeServerAction(() => accountService.confirmContactReset("email", token, newEmail));
|
|
37
|
-
}
|
|
38
|
-
async function requestPhoneChangeAction(newPhone) {
|
|
39
|
-
return safeServerAction(() => accountService.requestContactReset("phone", newPhone));
|
|
40
|
-
}
|
|
41
|
-
async function confirmPhoneChangeAction(token, newPhone) {
|
|
42
|
-
return safeServerAction(() => accountService.confirmContactReset("phone", token, newPhone));
|
|
43
|
-
}
|
|
44
|
-
async function generateTwoFactorAction() {
|
|
45
|
-
return safeServerAction(async () => {
|
|
46
|
-
const result = await twoFactorService.generate();
|
|
47
|
-
return {
|
|
48
|
-
qrcode: result.data.qrcode,
|
|
49
|
-
backupCodes: result.data.backup_codes
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
async function confirmTwoFactorAction(code) {
|
|
54
|
-
return safeServerAction(async () => {
|
|
55
|
-
await twoFactorService.confirm(code);
|
|
56
|
-
await accountService.updateAccountUser({ two_factor_authentication: true });
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
async function disableTwoFactorAction(code) {
|
|
60
|
-
return safeServerAction(async () => {
|
|
61
|
-
await twoFactorService.verify(code);
|
|
62
|
-
await twoFactorService.disable();
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
changePasswordAction,
|
|
67
|
-
confirmEmailChangeAction,
|
|
68
|
-
confirmPhoneChangeAction,
|
|
69
|
-
confirmTwoFactorAction,
|
|
70
|
-
createAccountUserAction,
|
|
71
|
-
deleteAccountAction,
|
|
72
|
-
deleteAccountUserAction,
|
|
73
|
-
disableTwoFactorAction,
|
|
74
|
-
generateTwoFactorAction,
|
|
75
|
-
listAccountUsersAction,
|
|
76
|
-
requestEmailChangeAction,
|
|
77
|
-
requestPhoneChangeAction,
|
|
78
|
-
updateAccountAction,
|
|
79
|
-
updateAccountUserByIdAction,
|
|
80
|
-
updateUserAction
|
|
81
|
-
};
|
|
82
|
-
//# sourceMappingURL=account-management.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/actions/account-management.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { accountService } from '../services/account.service';\nimport type {\n AccountUsersPaginationParams,\n ChangePasswordRequest,\n CreateAccountUserRequest,\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n} from '../types';\nimport { twoFactorService } from '../services/two-factor.service';\n\nexport async function listAccountUsersAction(params?: AccountUsersPaginationParams) {\n return safeServerAction(async () => {\n const { users, total } = await accountService.listAccountUsers(params);\n return { data: users, total };\n });\n}\n\nexport async function updateUserAction(user: UpdateAccountUserRequest) {\n return safeServerAction(() => accountService.updateAccountUser(user));\n}\n\nexport async function updateAccountUserByIdAction(\n userId: number,\n user: UpdateAccountUserRequest\n) {\n return safeServerAction(() => accountService.updateAccountUserById(userId, user));\n}\n\nexport async function updateAccountAction(data: UpdateAccountRequest) {\n return safeServerAction(() => accountService.updateAccount(data));\n}\n\nexport async function deleteAccountUserAction(userId: number) {\n return safeServerAction(() => accountService.deleteAccountUser(userId));\n}\n\nexport async function deleteAccountAction() {\n return safeServerAction(() => accountService.deleteAccount());\n}\n\nexport async function createAccountUserAction(user: CreateAccountUserRequest) {\n return safeServerAction(() => accountService.createAccountUser(user));\n}\n\nexport async function changePasswordAction(data: ChangePasswordRequest) {\n return safeServerAction(() => accountService.changePassword(data));\n}\n\nexport async function requestEmailChangeAction(newEmail: string) {\n return safeServerAction(() => accountService.requestContactReset('email', newEmail));\n}\n\nexport async function confirmEmailChangeAction(token: string, newEmail: string) {\n return safeServerAction(() => accountService.confirmContactReset('email', token, newEmail));\n}\n\nexport async function requestPhoneChangeAction(newPhone: string) {\n return safeServerAction(() => accountService.requestContactReset('phone', newPhone));\n}\n\nexport async function confirmPhoneChangeAction(token: string, newPhone: string) {\n return safeServerAction(() => accountService.confirmContactReset('phone', token, newPhone));\n}\n\nexport async function generateTwoFactorAction() {\n return safeServerAction(async () => {\n const result = await twoFactorService.generate();\n return {\n qrcode: result.data.qrcode,\n backupCodes: result.data.backup_codes,\n };\n });\n}\n\nexport async function confirmTwoFactorAction(code: string) {\n return safeServerAction(async () => {\n await twoFactorService.confirm(code);\n await accountService.updateAccountUser({ two_factor_authentication: true });\n });\n}\n\nexport async function disableTwoFactorAction(code: string) {\n return safeServerAction(async () => {\n await twoFactorService.verify(code);\n await twoFactorService.disable();\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAQ/B,SAAS,wBAAwB;AAEjC,eAAsB,uBAAuB,QAAuC;AAClF,SAAO,iBAAiB,YAAY;AAClC,UAAM,EAAE,OAAO,MAAM,IAAI,MAAM,eAAe,iBAAiB,MAAM;AACrE,WAAO,EAAE,MAAM,OAAO,MAAM;AAAA,EAC9B,CAAC;AACH;AAEA,eAAsB,iBAAiB,MAAgC;AACrE,SAAO,iBAAiB,MAAM,eAAe,kBAAkB,IAAI,CAAC;AACtE;AAEA,eAAsB,4BACpB,QACA,MACA;AACA,SAAO,iBAAiB,MAAM,eAAe,sBAAsB,QAAQ,IAAI,CAAC;AAClF;AAEA,eAAsB,oBAAoB,MAA4B;AACpE,SAAO,iBAAiB,MAAM,eAAe,cAAc,IAAI,CAAC;AAClE;AAEA,eAAsB,wBAAwB,QAAgB;AAC5D,SAAO,iBAAiB,MAAM,eAAe,kBAAkB,MAAM,CAAC;AACxE;AAEA,eAAsB,sBAAsB;AAC1C,SAAO,iBAAiB,MAAM,eAAe,cAAc,CAAC;AAC9D;AAEA,eAAsB,wBAAwB,MAAgC;AAC5E,SAAO,iBAAiB,MAAM,eAAe,kBAAkB,IAAI,CAAC;AACtE;AAEA,eAAsB,qBAAqB,MAA6B;AACtE,SAAO,iBAAiB,MAAM,eAAe,eAAe,IAAI,CAAC;AACnE;AAEA,eAAsB,yBAAyB,UAAkB;AAC/D,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,QAAQ,CAAC;AACrF;AAEA,eAAsB,yBAAyB,OAAe,UAAkB;AAC9E,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,OAAO,QAAQ,CAAC;AAC5F;AAEA,eAAsB,yBAAyB,UAAkB;AAC/D,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,QAAQ,CAAC;AACrF;AAEA,eAAsB,yBAAyB,OAAe,UAAkB;AAC9E,SAAO,iBAAiB,MAAM,eAAe,oBAAoB,SAAS,OAAO,QAAQ,CAAC;AAC5F;AAEA,eAAsB,0BAA0B;AAC9C,SAAO,iBAAiB,YAAY;AAClC,UAAM,SAAS,MAAM,iBAAiB,SAAS;AAC/C,WAAO;AAAA,MACL,QAAQ,OAAO,KAAK;AAAA,MACpB,aAAa,OAAO,KAAK;AAAA,IAC3B;AAAA,EACF,CAAC;AACH;AAEA,eAAsB,uBAAuB,MAAc;AACzD,SAAO,iBAAiB,YAAY;AAClC,UAAM,iBAAiB,QAAQ,IAAI;AACnC,UAAM,eAAe,kBAAkB,EAAE,2BAA2B,KAAK,CAAC;AAAA,EAC5E,CAAC;AACH;AAEA,eAAsB,uBAAuB,MAAc;AACzD,SAAO,iBAAiB,YAAY;AAClC,UAAM,iBAAiB,OAAO,IAAI;AAClC,UAAM,iBAAiB,QAAQ;AAAA,EACjC,CAAC;AACH;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { accountService } from "../services/account.service";
|
|
4
|
-
async function findCurrentAccount() {
|
|
5
|
-
return safeServerAction(() => accountService.findCurrentAccount());
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
findCurrentAccount
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=find-current-account.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/actions/find-current-account.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { accountService } from '../services/account.service';\nimport type { Account } from '../types';\n\nexport async function findCurrentAccount() {\n return safeServerAction<Account>(() => accountService.findCurrentAccount());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAG/B,eAAsB,qBAAqB;AACzC,SAAO,iBAA0B,MAAM,eAAe,mBAAmB,CAAC;AAC5E;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { currencyService } from "../services/currency.service";
|
|
4
|
-
async function listCurrenciesAction() {
|
|
5
|
-
return safeServerAction(() => currencyService.fetchOptions());
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
listCurrenciesAction
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=list-currencies.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/actions/list-currencies.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { currencyService } from '../services/currency.service';\n\nexport async function listCurrenciesAction() {\n return safeServerAction(() => currencyService.fetchOptions());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,eAAsB,uBAAuB;AAC3C,SAAO,iBAAiB,MAAM,gBAAgB,aAAa,CAAC;AAC9D;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { timezoneService } from "../services/timezone.service";
|
|
4
|
-
async function listTimezonesAction() {
|
|
5
|
-
return safeServerAction(() => timezoneService.fetchOptions());
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
listTimezonesAction
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=list-timezones.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/actions/list-timezones.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { timezoneService } from '../services/timezone.service';\n\nexport async function listTimezonesAction() {\n return safeServerAction(() => timezoneService.fetchOptions());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,eAAsB,sBAAsB;AAC1C,SAAO,iBAAiB,MAAM,gBAAgB,aAAa,CAAC;AAC9D;","names":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
|
-
import { findCurrentAccount } from "../actions/find-current-account.action";
|
|
4
|
-
import { withAction } from "../../../utils/withAction";
|
|
5
|
-
const ACCOUNT_QUERY_KEY = ["account"];
|
|
6
|
-
function useCurrentAccount() {
|
|
7
|
-
return useQuery({
|
|
8
|
-
queryKey: ACCOUNT_QUERY_KEY,
|
|
9
|
-
queryFn: withAction(findCurrentAccount),
|
|
10
|
-
staleTime: 0,
|
|
11
|
-
gcTime: 10 * 60 * 1e3,
|
|
12
|
-
retry: false
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
function useInvalidateAccount() {
|
|
16
|
-
const queryClient = useQueryClient();
|
|
17
|
-
return () => queryClient.invalidateQueries({ queryKey: ACCOUNT_QUERY_KEY });
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
ACCOUNT_QUERY_KEY,
|
|
21
|
-
useCurrentAccount,
|
|
22
|
-
useInvalidateAccount
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=current-account.hook.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/hooks/current-account.hook.tsx"],"sourcesContent":["'use client';\n\nimport { useQuery, useQueryClient } from '@tanstack/react-query';\nimport { findCurrentAccount } from '../actions/find-current-account.action';\nimport { withAction } from '../../../utils/withAction';\n\nexport const ACCOUNT_QUERY_KEY = ['account'];\n\nexport function useCurrentAccount() {\n return useQuery({\n queryKey: ACCOUNT_QUERY_KEY,\n queryFn: withAction(findCurrentAccount),\n staleTime: 0,\n gcTime: 10 * 60 * 1000,\n retry: false,\n });\n}\n\nexport function useInvalidateAccount() {\n const queryClient = useQueryClient();\n return () => queryClient.invalidateQueries({ queryKey: ACCOUNT_QUERY_KEY });\n}\n"],"mappings":";AAEA,SAAS,UAAU,sBAAsB;AACzC,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAEpB,MAAM,oBAAoB,CAAC,SAAS;AAEpC,SAAS,oBAAoB;AAClC,SAAO,SAAS;AAAA,IACd,UAAU;AAAA,IACV,SAAS,WAAW,kBAAkB;AAAA,IACtC,WAAW;AAAA,IACX,QAAQ,KAAK,KAAK;AAAA,IAClB,OAAO;AAAA,EACT,CAAC;AACH;AAEO,SAAS,uBAAuB;AACrC,QAAM,cAAc,eAAe;AACnC,SAAO,MAAM,YAAY,kBAAkB,EAAE,UAAU,kBAAkB,CAAC;AAC5E;","names":[]}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
-
import { USER_QUERY_KEY } from "../../auth/hooks/useUserQuery";
|
|
4
|
-
import { ACCOUNT_QUERY_KEY } from "./current-account.hook";
|
|
5
|
-
import {
|
|
6
|
-
updateUserAction,
|
|
7
|
-
updateAccountAction,
|
|
8
|
-
updateAccountUserByIdAction,
|
|
9
|
-
deleteAccountUserAction,
|
|
10
|
-
deleteAccountAction
|
|
11
|
-
} from "../actions/account-management.action";
|
|
12
|
-
import { withAction } from "../../../utils/withAction";
|
|
13
|
-
const ACCOUNT_USERS_QUERY_KEY = ["account-users"];
|
|
14
|
-
function useUpdateAccount() {
|
|
15
|
-
const queryClient = useQueryClient();
|
|
16
|
-
return useMutation({
|
|
17
|
-
mutationFn: withAction(updateAccountAction),
|
|
18
|
-
onSuccess: () => {
|
|
19
|
-
queryClient.invalidateQueries({ queryKey: ACCOUNT_USERS_QUERY_KEY });
|
|
20
|
-
queryClient.invalidateQueries({ queryKey: ACCOUNT_QUERY_KEY });
|
|
21
|
-
queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
function useUpdateAccountUser() {
|
|
26
|
-
const queryClient = useQueryClient();
|
|
27
|
-
return useMutation({
|
|
28
|
-
mutationFn: withAction(updateUserAction),
|
|
29
|
-
onSuccess: () => {
|
|
30
|
-
queryClient.invalidateQueries({ queryKey: ACCOUNT_USERS_QUERY_KEY });
|
|
31
|
-
queryClient.invalidateQueries({ queryKey: ACCOUNT_QUERY_KEY });
|
|
32
|
-
queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
function useUpdateAccountUserById() {
|
|
37
|
-
const queryClient = useQueryClient();
|
|
38
|
-
return useMutation({
|
|
39
|
-
mutationFn: withAction(
|
|
40
|
-
({ userId, ...user }) => updateAccountUserByIdAction(userId, user)
|
|
41
|
-
),
|
|
42
|
-
onSuccess: () => {
|
|
43
|
-
queryClient.invalidateQueries({ queryKey: ACCOUNT_USERS_QUERY_KEY });
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function useDeleteAccountUser(options) {
|
|
48
|
-
const queryClient = useQueryClient();
|
|
49
|
-
return useMutation({
|
|
50
|
-
mutationFn: withAction(deleteAccountUserAction),
|
|
51
|
-
...options,
|
|
52
|
-
onSuccess: (...params) => {
|
|
53
|
-
options?.onSuccess?.(...params);
|
|
54
|
-
queryClient.invalidateQueries({ queryKey: ACCOUNT_USERS_QUERY_KEY });
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function useDeleteAccount(options) {
|
|
59
|
-
return useMutation({
|
|
60
|
-
mutationFn: withAction(deleteAccountAction),
|
|
61
|
-
...options
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
export {
|
|
65
|
-
useDeleteAccount,
|
|
66
|
-
useDeleteAccountUser,
|
|
67
|
-
useUpdateAccount,
|
|
68
|
-
useUpdateAccountUser,
|
|
69
|
-
useUpdateAccountUserById
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=useAccountManagement.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/hooks/useAccountManagement.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient } from '@tanstack/react-query';\nimport { USER_QUERY_KEY } from '../../auth/hooks/useUserQuery';\nimport { ACCOUNT_QUERY_KEY } from './current-account.hook';\nimport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n DeleteAccountUserResponse,\n DeleteAccountResponse,\n} from '../types';\nimport {\n updateUserAction,\n updateAccountAction,\n updateAccountUserByIdAction,\n deleteAccountUserAction,\n deleteAccountAction,\n} from '../actions/account-management.action';\nimport { withAction } from '../../../utils/withAction';\nimport type { UseMutationOptions } from '@tanstack/react-query';\n\nconst ACCOUNT_USERS_QUERY_KEY = ['account-users'];\n\nexport function useUpdateAccount() {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: withAction(updateAccountAction),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ACCOUNT_USERS_QUERY_KEY });\n queryClient.invalidateQueries({ queryKey: ACCOUNT_QUERY_KEY });\n queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });\n },\n });\n}\n\nexport function useUpdateAccountUser() {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: withAction(updateUserAction),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ACCOUNT_USERS_QUERY_KEY });\n queryClient.invalidateQueries({ queryKey: ACCOUNT_QUERY_KEY });\n queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });\n },\n });\n}\n\nexport function useUpdateAccountUserById() {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: withAction(({ userId, ...user }: UpdateAccountUserRequest & { userId: number }) =>\n updateAccountUserByIdAction(userId, user)\n ),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ACCOUNT_USERS_QUERY_KEY });\n },\n });\n}\n\nexport function useDeleteAccountUser(\n options?: UseMutationOptions<DeleteAccountUserResponse, Error, number>\n) {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: withAction(deleteAccountUserAction),\n ...options,\n onSuccess: (...params) => {\n options?.onSuccess?.(...params);\n queryClient.invalidateQueries({ queryKey: ACCOUNT_USERS_QUERY_KEY });\n },\n });\n}\n\nexport function useDeleteAccount(\n options?: UseMutationOptions<DeleteAccountResponse, Error, void>\n) {\n return useMutation({\n mutationFn: withAction(deleteAccountAction),\n ...options,\n });\n}\n"],"mappings":";AAEA,SAAS,aAAa,sBAAsB;AAC5C,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAOlC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAG3B,MAAM,0BAA0B,CAAC,eAAe;AAEzC,SAAS,mBAAmB;AACjC,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,mBAAmB;AAAA,IAC1C,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,wBAAwB,CAAC;AACnE,kBAAY,kBAAkB,EAAE,UAAU,kBAAkB,CAAC;AAC7D,kBAAY,kBAAkB,EAAE,UAAU,eAAe,CAAC;AAAA,IAC5D;AAAA,EACF,CAAC;AACH;AAEO,SAAS,uBAAuB;AACrC,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,gBAAgB;AAAA,IACvC,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,wBAAwB,CAAC;AACnE,kBAAY,kBAAkB,EAAE,UAAU,kBAAkB,CAAC;AAC7D,kBAAY,kBAAkB,EAAE,UAAU,eAAe,CAAC;AAAA,IAC5D;AAAA,EACF,CAAC;AACH;AAEO,SAAS,2BAA2B;AACzC,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY;AAAA,IACjB,YAAY;AAAA,MAAW,CAAC,EAAE,QAAQ,GAAG,KAAK,MACxC,4BAA4B,QAAQ,IAAI;AAAA,IAC1C;AAAA,IACA,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,wBAAwB,CAAC;AAAA,IACrE;AAAA,EACF,CAAC;AACH;AAEO,SAAS,qBACd,SACA;AACA,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,uBAAuB;AAAA,IAC9C,GAAG;AAAA,IACH,WAAW,IAAI,WAAW;AACxB,eAAS,YAAY,GAAG,MAAM;AAC9B,kBAAY,kBAAkB,EAAE,UAAU,wBAAwB,CAAC;AAAA,IACrE;AAAA,EACF,CAAC;AACH;AAEO,SAAS,iBACd,SACA;AACA,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,mBAAmB;AAAA,IAC1C,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { listCurrenciesAction } from "../actions/list-currencies.action";
|
|
4
|
-
import { withAction } from "../../../utils/withAction";
|
|
5
|
-
const CURRENCIES_QUERY_KEY = ["currencies"];
|
|
6
|
-
function useCurrencies() {
|
|
7
|
-
return useQuery({
|
|
8
|
-
queryKey: CURRENCIES_QUERY_KEY,
|
|
9
|
-
queryFn: withAction(listCurrenciesAction),
|
|
10
|
-
staleTime: Infinity
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
CURRENCIES_QUERY_KEY,
|
|
15
|
-
useCurrencies
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=useCurrencies.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/hooks/useCurrencies.ts"],"sourcesContent":["'use client';\n\nimport { useQuery } from '@tanstack/react-query';\nimport { listCurrenciesAction } from '../actions/list-currencies.action';\nimport { withAction } from '../../../utils/withAction';\n\nexport const CURRENCIES_QUERY_KEY = ['currencies'];\n\nexport function useCurrencies() {\n return useQuery({\n queryKey: CURRENCIES_QUERY_KEY,\n queryFn: withAction(listCurrenciesAction),\n staleTime: Infinity,\n });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AACzB,SAAS,4BAA4B;AACrC,SAAS,kBAAkB;AAEpB,MAAM,uBAAuB,CAAC,YAAY;AAE1C,SAAS,gBAAgB;AAC9B,SAAO,SAAS;AAAA,IACd,UAAU;AAAA,IACV,SAAS,WAAW,oBAAoB;AAAA,IACxC,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { listTimezonesAction } from "../actions/list-timezones.action";
|
|
4
|
-
import { withAction } from "../../../utils/withAction";
|
|
5
|
-
const TIMEZONES_QUERY_KEY = ["timezones"];
|
|
6
|
-
function useTimezones() {
|
|
7
|
-
return useQuery({
|
|
8
|
-
queryKey: TIMEZONES_QUERY_KEY,
|
|
9
|
-
queryFn: withAction(listTimezonesAction),
|
|
10
|
-
staleTime: Infinity
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
TIMEZONES_QUERY_KEY,
|
|
15
|
-
useTimezones
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=useTimezones.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/hooks/useTimezones.ts"],"sourcesContent":["'use client';\n\nimport { useQuery } from '@tanstack/react-query';\nimport { listTimezonesAction } from '../actions/list-timezones.action';\nimport { withAction } from '../../../utils/withAction';\n\nexport const TIMEZONES_QUERY_KEY = ['timezones'];\n\nexport function useTimezones() {\n return useQuery({\n queryKey: TIMEZONES_QUERY_KEY,\n queryFn: withAction(listTimezonesAction),\n staleTime: Infinity,\n });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AACzB,SAAS,2BAA2B;AACpC,SAAS,kBAAkB;AAEpB,MAAM,sBAAsB,CAAC,WAAW;AAExC,SAAS,eAAe;AAC7B,SAAO,SAAS;AAAA,IACd,UAAU;AAAA,IACV,SAAS,WAAW,mBAAmB;AAAA,IACvC,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}
|