@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,10 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { projectUsersService } from "../services/project-users.service";
|
|
4
|
-
async function listProjectUsersAction(projectId, params = {}) {
|
|
5
|
-
return safeServerAction(() => projectUsersService.listInProject(projectId, params));
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
listProjectUsersAction
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=list-project-users.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/projects/actions/list-project-users.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { ListUsersParams } from '../types';\n\nexport async function listProjectUsersAction(projectId: number, params: ListUsersParams = {}) {\n return safeServerAction(() => projectUsersService.listInProject(projectId, params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAGpC,eAAsB,uBAAuB,WAAmB,SAA0B,CAAC,GAAG;AAC5F,SAAO,iBAAiB,MAAM,oBAAoB,cAAc,WAAW,MAAM,CAAC;AACpF;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { projectUsersService } from "../services/project-users.service";
|
|
4
|
-
async function removeProjectUserAction(params) {
|
|
5
|
-
return safeServerAction(() => projectUsersService.removeFromProject(params));
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
removeProjectUserAction
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=remove-project-user.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/projects/actions/remove-project-user.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { projectUsersService } from '../services/project-users.service';\nimport type { AddRemoveProjectUsersParams } from '../types';\n\nexport async function removeProjectUserAction(params: AddRemoveProjectUsersParams) {\n return safeServerAction(() => projectUsersService.removeFromProject(params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAGpC,eAAsB,wBAAwB,QAAqC;AACjF,SAAO,iBAAiB,MAAM,oBAAoB,kBAAkB,MAAM,CAAC;AAC7E;","names":[]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
3
|
-
import { listAvailableUsersAction } from "../actions/list-available-users.action";
|
|
4
|
-
import { withAction } from "../../../utils/withAction";
|
|
5
|
-
const PAGE_SIZE = 20;
|
|
6
|
-
const LIST_AVAILABLE_USERS_BASE_KEY = (projectId) => ["project-users", projectId, "out"];
|
|
7
|
-
const LIST_AVAILABLE_USERS_QUERY_KEY = (projectId, search = "") => [
|
|
8
|
-
...LIST_AVAILABLE_USERS_BASE_KEY(projectId),
|
|
9
|
-
search
|
|
10
|
-
];
|
|
11
|
-
function useListAvailableUsers(projectId, search = "") {
|
|
12
|
-
return useInfiniteQuery({
|
|
13
|
-
queryKey: LIST_AVAILABLE_USERS_QUERY_KEY(projectId, search),
|
|
14
|
-
queryFn: ({ pageParam }) => withAction(
|
|
15
|
-
() => listAvailableUsersAction(projectId, {
|
|
16
|
-
search: search || void 0,
|
|
17
|
-
page: pageParam,
|
|
18
|
-
limit: PAGE_SIZE
|
|
19
|
-
})
|
|
20
|
-
)(),
|
|
21
|
-
getNextPageParam: (lastPage, allPages) => {
|
|
22
|
-
const loaded = allPages.reduce((sum, p) => sum + p.data.length, 0);
|
|
23
|
-
return loaded < lastPage.total ? allPages.length + 1 : void 0;
|
|
24
|
-
},
|
|
25
|
-
initialPageParam: 1,
|
|
26
|
-
enabled: !!projectId
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
LIST_AVAILABLE_USERS_BASE_KEY,
|
|
31
|
-
LIST_AVAILABLE_USERS_QUERY_KEY,
|
|
32
|
-
useListAvailableUsers
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=list-available-users.hook.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/projects/hooks/list-available-users.hook.ts"],"sourcesContent":["'use client';\n\nimport { useInfiniteQuery } from '@tanstack/react-query';\nimport { listAvailableUsersAction } from '../actions/list-available-users.action';\nimport { withAction } from '../../../utils/withAction';\n\nconst PAGE_SIZE = 20;\n\nexport const LIST_AVAILABLE_USERS_BASE_KEY = (projectId: number) => ['project-users', projectId, 'out'];\nexport const LIST_AVAILABLE_USERS_QUERY_KEY = (projectId: number, search: string = '') => [\n ...LIST_AVAILABLE_USERS_BASE_KEY(projectId),\n search,\n];\n\nexport function useListAvailableUsers(projectId: number, search: string = '') {\n return useInfiniteQuery({\n queryKey: LIST_AVAILABLE_USERS_QUERY_KEY(projectId, search),\n queryFn: ({ pageParam }) =>\n withAction(() =>\n listAvailableUsersAction(projectId, {\n search: search || undefined,\n page: pageParam as number,\n limit: PAGE_SIZE,\n })\n )(),\n getNextPageParam: (lastPage, allPages) => {\n const loaded = allPages.reduce((sum, p) => sum + p.data.length, 0);\n return loaded < lastPage.total ? allPages.length + 1 : undefined;\n },\n initialPageParam: 1,\n enabled: !!projectId,\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,gCAAgC;AACzC,SAAS,kBAAkB;AAE3B,MAAM,YAAY;AAEX,MAAM,gCAAgC,CAAC,cAAsB,CAAC,iBAAiB,WAAW,KAAK;AAC/F,MAAM,iCAAiC,CAAC,WAAmB,SAAiB,OAAO;AAAA,EACxF,GAAG,8BAA8B,SAAS;AAAA,EAC1C;AACF;AAEO,SAAS,sBAAsB,WAAmB,SAAiB,IAAI;AAC5E,SAAO,iBAAiB;AAAA,IACtB,UAAU,+BAA+B,WAAW,MAAM;AAAA,IAC1D,SAAS,CAAC,EAAE,UAAU,MACpB;AAAA,MAAW,MACT,yBAAyB,WAAW;AAAA,QAClC,QAAQ,UAAU;AAAA,QAClB,MAAM;AAAA,QACN,OAAO;AAAA,MACT,CAAC;AAAA,IACH,EAAE;AAAA,IACJ,kBAAkB,CAAC,UAAU,aAAa;AACxC,YAAM,SAAS,SAAS,OAAO,CAAC,KAAK,MAAM,MAAM,EAAE,KAAK,QAAQ,CAAC;AACjE,aAAO,SAAS,SAAS,QAAQ,SAAS,SAAS,IAAI;AAAA,IACzD;AAAA,IACA,kBAAkB;AAAA,IAClB,SAAS,CAAC,CAAC;AAAA,EACb,CAAC;AACH;","names":[]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
3
|
-
import { listProjectUsersAction } from "../actions/list-project-users.action";
|
|
4
|
-
import { withAction } from "../../../utils/withAction";
|
|
5
|
-
const PAGE_SIZE = 20;
|
|
6
|
-
const LIST_PROJECT_USERS_BASE_KEY = (projectId) => ["project-users", projectId, "in"];
|
|
7
|
-
const LIST_PROJECT_USERS_QUERY_KEY = (projectId, search = "") => [
|
|
8
|
-
...LIST_PROJECT_USERS_BASE_KEY(projectId),
|
|
9
|
-
search
|
|
10
|
-
];
|
|
11
|
-
function useListProjectUsers(projectId, search = "") {
|
|
12
|
-
return useInfiniteQuery({
|
|
13
|
-
queryKey: LIST_PROJECT_USERS_QUERY_KEY(projectId, search),
|
|
14
|
-
queryFn: ({ pageParam }) => withAction(
|
|
15
|
-
() => listProjectUsersAction(projectId, {
|
|
16
|
-
search: search || void 0,
|
|
17
|
-
page: pageParam,
|
|
18
|
-
limit: PAGE_SIZE
|
|
19
|
-
})
|
|
20
|
-
)(),
|
|
21
|
-
getNextPageParam: (lastPage, allPages) => {
|
|
22
|
-
const loaded = allPages.reduce((sum, p) => sum + p.data.length, 0);
|
|
23
|
-
return loaded < lastPage.total ? allPages.length + 1 : void 0;
|
|
24
|
-
},
|
|
25
|
-
initialPageParam: 1,
|
|
26
|
-
enabled: !!projectId
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
LIST_PROJECT_USERS_BASE_KEY,
|
|
31
|
-
LIST_PROJECT_USERS_QUERY_KEY,
|
|
32
|
-
useListProjectUsers
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=list-project-users.hook.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/projects/hooks/list-project-users.hook.ts"],"sourcesContent":["'use client';\n\nimport { useInfiniteQuery } from '@tanstack/react-query';\nimport { listProjectUsersAction } from '../actions/list-project-users.action';\nimport { withAction } from '../../../utils/withAction';\n\nconst PAGE_SIZE = 20;\n\nexport const LIST_PROJECT_USERS_BASE_KEY = (projectId: number) => ['project-users', projectId, 'in'];\nexport const LIST_PROJECT_USERS_QUERY_KEY = (projectId: number, search: string = '') => [\n ...LIST_PROJECT_USERS_BASE_KEY(projectId),\n search,\n];\n\nexport function useListProjectUsers(projectId: number, search: string = '') {\n return useInfiniteQuery({\n queryKey: LIST_PROJECT_USERS_QUERY_KEY(projectId, search),\n queryFn: ({ pageParam }) =>\n withAction(() =>\n listProjectUsersAction(projectId, {\n search: search || undefined,\n page: pageParam as number,\n limit: PAGE_SIZE,\n })\n )(),\n getNextPageParam: (lastPage, allPages) => {\n const loaded = allPages.reduce((sum, p) => sum + p.data.length, 0);\n return loaded < lastPage.total ? allPages.length + 1 : undefined;\n },\n initialPageParam: 1,\n enabled: !!projectId,\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,8BAA8B;AACvC,SAAS,kBAAkB;AAE3B,MAAM,YAAY;AAEX,MAAM,8BAA8B,CAAC,cAAsB,CAAC,iBAAiB,WAAW,IAAI;AAC5F,MAAM,+BAA+B,CAAC,WAAmB,SAAiB,OAAO;AAAA,EACtF,GAAG,4BAA4B,SAAS;AAAA,EACxC;AACF;AAEO,SAAS,oBAAoB,WAAmB,SAAiB,IAAI;AAC1E,SAAO,iBAAiB;AAAA,IACtB,UAAU,6BAA6B,WAAW,MAAM;AAAA,IACxD,SAAS,CAAC,EAAE,UAAU,MACpB;AAAA,MAAW,MACT,uBAAuB,WAAW;AAAA,QAChC,QAAQ,UAAU;AAAA,QAClB,MAAM;AAAA,QACN,OAAO;AAAA,MACT,CAAC;AAAA,IACH,EAAE;AAAA,IACJ,kBAAkB,CAAC,UAAU,aAAa;AACxC,YAAM,SAAS,SAAS,OAAO,CAAC,KAAK,MAAM,MAAM,EAAE,KAAK,QAAQ,CAAC;AACjE,aAAO,SAAS,SAAS,QAAQ,SAAS,SAAS,IAAI;AAAA,IACzD;AAAA,IACA,kBAAkB;AAAA,IAClB,SAAS,CAAC,CAAC;AAAA,EACb,CAAC;AACH;","names":[]}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import "server-only";
|
|
2
|
-
import { api } from "../../../infra/api/client";
|
|
3
|
-
import { ApiError } from "../../../infra/api/types";
|
|
4
|
-
import { buildQueryParams } from "../../../infra/utils/params";
|
|
5
|
-
import { getUserContext } from "../../auth/utils/get-user-context";
|
|
6
|
-
import {
|
|
7
|
-
AccountUserSchema,
|
|
8
|
-
ProjectUserSchema
|
|
9
|
-
} from "../types";
|
|
10
|
-
class ProjectUsersService {
|
|
11
|
-
async listInProject(projectId, params = {}) {
|
|
12
|
-
const { id_account, id_user } = await getUserContext();
|
|
13
|
-
const query = buildQueryParams(params);
|
|
14
|
-
const url = `/account/${id_account}/user/${id_user}/projects/${projectId}/users${query ? `?${query}` : ""}`;
|
|
15
|
-
const response = await api.apps.get(url);
|
|
16
|
-
if (response.status === 0) {
|
|
17
|
-
throw new ApiError(
|
|
18
|
-
response.message || "Erro ao listar usu\xE1rios do projeto",
|
|
19
|
-
"LIST_PROJECT_USERS_FAILED",
|
|
20
|
-
400
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
data: response.data.map((item) => ProjectUserSchema.parse(item)),
|
|
25
|
-
total: response.total,
|
|
26
|
-
page: params.page ?? 1
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
async listNotInProject(projectId, params = {}) {
|
|
30
|
-
const { id_account } = await getUserContext();
|
|
31
|
-
const query = buildQueryParams({ notInProject: projectId, ...params });
|
|
32
|
-
const url = `/accounts/${id_account}/users${query ? `?${query}` : ""}`;
|
|
33
|
-
const response = await api.apps.get(url);
|
|
34
|
-
if (response.status === 0) {
|
|
35
|
-
throw new ApiError(
|
|
36
|
-
response.message || "Erro ao listar usu\xE1rios dispon\xEDveis",
|
|
37
|
-
"LIST_AVAILABLE_USERS_FAILED",
|
|
38
|
-
400
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
data: response.data.map((item) => AccountUserSchema.parse(item)),
|
|
43
|
-
total: response.total,
|
|
44
|
-
page: params.page ?? 1
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
async addToProject({ projectId, users }) {
|
|
48
|
-
const { id_account, id_user } = await getUserContext();
|
|
49
|
-
const url = `/account/${id_account}/user/${id_user}/projects/${projectId}/users`;
|
|
50
|
-
const response = await api.apps.post(url, { users });
|
|
51
|
-
if (response.status === 0) {
|
|
52
|
-
throw new ApiError(
|
|
53
|
-
response.message || "Erro ao adicionar usu\xE1rio ao projeto",
|
|
54
|
-
"ADD_PROJECT_USER_FAILED",
|
|
55
|
-
400
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
async removeFromProject({ projectId, users }) {
|
|
60
|
-
const { id_account, id_user } = await getUserContext();
|
|
61
|
-
const url = `/account/${id_account}/user/${id_user}/projects/${projectId}/users`;
|
|
62
|
-
const response = await api.apps.delete(url, {
|
|
63
|
-
body: JSON.stringify({ users })
|
|
64
|
-
});
|
|
65
|
-
if (response.status === 0) {
|
|
66
|
-
throw new ApiError(
|
|
67
|
-
response.message || "Erro ao remover usu\xE1rio do projeto",
|
|
68
|
-
"REMOVE_PROJECT_USER_FAILED",
|
|
69
|
-
400
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const projectUsersService = new ProjectUsersService();
|
|
75
|
-
export {
|
|
76
|
-
projectUsersService
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=project-users.service.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/projects/services/project-users.service.ts"],"sourcesContent":["import 'server-only';\r\n\r\nimport { api } from '../../../infra/api/client';\r\nimport { ApiError } from '../../../infra/api/types';\r\nimport { buildQueryParams } from '../../../infra/utils/params';\r\nimport { getUserContext } from '../../auth/utils/get-user-context';\r\nimport {\r\n AccountUser,\r\n AccountUserSchema,\r\n AddRemoveProjectUsersParams,\r\n ListUsersParams,\r\n ProjectUser,\r\n ProjectUserSchema,\r\n UsersPage,\r\n} from '../types';\r\n\r\ninterface ApiListResponse<T> {\r\n data: T[];\r\n total: number;\r\n status: number;\r\n message?: string;\r\n}\r\n\r\ninterface ApiActionResponse {\r\n status: number;\r\n message?: string;\r\n}\r\n\r\nclass ProjectUsersService {\r\n async listInProject(projectId: number, params: ListUsersParams = {}): Promise<UsersPage<ProjectUser>> {\r\n const { id_account, id_user } = await getUserContext();\r\n const query = buildQueryParams(params as Record<string, string | number | boolean | undefined>);\r\n const url = `/account/${id_account}/user/${id_user}/projects/${projectId}/users${query ? `?${query}` : ''}`;\r\n\r\n const response = await api.apps.get<ApiListResponse<ProjectUser>>(url);\r\n\r\n if (response.status === 0) {\r\n throw new ApiError(\r\n response.message || 'Erro ao listar usuários do projeto',\r\n 'LIST_PROJECT_USERS_FAILED',\r\n 400\r\n );\r\n }\r\n\r\n return {\r\n data: response.data.map((item) => ProjectUserSchema.parse(item)),\r\n total: response.total,\r\n page: params.page ?? 1,\r\n };\r\n }\r\n\r\n async listNotInProject(projectId: number, params: ListUsersParams = {}): Promise<UsersPage<AccountUser>> {\r\n const { id_account } = await getUserContext();\r\n const query = buildQueryParams({ notInProject: projectId, ...params } as Record<string, string | number | boolean | undefined>);\r\n const url = `/accounts/${id_account}/users${query ? `?${query}` : ''}`;\r\n\r\n const response = await api.apps.get<ApiListResponse<AccountUser>>(url);\r\n\r\n if (response.status === 0) {\r\n throw new ApiError(\r\n response.message || 'Erro ao listar usuários disponíveis',\r\n 'LIST_AVAILABLE_USERS_FAILED',\r\n 400\r\n );\r\n }\r\n\r\n return {\r\n data: response.data.map((item) => AccountUserSchema.parse(item)),\r\n total: response.total,\r\n page: params.page ?? 1,\r\n };\r\n }\r\n\r\n async addToProject({ projectId, users }: AddRemoveProjectUsersParams): Promise<void> {\r\n const { id_account, id_user } = await getUserContext();\r\n const url = `/account/${id_account}/user/${id_user}/projects/${projectId}/users`;\r\n\r\n const response = await api.apps.post<ApiActionResponse>(url, { users });\r\n\r\n if (response.status === 0) {\r\n throw new ApiError(\r\n response.message || 'Erro ao adicionar usuário ao projeto',\r\n 'ADD_PROJECT_USER_FAILED',\r\n 400\r\n );\r\n }\r\n }\r\n\r\n async removeFromProject({ projectId, users }: AddRemoveProjectUsersParams): Promise<void> {\r\n const { id_account, id_user } = await getUserContext();\r\n const url = `/account/${id_account}/user/${id_user}/projects/${projectId}/users`;\r\n\r\n const response = await api.apps.delete<ApiActionResponse>(url, {\r\n body: JSON.stringify({ users }),\r\n });\r\n\r\n if (response.status === 0) {\r\n throw new ApiError(\r\n response.message || 'Erro ao remover usuário do projeto',\r\n 'REMOVE_PROJECT_USER_FAILED',\r\n 400\r\n );\r\n }\r\n }\r\n}\r\n\r\nexport const projectUsersService = new ProjectUsersService();\r\n"],"mappings":"AAAA,OAAO;AAEP,SAAS,WAAW;AACpB,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B;AAAA,EAEE;AAAA,EAIA;AAAA,OAEK;AAcP,MAAM,oBAAoB;AAAA,EACxB,MAAM,cAAc,WAAmB,SAA0B,CAAC,GAAoC;AACpG,UAAM,EAAE,YAAY,QAAQ,IAAI,MAAM,eAAe;AACrD,UAAM,QAAQ,iBAAiB,MAA+D;AAC9F,UAAM,MAAM,YAAY,UAAU,SAAS,OAAO,aAAa,SAAS,SAAS,QAAQ,IAAI,KAAK,KAAK,EAAE;AAEzG,UAAM,WAAW,MAAM,IAAI,KAAK,IAAkC,GAAG;AAErE,QAAI,SAAS,WAAW,GAAG;AACzB,YAAM,IAAI;AAAA,QACR,SAAS,WAAW;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,MACL,MAAM,SAAS,KAAK,IAAI,CAAC,SAAS,kBAAkB,MAAM,IAAI,CAAC;AAAA,MAC/D,OAAO,SAAS;AAAA,MAChB,MAAM,OAAO,QAAQ;AAAA,IACvB;AAAA,EACF;AAAA,EAEA,MAAM,iBAAiB,WAAmB,SAA0B,CAAC,GAAoC;AACvG,UAAM,EAAE,WAAW,IAAI,MAAM,eAAe;AAC5C,UAAM,QAAQ,iBAAiB,EAAE,cAAc,WAAW,GAAG,OAAO,CAA0D;AAC9H,UAAM,MAAM,aAAa,UAAU,SAAS,QAAQ,IAAI,KAAK,KAAK,EAAE;AAEpE,UAAM,WAAW,MAAM,IAAI,KAAK,IAAkC,GAAG;AAErE,QAAI,SAAS,WAAW,GAAG;AACzB,YAAM,IAAI;AAAA,QACR,SAAS,WAAW;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,MACL,MAAM,SAAS,KAAK,IAAI,CAAC,SAAS,kBAAkB,MAAM,IAAI,CAAC;AAAA,MAC/D,OAAO,SAAS;AAAA,MAChB,MAAM,OAAO,QAAQ;AAAA,IACvB;AAAA,EACF;AAAA,EAEA,MAAM,aAAa,EAAE,WAAW,MAAM,GAA+C;AACnF,UAAM,EAAE,YAAY,QAAQ,IAAI,MAAM,eAAe;AACrD,UAAM,MAAM,YAAY,UAAU,SAAS,OAAO,aAAa,SAAS;AAExE,UAAM,WAAW,MAAM,IAAI,KAAK,KAAwB,KAAK,EAAE,MAAM,CAAC;AAEtE,QAAI,SAAS,WAAW,GAAG;AACzB,YAAM,IAAI;AAAA,QACR,SAAS,WAAW;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,kBAAkB,EAAE,WAAW,MAAM,GAA+C;AACxF,UAAM,EAAE,YAAY,QAAQ,IAAI,MAAM,eAAe;AACrD,UAAM,MAAM,YAAY,UAAU,SAAS,OAAO,aAAa,SAAS;AAExE,UAAM,WAAW,MAAM,IAAI,KAAK,OAA0B,KAAK;AAAA,MAC7D,MAAM,KAAK,UAAU,EAAE,MAAM,CAAC;AAAA,IAChC,CAAC;AAED,QAAI,SAAS,WAAW,GAAG;AACzB,YAAM,IAAI;AAAA,QACR,SAAS,WAAW;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,MAAM,sBAAsB,IAAI,oBAAoB;","names":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
const ProjectUserSchema = z.object({
|
|
3
|
-
id_user: z.union([z.number(), z.string()]).transform(Number),
|
|
4
|
-
id_account: z.union([z.number(), z.string()]).transform(Number),
|
|
5
|
-
id_project: z.union([z.number(), z.string()]).transform(Number),
|
|
6
|
-
name: z.string().nullable(),
|
|
7
|
-
email: z.string().nullable(),
|
|
8
|
-
profile: z.string().nullable().optional().default("viewer"),
|
|
9
|
-
photo: z.string().nullable().optional()
|
|
10
|
-
});
|
|
11
|
-
const AccountUserSchema = z.object({
|
|
12
|
-
id: z.union([z.number(), z.string()]).transform(Number),
|
|
13
|
-
name: z.string().nullable(),
|
|
14
|
-
email: z.string().nullable(),
|
|
15
|
-
profile: z.string().nullable().optional().default("viewer"),
|
|
16
|
-
photo: z.string().nullable().optional()
|
|
17
|
-
});
|
|
18
|
-
export {
|
|
19
|
-
AccountUserSchema,
|
|
20
|
-
ProjectUserSchema
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=types.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/modules/projects/types.ts"],"sourcesContent":["import { z } from \"zod\";\r\n\r\nexport const ProjectUserSchema = z.object({\r\n id_user: z.union([z.number(), z.string()]).transform(Number),\r\n id_account: z.union([z.number(), z.string()]).transform(Number),\r\n id_project: z.union([z.number(), z.string()]).transform(Number),\r\n name: z.string().nullable(),\r\n email: z.string().nullable(),\r\n profile: z.string().nullable().optional().default(\"viewer\"),\r\n photo: z.string().nullable().optional(),\r\n});\r\n\r\nexport type ProjectUser = z.infer<typeof ProjectUserSchema>;\r\n\r\nexport const AccountUserSchema = z.object({\r\n id: z.union([z.number(), z.string()]).transform(Number),\r\n name: z.string().nullable(),\r\n email: z.string().nullable(),\r\n profile: z.string().nullable().optional().default(\"viewer\"),\r\n photo: z.string().nullable().optional(),\r\n});\r\n\r\nexport type AccountUser = z.infer<typeof AccountUserSchema>;\r\n\r\nexport interface AddRemoveProjectUsersParams {\r\n projectId: number;\r\n users: number[];\r\n}\r\n\r\nexport interface ListUsersParams {\r\n search?: string;\r\n page?: number;\r\n limit?: number;\r\n}\r\n\r\nexport interface UsersPage<T> {\r\n data: T[];\r\n total: number;\r\n page: number;\r\n}\r\n"],"mappings":"AAAA,SAAS,SAAS;AAEX,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,UAAU,MAAM;AAAA,EAC3D,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,UAAU,MAAM;AAAA,EAC9D,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,UAAU,MAAM;AAAA,EAC9D,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,QAAQ;AAAA,EAC1D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AACxC,CAAC;AAIM,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,UAAU,MAAM;AAAA,EACtD,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,QAAQ;AAAA,EAC1D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AACxC,CAAC;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { subscriptionsService } from "../services/subscriptions.service";
|
|
4
|
-
async function listSubscriptionsAction(params) {
|
|
5
|
-
return safeServerAction(() => subscriptionsService.listSubscriptions(params));
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
listSubscriptionsAction
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=list-subscriptions.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/subscriptions/actions/list-subscriptions.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport type { FindSubscriptionsParams } from '../types';\nimport { subscriptionsService } from '../services/subscriptions.service';\n\nexport async function listSubscriptionsAction(params?: Partial<FindSubscriptionsParams>) {\n return safeServerAction(() => subscriptionsService.listSubscriptions(params));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AAEjC,SAAS,4BAA4B;AAErC,eAAsB,wBAAwB,QAA2C;AACvF,SAAO,iBAAiB,MAAM,qBAAqB,kBAAkB,MAAM,CAAC;AAC9E;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/subscriptions/constants/addons.constants.ts"],"sourcesContent":["export const ADDON_IDS = {\r\n DOMAINS: 1,\r\n PAGES: 2,\r\n PROJECTS: 3,\r\n AB_TEST: 4,\r\n HEATMAP: 5,\r\n AI: 6,\r\n} as const;\r\n\r\nexport type AddonKindEnum = (typeof ADDON_IDS)[keyof typeof ADDON_IDS];\r\n"],"mappings":"AAAO,MAAM,YAAY;AAAA,EACvB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AAAA,EACT,IAAI;AACN;","names":[]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { listSubscriptionsAction } from "../actions/list-subscriptions.action";
|
|
4
|
-
import { parseResult } from "../../../infra/utils/parser";
|
|
5
|
-
import { SubscriptionSchema } from "../types";
|
|
6
|
-
import { SUBSCRIPTIONS_QUERY_KEY } from "./list-subscriptions.hook";
|
|
7
|
-
import { withAction } from "../../../utils/withAction";
|
|
8
|
-
function useActiveSubscription() {
|
|
9
|
-
return useQuery({
|
|
10
|
-
queryKey: [...SUBSCRIPTIONS_QUERY_KEY, "active"],
|
|
11
|
-
queryFn: async () => parseResult(
|
|
12
|
-
SubscriptionSchema,
|
|
13
|
-
await withAction(() => listSubscriptionsAction({ active: true }))()
|
|
14
|
-
)
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
export {
|
|
18
|
-
useActiveSubscription
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=find-active-subscription.hook.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/subscriptions/hooks/find-active-subscription.hook.ts"],"sourcesContent":["'use client';\n\nimport { useQuery } from '@tanstack/react-query';\nimport { listSubscriptionsAction } from '../actions/list-subscriptions.action';\nimport { parseResult } from '../../../infra/utils/parser';\nimport { SubscriptionSchema } from '../types';\nimport { SUBSCRIPTIONS_QUERY_KEY } from './list-subscriptions.hook';\nimport { withAction } from '../../../utils/withAction';\n\nexport function useActiveSubscription() {\n return useQuery({\n queryKey: [...SUBSCRIPTIONS_QUERY_KEY, 'active'],\n queryFn: async () =>\n parseResult(\n SubscriptionSchema,\n await withAction(() => listSubscriptionsAction({ active: true }))()\n ),\n });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AACzB,SAAS,+BAA+B;AACxC,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,kBAAkB;AAEpB,SAAS,wBAAwB;AACtC,SAAO,SAAS;AAAA,IACd,UAAU,CAAC,GAAG,yBAAyB,QAAQ;AAAA,IAC/C,SAAS,YACP;AAAA,MACE;AAAA,MACA,MAAM,WAAW,MAAM,wBAAwB,EAAE,QAAQ,KAAK,CAAC,CAAC,EAAE;AAAA,IACpE;AAAA,EACJ,CAAC;AACH;","names":[]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { listSubscriptionsAction } from "../actions/list-subscriptions.action";
|
|
4
|
-
import { parseResult } from "../../../infra/utils/parser";
|
|
5
|
-
import { SubscriptionSchema } from "../types";
|
|
6
|
-
import { withAction } from "../../../utils/withAction";
|
|
7
|
-
const SUBSCRIPTIONS_QUERY_KEY = ["subscriptions"];
|
|
8
|
-
function useSubscriptions(params) {
|
|
9
|
-
return useQuery({
|
|
10
|
-
queryKey: [...SUBSCRIPTIONS_QUERY_KEY, params],
|
|
11
|
-
queryFn: async () => parseResult(SubscriptionSchema, await withAction(() => listSubscriptionsAction(params))())
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
SUBSCRIPTIONS_QUERY_KEY,
|
|
16
|
-
useSubscriptions
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=list-subscriptions.hook.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/subscriptions/hooks/list-subscriptions.hook.ts"],"sourcesContent":["'use client';\n\nimport { useQuery } from '@tanstack/react-query';\nimport { listSubscriptionsAction } from '../actions/list-subscriptions.action';\nimport { parseResult } from '../../../infra/utils/parser';\nimport { SubscriptionSchema, type FindSubscriptionsParams } from '../types';\nimport { withAction } from '../../../utils/withAction';\n\nexport const SUBSCRIPTIONS_QUERY_KEY = ['subscriptions'];\n\nexport function useSubscriptions(params?: Partial<FindSubscriptionsParams>) {\n return useQuery({\n queryKey: [...SUBSCRIPTIONS_QUERY_KEY, params],\n queryFn: async () =>\n parseResult(SubscriptionSchema, await withAction(() => listSubscriptionsAction(params))()),\n });\n}\n"],"mappings":";AAEA,SAAS,gBAAgB;AACzB,SAAS,+BAA+B;AACxC,SAAS,mBAAmB;AAC5B,SAAS,0BAAwD;AACjE,SAAS,kBAAkB;AAEpB,MAAM,0BAA0B,CAAC,eAAe;AAEhD,SAAS,iBAAiB,QAA2C;AAC1E,SAAO,SAAS;AAAA,IACd,UAAU,CAAC,GAAG,yBAAyB,MAAM;AAAA,IAC7C,SAAS,YACP,YAAY,oBAAoB,MAAM,WAAW,MAAM,wBAAwB,MAAM,CAAC,EAAE,CAAC;AAAA,EAC7F,CAAC;AACH;","names":[]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import "server-only";
|
|
2
|
-
import { api } from "../../../infra/api/client";
|
|
3
|
-
import { ApiError } from "../../../infra/api/types";
|
|
4
|
-
import { buildQueryParams } from "../../../infra/utils/params";
|
|
5
|
-
import { getUserContext } from "../../auth/utils/get-user-context";
|
|
6
|
-
import { SubscriptionSchema } from "../types";
|
|
7
|
-
class SubscriptionsService {
|
|
8
|
-
async listSubscriptions(params) {
|
|
9
|
-
const { id_account } = await getUserContext();
|
|
10
|
-
const query = buildQueryParams(params);
|
|
11
|
-
const url = `/accounts/${id_account}/subscriptions${query ? `?${query}` : ""}`;
|
|
12
|
-
const response = await api.apps.get(url);
|
|
13
|
-
if (response.status === 0) {
|
|
14
|
-
throw new ApiError(
|
|
15
|
-
response.message || "Erro ao listar assinaturas",
|
|
16
|
-
"LIST_SUBSCRIPTIONS_FAILED",
|
|
17
|
-
400
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
const data = response.data.map((item) => SubscriptionSchema.parse(item));
|
|
21
|
-
return {
|
|
22
|
-
data,
|
|
23
|
-
total: response.total,
|
|
24
|
-
success: true
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const subscriptionsService = new SubscriptionsService();
|
|
29
|
-
export {
|
|
30
|
-
subscriptionsService
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=subscriptions.service.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/subscriptions/services/subscriptions.service.ts"],"sourcesContent":["import 'server-only';\r\n\r\nimport { api } from '../../../infra/api/client';\r\nimport { ApiError, ApiPaginatedActionResult, PaginatedSuccessResult } from '../../../infra/api/types';\r\nimport { buildQueryParams } from '../../../infra/utils/params';\r\nimport { getUserContext } from '../../auth/utils/get-user-context';\r\nimport { Subscription, SubscriptionSchema, FindSubscriptionsParams } from '../types';\r\n\r\nclass SubscriptionsService {\r\n async listSubscriptions(\r\n params?: Partial<FindSubscriptionsParams>\r\n ): Promise<PaginatedSuccessResult<Subscription>> {\r\n const { id_account } = await getUserContext();\r\n\r\n const query = buildQueryParams(params as Record<string, string | boolean | undefined>);\r\n const url = `/accounts/${id_account}/subscriptions${query ? `?${query}` : ''}`;\r\n\r\n const response = await api.apps.get<ApiPaginatedActionResult<Subscription>>(url);\r\n\r\n if (response.status === 0) {\r\n throw new ApiError(\r\n response.message || 'Erro ao listar assinaturas',\r\n 'LIST_SUBSCRIPTIONS_FAILED',\r\n 400\r\n );\r\n }\r\n\r\n const data = response.data.map((item) => SubscriptionSchema.parse(item));\r\n\r\n return {\r\n data,\r\n total: response.total,\r\n success: true,\r\n } satisfies PaginatedSuccessResult<Subscription>;\r\n }\r\n}\r\n\r\nexport const subscriptionsService = new SubscriptionsService();\r\n"],"mappings":"AAAA,OAAO;AAEP,SAAS,WAAW;AACpB,SAAS,gBAAkE;AAC3E,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAuB,0BAAmD;AAE1E,MAAM,qBAAqB;AAAA,EACzB,MAAM,kBACJ,QAC+C;AAC/C,UAAM,EAAE,WAAW,IAAI,MAAM,eAAe;AAE5C,UAAM,QAAQ,iBAAiB,MAAsD;AACrF,UAAM,MAAM,aAAa,UAAU,iBAAiB,QAAQ,IAAI,KAAK,KAAK,EAAE;AAE5E,UAAM,WAAW,MAAM,IAAI,KAAK,IAA4C,GAAG;AAE/E,QAAI,SAAS,WAAW,GAAG;AACzB,YAAM,IAAI;AAAA,QACR,SAAS,WAAW;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAEA,UAAM,OAAO,SAAS,KAAK,IAAI,CAAC,SAAS,mBAAmB,MAAM,IAAI,CAAC;AAEvE,WAAO;AAAA,MACL;AAAA,MACA,OAAO,SAAS;AAAA,MAChB,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEO,MAAM,uBAAuB,IAAI,qBAAqB;","names":[]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
const SubscriptionItemSchema = z.object({
|
|
3
|
-
id: z.union([z.number(), z.string()]),
|
|
4
|
-
deleted: z.number(),
|
|
5
|
-
datetime_alt: z.coerce.date().nullable().optional(),
|
|
6
|
-
datetime_del: z.coerce.date().nullable().optional(),
|
|
7
|
-
datetime_add: z.coerce.date(),
|
|
8
|
-
id_wl: z.number(),
|
|
9
|
-
id_subscription: z.union([z.number(), z.string()]),
|
|
10
|
-
id_addon: z.number().nullable(),
|
|
11
|
-
addon_name: z.string().optional(),
|
|
12
|
-
value: z.number(),
|
|
13
|
-
currency: z.string(),
|
|
14
|
-
quantity: z.number(),
|
|
15
|
-
payment_status: z.number(),
|
|
16
|
-
id_charge: z.union([z.number(), z.string()]).nullable(),
|
|
17
|
-
trial: z.boolean(),
|
|
18
|
-
trial_ends_at: z.coerce.date().nullable().optional()
|
|
19
|
-
});
|
|
20
|
-
const SubscriptionSchema = z.object({
|
|
21
|
-
id: z.union([z.number(), z.string()]),
|
|
22
|
-
deleted: z.number(),
|
|
23
|
-
datetime_alt: z.coerce.date().nullable().optional(),
|
|
24
|
-
datetime_del: z.coerce.date().nullable().optional(),
|
|
25
|
-
datetime_add: z.coerce.date(),
|
|
26
|
-
id_wl: z.number(),
|
|
27
|
-
id_account: z.union([z.number(), z.string()]),
|
|
28
|
-
id_card: z.union([z.number(), z.string()]).nullable(),
|
|
29
|
-
id_coupon: z.union([z.number(), z.string()]).nullable(),
|
|
30
|
-
type: z.string(),
|
|
31
|
-
payment_method: z.number().nullable(),
|
|
32
|
-
periodicity: z.union([z.number(), z.string()]).nullable(),
|
|
33
|
-
value: z.number().nullable(),
|
|
34
|
-
id_product: z.number(),
|
|
35
|
-
id_plan: z.number(),
|
|
36
|
-
plan_name: z.string().nullable().optional(),
|
|
37
|
-
id_gateway: z.union([z.number(), z.string()]).nullable(),
|
|
38
|
-
gateway_account: z.string().nullable(),
|
|
39
|
-
date_hiring: z.coerce.date().nullable(),
|
|
40
|
-
date_due: z.coerce.date(),
|
|
41
|
-
date_cancellation: z.coerce.date().nullable(),
|
|
42
|
-
date_verification: z.coerce.date().nullable(),
|
|
43
|
-
cancellation_reason: z.string().nullable(),
|
|
44
|
-
cancellation_description: z.string().nullable(),
|
|
45
|
-
active: z.boolean(),
|
|
46
|
-
charged: z.boolean(),
|
|
47
|
-
datetime_last_update_periodicity: z.coerce.date().nullable().optional(),
|
|
48
|
-
card_name: z.string().nullable().optional(),
|
|
49
|
-
card_brand: z.string().nullable().optional(),
|
|
50
|
-
card_number: z.string().nullable().optional(),
|
|
51
|
-
items: z.array(SubscriptionItemSchema)
|
|
52
|
-
});
|
|
53
|
-
export {
|
|
54
|
-
SubscriptionItemSchema,
|
|
55
|
-
SubscriptionSchema
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=types.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/modules/subscriptions/types.ts"],"sourcesContent":["import z from 'zod';\r\n\r\nexport const SubscriptionItemSchema = z.object({\r\n id: z.union([z.number(), z.string()]),\r\n deleted: z.number(),\r\n datetime_alt: z.coerce.date().nullable().optional(),\r\n datetime_del: z.coerce.date().nullable().optional(),\r\n datetime_add: z.coerce.date(),\r\n id_wl: z.number(),\r\n id_subscription: z.union([z.number(), z.string()]),\r\n id_addon: z.number().nullable(),\r\n addon_name: z.string().optional(),\r\n value: z.number(),\r\n currency: z.string(),\r\n quantity: z.number(),\r\n payment_status: z.number(),\r\n id_charge: z.union([z.number(), z.string()]).nullable(),\r\n trial: z.boolean(),\r\n trial_ends_at: z.coerce.date().nullable().optional(),\r\n});\r\n\r\nexport type SubscriptionItem = z.infer<typeof SubscriptionItemSchema>;\r\n\r\nexport const SubscriptionSchema = z.object({\r\n id: z.union([z.number(), z.string()]),\r\n deleted: z.number(),\r\n datetime_alt: z.coerce.date().nullable().optional(),\r\n datetime_del: z.coerce.date().nullable().optional(),\r\n datetime_add: z.coerce.date(),\r\n id_wl: z.number(),\r\n id_account: z.union([z.number(), z.string()]),\r\n id_card: z.union([z.number(), z.string()]).nullable(),\r\n id_coupon: z.union([z.number(), z.string()]).nullable(),\r\n type: z.string(),\r\n payment_method: z.number().nullable(),\r\n periodicity: z.union([z.number(), z.string()]).nullable(),\r\n value: z.number().nullable(),\r\n id_product: z.number(),\r\n id_plan: z.number(),\r\n plan_name: z.string().nullable().optional(),\r\n id_gateway: z.union([z.number(), z.string()]).nullable(),\r\n gateway_account: z.string().nullable(),\r\n date_hiring: z.coerce.date().nullable(),\r\n date_due: z.coerce.date(),\r\n date_cancellation: z.coerce.date().nullable(),\r\n date_verification: z.coerce.date().nullable(),\r\n cancellation_reason: z.string().nullable(),\r\n cancellation_description: z.string().nullable(),\r\n active: z.boolean(),\r\n charged: z.boolean(),\r\n datetime_last_update_periodicity: z.coerce.date().nullable().optional(),\r\n card_name: z.string().nullable().optional(),\r\n card_brand: z.string().nullable().optional(),\r\n card_number: z.string().nullable().optional(),\r\n items: z.array(SubscriptionItemSchema),\r\n});\r\n\r\nexport type Subscription = z.infer<typeof SubscriptionSchema>;\r\n\r\nexport interface FindSubscriptionsParams {\r\n active?: boolean;\r\n trial?: boolean;\r\n date_start?: string;\r\n date_end?: string;\r\n date_hiring_start?: string;\r\n date_hiring_end?: string;\r\n}\r\n"],"mappings":"AAAA,OAAO,OAAO;AAEP,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAAA,EACpC,SAAS,EAAE,OAAO;AAAA,EAClB,cAAc,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,cAAc,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,cAAc,EAAE,OAAO,KAAK;AAAA,EAC5B,OAAO,EAAE,OAAO;AAAA,EAChB,iBAAiB,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAAA,EACjD,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,OAAO,EAAE,OAAO;AAAA,EAChB,UAAU,EAAE,OAAO;AAAA,EACnB,UAAU,EAAE,OAAO;AAAA,EACnB,gBAAgB,EAAE,OAAO;AAAA,EACzB,WAAW,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS;AAAA,EACtD,OAAO,EAAE,QAAQ;AAAA,EACjB,eAAe,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS;AACrD,CAAC;AAIM,MAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAAA,EACpC,SAAS,EAAE,OAAO;AAAA,EAClB,cAAc,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,cAAc,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EAClD,cAAc,EAAE,OAAO,KAAK;AAAA,EAC5B,OAAO,EAAE,OAAO;AAAA,EAChB,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAAA,EAC5C,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS;AAAA,EACpD,WAAW,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS;AAAA,EACtD,MAAM,EAAE,OAAO;AAAA,EACf,gBAAgB,EAAE,OAAO,EAAE,SAAS;AAAA,EACpC,aAAa,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS;AAAA,EACxD,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,YAAY,EAAE,OAAO;AAAA,EACrB,SAAS,EAAE,OAAO;AAAA,EAClB,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC1C,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,EAAE,SAAS;AAAA,EACvD,iBAAiB,EAAE,OAAO,EAAE,SAAS;AAAA,EACrC,aAAa,EAAE,OAAO,KAAK,EAAE,SAAS;AAAA,EACtC,UAAU,EAAE,OAAO,KAAK;AAAA,EACxB,mBAAmB,EAAE,OAAO,KAAK,EAAE,SAAS;AAAA,EAC5C,mBAAmB,EAAE,OAAO,KAAK,EAAE,SAAS;AAAA,EAC5C,qBAAqB,EAAE,OAAO,EAAE,SAAS;AAAA,EACzC,0BAA0B,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9C,QAAQ,EAAE,QAAQ;AAAA,EAClB,SAAS,EAAE,QAAQ;AAAA,EACnB,kCAAkC,EAAE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACtE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC1C,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC3C,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAAA,EAC5C,OAAO,EAAE,MAAM,sBAAsB;AACvC,CAAC;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { userService } from "../services/user.service";
|
|
4
|
-
async function findUserById() {
|
|
5
|
-
return safeServerAction(() => userService.findById());
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
findUserById
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=find-user-by-id.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/users/action/find-user-by-id.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { userService } from '../services/user.service';\n\nexport async function findUserById() {\n return safeServerAction(() => userService.findById());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAE5B,eAAsB,eAAe;AACnC,SAAO,iBAAiB,MAAM,YAAY,SAAS,CAAC;AACtD;","names":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { messagesService } from "../services/messages.service";
|
|
4
|
-
async function listMessagesAction(params) {
|
|
5
|
-
return safeServerAction(async () => {
|
|
6
|
-
const result = await messagesService.listMessages(params);
|
|
7
|
-
return { data: result.data, total: result.total, totalUnread: result.totalUnread };
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
11
|
-
listMessagesAction
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=list-messages.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/users/action/list-messages.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { messagesService } from '../services/messages.service';\nimport type { FindMessagesParams } from '../schema/messages.schema';\n\nexport async function listMessagesAction(params?: Partial<FindMessagesParams>) {\n return safeServerAction(async () => {\n const result = await messagesService.listMessages(params);\n return { data: result.data, total: result.total, totalUnread: result.totalUnread };\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAGhC,eAAsB,mBAAmB,QAAsC;AAC7E,SAAO,iBAAiB,YAAY;AAClC,UAAM,SAAS,MAAM,gBAAgB,aAAa,MAAM;AACxD,WAAO,EAAE,MAAM,OAAO,MAAM,OAAO,OAAO,OAAO,aAAa,OAAO,YAAY;AAAA,EACnF,CAAC;AACH;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { messagesService } from "../services/messages.service";
|
|
4
|
-
async function markAllMessagesAsReadAction() {
|
|
5
|
-
return safeServerAction(() => messagesService.markAllAsRead());
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
markAllMessagesAsReadAction
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=mark-all-messages-as-read.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/users/action/mark-all-messages-as-read.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { messagesService } from '../services/messages.service';\n\nexport async function markAllMessagesAsReadAction() {\n return safeServerAction(() => messagesService.markAllAsRead());\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,eAAsB,8BAA8B;AAClD,SAAO,iBAAiB,MAAM,gBAAgB,cAAc,CAAC;AAC/D;","names":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
-
import { messagesService } from "../services/messages.service";
|
|
4
|
-
async function markMessageAsReadAction(messageId) {
|
|
5
|
-
return safeServerAction(() => messagesService.markAsRead(messageId));
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
markMessageAsReadAction
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=mark-message-as-read.action.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/users/action/mark-message-as-read.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { messagesService } from '../services/messages.service';\n\nexport async function markMessageAsReadAction(messageId: string) {\n return safeServerAction(() => messagesService.markAsRead(messageId));\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAEhC,eAAsB,wBAAwB,WAAmB;AAC/D,SAAO,iBAAiB,MAAM,gBAAgB,WAAW,SAAS,CAAC;AACrE;","names":[]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
|
-
import { listMessagesAction } from "../action/list-messages.action";
|
|
4
|
-
import { markMessageAsReadAction } from "../action/mark-message-as-read.action";
|
|
5
|
-
import { markAllMessagesAsReadAction } from "../action/mark-all-messages-as-read.action";
|
|
6
|
-
import { withAction } from "../../../utils/withAction";
|
|
7
|
-
const MESSAGES_QUERY_KEY = ["messages"];
|
|
8
|
-
const INFINITE_MESSAGES_PAGE_SIZE = 10;
|
|
9
|
-
function useMessages(params) {
|
|
10
|
-
return useQuery({
|
|
11
|
-
queryKey: [...MESSAGES_QUERY_KEY, params],
|
|
12
|
-
queryFn: withAction(() => listMessagesAction(params))
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
function useInfiniteMessages(params) {
|
|
16
|
-
return useInfiniteQuery({
|
|
17
|
-
queryKey: [...MESSAGES_QUERY_KEY, "infinite", params],
|
|
18
|
-
queryFn: ({ pageParam }) => withAction(
|
|
19
|
-
() => listMessagesAction({
|
|
20
|
-
...params,
|
|
21
|
-
page: pageParam,
|
|
22
|
-
limit: INFINITE_MESSAGES_PAGE_SIZE
|
|
23
|
-
})
|
|
24
|
-
)(),
|
|
25
|
-
getNextPageParam: (lastPage, allPages) => {
|
|
26
|
-
const loaded = allPages.reduce((sum, p) => sum + p.data.length, 0);
|
|
27
|
-
return loaded < lastPage.total ? allPages.length + 1 : void 0;
|
|
28
|
-
},
|
|
29
|
-
initialPageParam: 1
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function useMarkMessageAsRead() {
|
|
33
|
-
const queryClient = useQueryClient();
|
|
34
|
-
return useMutation({
|
|
35
|
-
mutationFn: withAction(markMessageAsReadAction),
|
|
36
|
-
onSuccess: () => {
|
|
37
|
-
queryClient.invalidateQueries({ queryKey: MESSAGES_QUERY_KEY });
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function useMarkAllMessagesAsRead() {
|
|
42
|
-
const queryClient = useQueryClient();
|
|
43
|
-
return useMutation({
|
|
44
|
-
mutationFn: withAction(markAllMessagesAsReadAction),
|
|
45
|
-
onSuccess: () => {
|
|
46
|
-
queryClient.invalidateQueries({ queryKey: MESSAGES_QUERY_KEY });
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
export {
|
|
51
|
-
MESSAGES_QUERY_KEY,
|
|
52
|
-
useInfiniteMessages,
|
|
53
|
-
useMarkAllMessagesAsRead,
|
|
54
|
-
useMarkMessageAsRead,
|
|
55
|
-
useMessages
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=messages.hook.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/users/hooks/messages.hook.ts"],"sourcesContent":["'use client';\n\nimport { useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { listMessagesAction } from '../action/list-messages.action';\nimport { markMessageAsReadAction } from '../action/mark-message-as-read.action';\nimport { markAllMessagesAsReadAction } from '../action/mark-all-messages-as-read.action';\nimport { withAction } from '../../../utils/withAction';\nimport type { FindMessagesParams } from '../schema/messages.schema';\n\nexport const MESSAGES_QUERY_KEY = ['messages'];\n\nconst INFINITE_MESSAGES_PAGE_SIZE = 10;\n\nexport function useMessages(params?: Partial<FindMessagesParams>) {\n return useQuery({\n queryKey: [...MESSAGES_QUERY_KEY, params],\n queryFn: withAction(() => listMessagesAction(params)),\n });\n}\n\nexport function useInfiniteMessages(params?: Partial<Omit<FindMessagesParams, 'page' | 'limit'>>) {\n return useInfiniteQuery({\n queryKey: [...MESSAGES_QUERY_KEY, 'infinite', params],\n queryFn: ({ pageParam }) =>\n withAction(() =>\n listMessagesAction({\n ...params,\n page: pageParam as number,\n limit: INFINITE_MESSAGES_PAGE_SIZE,\n })\n )(),\n getNextPageParam: (lastPage, allPages) => {\n const loaded = allPages.reduce((sum, p) => sum + p.data.length, 0);\n return loaded < lastPage.total ? allPages.length + 1 : undefined;\n },\n initialPageParam: 1,\n });\n}\n\nexport function useMarkMessageAsRead() {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: withAction(markMessageAsReadAction),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: MESSAGES_QUERY_KEY });\n },\n });\n}\n\nexport function useMarkAllMessagesAsRead() {\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationFn: withAction(markAllMessagesAsReadAction),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: MESSAGES_QUERY_KEY });\n },\n });\n}\n"],"mappings":";AAEA,SAAS,kBAAkB,aAAa,UAAU,sBAAsB;AACxE,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,mCAAmC;AAC5C,SAAS,kBAAkB;AAGpB,MAAM,qBAAqB,CAAC,UAAU;AAE7C,MAAM,8BAA8B;AAE7B,SAAS,YAAY,QAAsC;AAChE,SAAO,SAAS;AAAA,IACd,UAAU,CAAC,GAAG,oBAAoB,MAAM;AAAA,IACxC,SAAS,WAAW,MAAM,mBAAmB,MAAM,CAAC;AAAA,EACtD,CAAC;AACH;AAEO,SAAS,oBAAoB,QAA8D;AAChG,SAAO,iBAAiB;AAAA,IACtB,UAAU,CAAC,GAAG,oBAAoB,YAAY,MAAM;AAAA,IACpD,SAAS,CAAC,EAAE,UAAU,MACpB;AAAA,MAAW,MACT,mBAAmB;AAAA,QACjB,GAAG;AAAA,QACH,MAAM;AAAA,QACN,OAAO;AAAA,MACT,CAAC;AAAA,IACH,EAAE;AAAA,IACJ,kBAAkB,CAAC,UAAU,aAAa;AACxC,YAAM,SAAS,SAAS,OAAO,CAAC,KAAK,MAAM,MAAM,EAAE,KAAK,QAAQ,CAAC;AACjE,aAAO,SAAS,SAAS,QAAQ,SAAS,SAAS,IAAI;AAAA,IACzD;AAAA,IACA,kBAAkB;AAAA,EACpB,CAAC;AACH;AAEO,SAAS,uBAAuB;AACrC,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,uBAAuB;AAAA,IAC9C,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,mBAAmB,CAAC;AAAA,IAChE;AAAA,EACF,CAAC;AACH;AAEO,SAAS,2BAA2B;AACzC,QAAM,cAAc,eAAe;AAEnC,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,2BAA2B;AAAA,IAClD,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,mBAAmB,CAAC;AAAA,IAChE;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
const MessageSchema = z.object({
|
|
3
|
-
id: z.string(),
|
|
4
|
-
deleted: z.number(),
|
|
5
|
-
datetime_alt: z.string().nullable(),
|
|
6
|
-
datetime_del: z.string().nullable(),
|
|
7
|
-
datetime_add: z.string(),
|
|
8
|
-
id_wl: z.number(),
|
|
9
|
-
id_account: z.number(),
|
|
10
|
-
id_user: z.number(),
|
|
11
|
-
status: z.number().nullable(),
|
|
12
|
-
type: z.string(),
|
|
13
|
-
subject: z.string(),
|
|
14
|
-
message: z.string(),
|
|
15
|
-
to: z.string(),
|
|
16
|
-
url: z.string()
|
|
17
|
-
});
|
|
18
|
-
export {
|
|
19
|
-
MessageSchema
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=messages.schema.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/users/schema/messages.schema.ts"],"sourcesContent":["import { z } from 'zod';\r\n\r\nexport const MessageSchema = z.object({\r\n id: z.string(),\r\n deleted: z.number(),\r\n datetime_alt: z.string().nullable(),\r\n datetime_del: z.string().nullable(),\r\n datetime_add: z.string(),\r\n id_wl: z.number(),\r\n id_account: z.number(),\r\n id_user: z.number(),\r\n status: z.number().nullable(),\r\n type: z.string(),\r\n subject: z.string(),\r\n message: z.string(),\r\n to: z.string(),\r\n url: z.string(),\r\n});\r\n\r\nexport type Message = z.infer<typeof MessageSchema>;\r\n\r\nexport interface FindMessagesParams {\r\n id_user: number;\r\n type: string;\r\n limit: number;\r\n page: number;\r\n status: number;\r\n readed: boolean;\r\n order: 'asc' | 'desc';\r\n}\r\n\r\nexport interface ListMessagesApiResponse {\r\n status: 0 | 1;\r\n total: number;\r\n data: Message[];\r\n totalUnread: number;\r\n message?: string;\r\n}\r\n\r\nexport interface MarkAsReadApiResponse {\r\n status: 0 | 1;\r\n message?: string;\r\n}\r\n\r\nexport interface MarkAllAsReadApiResponse {\r\n status: 0 | 1;\r\n message?: string;\r\n}\r\n"],"mappings":"AAAA,SAAS,SAAS;AAEX,MAAM,gBAAgB,EAAE,OAAO;AAAA,EACpC,IAAI,EAAE,OAAO;AAAA,EACb,SAAS,EAAE,OAAO;AAAA,EAClB,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,cAAc,EAAE,OAAO,EAAE,SAAS;AAAA,EAClC,cAAc,EAAE,OAAO;AAAA,EACvB,OAAO,EAAE,OAAO;AAAA,EAChB,YAAY,EAAE,OAAO;AAAA,EACrB,SAAS,EAAE,OAAO;AAAA,EAClB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,MAAM,EAAE,OAAO;AAAA,EACf,SAAS,EAAE,OAAO;AAAA,EAClB,SAAS,EAAE,OAAO;AAAA,EAClB,IAAI,EAAE,OAAO;AAAA,EACb,KAAK,EAAE,OAAO;AAChB,CAAC;","names":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var UserProfile = /* @__PURE__ */ ((UserProfile2) => {
|
|
2
|
-
UserProfile2["viewer"] = "viewer";
|
|
3
|
-
UserProfile2["collaborator"] = "collaborator";
|
|
4
|
-
UserProfile2["admin"] = "admin";
|
|
5
|
-
UserProfile2["owner"] = "owner";
|
|
6
|
-
return UserProfile2;
|
|
7
|
-
})(UserProfile || {});
|
|
8
|
-
export {
|
|
9
|
-
UserProfile
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=schema.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/modules/users/schema.ts"],"sourcesContent":["export enum UserProfile {\r\n viewer = 'viewer',\r\n collaborator = 'collaborator',\r\n admin = 'admin',\r\n owner = 'owner',\r\n}\r\n\r\nexport interface User {\r\n // Identificação\r\n id: number;\r\n id_wl: number;\r\n id_account: number;\r\n id_api: number;\r\n\r\n // Dados pessoais\r\n name: string;\r\n last_name: string;\r\n email: string;\r\n ddi: string;\r\n phone: string;\r\n rg: string | null;\r\n cpf: string | null;\r\n gender: number;\r\n\r\n // Autenticação e segurança\r\n two_factor_authentication: boolean;\r\n\r\n // Perfil e permissões\r\n profile: UserProfile;\r\n\r\n // Preferências\r\n language: string;\r\n receive_sms: boolean;\r\n receive_email: boolean;\r\n photo: string | null;\r\n\r\n // Metadados\r\n deleted: number;\r\n datetime_alt: string;\r\n datetime_del: string | null;\r\n datetime_add: string;\r\n\r\n total_projects: number;\r\n projects: { id: number; title: string }[];\r\n\r\n initials?: string;\r\n emailVerified?: boolean;\r\n createdAt?: string;\r\n updatedAt?: string;\r\n}\r\n\r\nexport interface GetUserDataResponse {\r\n status: 0 | 1;\r\n total: number;\r\n data: User[];\r\n}\r\n\r\nexport interface JWTPayload {\r\n session: {\r\n location: {\r\n continent: string;\r\n country: string;\r\n region: string;\r\n city: string;\r\n latitude: string;\r\n longitude: string;\r\n };\r\n ip: string;\r\n timezone: string;\r\n agent: string;\r\n code: string | null;\r\n };\r\n id_wl: string;\r\n id_account: number;\r\n id_user: number;\r\n iss: string;\r\n aud: string;\r\n iat: number;\r\n}\r\n"],"mappings":"AAAO,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,aAAA,YAAS;AACT,EAAAA,aAAA,kBAAe;AACf,EAAAA,aAAA,WAAQ;AACR,EAAAA,aAAA,WAAQ;AAJE,SAAAA;AAAA,GAAA;","names":["UserProfile"]}
|