@greatapps/common 1.1.541 → 1.1.543
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +1 -1
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +46 -7
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +2 -2
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/dist/modules/accounts/actions/account-management.action.mjs +15 -14
- package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
- package/dist/modules/auth/utils/require-valid-session.mjs +17 -0
- package/dist/modules/auth/utils/require-valid-session.mjs.map +1 -0
- package/dist/modules/cards/actions/create-card.action.mjs +2 -2
- package/dist/modules/cards/actions/create-card.action.mjs.map +1 -1
- package/dist/modules/cards/actions/delete-card.action.mjs +2 -2
- package/dist/modules/cards/actions/delete-card.action.mjs.map +1 -1
- package/dist/modules/cards/actions/set-default-card.action.mjs +2 -2
- package/dist/modules/cards/actions/set-default-card.action.mjs.map +1 -1
- package/dist/modules/pages/actions/count-pages.action.mjs +12 -0
- package/dist/modules/pages/actions/count-pages.action.mjs.map +1 -0
- package/dist/modules/pages/constants/query-keys.constants.mjs +5 -0
- package/dist/modules/pages/constants/query-keys.constants.mjs.map +1 -0
- package/dist/modules/pages/hooks/count-pages.hook.mjs +23 -0
- package/dist/modules/pages/hooks/count-pages.hook.mjs.map +1 -0
- package/dist/modules/pages/services/pages.service.mjs +24 -0
- package/dist/modules/pages/services/pages.service.mjs.map +1 -0
- package/dist/modules/projects/actions/add-project-user.action.mjs +2 -2
- package/dist/modules/projects/actions/add-project-user.action.mjs.map +1 -1
- package/dist/modules/projects/actions/create-project.action.mjs +2 -2
- package/dist/modules/projects/actions/create-project.action.mjs.map +1 -1
- package/dist/modules/projects/actions/delete-project.action.mjs +2 -2
- package/dist/modules/projects/actions/delete-project.action.mjs.map +1 -1
- package/dist/modules/projects/actions/remove-project-user.action.mjs +2 -2
- package/dist/modules/projects/actions/remove-project-user.action.mjs.map +1 -1
- package/dist/modules/projects/actions/update-project.action.mjs +2 -2
- package/dist/modules/projects/actions/update-project.action.mjs.map +1 -1
- package/dist/modules/subscriptions/actions/update-subscription-plan.action.mjs +2 -2
- package/dist/modules/subscriptions/actions/update-subscription-plan.action.mjs.map +1 -1
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +2 -2
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +1 -1
- package/dist/modules/users/action/mark-message-as-read.action.mjs +2 -2
- package/dist/modules/users/action/mark-message-as-read.action.mjs.map +1 -1
- package/dist/server.mjs +6 -0
- package/dist/server.mjs.map +1 -1
- package/dist/store/useAccountModals.mjs +2 -3
- package/dist/store/useAccountModals.mjs.map +1 -1
- package/dist/utils/safeMutationAction.mjs +13 -0
- package/dist/utils/safeMutationAction.mjs.map +1 -0
- package/package.json +1 -1
- package/src/components/account/ConfigurationsMyAccountModal.tsx +1 -0
- package/src/components/account/ConfirmDeleteAccountModal.tsx +47 -10
- package/src/components/account/DeleteAccountModal.tsx +2 -2
- package/src/index.ts +5 -0
- package/src/modules/accounts/actions/account-management.action.ts +15 -14
- package/src/modules/auth/utils/require-valid-session.ts +35 -0
- package/src/modules/cards/actions/create-card.action.ts +2 -2
- package/src/modules/cards/actions/delete-card.action.ts +2 -2
- package/src/modules/cards/actions/set-default-card.action.ts +2 -2
- package/src/modules/pages/actions/count-pages.action.ts +10 -0
- package/src/modules/pages/constants/query-keys.constants.ts +1 -0
- package/src/modules/pages/hooks/count-pages.hook.ts +22 -0
- package/src/modules/pages/services/pages.service.ts +27 -0
- package/src/modules/projects/actions/add-project-user.action.ts +2 -2
- package/src/modules/projects/actions/create-project.action.ts +2 -2
- package/src/modules/projects/actions/delete-project.action.ts +2 -2
- package/src/modules/projects/actions/remove-project-user.action.ts +2 -2
- package/src/modules/projects/actions/update-project.action.ts +2 -2
- package/src/modules/subscriptions/actions/update-subscription-plan.action.ts +2 -2
- package/src/modules/users/action/mark-all-messages-as-read.action.ts +2 -2
- package/src/modules/users/action/mark-message-as-read.action.ts +2 -2
- package/src/server.ts +3 -0
- package/src/store/useAccountModals.ts +6 -8
- package/src/utils/safeMutationAction.ts +30 -0
|
@@ -27,7 +27,7 @@ function ConfigurationsMyAccountModal() {
|
|
|
27
27
|
const { data: subscriptionData } = useActiveSubscription();
|
|
28
28
|
const subscription = subscriptionData?.data?.[0] ?? null;
|
|
29
29
|
const isPaidSubscriptionType = !!subscription && subscription.type !== "free" && subscription.type !== "trial";
|
|
30
|
-
const isBlockingSubscription = isPaidSubscriptionType && subscription.active === true && !hasSubscriptionExpired(subscription.date_due);
|
|
30
|
+
const isBlockingSubscription = isPaidSubscriptionType && subscription.active === true && !subscription.date_cancellation && !hasSubscriptionExpired(subscription.date_due);
|
|
31
31
|
const { user } = useAuth();
|
|
32
32
|
const isOwner = user?.profile === UserProfile.owner;
|
|
33
33
|
const isMobile = useIsMobile();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/ConfigurationsMyAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconKey, IconLock, IconSettings2, IconX } from '@tabler/icons-react';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../ui/data-display/Tabs';\nimport { cn } from '../../infra/utils/clsx';\nimport { AccountSectionType } from '../../enums/AccountSectionType';\nimport { PreferencesSection } from './sections/PreferencesSection';\nimport { ChangePasswordSection } from './sections/ChangePasswordSection';\nimport { TokenSection } from './sections/TokenSection';\nimport { SecuritySection } from './sections/SecuritySection';\nimport useConfigurationsModal from './hooks/useConfigurationsModal';\nimport useIsMobile from '../../hooks/useIsMobile';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport { useAuth } from '../../providers/auth.provider';\nimport { UserProfile } from '../../modules/users/schema';\nimport { useActiveSubscription } from '../../modules/subscriptions/hooks/find-active-subscription.hook';\nimport { hasSubscriptionExpired } from '../../modules/subscriptions/utils/has-subscription-expired';\n\nexport default function ConfigurationsMyAccountModal() {\n const {\n activeModal,\n openDeleteAccount,\n openIsntPossibleDelete,\n close,\n } = useAccountModals();\n\n const open = activeModal === 'configurations';\n\n const { data: subscriptionData } = useActiveSubscription();\n const subscription = subscriptionData?.data?.[0] ?? null;\n const isPaidSubscriptionType =\n !!subscription &&\n subscription.type !== 'free' &&\n subscription.type !== 'trial';\n const isBlockingSubscription =\n isPaidSubscriptionType &&\n subscription.active === true &&\n !hasSubscriptionExpired(subscription.date_due);\n\n const { user } = useAuth();\n const isOwner = user?.profile === UserProfile.owner;\n\n const isMobile = useIsMobile();\n const { activeSection, setActiveSection } = useConfigurationsModal({\n isOpen: open,\n });\n\n const handleDeleteAccount = () => {\n close();\n if (isBlockingSubscription) {\n openIsntPossibleDelete();\n } else {\n openDeleteAccount();\n }\n };\n\n const tabTriggerClasses = cn(\n 'border-0! px-0 py-0',\n\n 'lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full',\n 'lg:bg-white lg:hover:bg-gray-100 lg:active:bg-gray-50 lg:border-0',\n 'lg:data-[state=active]:bg-gray-50',\n\n 'flex items-center gap-1.5 px-3 py-3 justify-center whitespace-nowrap',\n 'border-b-2 border-transparent',\n 'data-[state=active]:bg-gray-50 rounded-lg',\n\n 'text-gray-500 data-[state=active]:text-gray-950',\n 'hover:text-gray-900 transition-colors'\n );\n\n return (\n <Dialog open={open} onOpenChange={close}>\n <DialogContent\n showCloseButton={!isMobile}\n overlayClassName=\"bg-black/20 lg:bg-black/50\"\n className=\"\n flex flex-col p-0 gap-0 max-w-full sm:max-w-full overflow-x-hidden border-0\n rounded-t-2xl rounded-b-none h-[100dvh] top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0\n lg:flex-row lg:w-[892px] lg:max-w-[892px] lg:h-[626px] lg:rounded-lg lg:border\n lg:top-[50%] lg:bottom-auto lg:left-[50%] lg:right-auto lg:translate-x-[-50%] lg:translate-y-[-50%]\"\n >\n <DialogHeader className=\"sr-only\">\n <DialogTitle>Configurações</DialogTitle>\n </DialogHeader>\n <div className=\"md:hidden flex items-center justify-between px-5 py-3 border-b border-gray-200\">\n <span className=\"text-gray-950 paragraph-medium-semibold\">Configurações</span>\n <button\n type=\"button\"\n className=\"size-8 flex items-center justify-center text-gray-500 cursor-pointer\"\n onClick={close}\n >\n <IconX size={18} />\n </button>\n </div>\n <Tabs\n value={activeSection}\n onValueChange={(value) => setActiveSection(value as AccountSectionType)}\n orientation=\"vertical\"\n className=\"flex lg:flex-row flex-col w-full h-full flex-1 lg:h-full lg:pt-0 lg:gap-0\"\n >\n <TabsList\n className={cn(\n 'flex gap-0 bg-transparent border-b-0',\n\n 'lg:flex-col lg:items-stretch lg:justify-start lg:w-auto lg:min-w-60',\n 'lg:border-r lg:border-gray-200 lg:pl-5 lg:pr-5 lg:pt-5 lg:gap-5 lg:overflow-x-visible lg:self-stretch',\n\n 'flex-row items-center justify-start w-full overflow-x-auto scrollbar-hide shrink-0',\n 'px-4 py-3',\n '[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-24px),transparent)] lg:[mask-image:none]'\n )}\n >\n <span className=\"hidden lg:block paragraph-medium-semibold text-gray-950 mb-0\">\n Configurações\n </span>\n\n <div className=\"lg:flex lg:flex-col flex flex-row lg:gap-0 gap-0 lg:w-full\">\n <TabsTrigger value={AccountSectionType.PREFERENCES} className={tabTriggerClasses}>\n <IconSettings2 size={20} className=\"shrink-0\" />\n <span className=\"paragraph-small-medium\">Preferências</span>\n </TabsTrigger>\n\n {isOwner && (\n <TabsTrigger value={AccountSectionType.TOKEN} className={tabTriggerClasses}>\n <IconKey size={20} className=\"shrink-0\" />\n <span className=\"paragraph-small-medium\">Token da conta</span>\n </TabsTrigger>\n )}\n\n {isOwner && (\n <TabsTrigger value={AccountSectionType.SECURITY} className={tabTriggerClasses}>\n <IconLock size={20} className=\"shrink-0\" />\n <span className=\"paragraph-small-medium\">Segurança</span>\n </TabsTrigger>\n )}\n </div>\n </TabsList>\n\n <div className=\"w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative flex flex-col\">\n <TabsContent value={AccountSectionType.PREFERENCES} className=\"h-full! relative overflow-hidden\">\n <PreferencesSection onClose={close} />\n </TabsContent>\n\n {isOwner && (\n <TabsContent value={AccountSectionType.TOKEN} className=\"h-full! relative overflow-hidden\">\n <TokenSection />\n </TabsContent>\n )}\n\n {isOwner && (\n <>\n <TabsContent value={AccountSectionType.SECURITY} className=\"h-full! relative overflow-hidden\">\n <SecuritySection\n setActiveSection={setActiveSection}\n onClose={close}\n onDeleteAccount={handleDeleteAccount}\n />\n </TabsContent>\n\n <TabsContent value={AccountSectionType.CHANGE_PASSWORD} className=\"h-full! relative overflow-hidden\">\n <ChangePasswordSection onBack={() => setActiveSection(AccountSectionType.SECURITY)} />\n </TabsContent>\n </>\n )}\n </div>\n </Tabs>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAoFU,SAoEI,UApEJ,KAEF,YAFE;AAlFV,SAAS,SAAS,UAAU,eAAe,aAAa;AACxD,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,MAAM,UAAU,aAAa,mBAAmB;AACzD,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,OAAO,4BAA4B;AACnC,OAAO,iBAAiB;AACxB,SAAS,wBAAwB;AACjC,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AAExB,SAAR,+BAAgD;AACrD,QAAM;AAAA,IACJ;AAAA,IACA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,oBAAC,eAAY,OAAO,mBAAmB,iBAAiB,WAAU,oCAChE,8BAAC,yBAAsB,QAAQ,MAAM,iBAAiB,mBAAmB,QAAQ,GAAG,GACtF;AAAA,mBACF;AAAA,iBAEJ;AAAA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/account/ConfigurationsMyAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconKey, IconLock, IconSettings2, IconX } from '@tabler/icons-react';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../ui/data-display/Tabs';\nimport { cn } from '../../infra/utils/clsx';\nimport { AccountSectionType } from '../../enums/AccountSectionType';\nimport { PreferencesSection } from './sections/PreferencesSection';\nimport { ChangePasswordSection } from './sections/ChangePasswordSection';\nimport { TokenSection } from './sections/TokenSection';\nimport { SecuritySection } from './sections/SecuritySection';\nimport useConfigurationsModal from './hooks/useConfigurationsModal';\nimport useIsMobile from '../../hooks/useIsMobile';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport { useAuth } from '../../providers/auth.provider';\nimport { UserProfile } from '../../modules/users/schema';\nimport { useActiveSubscription } from '../../modules/subscriptions/hooks/find-active-subscription.hook';\nimport { hasSubscriptionExpired } from '../../modules/subscriptions/utils/has-subscription-expired';\n\nexport default function ConfigurationsMyAccountModal() {\n const {\n activeModal,\n openDeleteAccount,\n openIsntPossibleDelete,\n close,\n } = useAccountModals();\n\n const open = activeModal === 'configurations';\n\n const { data: subscriptionData } = useActiveSubscription();\n const subscription = subscriptionData?.data?.[0] ?? null;\n const isPaidSubscriptionType =\n !!subscription &&\n subscription.type !== 'free' &&\n subscription.type !== 'trial';\n const isBlockingSubscription =\n isPaidSubscriptionType &&\n subscription.active === true &&\n !subscription.date_cancellation &&\n !hasSubscriptionExpired(subscription.date_due);\n\n const { user } = useAuth();\n const isOwner = user?.profile === UserProfile.owner;\n\n const isMobile = useIsMobile();\n const { activeSection, setActiveSection } = useConfigurationsModal({\n isOpen: open,\n });\n\n const handleDeleteAccount = () => {\n close();\n if (isBlockingSubscription) {\n openIsntPossibleDelete();\n } else {\n openDeleteAccount();\n }\n };\n\n const tabTriggerClasses = cn(\n 'border-0! px-0 py-0',\n\n 'lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full',\n 'lg:bg-white lg:hover:bg-gray-100 lg:active:bg-gray-50 lg:border-0',\n 'lg:data-[state=active]:bg-gray-50',\n\n 'flex items-center gap-1.5 px-3 py-3 justify-center whitespace-nowrap',\n 'border-b-2 border-transparent',\n 'data-[state=active]:bg-gray-50 rounded-lg',\n\n 'text-gray-500 data-[state=active]:text-gray-950',\n 'hover:text-gray-900 transition-colors'\n );\n\n return (\n <Dialog open={open} onOpenChange={close}>\n <DialogContent\n showCloseButton={!isMobile}\n overlayClassName=\"bg-black/20 lg:bg-black/50\"\n className=\"\n flex flex-col p-0 gap-0 max-w-full sm:max-w-full overflow-x-hidden border-0\n rounded-t-2xl rounded-b-none h-[100dvh] top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0\n lg:flex-row lg:w-[892px] lg:max-w-[892px] lg:h-[626px] lg:rounded-lg lg:border\n lg:top-[50%] lg:bottom-auto lg:left-[50%] lg:right-auto lg:translate-x-[-50%] lg:translate-y-[-50%]\"\n >\n <DialogHeader className=\"sr-only\">\n <DialogTitle>Configurações</DialogTitle>\n </DialogHeader>\n <div className=\"md:hidden flex items-center justify-between px-5 py-3 border-b border-gray-200\">\n <span className=\"text-gray-950 paragraph-medium-semibold\">Configurações</span>\n <button\n type=\"button\"\n className=\"size-8 flex items-center justify-center text-gray-500 cursor-pointer\"\n onClick={close}\n >\n <IconX size={18} />\n </button>\n </div>\n <Tabs\n value={activeSection}\n onValueChange={(value) => setActiveSection(value as AccountSectionType)}\n orientation=\"vertical\"\n className=\"flex lg:flex-row flex-col w-full h-full flex-1 lg:h-full lg:pt-0 lg:gap-0\"\n >\n <TabsList\n className={cn(\n 'flex gap-0 bg-transparent border-b-0',\n\n 'lg:flex-col lg:items-stretch lg:justify-start lg:w-auto lg:min-w-60',\n 'lg:border-r lg:border-gray-200 lg:pl-5 lg:pr-5 lg:pt-5 lg:gap-5 lg:overflow-x-visible lg:self-stretch',\n\n 'flex-row items-center justify-start w-full overflow-x-auto scrollbar-hide shrink-0',\n 'px-4 py-3',\n '[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-24px),transparent)] lg:[mask-image:none]'\n )}\n >\n <span className=\"hidden lg:block paragraph-medium-semibold text-gray-950 mb-0\">\n Configurações\n </span>\n\n <div className=\"lg:flex lg:flex-col flex flex-row lg:gap-0 gap-0 lg:w-full\">\n <TabsTrigger value={AccountSectionType.PREFERENCES} className={tabTriggerClasses}>\n <IconSettings2 size={20} className=\"shrink-0\" />\n <span className=\"paragraph-small-medium\">Preferências</span>\n </TabsTrigger>\n\n {isOwner && (\n <TabsTrigger value={AccountSectionType.TOKEN} className={tabTriggerClasses}>\n <IconKey size={20} className=\"shrink-0\" />\n <span className=\"paragraph-small-medium\">Token da conta</span>\n </TabsTrigger>\n )}\n\n {isOwner && (\n <TabsTrigger value={AccountSectionType.SECURITY} className={tabTriggerClasses}>\n <IconLock size={20} className=\"shrink-0\" />\n <span className=\"paragraph-small-medium\">Segurança</span>\n </TabsTrigger>\n )}\n </div>\n </TabsList>\n\n <div className=\"w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative flex flex-col\">\n <TabsContent value={AccountSectionType.PREFERENCES} className=\"h-full! relative overflow-hidden\">\n <PreferencesSection onClose={close} />\n </TabsContent>\n\n {isOwner && (\n <TabsContent value={AccountSectionType.TOKEN} className=\"h-full! relative overflow-hidden\">\n <TokenSection />\n </TabsContent>\n )}\n\n {isOwner && (\n <>\n <TabsContent value={AccountSectionType.SECURITY} className=\"h-full! relative overflow-hidden\">\n <SecuritySection\n setActiveSection={setActiveSection}\n onClose={close}\n onDeleteAccount={handleDeleteAccount}\n />\n </TabsContent>\n\n <TabsContent value={AccountSectionType.CHANGE_PASSWORD} className=\"h-full! relative overflow-hidden\">\n <ChangePasswordSection onBack={() => setActiveSection(AccountSectionType.SECURITY)} />\n </TabsContent>\n </>\n )}\n </div>\n </Tabs>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAqFU,SAoEI,UApEJ,KAEF,YAFE;AAnFV,SAAS,SAAS,UAAU,eAAe,aAAa;AACxD,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,MAAM,UAAU,aAAa,mBAAmB;AACzD,SAAS,UAAU;AACnB,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,OAAO,4BAA4B;AACnC,OAAO,iBAAiB;AACxB,SAAS,wBAAwB;AACjC,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,6BAA6B;AACtC,SAAS,8BAA8B;AAExB,SAAR,+BAAgD;AACrD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,iBAAiB;AAErB,QAAM,OAAO,gBAAgB;AAE7B,QAAM,EAAE,MAAM,iBAAiB,IAAI,sBAAsB;AACzD,QAAM,eAAe,kBAAkB,OAAO,CAAC,KAAK;AACpD,QAAM,yBACJ,CAAC,CAAC,gBACF,aAAa,SAAS,UACtB,aAAa,SAAS;AACxB,QAAM,yBACJ,0BACA,aAAa,WAAW,QACxB,CAAC,aAAa,qBACd,CAAC,uBAAuB,aAAa,QAAQ;AAE/C,QAAM,EAAE,KAAK,IAAI,QAAQ;AACzB,QAAM,UAAU,MAAM,YAAY,YAAY;AAE9C,QAAM,WAAW,YAAY;AAC7B,QAAM,EAAE,eAAe,iBAAiB,IAAI,uBAAuB;AAAA,IACjE,QAAQ;AAAA,EACV,CAAC;AAED,QAA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BAAmB,OAAO,WAAW,mBACvD;AAAA,4CAAC,WAAQ,MAAM,IAAI,WAAU,YAAW;AAAA,wBACxC,oBAAC,UAAK,WAAU,0BAAyB,4BAAc;AAAA,yBACzD;AAAA,sBAGD,WACC,qBAAC,eAAY,OAAO,mBAAmB,UAAU,WAAW,mBAC1D;AAAA,4CAAC,YAAS,MAAM,IAAI,WAAU,YAAW;AAAA,wBACzC,oBAAC,UAAK,WAAU,0BAAyB,0BAAS;AAAA,yBACpD;AAAA,uBAEJ;AAAA;AAAA;AAAA,cACF;AAAA,cAEA,qBAAC,SAAI,WAAU,8FACb;AAAA,oCAAC,eAAY,OAAO,mBAAmB,aAAa,WAAU,oCAC5D,8BAAC,sBAAmB,SAAS,OAAO,GACtC;AAAA,gBAEC,WACC,oBAAC,eAAY,OAAO,mBAAmB,OAAO,WAAU,oCACtD,8BAAC,gBAAa,GAChB;AAAA,gBAGD,WACC,iCACE;AAAA,sCAAC,eAAY,OAAO,mBAAmB,UAAU,WAAU,oCACzD;AAAA,oBAAC;AAAA;AAAA,sBACC;AAAA,sBACA,SAAS;AAAA,sBACT,iBAAiB;AAAA;AAAA,kBACnB,GACF;AAAA,kBAEA,oBAAC,eAAY,OAAO,mBAAmB,iBAAiB,WAAU,oCAChE,8BAAC,yBAAsB,QAAQ,MAAM,iBAAiB,mBAAmB,QAAQ,GAAG,GACtF;AAAA,mBACF;AAAA,iBAEJ;AAAA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -6,14 +6,44 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/overlay/
|
|
|
6
6
|
import { Button } from "../ui/buttons/Button";
|
|
7
7
|
import { Toast } from "../ui/feedback/Toast";
|
|
8
8
|
import { useAccountModals } from "../../store/useAccountModals";
|
|
9
|
+
import { useCountPages } from "../../modules/pages/hooks/count-pages.hook";
|
|
10
|
+
import {
|
|
11
|
+
useDeleteAccount,
|
|
12
|
+
useDeleteAccountUser
|
|
13
|
+
} from "../../modules/accounts/hooks/useAccountManagement";
|
|
14
|
+
import { useAuth } from "../../providers/auth.provider";
|
|
15
|
+
import { UserProfile } from "../../modules/users/schema";
|
|
9
16
|
function ConfirmDeleteAccountModal() {
|
|
10
|
-
const { activeModal,
|
|
17
|
+
const { activeModal, close } = useAccountModals();
|
|
11
18
|
const open = activeModal === "confirmDelete";
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
const { data: pagesCount = 0 } = useCountPages();
|
|
20
|
+
const { user, logout } = useAuth();
|
|
21
|
+
const isOwner = user?.profile === UserProfile.owner;
|
|
22
|
+
const deleteAccount = useDeleteAccount();
|
|
23
|
+
const deleteAccountUser = useDeleteAccountUser();
|
|
24
|
+
const isDeleting = deleteAccount.isPending || deleteAccountUser.isPending;
|
|
25
|
+
const handleConfirm = async () => {
|
|
26
|
+
try {
|
|
27
|
+
if (isOwner) {
|
|
28
|
+
await deleteAccount.mutateAsync();
|
|
29
|
+
} else {
|
|
30
|
+
await deleteAccountUser.mutateAsync(user.id);
|
|
31
|
+
}
|
|
32
|
+
close();
|
|
33
|
+
toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "success", message: "Conta exclu\xEDda com sucesso", toastId: t }));
|
|
34
|
+
await logout();
|
|
35
|
+
} catch (error) {
|
|
36
|
+
toast.custom((t) => /* @__PURE__ */ jsx(
|
|
37
|
+
Toast,
|
|
38
|
+
{
|
|
39
|
+
variant: "error",
|
|
40
|
+
message: error instanceof Error ? error.message : "Erro ao excluir. Tente novamente.",
|
|
41
|
+
toastId: t
|
|
42
|
+
}
|
|
43
|
+
));
|
|
44
|
+
}
|
|
15
45
|
};
|
|
16
|
-
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col p-0 gap-0 max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!", children: [
|
|
46
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: isDeleting ? void 0 : close, children: /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col p-0 gap-0 max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!", children: [
|
|
17
47
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 p-4 lg:p-5", children: [
|
|
18
48
|
/* @__PURE__ */ jsx(DialogHeader, { className: "p-0", children: /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-gray-950", children: "Uma pena te ver ir!" }) }),
|
|
19
49
|
/* @__PURE__ */ jsxs("div", { className: "bg-red-50 p-4 lg:p-5 rounded-lg flex items-center gap-4", children: [
|
|
@@ -34,8 +64,17 @@ function ConfirmDeleteAccountModal() {
|
|
|
34
64
|
] }),
|
|
35
65
|
/* @__PURE__ */ jsx("div", { className: "h-px bg-gray-200" }),
|
|
36
66
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-4 lg:p-5", children: [
|
|
37
|
-
/* @__PURE__ */ jsx(Button, { className: "h-10 flex-1", onClick: close, children: "Manter minha conta" }),
|
|
38
|
-
/* @__PURE__ */ jsx(
|
|
67
|
+
/* @__PURE__ */ jsx(Button, { className: "h-10 flex-1", onClick: close, disabled: isDeleting, children: "Manter minha conta" }),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
Button,
|
|
70
|
+
{
|
|
71
|
+
variant: "secondary",
|
|
72
|
+
className: "h-10! flex-1",
|
|
73
|
+
onClick: handleConfirm,
|
|
74
|
+
disabled: isDeleting,
|
|
75
|
+
children: isDeleting ? "Excluindo..." : "Excluir mesmo assim"
|
|
76
|
+
}
|
|
77
|
+
)
|
|
39
78
|
] })
|
|
40
79
|
] }) });
|
|
41
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/ConfirmDeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconAlertTriangle } from '@tabler/icons-react';\nimport { toast } from 'sonner';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { Toast } from '../ui/feedback/Toast';\nimport { useAccountModals } from '../../store/useAccountModals';\n\nexport default function ConfirmDeleteAccountModal() {\n const { activeModal,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/account/ConfirmDeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconAlertTriangle } from '@tabler/icons-react';\nimport { toast } from 'sonner';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { Toast } from '../ui/feedback/Toast';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport { useCountPages } from '../../modules/pages/hooks/count-pages.hook';\nimport {\n useDeleteAccount,\n useDeleteAccountUser,\n} from '../../modules/accounts/hooks/useAccountManagement';\nimport { useAuth } from '../../providers/auth.provider';\nimport { UserProfile } from '../../modules/users/schema';\n\nexport default function ConfirmDeleteAccountModal() {\n const { activeModal, close } = useAccountModals();\n const open = activeModal === 'confirmDelete';\n\n const { data: pagesCount = 0 } = useCountPages();\n\n const { user, logout } = useAuth();\n const isOwner = user?.profile === UserProfile.owner;\n\n const deleteAccount = useDeleteAccount();\n const deleteAccountUser = useDeleteAccountUser();\n const isDeleting = deleteAccount.isPending || deleteAccountUser.isPending;\n\n const handleConfirm = async () => {\n try {\n if (isOwner) {\n await deleteAccount.mutateAsync();\n } else {\n await deleteAccountUser.mutateAsync(user!.id);\n }\n close();\n toast.custom((t) => (\n <Toast variant=\"success\" message=\"Conta excluída com sucesso\" toastId={t} />\n ));\n await logout();\n } catch (error) {\n toast.custom((t) => (\n <Toast\n variant=\"error\"\n message={error instanceof Error ? error.message : 'Erro ao excluir. Tente novamente.'}\n toastId={t}\n />\n ));\n }\n };\n\n return (\n <Dialog open={open} onOpenChange={isDeleting ? undefined : close}>\n <DialogContent className=\"flex flex-col p-0 gap-0 max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\">\n <div className=\"flex flex-col gap-5 p-4 lg:p-5\">\n <DialogHeader className=\"p-0\">\n <DialogTitle className=\"paragraph-medium-semibold text-gray-950\">\n Uma pena te ver ir!\n </DialogTitle>\n </DialogHeader>\n\n <div className=\"bg-red-50 p-4 lg:p-5 rounded-lg flex items-center gap-4\">\n <IconAlertTriangle size={20} className=\"text-red-500 shrink-0\" strokeWidth={2} />\n <p className=\"paragraph-small-regular text-gray-600\">\n Todas suas{' '}\n <span className=\"font-semibold text-gray-950\">{pagesCount} páginas</span>{' '}\n serão deletadas permanentemente. Essa ação é{' '}\n <span className=\"font-semibold text-gray-950\">irreversível!</span>\n </p>\n </div>\n </div>\n\n <div className=\"h-px bg-gray-200\" />\n\n <div className=\"flex items-center gap-2 p-4 lg:p-5\">\n <Button className=\"h-10 flex-1\" onClick={close} disabled={isDeleting}>\n Manter minha conta\n </Button>\n <Button\n variant=\"secondary\"\n className=\"h-10! flex-1\"\n onClick={handleConfirm}\n disabled={isDeleting}\n >\n {isDeleting ? 'Excluindo...' : 'Excluir mesmo assim'}\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAsCQ,cA4BM,YA5BN;AApCR,SAAS,yBAAyB;AAClC,SAAS,aAAa;AACtB,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B;AAAA,EACE;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YAAW;AAAA,aAAQ;AAAA,UAAQ;AAAA,UAAI;AAAA,UACjC;AAAA,UAC7C,oBAAC,UAAK,WAAU,+BAA8B,8BAAa;AAAA,WAC7D;AAAA,SACF;AAAA,OACF;AAAA,IAEA,oBAAC,SAAI,WAAU,oBAAmB;AAAA,IAElC,qBAAC,SAAI,WAAU,sCACb;AAAA,0BAAC,UAAO,WAAU,eAAc,SAAS,OAAO,UAAU,YAAY,gCAEtE;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,SAAS;AAAA,UACT,UAAU;AAAA,UAET,uBAAa,iBAAiB;AAAA;AAAA,MACjC;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -21,7 +21,7 @@ const REASON_OPTIONS = [
|
|
|
21
21
|
{ value: "outro", label: "Outro motivo" }
|
|
22
22
|
];
|
|
23
23
|
function DeleteAccountModal() {
|
|
24
|
-
const { activeModal,
|
|
24
|
+
const { activeModal, openConfigurations, openConfirmDelete, close } = useAccountModals();
|
|
25
25
|
const open = activeModal === "deleteAccount";
|
|
26
26
|
const [reason, setReason] = useState("");
|
|
27
27
|
const [description, setDescription] = useState("");
|
|
@@ -44,7 +44,7 @@ function DeleteAccountModal() {
|
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
resetForm();
|
|
47
|
-
openConfirmDelete(
|
|
47
|
+
openConfirmDelete();
|
|
48
48
|
};
|
|
49
49
|
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsx(DialogContent, { className: "flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-lg lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-y-auto", children: /* @__PURE__ */ jsxs("form", { onSubmit: handleDelete, className: "flex flex-col flex-1 lg:flex-none", children: [
|
|
50
50
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 p-4 lg:p-6 flex-1 lg:flex-none", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/DeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useCallback } from 'react';\nimport { IconLock, IconAlertTriangle } from '@tabler/icons-react';\nimport { toast } from 'sonner';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { FormField } from '../ui/form/FormField';\nimport { SelectField } from '../ui/form/SelectField';\nimport { TextAreaField } from '../ui/form/TextAreaField';\nimport { Toast } from '../ui/feedback/Toast';\nimport usePasswordVisibility from '../../hooks/usePasswordVisibility';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport { AccountSectionType } from '../../enums/AccountSectionType';\n\nconst REASON_OPTIONS = [\n { value: 'sem-funcao', label: 'A ferramenta não possui uma função que eu preciso' },\n { value: 'problemas', label: 'Encontrei problemas técnicos ou erros no sistema' },\n { value: 'suporte', label: 'Tive problemas com o suporte ou atendimento' },\n { value: 'demora', label: 'As atualizações demoram mais do que o esperado' },\n { value: 'temporario', label: 'O cancelamento é temporário' },\n { value: 'outro', label: 'Outro motivo' },\n];\n\nexport default function DeleteAccountModal() {\n const { activeModal,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/account/DeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useCallback } from 'react';\nimport { IconLock, IconAlertTriangle } from '@tabler/icons-react';\nimport { toast } from 'sonner';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { FormField } from '../ui/form/FormField';\nimport { SelectField } from '../ui/form/SelectField';\nimport { TextAreaField } from '../ui/form/TextAreaField';\nimport { Toast } from '../ui/feedback/Toast';\nimport usePasswordVisibility from '../../hooks/usePasswordVisibility';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport { AccountSectionType } from '../../enums/AccountSectionType';\n\nconst REASON_OPTIONS = [\n { value: 'sem-funcao', label: 'A ferramenta não possui uma função que eu preciso' },\n { value: 'problemas', label: 'Encontrei problemas técnicos ou erros no sistema' },\n { value: 'suporte', label: 'Tive problemas com o suporte ou atendimento' },\n { value: 'demora', label: 'As atualizações demoram mais do que o esperado' },\n { value: 'temporario', label: 'O cancelamento é temporário' },\n { value: 'outro', label: 'Outro motivo' },\n];\n\nexport default function DeleteAccountModal() {\n const { activeModal, openConfigurations, openConfirmDelete, close } = useAccountModals();\n const open = activeModal === 'deleteAccount';\n\n const [reason, setReason] = useState('');\n const [description, setDescription] = useState('');\n const [password, setPassword] = useState('');\n const { showPassword, togglePassword } = usePasswordVisibility();\n\n const isFormValid = Boolean(reason && description && password);\n\n const resetForm = useCallback(() => {\n setReason('');\n setDescription('');\n setPassword('');\n }, []);\n\n const handleClose = () => {\n resetForm();\n openConfigurations(AccountSectionType.SECURITY);\n };\n\n const handleDelete = (e: React.FormEvent) => {\n e.preventDefault();\n if (!isFormValid) {\n toast.custom((t) => (\n <Toast variant=\"error\" message=\"Preencha todos os campos obrigatórios\" toastId={t} />\n ));\n return;\n }\n resetForm();\n openConfirmDelete();\n };\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-lg lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-y-auto\">\n <form onSubmit={handleDelete} className=\"flex flex-col flex-1 lg:flex-none\">\n <div className=\"flex flex-col gap-6 p-4 lg:p-6 flex-1 lg:flex-none\">\n <DialogHeader className=\"p-0\">\n <div className=\"flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5 mb-5\">\n <IconAlertTriangle size={20} className=\"text-red-500\" />\n </div>\n <DialogTitle>Excluir conta</DialogTitle>\n <DialogDescription className=\"paragraph-small-regular\">\n Esta ação é <span className=\"font-semibold text-gray-950\">irreversível</span>. Ao\n confirmar, sua conta e todos os seus dados serão excluídos.\n </DialogDescription>\n </DialogHeader>\n\n <SelectField\n label=\"Motivo do cancelamento\"\n required\n placeholder=\"Selecione\"\n options={REASON_OPTIONS}\n value={reason}\n onChange={(value) => setReason(value as string)}\n className=\"h-10!\"\n />\n\n <div>\n <TextAreaField\n label=\"Descreva o que levou a tomar essa decisão\"\n required\n placeholder=\"Explique sua decisão...\"\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n rows={4}\n maxLength={400}\n />\n <span className=\"paragraph-xsmall-medium text-gray-600 text-left mt-1 block\">\n {description.length}/400 caracteres\n </span>\n </div>\n\n <FormField\n className=\"text-gray-600\"\n label=\"Senha\"\n type=\"password\"\n placeholder=\"Informe sua senha\"\n leftIcon={IconLock}\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n classnameContainer=\"h-10!\"\n showPassword={showPassword}\n onTogglePassword={togglePassword}\n />\n </div>\n\n <div className=\"flex flex-row items-center justify-start gap-2 p-4 lg:p-6 border-t border-gray-200 bg-white mt-auto lg:mt-0\">\n <Button\n variant=\"default\"\n className=\"h-10\"\n type=\"submit\"\n >\n Excluir conta\n </Button>\n <Button variant=\"secondary\" className=\"h-10\" type=\"button\" onClick={handleClose}>\n Fechar\n </Button>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkDQ,cAkBM,YAlBN;AAhDR,SAAS,UAAU,mBAAmB;AACtC,SAAS,UAAU,yBAAyB;AAC5C,SAAS,aAAa;AACtB,SAAS,QAAQ,eAAe,mBAAmB,cAAc,mBAAmB;AACpF,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UACC,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,MAAK;AAAA,UACN;AAAA;AAAA,MAED;AAAA,MACA,oBAAC,UAAO,SAAQ,aAAY,WAAU,QAAO,MAAK,UAAS,SAAS,aAAa,oBAEjF;AAAA,OACF;AAAA,KACF,GACF,GACF;AAEJ;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -82,6 +82,11 @@ import {
|
|
|
82
82
|
} from "./modules/cards/types";
|
|
83
83
|
import { buildPlanExtras } from "./modules/subscriptions/utils/build-plan-extras";
|
|
84
84
|
import { hasSubscriptionExpired } from "./modules/subscriptions/utils/has-subscription-expired";
|
|
85
|
+
import {
|
|
86
|
+
useCountPages,
|
|
87
|
+
COUNT_PAGES_QUERY_KEY
|
|
88
|
+
} from "./modules/pages/hooks/count-pages.hook";
|
|
89
|
+
import { PAGES_QUERY_KEY } from "./modules/pages/constants/query-keys.constants";
|
|
85
90
|
import {
|
|
86
91
|
getPriceFromCalculatedData,
|
|
87
92
|
getOriginalPriceFromCalculatedData,
|
|
@@ -385,6 +390,7 @@ export {
|
|
|
385
390
|
default2 as BuyCreditsModal,
|
|
386
391
|
CARDS_QUERY_KEY,
|
|
387
392
|
CHARGES_QUERY_KEY,
|
|
393
|
+
COUNT_PAGES_QUERY_KEY,
|
|
388
394
|
CURRENCY_OPTIONS,
|
|
389
395
|
Calendar,
|
|
390
396
|
CalendarDayButton,
|
|
@@ -473,6 +479,7 @@ export {
|
|
|
473
479
|
default5 as NotificationCard,
|
|
474
480
|
NotificationPageContent,
|
|
475
481
|
NotificationsPopover,
|
|
482
|
+
PAGES_QUERY_KEY,
|
|
476
483
|
PLANS_QUERY_KEY,
|
|
477
484
|
PROJECTS_BASE_KEY,
|
|
478
485
|
PROJECTS_QUERY_KEY,
|
|
@@ -605,6 +612,7 @@ export {
|
|
|
605
612
|
useCardById,
|
|
606
613
|
useCards,
|
|
607
614
|
default7 as useCopyToClipboard,
|
|
615
|
+
useCountPages,
|
|
608
616
|
default12 as useCountdownTimer,
|
|
609
617
|
useCreateCard,
|
|
610
618
|
useCreateProject,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from \"./modules/auth/schema\";\nexport * from \"./modules/users/schema\";\nexport * from \"./modules/whitelabel/schema\";\n// Style types now come from whitelabel schema directly\nexport * from \"./infra/api/types\";\n\n// Contexts\nexport * from \"./providers/query.provider\";\nexport * from \"./providers/auth.provider\";\nexport * from \"./providers/whitelabel.provider\";\n\n// Hooks\nexport {\n useListProjectUsers,\n LIST_PROJECT_USERS_QUERY_KEY,\n LIST_PROJECT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-project-users.hook\";\nexport {\n useListAvailableUsers,\n LIST_AVAILABLE_USERS_QUERY_KEY,\n LIST_AVAILABLE_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-available-users.hook\";\nexport {\n useListAllAccountUsers,\n LIST_ALL_ACCOUNT_USERS_QUERY_KEY,\n LIST_ALL_ACCOUNT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-all-account-users.hook\";\nexport {\n useProjects,\n PROJECTS_BASE_KEY,\n PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-projects.hook\";\nexport {\n useInfiniteProjects,\n INFINITE_PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-infinite-projects.hook\";\nexport { useProject } from \"./modules/projects/hooks/find-project.hook\";\nexport { useCreateProject } from \"./modules/projects/hooks/create-project.hook\";\nexport { useUpdateProject } from \"./modules/projects/hooks/update-project.hook\";\nexport { useDeleteProject } from \"./modules/projects/hooks/delete-project.hook\";\nexport type {\n Project,\n ProjectsPage,\n CreateProjectRequest,\n UpdateProjectRequest,\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\nexport { ProjectSchema } from \"./modules/projects/types\";\nexport type { ListProjectsActionParams } from \"./modules/projects/actions/list-projects.action\";\nexport {\n useUserQuery,\n useUserValidateSession,\n useInvalidateUser,\n useSetUserData,\n useTwoFactorVerify,\n USER_QUERY_KEY,\n} from \"./modules/auth/hooks/useUserQuery\";\nexport { useManagementPermissions } from \"./modules/auth/hooks/useManagementPermissions\";\nexport type { ManagementPermission } from \"./modules/auth/types/management-permission.type\";\nexport { useSubscriptions } from \"./modules/subscriptions/hooks/list-subscriptions.hook\";\nexport {\n SUBSCRIPTIONS_QUERY_KEY,\n CHARGES_QUERY_KEY,\n} from \"./modules/subscriptions/constants/query-keys.constants\";\nexport { useActiveSubscription } from \"./modules/subscriptions/hooks/find-active-subscription.hook\";\nexport { useCancelledSubscriptionGuard } from \"./modules/subscriptions/hooks/use-cancelled-subscription-guard\";\nexport { usePlanById } from \"./modules/plans/hooks/use-plan-by-id.hook\";\nexport { useHasPlanAddon } from \"./modules/plans/hooks/use-has-plan-addon.hook\";\nexport { useCalculateSubscription } from \"./modules/subscriptions/hooks/calculate-subscription.hook\";\nexport { useUpdateSubscriptionPlan } from \"./modules/subscriptions/hooks/update-subscription-plan.hook\";\nexport { useCards, CARDS_QUERY_KEY } from \"./modules/cards/hooks/cards.hook\";\nexport { useCardById } from \"./modules/cards/hooks/card-by-id.hook\";\nexport { useCreateCard } from \"./modules/cards/hooks/create-card.hook\";\nexport { useSetDefaultCard } from \"./modules/cards/hooks/set-default-card.hook\";\nexport { useDeleteCard } from \"./modules/cards/hooks/delete-card.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditOperation,\n} from \"./modules/ia-credits/types\";\nexport type {\n Subscription,\n SubscriptionItem,\n FindSubscriptionsParams,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n SubscriptionSchema,\n SubscriptionItemSchema,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n ADDON_IDS,\n AI_CREDIT_OPTIONS,\n AI_CREDIT_VALUES,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n AddonKindEnum,\n AiCreditOption,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n Plan,\n PlanItem,\n UiPlan,\n PlanFeature,\n PlanMainFeatures,\n PlanPricingByPeriod,\n PlanTooltips,\n} from \"./modules/plans/types/plan.type\";\nexport { PlanSchema, PlanItemSchema } from \"./modules/plans/types/plan.type\";\nexport { mapApiPlanToUiPlan } from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport type { PlanBillingPeriod } from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport {\n usePlans,\n PLANS_QUERY_KEY,\n} from \"./modules/plans/hooks/list-plans.hook\";\nexport type { BillingPeriod } from \"./modules/subscriptions/types/billing-period.type\";\nexport type {\n CalculateSubscriptionRequest,\n CalculateSubscriptionResponse,\n UpdateSubscriptionPlanRequest,\n} from \"./modules/subscriptions/types/calculate-subscription.type\";\nexport type {\n Card as PaymentCard,\n CreateCardRequest,\n FindCardsParams,\n} from \"./modules/cards/types\";\nexport {\n CardSchema as PaymentCardSchema,\n CreateCardRequestSchema,\n FindCardsParamsSchema,\n} from \"./modules/cards/types\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport {\n getPriceFromCalculatedData,\n getOriginalPriceFromCalculatedData,\n periodicityToBillingPeriod,\n} from \"./modules/subscriptions/utils/periodicity\";\nexport { useBuyCreditsModal } from \"./store/useBuyCreditsModal\";\nexport { usePaidPlanRequiredModal } from \"./store/usePaidPlanRequiredModal\";\nexport { default as BuyCreditsModal } from \"./components/modals/BuyCreditsModal\";\nexport { default as PaidPlanRequiredModal } from \"./components/modals/PaidPlanRequiredModal\";\nexport { default as AddCardModal } from \"./components/modals/cards/AddCardModal\";\nexport {\n CardFormFields,\n cardFormSchema,\n} from \"./components/modals/cards/CardFormFields\";\nexport type { CardFormData } from \"./components/modals/cards/CardFormFields\";\nexport { Skeleton } from \"./components/ui/feedback/Skeleton\";\nexport { PaymentInfoCard } from \"./components/ui/data-display/PaymentInfoCard\";\nexport { CardBrandIcon } from \"./components/ui/data-display/CardBrandIcons\";\nexport { CardItem } from \"./components/ui/data-display/CardItem\";\n\n// Providers\nexport { QueryProvider } from \"./providers/query.provider\";\n\n// Middleware\nexport { createAuthMiddleware } from \"./middlewares/create-auth-middleware\";\nexport { createMiddlewareChain } from \"./middlewares/chain\";\nexport { continueChain, stopChain } from \"./middlewares/types\";\nexport type {\n MiddlewareFunction,\n MiddlewareConfig,\n MiddlewareResult,\n} from \"./middlewares/types\";\n\n// Utils\nexport { cn } from \"./infra/utils/clsx\";\nexport { formatShortDate, formatDateTime } from \"./infra/utils/date\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\nexport { withAction } from \"./utils/withAction\";\n\n// Layout\nexport {\n MainLayout,\n MainLayoutContent,\n MainLayoutSpacer,\n MainLayoutMain,\n} from \"./components/layouts/MainLayout\";\nexport { NavBar } from \"./components/layouts/NavBar\";\nexport type { NavBarProps } from \"./components/layouts/NavBar\";\nexport { AppNavBar } from \"./components/layouts/AppNavBar\";\nexport type { AppNavBarProps } from \"./components/layouts/AppNavBar\";\nexport { AppMobileNavBar } from \"./components/layouts/AppMobileNavBar\";\nexport type { AppMobileNavBarProps } from \"./components/layouts/AppMobileNavBar\";\nexport { SideBarNavigation } from \"./components/layouts/SideBarNavigation\";\nexport { MdSideBarNavigation } from \"./components/layouts/MdSideBarNavigation\";\nexport { default as NotificationCard } from \"./components/widgets/notifications/NotificationCard\";\nexport type { NotificationCardProps } from \"./components/widgets/notifications/NotificationCard\";\nexport { NotificationsPopover } from \"./components/layouts/NotificationsPopover\";\nexport type { NotificationsPopoverProps } from \"./components/layouts/NotificationsPopover\";\nexport { NotificationPageContent } from \"./components/pages/notifications/Notifications\";\nexport { NotFoundPage } from \"./components/pages/NotFoundPage\";\nexport { UsersSelectorPopover } from \"./components/layouts/UsersSelectorPopover\";\nexport type { UsersSelectorPopoverProps } from \"./components/layouts/UsersSelectorPopover\";\nexport { ProfilePopover } from \"./components/layouts/ProfilePopover\";\nexport type {\n ProfilePopoverProps,\n ProfileMenuItem,\n} from \"./components/layouts/ProfilePopover\";\nexport { default as WhitelabelCodes } from \"./components/layouts/WhitelabelCodes\";\nexport { NavBarItem } from \"./components/layouts/NavBarItem\";\nexport type { NavBarItemProps } from \"./components/layouts/NavBarItem\";\n\n// Navigation\nexport { AppNavigation } from \"./components/navigation/AppNavigation\";\nexport { CancelledSubscriptionBanner } from \"./components/navigation/CancelledSubscriptionBanner\";\nexport type { NavItemConfig } from \"./components/navigation/subcomponents/NavItems\";\nexport { useMobileNavbarSheet } from \"./store/useMobileNavbarSheet\";\n\n// Auth Query Key Utilities\nexport {\n useAuthQueryKey,\n useWlQueryKey,\n useWlId,\n} from \"./hooks/useAuthQueryKey\";\n\n// Hooks\nexport { default as useCopyToClipboard } from \"./hooks/copy-to-clipboard.hook\";\n\n// UI - Buttons\nexport { Button, buttonVariants } from \"./components/ui/buttons/Button\";\nexport { CopyButton } from \"./components/ui/buttons/CopyButton\";\nexport { default as CancelButton } from \"./components/ui/buttons/CancelButton\";\n\n// UI - Data Display\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from \"./components/ui/data-display/Accordion\";\nexport { Badge, badgeVariants } from \"./components/ui/data-display/Badge\";\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n} from \"./components/ui/data-display/Card\";\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n} from \"./components/ui/data-display/Pagination\";\nexport { ScrollArea, ScrollBar } from \"./components/ui/data-display/ScrollArea\";\nexport { Separator } from \"./components/ui/data-display/Separator\";\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from \"./components/ui/data-display/Table\";\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from \"./components/ui/data-display/Tabs\";\nexport { UserAvatar } from \"./components/ui/data-display/UserAvatar\";\nexport type { UserAvatarProps } from \"./components/ui/data-display/UserAvatar\";\n\n// UI - Feedback\nexport { default as CircularProgress } from \"./components/ui/feedback/CircularProgress\";\nexport { default as DefaultCircularProgress } from \"./components/ui/feedback/DefaultCircularProgress\";\nexport { Progress } from \"./components/ui/feedback/Progress\";\nexport { LoadingOverlay } from \"./components/ui/feedback/LoadingOverlay\";\nexport {\n Toast,\n toastVariants,\n toastIconContainerVariants,\n} from \"./components/ui/feedback/Toast\";\nexport type { ToastProps } from \"./components/ui/feedback/Toast\";\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from \"./components/ui/form/Calendar\";\nexport { Checkbox } from \"./components/ui/form/Checkbox\";\nexport { DatePicker } from \"./components/ui/form/DatePicker\";\nexport { DateRangePicker } from \"./components/ui/form/DateRangePicker\";\nexport { Input } from \"./components/ui/form/Input\";\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./components/ui/form/InputOtp\";\nexport { RadioGroup, RadioGroupItem } from \"./components/ui/form/RadioGroup\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from \"./components/ui/form/Select\";\nexport { Switch } from \"./components/ui/form/Switch\";\nexport { Textarea } from \"./components/ui/form/Textarea\";\n\n// UI - Overlay\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from \"./components/ui/overlay/Command\";\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"./components/ui/overlay/Dialog\";\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n} from \"./components/ui/overlay/Popover\";\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from \"./components/ui/overlay/Sheet\";\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"./components/ui/overlay/Tooltip\";\n\n// Embeds\nexport { FrillEmbed } from \"./components/embeds/FrillEmbed\";\nexport {\n CrispEmbed,\n openCrispHelpdesk,\n hideCrisp,\n showCrisp,\n updateCrispUser,\n} from \"./components/embeds/CrispEmbed\";\nexport { EmbedWidgets } from \"./components/embeds/EmbedWidgets\";\nexport { ClarityEmbed } from \"./components/embeds/ClarityEmbed\";\n\n// Store\nexport { useMdSidebarStore } from \"./store/useMdSidebarStore\";\nexport { useDesktopSidebarStore } from \"./store/useDesktopSidebarStore\";\nexport { useModalManager } from \"./store/useModalManager\";\nexport type { ModalData } from \"./store/useModalManager\";\n\n// Enums\nexport { AccountSectionType } from \"./enums/AccountSectionType\";\n\n// Hooks\nexport { default as usePasswordVisibility } from \"./hooks/usePasswordVisibility\";\nexport { default as useCountdownTimer } from \"./hooks/useCountdownTimer\";\nexport { default as useIsMobile } from \"./hooks/useIsMobile\";\nexport { useDebounce } from \"./hooks/useDebounce\";\nexport { useDebouncedEffect } from \"./hooks/useDebouncedEffect\";\nexport { useDebounceState } from \"./hooks/useDebounceState\";\n\n// Utils\nexport {\n formatPhone,\n formatTimer,\n formatFullName,\n formatCPF,\n formatCNPJ,\n formatCardNumber,\n} from \"./utils/format/masks\";\nexport { formatCurrencyNumber } from \"./utils/format/currency\";\nexport { BR_STATE_OPTIONS } from \"./utils/constants/br-states\";\nexport type { TimezoneOption } from \"./modules/accounts/services/timezone.service\";\nexport {\n buildLocaleOptions,\n LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS,\n} from \"./utils/intl/locales\";\nexport type { LocaleOption } from \"./utils/intl/locales\";\nexport { copyToClipboard, readFromClipboard } from \"./utils/browser/clipboard\";\n\n// UI - Form (new widgets)\nexport { FormField } from \"./components/ui/form/FormField\";\nexport { SelectField } from \"./components/ui/form/SelectField\";\nexport { ComboboxField } from \"./components/ui/form/ComboboxField\";\nexport type { ComboboxOption } from \"./components/ui/form/ComboboxField\";\nexport { default as PhoneInput } from \"./components/ui/form/PhoneInput\";\nexport { default as SwitchOptionFieldWithIcon } from \"./components/ui/form/SwitchOptionFieldWithIcon\";\nexport { TextAreaField } from \"./components/ui/form/TextAreaField\";\n\n// Account Module - Hooks\nexport {\n useCurrentAccount,\n ACCOUNT_QUERY_KEY,\n} from \"./modules/accounts/hooks/current-account.hook\";\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useDeleteAccountUser,\n useDeleteAccount,\n ACCOUNT_USERS_QUERY_KEY,\n} from \"./modules/accounts/hooks/useAccountManagement\";\nexport { useViaCep } from \"./modules/accounts/hooks/useViaCep\";\nexport { useAccountToken } from \"./modules/accounts/hooks/use-account-token.hook\";\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from \"./modules/accounts/types\";\n\nexport { default as AccountModals } from \"./components/account/AccountModals\";\nexport { useAccountModals } from \"./store/useAccountModals\";\nexport type { AccountModalsConfig } from \"./store/useAccountModals\";\n\nexport { ModalManager } from \"./components/modals/ModalManager\";\nexport { Modals } from \"./components/modals/Modals\";\n\nexport { default as TwoFactorAuthModal } from \"./components/account/TwoFactorAuthModal\";\nexport { default as DisableTwoFactorAuthModal } from \"./components/account/DisableTwoFactorAuthModal\";\nexport { default as ConfirmGlobalPreferencesModal } from \"./components/account/ConfirmGlobalPreferencesModal\";\nexport { MyProfileSection } from \"./components/account/sections/MyProfileSection\";\nexport { PreferencesSection } from \"./components/account/sections/PreferencesSection\";\nexport { SecuritySection } from \"./components/account/sections/SecuritySection\";\nexport { ChangePasswordSection } from \"./components/account/sections/ChangePasswordSection\";\nexport { ChangeEmailModal } from \"./components/account/sections/ChangeEmailModal\";\nexport { ChangePhoneModal } from \"./components/account/sections/ChangePhoneModal\";\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from \"./components/account/constants\";\n\n// Image Upload\nexport {\n ImageUpload,\n ImageCropModal,\n ImageTooSmallModal,\n} from \"./components/widgets/ImageUpload\";\nexport {\n useImageUpload,\n type ImageTooSmallError,\n} from \"./modules/images/hooks/use-image-upload.hook\";\nexport {\n ACCEPTED_IMAGE_FORMATS,\n ACCEPTED_IMAGE_FORMATS_STRING,\n MAX_FILE_SIZE_MB,\n} from \"./modules/images/constants/image.constants\";\nexport type {\n ImageConfig,\n CropArea,\n ProcessedImage,\n CompressImageOptions,\n} from \"./modules/images/types/image.type\";\nexport { compressImage } from \"./modules/images/utils/compress-image\";\nexport { cropImageToCanvas } from \"./modules/images/utils/crop-image\";\nexport { base64ToFile, fileToBase64 } from \"./modules/images/utils/base64\";\nexport {\n validateImage,\n validateImageFormat,\n validateImageSize,\n getImageDimensions,\n} from \"./modules/images/utils/validate-image\";\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,O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":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from \"./modules/auth/schema\";\nexport * from \"./modules/users/schema\";\nexport * from \"./modules/whitelabel/schema\";\n// Style types now come from whitelabel schema directly\nexport * from \"./infra/api/types\";\n\n// Contexts\nexport * from \"./providers/query.provider\";\nexport * from \"./providers/auth.provider\";\nexport * from \"./providers/whitelabel.provider\";\n\n// Hooks\nexport {\n useListProjectUsers,\n LIST_PROJECT_USERS_QUERY_KEY,\n LIST_PROJECT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-project-users.hook\";\nexport {\n useListAvailableUsers,\n LIST_AVAILABLE_USERS_QUERY_KEY,\n LIST_AVAILABLE_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-available-users.hook\";\nexport {\n useListAllAccountUsers,\n LIST_ALL_ACCOUNT_USERS_QUERY_KEY,\n LIST_ALL_ACCOUNT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-all-account-users.hook\";\nexport {\n useProjects,\n PROJECTS_BASE_KEY,\n PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-projects.hook\";\nexport {\n useInfiniteProjects,\n INFINITE_PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-infinite-projects.hook\";\nexport { useProject } from \"./modules/projects/hooks/find-project.hook\";\nexport { useCreateProject } from \"./modules/projects/hooks/create-project.hook\";\nexport { useUpdateProject } from \"./modules/projects/hooks/update-project.hook\";\nexport { useDeleteProject } from \"./modules/projects/hooks/delete-project.hook\";\nexport type {\n Project,\n ProjectsPage,\n CreateProjectRequest,\n UpdateProjectRequest,\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\nexport { ProjectSchema } from \"./modules/projects/types\";\nexport type { ListProjectsActionParams } from \"./modules/projects/actions/list-projects.action\";\nexport {\n useUserQuery,\n useUserValidateSession,\n useInvalidateUser,\n useSetUserData,\n useTwoFactorVerify,\n USER_QUERY_KEY,\n} from \"./modules/auth/hooks/useUserQuery\";\nexport { useManagementPermissions } from \"./modules/auth/hooks/useManagementPermissions\";\nexport type { ManagementPermission } from \"./modules/auth/types/management-permission.type\";\nexport { useSubscriptions } from \"./modules/subscriptions/hooks/list-subscriptions.hook\";\nexport {\n SUBSCRIPTIONS_QUERY_KEY,\n CHARGES_QUERY_KEY,\n} from \"./modules/subscriptions/constants/query-keys.constants\";\nexport { useActiveSubscription } from \"./modules/subscriptions/hooks/find-active-subscription.hook\";\nexport { useCancelledSubscriptionGuard } from \"./modules/subscriptions/hooks/use-cancelled-subscription-guard\";\nexport { usePlanById } from \"./modules/plans/hooks/use-plan-by-id.hook\";\nexport { useHasPlanAddon } from \"./modules/plans/hooks/use-has-plan-addon.hook\";\nexport { useCalculateSubscription } from \"./modules/subscriptions/hooks/calculate-subscription.hook\";\nexport { useUpdateSubscriptionPlan } from \"./modules/subscriptions/hooks/update-subscription-plan.hook\";\nexport { useCards, CARDS_QUERY_KEY } from \"./modules/cards/hooks/cards.hook\";\nexport { useCardById } from \"./modules/cards/hooks/card-by-id.hook\";\nexport { useCreateCard } from \"./modules/cards/hooks/create-card.hook\";\nexport { useSetDefaultCard } from \"./modules/cards/hooks/set-default-card.hook\";\nexport { useDeleteCard } from \"./modules/cards/hooks/delete-card.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditOperation,\n} from \"./modules/ia-credits/types\";\nexport type {\n Subscription,\n SubscriptionItem,\n FindSubscriptionsParams,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n SubscriptionSchema,\n SubscriptionItemSchema,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n ADDON_IDS,\n AI_CREDIT_OPTIONS,\n AI_CREDIT_VALUES,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n AddonKindEnum,\n AiCreditOption,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n Plan,\n PlanItem,\n UiPlan,\n PlanFeature,\n PlanMainFeatures,\n PlanPricingByPeriod,\n PlanTooltips,\n} from \"./modules/plans/types/plan.type\";\nexport { PlanSchema, PlanItemSchema } from \"./modules/plans/types/plan.type\";\nexport { mapApiPlanToUiPlan } from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport type { PlanBillingPeriod } from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport {\n usePlans,\n PLANS_QUERY_KEY,\n} from \"./modules/plans/hooks/list-plans.hook\";\nexport type { BillingPeriod } from \"./modules/subscriptions/types/billing-period.type\";\nexport type {\n CalculateSubscriptionRequest,\n CalculateSubscriptionResponse,\n UpdateSubscriptionPlanRequest,\n} from \"./modules/subscriptions/types/calculate-subscription.type\";\nexport type {\n Card as PaymentCard,\n CreateCardRequest,\n FindCardsParams,\n} from \"./modules/cards/types\";\nexport {\n CardSchema as PaymentCardSchema,\n CreateCardRequestSchema,\n FindCardsParamsSchema,\n} from \"./modules/cards/types\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport {\n useCountPages,\n COUNT_PAGES_QUERY_KEY,\n} from \"./modules/pages/hooks/count-pages.hook\";\nexport { PAGES_QUERY_KEY } from \"./modules/pages/constants/query-keys.constants\";\nexport {\n getPriceFromCalculatedData,\n getOriginalPriceFromCalculatedData,\n periodicityToBillingPeriod,\n} from \"./modules/subscriptions/utils/periodicity\";\nexport { useBuyCreditsModal } from \"./store/useBuyCreditsModal\";\nexport { usePaidPlanRequiredModal } from \"./store/usePaidPlanRequiredModal\";\nexport { default as BuyCreditsModal } from \"./components/modals/BuyCreditsModal\";\nexport { default as PaidPlanRequiredModal } from \"./components/modals/PaidPlanRequiredModal\";\nexport { default as AddCardModal } from \"./components/modals/cards/AddCardModal\";\nexport {\n CardFormFields,\n cardFormSchema,\n} from \"./components/modals/cards/CardFormFields\";\nexport type { CardFormData } from \"./components/modals/cards/CardFormFields\";\nexport { Skeleton } from \"./components/ui/feedback/Skeleton\";\nexport { PaymentInfoCard } from \"./components/ui/data-display/PaymentInfoCard\";\nexport { CardBrandIcon } from \"./components/ui/data-display/CardBrandIcons\";\nexport { CardItem } from \"./components/ui/data-display/CardItem\";\n\n// Providers\nexport { QueryProvider } from \"./providers/query.provider\";\n\n// Middleware\nexport { createAuthMiddleware } from \"./middlewares/create-auth-middleware\";\nexport { createMiddlewareChain } from \"./middlewares/chain\";\nexport { continueChain, stopChain } from \"./middlewares/types\";\nexport type {\n MiddlewareFunction,\n MiddlewareConfig,\n MiddlewareResult,\n} from \"./middlewares/types\";\n\n// Utils\nexport { cn } from \"./infra/utils/clsx\";\nexport { formatShortDate, formatDateTime } from \"./infra/utils/date\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\nexport { withAction } from \"./utils/withAction\";\n\n// Layout\nexport {\n MainLayout,\n MainLayoutContent,\n MainLayoutSpacer,\n MainLayoutMain,\n} from \"./components/layouts/MainLayout\";\nexport { NavBar } from \"./components/layouts/NavBar\";\nexport type { NavBarProps } from \"./components/layouts/NavBar\";\nexport { AppNavBar } from \"./components/layouts/AppNavBar\";\nexport type { AppNavBarProps } from \"./components/layouts/AppNavBar\";\nexport { AppMobileNavBar } from \"./components/layouts/AppMobileNavBar\";\nexport type { AppMobileNavBarProps } from \"./components/layouts/AppMobileNavBar\";\nexport { SideBarNavigation } from \"./components/layouts/SideBarNavigation\";\nexport { MdSideBarNavigation } from \"./components/layouts/MdSideBarNavigation\";\nexport { default as NotificationCard } from \"./components/widgets/notifications/NotificationCard\";\nexport type { NotificationCardProps } from \"./components/widgets/notifications/NotificationCard\";\nexport { NotificationsPopover } from \"./components/layouts/NotificationsPopover\";\nexport type { NotificationsPopoverProps } from \"./components/layouts/NotificationsPopover\";\nexport { NotificationPageContent } from \"./components/pages/notifications/Notifications\";\nexport { NotFoundPage } from \"./components/pages/NotFoundPage\";\nexport { UsersSelectorPopover } from \"./components/layouts/UsersSelectorPopover\";\nexport type { UsersSelectorPopoverProps } from \"./components/layouts/UsersSelectorPopover\";\nexport { ProfilePopover } from \"./components/layouts/ProfilePopover\";\nexport type {\n ProfilePopoverProps,\n ProfileMenuItem,\n} from \"./components/layouts/ProfilePopover\";\nexport { default as WhitelabelCodes } from \"./components/layouts/WhitelabelCodes\";\nexport { NavBarItem } from \"./components/layouts/NavBarItem\";\nexport type { NavBarItemProps } from \"./components/layouts/NavBarItem\";\n\n// Navigation\nexport { AppNavigation } from \"./components/navigation/AppNavigation\";\nexport { CancelledSubscriptionBanner } from \"./components/navigation/CancelledSubscriptionBanner\";\nexport type { NavItemConfig } from \"./components/navigation/subcomponents/NavItems\";\nexport { useMobileNavbarSheet } from \"./store/useMobileNavbarSheet\";\n\n// Auth Query Key Utilities\nexport {\n useAuthQueryKey,\n useWlQueryKey,\n useWlId,\n} from \"./hooks/useAuthQueryKey\";\n\n// Hooks\nexport { default as useCopyToClipboard } from \"./hooks/copy-to-clipboard.hook\";\n\n// UI - Buttons\nexport { Button, buttonVariants } from \"./components/ui/buttons/Button\";\nexport { CopyButton } from \"./components/ui/buttons/CopyButton\";\nexport { default as CancelButton } from \"./components/ui/buttons/CancelButton\";\n\n// UI - Data Display\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from \"./components/ui/data-display/Accordion\";\nexport { Badge, badgeVariants } from \"./components/ui/data-display/Badge\";\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n} from \"./components/ui/data-display/Card\";\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n} from \"./components/ui/data-display/Pagination\";\nexport { ScrollArea, ScrollBar } from \"./components/ui/data-display/ScrollArea\";\nexport { Separator } from \"./components/ui/data-display/Separator\";\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from \"./components/ui/data-display/Table\";\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from \"./components/ui/data-display/Tabs\";\nexport { UserAvatar } from \"./components/ui/data-display/UserAvatar\";\nexport type { UserAvatarProps } from \"./components/ui/data-display/UserAvatar\";\n\n// UI - Feedback\nexport { default as CircularProgress } from \"./components/ui/feedback/CircularProgress\";\nexport { default as DefaultCircularProgress } from \"./components/ui/feedback/DefaultCircularProgress\";\nexport { Progress } from \"./components/ui/feedback/Progress\";\nexport { LoadingOverlay } from \"./components/ui/feedback/LoadingOverlay\";\nexport {\n Toast,\n toastVariants,\n toastIconContainerVariants,\n} from \"./components/ui/feedback/Toast\";\nexport type { ToastProps } from \"./components/ui/feedback/Toast\";\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from \"./components/ui/form/Calendar\";\nexport { Checkbox } from \"./components/ui/form/Checkbox\";\nexport { DatePicker } from \"./components/ui/form/DatePicker\";\nexport { DateRangePicker } from \"./components/ui/form/DateRangePicker\";\nexport { Input } from \"./components/ui/form/Input\";\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./components/ui/form/InputOtp\";\nexport { RadioGroup, RadioGroupItem } from \"./components/ui/form/RadioGroup\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from \"./components/ui/form/Select\";\nexport { Switch } from \"./components/ui/form/Switch\";\nexport { Textarea } from \"./components/ui/form/Textarea\";\n\n// UI - Overlay\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from \"./components/ui/overlay/Command\";\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"./components/ui/overlay/Dialog\";\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n} from \"./components/ui/overlay/Popover\";\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from \"./components/ui/overlay/Sheet\";\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"./components/ui/overlay/Tooltip\";\n\n// Embeds\nexport { FrillEmbed } from \"./components/embeds/FrillEmbed\";\nexport {\n CrispEmbed,\n openCrispHelpdesk,\n hideCrisp,\n showCrisp,\n updateCrispUser,\n} from \"./components/embeds/CrispEmbed\";\nexport { EmbedWidgets } from \"./components/embeds/EmbedWidgets\";\nexport { ClarityEmbed } from \"./components/embeds/ClarityEmbed\";\n\n// Store\nexport { useMdSidebarStore } from \"./store/useMdSidebarStore\";\nexport { useDesktopSidebarStore } from \"./store/useDesktopSidebarStore\";\nexport { useModalManager } from \"./store/useModalManager\";\nexport type { ModalData } from \"./store/useModalManager\";\n\n// Enums\nexport { AccountSectionType } from \"./enums/AccountSectionType\";\n\n// Hooks\nexport { default as usePasswordVisibility } from \"./hooks/usePasswordVisibility\";\nexport { default as useCountdownTimer } from \"./hooks/useCountdownTimer\";\nexport { default as useIsMobile } from \"./hooks/useIsMobile\";\nexport { useDebounce } from \"./hooks/useDebounce\";\nexport { useDebouncedEffect } from \"./hooks/useDebouncedEffect\";\nexport { useDebounceState } from \"./hooks/useDebounceState\";\n\n// Utils\nexport {\n formatPhone,\n formatTimer,\n formatFullName,\n formatCPF,\n formatCNPJ,\n formatCardNumber,\n} from \"./utils/format/masks\";\nexport { formatCurrencyNumber } from \"./utils/format/currency\";\nexport { BR_STATE_OPTIONS } from \"./utils/constants/br-states\";\nexport type { TimezoneOption } from \"./modules/accounts/services/timezone.service\";\nexport {\n buildLocaleOptions,\n LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS,\n} from \"./utils/intl/locales\";\nexport type { LocaleOption } from \"./utils/intl/locales\";\nexport { copyToClipboard, readFromClipboard } from \"./utils/browser/clipboard\";\n\n// UI - Form (new widgets)\nexport { FormField } from \"./components/ui/form/FormField\";\nexport { SelectField } from \"./components/ui/form/SelectField\";\nexport { ComboboxField } from \"./components/ui/form/ComboboxField\";\nexport type { ComboboxOption } from \"./components/ui/form/ComboboxField\";\nexport { default as PhoneInput } from \"./components/ui/form/PhoneInput\";\nexport { default as SwitchOptionFieldWithIcon } from \"./components/ui/form/SwitchOptionFieldWithIcon\";\nexport { TextAreaField } from \"./components/ui/form/TextAreaField\";\n\n// Account Module - Hooks\nexport {\n useCurrentAccount,\n ACCOUNT_QUERY_KEY,\n} from \"./modules/accounts/hooks/current-account.hook\";\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useDeleteAccountUser,\n useDeleteAccount,\n ACCOUNT_USERS_QUERY_KEY,\n} from \"./modules/accounts/hooks/useAccountManagement\";\nexport { useViaCep } from \"./modules/accounts/hooks/useViaCep\";\nexport { useAccountToken } from \"./modules/accounts/hooks/use-account-token.hook\";\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from \"./modules/accounts/types\";\n\nexport { default as AccountModals } from \"./components/account/AccountModals\";\nexport { useAccountModals } from \"./store/useAccountModals\";\nexport type { AccountModalsConfig } from \"./store/useAccountModals\";\n\nexport { ModalManager } from \"./components/modals/ModalManager\";\nexport { Modals } from \"./components/modals/Modals\";\n\nexport { default as TwoFactorAuthModal } from \"./components/account/TwoFactorAuthModal\";\nexport { default as DisableTwoFactorAuthModal } from \"./components/account/DisableTwoFactorAuthModal\";\nexport { default as ConfirmGlobalPreferencesModal } from \"./components/account/ConfirmGlobalPreferencesModal\";\nexport { MyProfileSection } from \"./components/account/sections/MyProfileSection\";\nexport { PreferencesSection } from \"./components/account/sections/PreferencesSection\";\nexport { SecuritySection } from \"./components/account/sections/SecuritySection\";\nexport { ChangePasswordSection } from \"./components/account/sections/ChangePasswordSection\";\nexport { ChangeEmailModal } from \"./components/account/sections/ChangeEmailModal\";\nexport { ChangePhoneModal } from \"./components/account/sections/ChangePhoneModal\";\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from \"./components/account/constants\";\n\n// Image Upload\nexport {\n ImageUpload,\n ImageCropModal,\n ImageTooSmallModal,\n} from \"./components/widgets/ImageUpload\";\nexport {\n useImageUpload,\n type ImageTooSmallError,\n} from \"./modules/images/hooks/use-image-upload.hook\";\nexport {\n ACCEPTED_IMAGE_FORMATS,\n ACCEPTED_IMAGE_FORMATS_STRING,\n MAX_FILE_SIZE_MB,\n} from \"./modules/images/constants/image.constants\";\nexport type {\n ImageConfig,\n CropArea,\n ProcessedImage,\n CompressImageOptions,\n} from \"./modules/images/types/image.type\";\nexport { compressImage } from \"./modules/images/utils/compress-image\";\nexport { cropImageToCanvas } from \"./modules/images/utils/crop-image\";\nexport { base64ToFile, fileToBase64 } from \"./modules/images/utils/base64\";\nexport {\n validateImage,\n validateImageFormat,\n validateImageSize,\n getImageDimensions,\n} from \"./modules/images/utils/validate-image\";\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AAGd;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AA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A,EACA;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use server";
|
|
2
2
|
import { safeServerAction } from "../../../utils/safeServerAction";
|
|
3
|
+
import { safeMutationAction } from "../../../utils/safeMutationAction";
|
|
3
4
|
import { accountService } from "../services/account.service";
|
|
4
5
|
import { twoFactorService } from "../services/two-factor.service";
|
|
5
6
|
import { findUserById } from "../../users/action/find-user-by-id.action";
|
|
@@ -12,13 +13,13 @@ async function listAccountUsersAction(params) {
|
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
async function updateUserAction(user) {
|
|
15
|
-
return
|
|
16
|
+
return safeMutationAction(() => accountService.updateAccountUser(user));
|
|
16
17
|
}
|
|
17
18
|
async function updateAccountUserByIdAction(userId, user) {
|
|
18
|
-
return
|
|
19
|
+
return safeMutationAction(() => accountService.updateAccountUserById(userId, user));
|
|
19
20
|
}
|
|
20
21
|
async function updateAccountAction(data) {
|
|
21
|
-
return
|
|
22
|
+
return safeMutationAction(async () => {
|
|
22
23
|
if (data.name !== void 0) {
|
|
23
24
|
const userResult = await findUserById();
|
|
24
25
|
if (!userResult.success || userResult.data?.profile !== UserProfile.owner) {
|
|
@@ -33,31 +34,31 @@ async function updateAccountAction(data) {
|
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
36
|
async function deleteAccountUserAction(userId) {
|
|
36
|
-
return
|
|
37
|
+
return safeMutationAction(() => accountService.deleteAccountUser(userId));
|
|
37
38
|
}
|
|
38
39
|
async function deleteAccountAction() {
|
|
39
|
-
return
|
|
40
|
+
return safeMutationAction(() => accountService.deleteAccount());
|
|
40
41
|
}
|
|
41
42
|
async function createAccountUserAction(user) {
|
|
42
|
-
return
|
|
43
|
+
return safeMutationAction(() => accountService.createAccountUser(user));
|
|
43
44
|
}
|
|
44
45
|
async function changePasswordAction(data) {
|
|
45
|
-
return
|
|
46
|
+
return safeMutationAction(() => accountService.changePassword(data));
|
|
46
47
|
}
|
|
47
48
|
async function requestEmailChangeAction(newEmail) {
|
|
48
|
-
return
|
|
49
|
+
return safeMutationAction(() => accountService.requestContactReset("email", newEmail));
|
|
49
50
|
}
|
|
50
51
|
async function confirmEmailChangeAction(token, newEmail) {
|
|
51
|
-
return
|
|
52
|
+
return safeMutationAction(() => accountService.confirmContactReset("email", token, newEmail));
|
|
52
53
|
}
|
|
53
54
|
async function requestPhoneChangeAction(newPhone, ddi) {
|
|
54
|
-
return
|
|
55
|
+
return safeMutationAction(() => accountService.requestContactReset("phone", newPhone, ddi));
|
|
55
56
|
}
|
|
56
57
|
async function confirmPhoneChangeAction(token, newPhone, ddi) {
|
|
57
|
-
return
|
|
58
|
+
return safeMutationAction(() => accountService.confirmContactReset("phone", token, newPhone, ddi));
|
|
58
59
|
}
|
|
59
60
|
async function generateTwoFactorAction() {
|
|
60
|
-
return
|
|
61
|
+
return safeMutationAction(async () => {
|
|
61
62
|
const result = await twoFactorService.generate();
|
|
62
63
|
return {
|
|
63
64
|
qrcode: result.data.qrcode,
|
|
@@ -66,13 +67,13 @@ async function generateTwoFactorAction() {
|
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
async function confirmTwoFactorAction(code) {
|
|
69
|
-
return
|
|
70
|
+
return safeMutationAction(async () => {
|
|
70
71
|
await twoFactorService.confirm(code);
|
|
71
72
|
await accountService.updateAccountUser({ two_factor_authentication: true });
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
75
|
async function disableTwoFactorAction(code) {
|
|
75
|
-
return
|
|
76
|
+
return safeMutationAction(async () => {
|
|
76
77
|
await twoFactorService.verify(code);
|
|
77
78
|
await twoFactorService.disable();
|
|
78
79
|
await accountService.updateAccountUser({ two_factor_authentication: false });
|
|
@@ -1 +1 @@
|
|
|
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';\nimport { findUserById } from '../../users/action/find-user-by-id.action';\nimport { UserProfile } from '../../users/schema';\nimport { ApiError } from '../../../infra/api/types';\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
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/accounts/actions/account-management.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { safeMutationAction } from '../../../utils/safeMutationAction';\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';\nimport { findUserById } from '../../users/action/find-user-by-id.action';\nimport { UserProfile } from '../../users/schema';\nimport { ApiError } from '../../../infra/api/types';\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 safeMutationAction(() => accountService.updateAccountUser(user));\n}\n\nexport async function updateAccountUserByIdAction(\n userId: number,\n user: UpdateAccountUserRequest\n) {\n return safeMutationAction(() => accountService.updateAccountUserById(userId, user));\n}\n\nexport async function updateAccountAction(data: UpdateAccountRequest) {\n return safeMutationAction(async () => {\n if (data.name !== undefined) {\n const userResult = await findUserById();\n if (!userResult.success || userResult.data?.profile !== UserProfile.owner) {\n throw new ApiError(\n 'Apenas o proprietário da conta pode alterar o nome da empresa',\n 'FORBIDDEN',\n 403\n );\n }\n }\n\n return accountService.updateAccount(data);\n });\n}\n\nexport async function deleteAccountUserAction(userId: number) {\n return safeMutationAction(() => accountService.deleteAccountUser(userId));\n}\n\nexport async function deleteAccountAction() {\n return safeMutationAction(() => accountService.deleteAccount());\n}\n\nexport async function createAccountUserAction(user: CreateAccountUserRequest) {\n return safeMutationAction(() => accountService.createAccountUser(user));\n}\n\nexport async function changePasswordAction(data: ChangePasswordRequest) {\n return safeMutationAction(() => accountService.changePassword(data));\n}\n\nexport async function requestEmailChangeAction(newEmail: string) {\n return safeMutationAction(() => accountService.requestContactReset('email', newEmail));\n}\n\nexport async function confirmEmailChangeAction(token: string, newEmail: string) {\n return safeMutationAction(() => accountService.confirmContactReset('email', token, newEmail));\n}\n\nexport async function requestPhoneChangeAction(newPhone: string, ddi?: string) {\n return safeMutationAction(() => accountService.requestContactReset('phone', newPhone, ddi));\n}\n\nexport async function confirmPhoneChangeAction(token: string, newPhone: string, ddi?: string) {\n return safeMutationAction(() => accountService.confirmContactReset('phone', token, newPhone, ddi));\n}\n\nexport async function generateTwoFactorAction() {\n return safeMutationAction(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 safeMutationAction(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 safeMutationAction(async () => {\n await twoFactorService.verify(code);\n await twoFactorService.disable();\n await accountService.updateAccountUser({ two_factor_authentication: false });\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAQ/B,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AAEzB,eAAsB,uBAAuB,QAAuC;AAClF,SAAO,iBAAiB,YAAY;AAClC,UAAM,EAAE,OAAO,MAAM,IAAI,MAAM,eAAe,iBAAiB,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AyB,OAAe,UAAkB,KAAc;AAC5F,SAAO,mBAAmB,MAAM,eAAe,oBAAoB,SAAS,OAAO,UAAU,GAAG,CAAC;AACnG;AAEA,eAAsB,0BAA0B;AAC9C,SAAO,mBAAmB,YAAY;AACpC,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,mBAAmB,YAAY;AACpC,UAAM,iBAAiB,QAAQ,IAAI;AACnC,UAAM,eAAe,kBAAkB,EAAE,2BAA2B,KAAK,CAAC;AAAA,EAC5E,CAAC;AACH;AAEA,eAAsB,uBAAuB,MAAc;AACzD,SAAO,mBAAmB,YAAY;AACpC,UAAM,iBAAiB,OAAO,IAAI;AAClC,UAAM,iBAAiB,QAAQ;AAC/B,UAAM,eAAe,kBAAkB,EAAE,2BAA2B,MAAM,CAAC;AAAA,EAC7E,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { cache } from "react";
|
|
3
|
+
import { ApiError } from "../../../infra/api/types";
|
|
4
|
+
import { getClientInfoFromRequest } from "../../../infra/utils/client-info";
|
|
5
|
+
import { authService } from "../services/auth.service";
|
|
6
|
+
const requireValidSession = cache(async () => {
|
|
7
|
+
if (process.env.DUMMY_AUTH_TOKEN) return;
|
|
8
|
+
const clientInfo = await getClientInfoFromRequest();
|
|
9
|
+
const isValid = await authService.validateSession(clientInfo);
|
|
10
|
+
if (!isValid) {
|
|
11
|
+
throw new ApiError("Sess\xE3o inv\xE1lida ou expirada", "SESSION_INVALID", 401);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
requireValidSession
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=require-valid-session.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/auth/utils/require-valid-session.ts"],"sourcesContent":["import 'server-only';\n\nimport { cache } from 'react';\n\nimport { ApiError } from '../../../infra/api/types';\nimport { getClientInfoFromRequest } from '../../../infra/utils/client-info';\nimport { authService } from '../services/auth.service';\n\n/**\n * Valida a sessão do usuário chamando POST /auth/keep no backend.\n *\n * Garante que o cookie `greatapps`:\n * 1. Existe.\n * 2. Corresponde a uma sessão registrada no banco (não foi forjado).\n * 3. Ainda é considerada válida pelo backend (não foi revogada/expirada).\n *\n * Deduplicada por request via React.cache — múltiplas chamadas dentro do\n * mesmo server action resultam em 1 round-trip ao backend, não N.\n *\n * Use em server actions sensíveis (mutações, billing, destrutivas).\n * Prefira o wrapper `safeMutationAction` que já envelopa isto junto com\n * o `safeServerAction` padrão.\n *\n * Em caso de erro de rede/backend, falha fechada (SESSION_INVALID 401).\n */\nexport const requireValidSession = cache(async (): Promise<void> => {\n if (process.env.DUMMY_AUTH_TOKEN) return;\n\n const clientInfo = await getClientInfoFromRequest();\n const isValid = await authService.validateSession(clientInfo);\n\n if (!isValid) {\n throw new ApiError('Sessão inválida ou expirada', 'SESSION_INVALID', 401);\n }\n});\n"],"mappings":"AAAA,OAAO;AAEP,SAAS,aAAa;AAEtB,SAAS,gBAAgB;AACzB,SAAS,gCAAgC;AACzC,SAAS,mBAAmB;AAmBrB,MAAM,sBAAsB,MAAM,YAA2B;AAClE,MAAI,QAAQ,IAAI,iBAAkB;AAElC,QAAM,aAAa,MAAM,yBAAyB;AAClD,QAAM,UAAU,MAAM,YAAY,gBAAgB,UAAU;AAE5D,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,SAAS,qCAA+B,mBAAmB,GAAG;AAAA,EAC1E;AACF,CAAC;","names":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use server";
|
|
2
|
-
import {
|
|
2
|
+
import { safeMutationAction } from "../../../utils/safeMutationAction";
|
|
3
3
|
import { cardsService } from "../services/cards.service";
|
|
4
4
|
async function createCardAction(data) {
|
|
5
|
-
return
|
|
5
|
+
return safeMutationAction(() => cardsService.createCard(data));
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
8
|
createCardAction
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/cards/actions/create-card.action.ts"],"sourcesContent":["'use server';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/cards/actions/create-card.action.ts"],"sourcesContent":["'use server';\n\nimport { safeMutationAction } from '../../../utils/safeMutationAction';\nimport { cardsService } from '../services/cards.service';\nimport { CreateCardRequest } from '../types';\n\nexport async function createCardAction(data: CreateCardRequest) {\n return safeMutationAction(() => cardsService.createCard(data));\n}\n"],"mappings":";AAEA,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAG7B,eAAsB,iBAAiB,MAAyB;AAC9D,SAAO,mBAAmB,MAAM,aAAa,WAAW,IAAI,CAAC;AAC/D;","names":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use server";
|
|
2
|
-
import {
|
|
2
|
+
import { safeMutationAction } from "../../../utils/safeMutationAction";
|
|
3
3
|
import { cardsService } from "../services/cards.service";
|
|
4
4
|
async function deleteCardAction(id) {
|
|
5
|
-
return
|
|
5
|
+
return safeMutationAction(() => cardsService.deleteCard(id));
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
8
|
deleteCardAction
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/cards/actions/delete-card.action.ts"],"sourcesContent":["'use server';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/cards/actions/delete-card.action.ts"],"sourcesContent":["'use server';\n\nimport { safeMutationAction } from '../../../utils/safeMutationAction';\nimport { cardsService } from '../services/cards.service';\n\nexport async function deleteCardAction(id: string) {\n return safeMutationAction(() => cardsService.deleteCard(id));\n}\n"],"mappings":";AAEA,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAE7B,eAAsB,iBAAiB,IAAY;AACjD,SAAO,mBAAmB,MAAM,aAAa,WAAW,EAAE,CAAC;AAC7D;","names":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use server";
|
|
2
|
-
import {
|
|
2
|
+
import { safeMutationAction } from "../../../utils/safeMutationAction";
|
|
3
3
|
import { cardsService } from "../services/cards.service";
|
|
4
4
|
async function setDefaultCardAction(cardId) {
|
|
5
|
-
return
|
|
5
|
+
return safeMutationAction(() => cardsService.setDefaultCard(cardId));
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
8
|
setDefaultCardAction
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/cards/actions/set-default-card.action.ts"],"sourcesContent":["'use server';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/cards/actions/set-default-card.action.ts"],"sourcesContent":["'use server';\n\nimport { safeMutationAction } from '../../../utils/safeMutationAction';\nimport { cardsService } from '../services/cards.service';\n\nexport async function setDefaultCardAction(cardId: string) {\n return safeMutationAction(() => cardsService.setDefaultCard(cardId));\n}\n"],"mappings":";AAEA,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAE7B,eAAsB,qBAAqB,QAAgB;AACzD,SAAO,mBAAmB,MAAM,aAAa,eAAe,MAAM,CAAC;AACrE;","names":[]}
|