@greatapps/common 1.1.387 → 1.1.388
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/modals/PaidPlanRequiredModal.mjs +46 -0
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -0
- package/dist/index.mjs +36 -32
- package/dist/index.mjs.map +1 -1
- package/dist/modules/auth/utils/assert-paid-subscription.mjs +40 -0
- package/dist/modules/auth/utils/assert-paid-subscription.mjs.map +1 -0
- package/dist/server.mjs +2 -0
- package/dist/server.mjs.map +1 -1
- package/dist/store/usePaidPlanRequiredModal.mjs +14 -0
- package/dist/store/usePaidPlanRequiredModal.mjs.map +1 -0
- package/package.json +1 -1
- package/src/components/modals/PaidPlanRequiredModal.tsx +57 -0
- package/src/index.ts +2 -0
- package/src/modules/auth/utils/assert-paid-subscription.ts +43 -0
- package/src/server.ts +1 -0
- package/src/store/usePaidPlanRequiredModal.ts +19 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { IconLock } from "@tabler/icons-react";
|
|
4
|
+
import { Button } from "../ui/buttons/Button";
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogDescription,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle
|
|
11
|
+
} from "../ui/overlay/Dialog";
|
|
12
|
+
import { useWhitelabelUrls } from "../../modules/whitelabel/hooks/whitelabel.hook";
|
|
13
|
+
import { useModalManager } from "../../store/useModalManager";
|
|
14
|
+
function PaidPlanRequiredModal() {
|
|
15
|
+
const { activeModal, modalData, closeModal } = useModalManager();
|
|
16
|
+
const isOpen = activeModal === "paidPlanRequiredModal";
|
|
17
|
+
const data = modalData;
|
|
18
|
+
const { accountsUrl } = useWhitelabelUrls();
|
|
19
|
+
const title = data.title ?? "Recurso dispon\xEDvel em planos pagos";
|
|
20
|
+
const description = data.description ?? "Para acessar este recurso, fa\xE7a upgrade para um plano pago";
|
|
21
|
+
const handleKnowPlans = () => {
|
|
22
|
+
closeModal();
|
|
23
|
+
window.open(`${accountsUrl}/signature?tab=plans`, "_blank");
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: () => closeModal(), children: /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col p-0 gap-0 w-full md:w-[410px] lg:w-[410px]", children: [
|
|
26
|
+
/* @__PURE__ */ jsxs(DialogHeader, { className: "gap-3 text-left p-5", children: [
|
|
27
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-10 h-10 bg-zinc-50 rounded-lg", children: /* @__PURE__ */ jsx(IconLock, { size: 24, className: "text-zinc-950" }) }),
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-zinc-950", children: title }),
|
|
30
|
+
/* @__PURE__ */ jsx(DialogDescription, { className: "paragraph-small-regular text-zinc-600", children: description })
|
|
31
|
+
] })
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 p-5 border-t border-zinc-200", children: /* @__PURE__ */ jsx(
|
|
34
|
+
Button,
|
|
35
|
+
{
|
|
36
|
+
className: "w-fit h-10!",
|
|
37
|
+
onClick: handleKnowPlans,
|
|
38
|
+
children: "Conhecer planos"
|
|
39
|
+
}
|
|
40
|
+
) })
|
|
41
|
+
] }) });
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
PaidPlanRequiredModal as default
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=PaidPlanRequiredModal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/modals/PaidPlanRequiredModal.tsx"],"sourcesContent":["\"use client\";\n\nimport { IconLock } from '@tabler/icons-react';\nimport { Button } from '../ui/buttons/Button';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '../ui/overlay/Dialog';\nimport { useWhitelabelUrls } from '../../modules/whitelabel/hooks/whitelabel.hook';\nimport { useModalManager } from '../../store/useModalManager';\nimport type { ModalData } from '../../store/useModalManager';\n\nexport default function PaidPlanRequiredModal() {\n const { activeModal, modalData, closeModal } = useModalManager();\n const isOpen = activeModal === 'paidPlanRequiredModal';\n const data = modalData as ModalData & { title?: string; description?: string };\n const { accountsUrl } = useWhitelabelUrls();\n\n const title = (data.title as string) ?? \"Recurso disponível em planos pagos\";\n const description = (data.description as string) ?? \"Para acessar este recurso, faça upgrade para um plano pago\";\n\n const handleKnowPlans = () => {\n closeModal();\n window.open(`${accountsUrl}/signature?tab=plans`, '_blank');\n };\n\n return (\n <Dialog open={isOpen} onOpenChange={() => closeModal()}>\n <DialogContent className=\"flex flex-col p-0 gap-0 w-full md:w-[410px] lg:w-[410px]\">\n <DialogHeader className=\"gap-3 text-left p-5\">\n <div className=\"flex items-center justify-center w-10 h-10 bg-zinc-50 rounded-lg\">\n <IconLock size={24} className=\"text-zinc-950\" />\n </div>\n <div className=\"flex flex-col gap-2\">\n <DialogTitle className=\"paragraph-medium-semibold text-zinc-950\">\n {title}\n </DialogTitle>\n <DialogDescription className=\"paragraph-small-regular text-zinc-600\">\n {description}\n </DialogDescription>\n </div>\n </DialogHeader>\n <div className=\"flex items-center gap-2 p-5 border-t border-zinc-200\">\n <Button\n className=\"w-fit h-10!\"\n onClick={handleKnowPlans}\n >\n Conhecer planos\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkCwB,cAEJ,YAFI;AAhCxB,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,yBAAyB;AAClC,SAAS,uBAAuB;AAGjB,SAAR,wBAAyC;AAC5C,QAAM,EAAE,aAAa,WAAW,WAAW,IAAI,gBAAgB;AAC/D,QAAM,SAAS,gBAAgB;AAC/B,QAAM,OAAO;AACb,QAAM,EAAE,YAAY,IAAI,kBAAkB;AAE1C,QAAM,QAAS,KAAK,SAAoB;AACxC,QAAM,cAAe,KAAK,eAA0B;AAEpD,QAAM,kBAAkB,MAAM;AAC1B,eAAW;AACX,WAAO,KAAK,GAAG,WAAW,wBAAwB,QAAQ;AAAA,EAC9D;AAEA,SACI,oBAAC,UAAO,MAAM,QAAQ,cAAc,MAAM,WAAW,GACjD,+BAAC,iBAAc,WAAU,4DACrB;AAAA,yBAAC,gBAAa,WAAU,uBACpB;AAAA,0BAAC,SAAI,WAAU,oEACX,8BAAC,YAAS,MAAM,IAAI,WAAU,iBAAgB,GAClD;AAAA,MACA,qBAAC,SAAI,WAAU,uBACX;AAAA,4BAAC,eAAY,WAAU,2CAClB,iBACL;AAAA,QACA,oBAAC,qBAAkB,WAAU,yCACxB,uBACL;AAAA,SACJ;AAAA,OACJ;AAAA,IACA,oBAAC,SAAI,WAAU,wDACX;AAAA,MAAC;AAAA;AAAA,QACG,WAAU;AAAA,QACV,SAAS;AAAA,QACZ;AAAA;AAAA,IAED,GACJ;AAAA,KACJ,GACJ;AAER;","names":[]}
|
package/dist/index.mjs
CHANGED
|
@@ -46,8 +46,10 @@ import { buildPlanExtras } from "./modules/subscriptions/utils/build-plan-extras
|
|
|
46
46
|
import { hasSubscriptionExpired } from "./modules/subscriptions/utils/has-subscription-expired";
|
|
47
47
|
import { getPriceFromCalculatedData, periodicityToBillingPeriod } from "./modules/subscriptions/utils/periodicity";
|
|
48
48
|
import { useBuyCreditsModal } from "./store/useBuyCreditsModal";
|
|
49
|
+
import { usePaidPlanRequiredModal } from "./store/usePaidPlanRequiredModal";
|
|
49
50
|
import { default as default2 } from "./components/modals/BuyCreditsModal";
|
|
50
|
-
import { default as default3 } from "./components/modals/
|
|
51
|
+
import { default as default3 } from "./components/modals/PaidPlanRequiredModal";
|
|
52
|
+
import { default as default4 } from "./components/modals/cards/AddCardModal";
|
|
51
53
|
import { CardFormFields, cardFormSchema } from "./components/modals/cards/CardFormFields";
|
|
52
54
|
import { Skeleton } from "./components/ui/feedback/Skeleton";
|
|
53
55
|
import { PaymentInfoCard } from "./components/ui/data-display/PaymentInfoCard";
|
|
@@ -73,21 +75,21 @@ import { AppNavBar } from "./components/layouts/AppNavBar";
|
|
|
73
75
|
import { AppMobileNavBar } from "./components/layouts/AppMobileNavBar";
|
|
74
76
|
import { SideBarNavigation } from "./components/layouts/SideBarNavigation";
|
|
75
77
|
import { MdSideBarNavigation } from "./components/layouts/MdSideBarNavigation";
|
|
76
|
-
import { default as
|
|
78
|
+
import { default as default5 } from "./components/widgets/notifications/NotificationCard";
|
|
77
79
|
import { NotificationsPopover } from "./components/layouts/NotificationsPopover";
|
|
78
80
|
import { NotificationPageContent } from "./components/pages/notifications/Notifications";
|
|
79
81
|
import { NotFoundPage } from "./components/pages/NotFoundPage";
|
|
80
82
|
import { UsersSelectorPopover } from "./components/layouts/UsersSelectorPopover";
|
|
81
83
|
import { ProfilePopover } from "./components/layouts/ProfilePopover";
|
|
82
|
-
import { default as
|
|
84
|
+
import { default as default6 } from "./components/layouts/WhitelabelCodes";
|
|
83
85
|
import { NavBarItem } from "./components/layouts/NavBarItem";
|
|
84
86
|
import { AppNavigation } from "./components/navigation/AppNavigation";
|
|
85
87
|
import { CancelledSubscriptionBanner } from "./components/navigation/CancelledSubscriptionBanner";
|
|
86
88
|
import { useMobileNavbarSheet } from "./store/useMobileNavbarSheet";
|
|
87
|
-
import { default as
|
|
89
|
+
import { default as default7 } from "./hooks/copy-to-clipboard.hook";
|
|
88
90
|
import { Button, buttonVariants } from "./components/ui/buttons/Button";
|
|
89
91
|
import { CopyButton } from "./components/ui/buttons/CopyButton";
|
|
90
|
-
import { default as
|
|
92
|
+
import { default as default8 } from "./components/ui/buttons/CancelButton";
|
|
91
93
|
import {
|
|
92
94
|
Accordion,
|
|
93
95
|
AccordionItem,
|
|
@@ -132,8 +134,8 @@ import {
|
|
|
132
134
|
TabsContent
|
|
133
135
|
} from "./components/ui/data-display/Tabs";
|
|
134
136
|
import { UserAvatar } from "./components/ui/data-display/UserAvatar";
|
|
135
|
-
import { default as
|
|
136
|
-
import { default as
|
|
137
|
+
import { default as default9 } from "./components/ui/feedback/CircularProgress";
|
|
138
|
+
import { default as default10 } from "./components/ui/feedback/DefaultCircularProgress";
|
|
137
139
|
import { Progress } from "./components/ui/feedback/Progress";
|
|
138
140
|
import { LoadingOverlay } from "./components/ui/feedback/LoadingOverlay";
|
|
139
141
|
import {
|
|
@@ -218,9 +220,9 @@ import { useMdSidebarStore } from "./store/useMdSidebarStore";
|
|
|
218
220
|
import { useDesktopSidebarStore } from "./store/useDesktopSidebarStore";
|
|
219
221
|
import { useModalManager } from "./store/useModalManager";
|
|
220
222
|
import { AccountSectionType } from "./enums/AccountSectionType";
|
|
221
|
-
import { default as
|
|
222
|
-
import { default as
|
|
223
|
-
import { default as
|
|
223
|
+
import { default as default11 } from "./hooks/usePasswordVisibility";
|
|
224
|
+
import { default as default12 } from "./hooks/useCountdownTimer";
|
|
225
|
+
import { default as default13 } from "./hooks/useIsMobile";
|
|
224
226
|
import { useDebounce } from "./hooks/useDebounce";
|
|
225
227
|
import { useDebouncedEffect } from "./hooks/useDebouncedEffect";
|
|
226
228
|
import { useDebounceState } from "./hooks/useDebounceState";
|
|
@@ -241,8 +243,8 @@ import { copyToClipboard, readFromClipboard } from "./utils/browser/clipboard";
|
|
|
241
243
|
import { FormField } from "./components/ui/form/FormField";
|
|
242
244
|
import { SelectField } from "./components/ui/form/SelectField";
|
|
243
245
|
import { ComboboxField } from "./components/ui/form/ComboboxField";
|
|
244
|
-
import { default as
|
|
245
|
-
import { default as
|
|
246
|
+
import { default as default14 } from "./components/ui/form/PhoneInput";
|
|
247
|
+
import { default as default15 } from "./components/ui/form/SwitchOptionFieldWithIcon";
|
|
246
248
|
import { TextAreaField } from "./components/ui/form/TextAreaField";
|
|
247
249
|
import {
|
|
248
250
|
useCurrentAccount,
|
|
@@ -256,13 +258,13 @@ import {
|
|
|
256
258
|
useDeleteAccount
|
|
257
259
|
} from "./modules/accounts/hooks/useAccountManagement";
|
|
258
260
|
import { useViaCep } from "./modules/accounts/hooks/useViaCep";
|
|
259
|
-
import { default as
|
|
261
|
+
import { default as default16 } from "./components/account/AccountModals";
|
|
260
262
|
import { useAccountModals } from "./store/useAccountModals";
|
|
261
263
|
import { ModalManager } from "./components/modals/ModalManager";
|
|
262
264
|
import { Modals } from "./components/modals/Modals";
|
|
263
|
-
import { default as
|
|
264
|
-
import { default as
|
|
265
|
-
import { default as
|
|
265
|
+
import { default as default17 } from "./components/account/TwoFactorAuthModal";
|
|
266
|
+
import { default as default18 } from "./components/account/DisableTwoFactorAuthModal";
|
|
267
|
+
import { default as default19 } from "./components/account/ConfirmGlobalPreferencesModal";
|
|
266
268
|
import { MyProfileSection } from "./components/account/sections/MyProfileSection";
|
|
267
269
|
import { PreferencesSection } from "./components/account/sections/PreferencesSection";
|
|
268
270
|
import { SecuritySection } from "./components/account/sections/SecuritySection";
|
|
@@ -285,9 +287,9 @@ export {
|
|
|
285
287
|
AccordionContent,
|
|
286
288
|
AccordionItem,
|
|
287
289
|
AccordionTrigger,
|
|
288
|
-
|
|
290
|
+
default16 as AccountModals,
|
|
289
291
|
AccountSectionType,
|
|
290
|
-
|
|
292
|
+
default4 as AddCardModal,
|
|
291
293
|
AppMobileNavBar,
|
|
292
294
|
AppNavBar,
|
|
293
295
|
AppNavigation,
|
|
@@ -299,7 +301,7 @@ export {
|
|
|
299
301
|
CURRENCY_OPTIONS,
|
|
300
302
|
Calendar,
|
|
301
303
|
CalendarDayButton,
|
|
302
|
-
|
|
304
|
+
default8 as CancelButton,
|
|
303
305
|
CancelledSubscriptionBanner,
|
|
304
306
|
Card,
|
|
305
307
|
CardAction,
|
|
@@ -315,7 +317,7 @@ export {
|
|
|
315
317
|
ChangePasswordSection,
|
|
316
318
|
ChangePhoneModal,
|
|
317
319
|
Checkbox,
|
|
318
|
-
|
|
320
|
+
default9 as CircularProgress,
|
|
319
321
|
ComboboxField,
|
|
320
322
|
Command,
|
|
321
323
|
CommandDialog,
|
|
@@ -326,13 +328,13 @@ export {
|
|
|
326
328
|
CommandList,
|
|
327
329
|
CommandSeparator,
|
|
328
330
|
CommandShortcut,
|
|
329
|
-
|
|
331
|
+
default19 as ConfirmGlobalPreferencesModal,
|
|
330
332
|
CopyButton,
|
|
331
333
|
CreateCardRequestSchema,
|
|
332
334
|
CrispEmbed,
|
|
333
335
|
DatePicker,
|
|
334
336
|
DateRangePicker,
|
|
335
|
-
|
|
337
|
+
default10 as DefaultCircularProgress,
|
|
336
338
|
Dialog,
|
|
337
339
|
DialogClose,
|
|
338
340
|
DialogContent,
|
|
@@ -343,7 +345,7 @@ export {
|
|
|
343
345
|
DialogPortal,
|
|
344
346
|
DialogTitle,
|
|
345
347
|
DialogTrigger,
|
|
346
|
-
|
|
348
|
+
default18 as DisableTwoFactorAuthModal,
|
|
347
349
|
FormField,
|
|
348
350
|
FrillEmbed,
|
|
349
351
|
GENDER_OPTIONS,
|
|
@@ -371,7 +373,7 @@ export {
|
|
|
371
373
|
NavBar,
|
|
372
374
|
NavBarItem,
|
|
373
375
|
NotFoundPage,
|
|
374
|
-
|
|
376
|
+
default5 as NotificationCard,
|
|
375
377
|
NotificationPageContent,
|
|
376
378
|
NotificationsPopover,
|
|
377
379
|
Pagination,
|
|
@@ -381,9 +383,10 @@ export {
|
|
|
381
383
|
PaginationLink,
|
|
382
384
|
PaginationNext,
|
|
383
385
|
PaginationPrevious,
|
|
386
|
+
default3 as PaidPlanRequiredModal,
|
|
384
387
|
CardSchema as PaymentCardSchema,
|
|
385
388
|
PaymentInfoCard,
|
|
386
|
-
|
|
389
|
+
default14 as PhoneInput,
|
|
387
390
|
PlanItemSchema,
|
|
388
391
|
PlanSchema,
|
|
389
392
|
Popover,
|
|
@@ -425,7 +428,7 @@ export {
|
|
|
425
428
|
SubscriptionItemSchema,
|
|
426
429
|
SubscriptionSchema,
|
|
427
430
|
Switch,
|
|
428
|
-
|
|
431
|
+
default15 as SwitchOptionFieldWithIcon,
|
|
429
432
|
TIME_FORMAT_OPTIONS,
|
|
430
433
|
Table,
|
|
431
434
|
TableBody,
|
|
@@ -446,11 +449,11 @@ export {
|
|
|
446
449
|
TooltipContent,
|
|
447
450
|
TooltipProvider,
|
|
448
451
|
TooltipTrigger,
|
|
449
|
-
|
|
452
|
+
default17 as TwoFactorAuthModal,
|
|
450
453
|
USER_QUERY_KEY,
|
|
451
454
|
UserAvatar,
|
|
452
455
|
UsersSelectorPopover,
|
|
453
|
-
|
|
456
|
+
default6 as WhitelabelCodes,
|
|
454
457
|
badgeVariants,
|
|
455
458
|
buildLocaleOptions,
|
|
456
459
|
buildPlanExtras,
|
|
@@ -487,8 +490,8 @@ export {
|
|
|
487
490
|
useCalculateSubscription,
|
|
488
491
|
useCancelledSubscriptionGuard,
|
|
489
492
|
useCards,
|
|
490
|
-
|
|
491
|
-
|
|
493
|
+
default7 as useCopyToClipboard,
|
|
494
|
+
default12 as useCountdownTimer,
|
|
492
495
|
useCreateCard,
|
|
493
496
|
useCurrentAccount,
|
|
494
497
|
useDebounce,
|
|
@@ -500,14 +503,15 @@ export {
|
|
|
500
503
|
useHasPlanAddon,
|
|
501
504
|
useIaCredits,
|
|
502
505
|
useInvalidateUser,
|
|
503
|
-
|
|
506
|
+
default13 as useIsMobile,
|
|
504
507
|
useListAvailableUsers,
|
|
505
508
|
useListProjectUsers,
|
|
506
509
|
useManagementPermissions,
|
|
507
510
|
useMdSidebarStore,
|
|
508
511
|
useMobileNavbarSheet,
|
|
509
512
|
useModalManager,
|
|
510
|
-
|
|
513
|
+
usePaidPlanRequiredModal,
|
|
514
|
+
default11 as usePasswordVisibility,
|
|
511
515
|
usePlanById,
|
|
512
516
|
useSetUserData,
|
|
513
517
|
useSubscriptions,
|
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 type {\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\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 { SUBSCRIPTIONS_QUERY_KEY } 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 { useCreateCard } from \"./modules/cards/hooks/create-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 { ADDON_IDS, AI_CREDIT_OPTIONS, AI_CREDIT_VALUES } from \"./modules/subscriptions/constants/addons.constants\";\nexport type { AddonKindEnum, AiCreditOption } from \"./modules/subscriptions/constants/addons.constants\";\nexport type { Plan, PlanItem } from \"./modules/plans/types/plan.type\";\nexport { PlanSchema, PlanItemSchema } from \"./modules/plans/types/plan.type\";\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 { Card as PaymentCard, CreateCardRequest } from \"./modules/cards/types\";\nexport { CardSchema as PaymentCardSchema, CreateCardRequestSchema } from \"./modules/cards/types\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport { getPriceFromCalculatedData, periodicityToBillingPeriod } from \"./modules/subscriptions/utils/periodicity\";\nexport { useBuyCreditsModal } from \"./store/useBuyCreditsModal\";\nexport { default as BuyCreditsModal } from \"./components/modals/BuyCreditsModal\";\nexport { default as AddCardModal } from \"./components/modals/cards/AddCardModal\";\nexport { CardFormFields, cardFormSchema } 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 } 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 type { NavigationProject } from './components/navigation/types';\nexport { useMobileNavbarSheet } from './store/useMobileNavbarSheet';\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 { CrispEmbed, openCrispHelpdesk, hideCrisp, showCrisp } from \"./components/embeds/CrispEmbed\";\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 { 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} from \"./modules/accounts/hooks/useAccountManagement\";\nexport { useViaCep } from \"./modules/accounts/hooks/useViaCep\";\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 G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GnD,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,SAAoB,WAAXA,iBAA6B;AACtC,SAAoB,WAAXA,iBAA4C;AACrD,SAAS,qBAAqB;AAG9B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAgB1B,SAAoB,WAAXA,iBAAgC;AACzC,SAAS,wBAAwB;AAGjC,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAEvB,SAAoB,WAAXA,iBAAqC;AAC9C,SAAoB,WAAXA,iBAA4C;AACrD,SAAoB,WAAXA,iBAAgD;AACzD,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
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 type {\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\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 { SUBSCRIPTIONS_QUERY_KEY } 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 { useCreateCard } from \"./modules/cards/hooks/create-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 { ADDON_IDS, AI_CREDIT_OPTIONS, AI_CREDIT_VALUES } from \"./modules/subscriptions/constants/addons.constants\";\nexport type { AddonKindEnum, AiCreditOption } from \"./modules/subscriptions/constants/addons.constants\";\nexport type { Plan, PlanItem } from \"./modules/plans/types/plan.type\";\nexport { PlanSchema, PlanItemSchema } from \"./modules/plans/types/plan.type\";\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 { Card as PaymentCard, CreateCardRequest } from \"./modules/cards/types\";\nexport { CardSchema as PaymentCardSchema, CreateCardRequestSchema } from \"./modules/cards/types\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport { getPriceFromCalculatedData, periodicityToBillingPeriod } 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 { CardFormFields, cardFormSchema } 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 } 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 type { NavigationProject } from './components/navigation/types';\nexport { useMobileNavbarSheet } from './store/useMobileNavbarSheet';\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 { CrispEmbed, openCrispHelpdesk, hideCrisp, showCrisp } from \"./components/embeds/CrispEmbed\";\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 { 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} from \"./modules/accounts/hooks/useAccountManagement\";\nexport { useViaCep } from \"./modules/accounts/hooks/useViaCep\";\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"],"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;AAQP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gCAAgC;AAEzC,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,6BAA6B;AACtC,SAAS,qCAAqC;AAC9C,SAA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AAgD;AACzD,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { ApiError } from "../../../infra/api/types";
|
|
3
|
+
import { listSubscriptionsAction } from "../../subscriptions/actions/list-subscriptions.action";
|
|
4
|
+
import { hasSubscriptionExpired } from "../../subscriptions/utils/has-subscription-expired";
|
|
5
|
+
async function assertPaidSubscription() {
|
|
6
|
+
const result = await listSubscriptionsAction({ active: true });
|
|
7
|
+
if (!result.success) {
|
|
8
|
+
throw new ApiError(
|
|
9
|
+
result.error || "N\xE3o foi poss\xEDvel validar a assinatura atual",
|
|
10
|
+
"SUBSCRIPTION_CONTEXT_FAILED",
|
|
11
|
+
403
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
const subscription = result.data?.data?.[0];
|
|
15
|
+
if (!subscription) {
|
|
16
|
+
throw new ApiError(
|
|
17
|
+
"Nenhuma assinatura ativa encontrada. Assine um plano para continuar.",
|
|
18
|
+
"SUBSCRIPTION_NOT_FOUND",
|
|
19
|
+
403
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
if (hasSubscriptionExpired(subscription.date_due)) {
|
|
23
|
+
throw new ApiError(
|
|
24
|
+
"Sua assinatura est\xE1 vencida. Assine um novo plano para continuar.",
|
|
25
|
+
"SUBSCRIPTION_EXPIRED",
|
|
26
|
+
403
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
if (subscription.type === "free" || subscription.id_plan === 5 || subscription.type === "trial") {
|
|
30
|
+
throw new ApiError(
|
|
31
|
+
"Este recurso est\xE1 dispon\xEDvel apenas para planos pagos. Fa\xE7a upgrade do seu plano para continuar.",
|
|
32
|
+
"PAID_SUBSCRIPTION_REQUIRED",
|
|
33
|
+
403
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
assertPaidSubscription
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=assert-paid-subscription.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/auth/utils/assert-paid-subscription.ts"],"sourcesContent":["import \"server-only\";\n\nimport { ApiError } from \"../../../infra/api/types\";\nimport { listSubscriptionsAction } from \"../../subscriptions/actions/list-subscriptions.action\";\nimport { hasSubscriptionExpired } from \"../../subscriptions/utils/has-subscription-expired\";\n\nexport async function assertPaidSubscription() {\n const result = await listSubscriptionsAction({ active: true });\n\n if (!result.success) {\n throw new ApiError(\n result.error || \"Não foi possível validar a assinatura atual\",\n \"SUBSCRIPTION_CONTEXT_FAILED\",\n 403,\n );\n }\n\n const subscription = result.data?.data?.[0];\n\n if (!subscription) {\n throw new ApiError(\n \"Nenhuma assinatura ativa encontrada. Assine um plano para continuar.\",\n \"SUBSCRIPTION_NOT_FOUND\",\n 403,\n );\n }\n\n if (hasSubscriptionExpired(subscription.date_due)) {\n throw new ApiError(\n \"Sua assinatura está vencida. Assine um novo plano para continuar.\",\n \"SUBSCRIPTION_EXPIRED\",\n 403,\n );\n }\n\n if (subscription.type === 'free' || subscription.id_plan === 5 || subscription.type === 'trial') {\n throw new ApiError(\n \"Este recurso está disponível apenas para planos pagos. Faça upgrade do seu plano para continuar.\",\n \"PAID_SUBSCRIPTION_REQUIRED\",\n 403,\n );\n }\n}\n"],"mappings":"AAAA,OAAO;AAEP,SAAS,gBAAgB;AACzB,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AAEvC,eAAsB,yBAAyB;AAC7C,QAAM,SAAS,MAAM,wBAAwB,EAAE,QAAQ,KAAK,CAAC;AAE7D,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,IAAI;AAAA,MACR,OAAO,SAAS;AAAA,MAChB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAe,OAAO,MAAM,OAAO,CAAC;AAE1C,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,MAAI,uBAAuB,aAAa,QAAQ,GAAG;AACjD,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,MAAI,aAAa,SAAS,UAAU,aAAa,YAAY,KAAK,aAAa,SAAS,SAAS;AAC/F,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/dist/server.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { revalidateWhitelabelAction } from "./modules/whitelabel/actions/revalid
|
|
|
6
6
|
import { assertManagementPermission } from "./modules/auth/utils/assert-management-permission";
|
|
7
7
|
import { assertManagementSubscription } from "./modules/auth/utils/assert-management-subscription";
|
|
8
8
|
import { assertSubscriptionAddon } from "./modules/auth/utils/assert-subscription-addon";
|
|
9
|
+
import { assertPaidSubscription } from "./modules/auth/utils/assert-paid-subscription";
|
|
9
10
|
import { subscriptionsService } from "./modules/subscriptions/services/subscriptions.service";
|
|
10
11
|
import { plansService } from "./modules/plans/services/plans.service";
|
|
11
12
|
import { cardsService } from "./modules/cards/services/cards.service";
|
|
@@ -59,6 +60,7 @@ export {
|
|
|
59
60
|
apiClient,
|
|
60
61
|
assertManagementPermission,
|
|
61
62
|
assertManagementSubscription,
|
|
63
|
+
assertPaidSubscription,
|
|
62
64
|
assertSubscriptionAddon,
|
|
63
65
|
authService,
|
|
64
66
|
buildWlOverride,
|
package/dist/server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import 'server-only';\r\n\r\n// API Client\r\nexport { ApiClient, api, apiClient } from './infra/api/client';\r\n\r\n// Services\r\nexport { authService } from './modules/auth/services/auth.service';\r\nexport { whitelabelService } from './modules/whitelabel/services/whitelabel.service';\r\nexport { revalidateWhitelabelAction } from './modules/whitelabel/actions/revalidate-whitelabel.action';\r\nexport { assertManagementPermission } from './modules/auth/utils/assert-management-permission';\r\nexport { assertManagementSubscription } from './modules/auth/utils/assert-management-subscription';\r\nexport { assertSubscriptionAddon } from './modules/auth/utils/assert-subscription-addon';\r\nexport { subscriptionsService } from './modules/subscriptions/services/subscriptions.service';\r\nexport { plansService } from './modules/plans/services/plans.service';\r\nexport { cardsService } from './modules/cards/services/cards.service';\r\nexport { iaCreditsService } from './modules/ia-credits/services/ia-credits.service';\r\n\r\n// Actions\r\nexport { findWhitelabel } from './modules/whitelabel/actions/find-whitelabel.action';\r\nexport { validateSessionAction } from './modules/auth/actions/validate-session.action';\r\nexport { findUserById } from './modules/users/action/find-user-by-id.action';\r\nexport { findCurrentAccount } from './modules/accounts/actions/find-current-account.action';\r\nexport { listSubscriptionsAction } from './modules/subscriptions/actions/list-subscriptions.action';\r\nexport { findPlanByIdAction } from './modules/plans/actions/find-plan-by-id.action';\r\nexport { calculateSubscriptionAction } from './modules/subscriptions/actions/calculate-subscription.action';\r\nexport { updateSubscriptionPlanAction } from './modules/subscriptions/actions/update-subscription-plan.action';\r\nexport { listCardsAction } from './modules/cards/actions/list-cards.action';\r\nexport { createCardAction } from './modules/cards/actions/create-card.action';\r\nexport { resolvePlanExtrasPrices } from './modules/subscriptions/utils/resolve-plan-extras-prices';\r\nexport { hasSubscriptionExpired } from './modules/subscriptions/utils/has-subscription-expired';\r\nexport { listIaCreditsAction } from './modules/ia-credits/actions/list-ia-credits.action';\r\n\r\n// Project Users Services & Actions (server-only)\r\nexport { projectUsersService } from './modules/projects/services/project-users.service';\r\nexport { listProjectUsersAction } from './modules/projects/actions/list-project-users.action';\r\nexport { listAvailableUsersAction } from './modules/projects/actions/list-available-users.action';\r\nexport { addProjectUserAction } from './modules/projects/actions/add-project-user.action';\r\nexport { removeProjectUserAction } from './modules/projects/actions/remove-project-user.action';\r\n\r\n// Account Services & Actions (server-only)\r\nexport { accountService } from './modules/accounts/services/account.service';\r\nexport { twoFactorService } from './modules/accounts/services/two-factor.service';\r\nexport {\r\n listAccountUsersAction,\r\n updateUserAction,\r\n updateAccountAction,\r\n updateAccountUserByIdAction,\r\n deleteAccountUserAction,\r\n deleteAccountAction,\r\n createAccountUserAction,\r\n changePasswordAction,\r\n requestEmailChangeAction,\r\n confirmEmailChangeAction,\r\n requestPhoneChangeAction,\r\n confirmPhoneChangeAction,\r\n generateTwoFactorAction,\r\n confirmTwoFactorAction,\r\n disableTwoFactorAction,\r\n} from './modules/accounts/actions/account-management.action';\r\n\r\n// Server Utils\r\nexport { getClientInfoFromRequest } from './infra/utils/client-info';\r\nexport { getUserContext } from './modules/auth/utils/get-user-context';\r\nexport { buildWlOverride, buildWlOverrideFromJwt } from './modules/auth/utils/build-wl-override';\r\nexport { safeServerAction } from './utils/safeServerAction';\r\n"],"mappings":"AAAA,OAAO;AAGP,SAAS,WAAW,KAAK,iBAAiB;AAG1C,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,kCAAkC;AAC3C,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AACxC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAGjC,SAAS,sBAAsB;AAC/B,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,0BAA0B;AACnC,SAAS,mCAAmC;AAC5C,SAAS,oCAAoC;AAC7C,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,2BAA2B;AAGpC,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AAGxC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB,8BAA8B;AACxD,SAAS,wBAAwB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import 'server-only';\r\n\r\n// API Client\r\nexport { ApiClient, api, apiClient } from './infra/api/client';\r\n\r\n// Services\r\nexport { authService } from './modules/auth/services/auth.service';\r\nexport { whitelabelService } from './modules/whitelabel/services/whitelabel.service';\r\nexport { revalidateWhitelabelAction } from './modules/whitelabel/actions/revalidate-whitelabel.action';\r\nexport { assertManagementPermission } from './modules/auth/utils/assert-management-permission';\r\nexport { assertManagementSubscription } from './modules/auth/utils/assert-management-subscription';\r\nexport { assertSubscriptionAddon } from './modules/auth/utils/assert-subscription-addon';\r\nexport { assertPaidSubscription } from './modules/auth/utils/assert-paid-subscription';\r\nexport { subscriptionsService } from './modules/subscriptions/services/subscriptions.service';\r\nexport { plansService } from './modules/plans/services/plans.service';\r\nexport { cardsService } from './modules/cards/services/cards.service';\r\nexport { iaCreditsService } from './modules/ia-credits/services/ia-credits.service';\r\n\r\n// Actions\r\nexport { findWhitelabel } from './modules/whitelabel/actions/find-whitelabel.action';\r\nexport { validateSessionAction } from './modules/auth/actions/validate-session.action';\r\nexport { findUserById } from './modules/users/action/find-user-by-id.action';\r\nexport { findCurrentAccount } from './modules/accounts/actions/find-current-account.action';\r\nexport { listSubscriptionsAction } from './modules/subscriptions/actions/list-subscriptions.action';\r\nexport { findPlanByIdAction } from './modules/plans/actions/find-plan-by-id.action';\r\nexport { calculateSubscriptionAction } from './modules/subscriptions/actions/calculate-subscription.action';\r\nexport { updateSubscriptionPlanAction } from './modules/subscriptions/actions/update-subscription-plan.action';\r\nexport { listCardsAction } from './modules/cards/actions/list-cards.action';\r\nexport { createCardAction } from './modules/cards/actions/create-card.action';\r\nexport { resolvePlanExtrasPrices } from './modules/subscriptions/utils/resolve-plan-extras-prices';\r\nexport { hasSubscriptionExpired } from './modules/subscriptions/utils/has-subscription-expired';\r\nexport { listIaCreditsAction } from './modules/ia-credits/actions/list-ia-credits.action';\r\n\r\n// Project Users Services & Actions (server-only)\r\nexport { projectUsersService } from './modules/projects/services/project-users.service';\r\nexport { listProjectUsersAction } from './modules/projects/actions/list-project-users.action';\r\nexport { listAvailableUsersAction } from './modules/projects/actions/list-available-users.action';\r\nexport { addProjectUserAction } from './modules/projects/actions/add-project-user.action';\r\nexport { removeProjectUserAction } from './modules/projects/actions/remove-project-user.action';\r\n\r\n// Account Services & Actions (server-only)\r\nexport { accountService } from './modules/accounts/services/account.service';\r\nexport { twoFactorService } from './modules/accounts/services/two-factor.service';\r\nexport {\r\n listAccountUsersAction,\r\n updateUserAction,\r\n updateAccountAction,\r\n updateAccountUserByIdAction,\r\n deleteAccountUserAction,\r\n deleteAccountAction,\r\n createAccountUserAction,\r\n changePasswordAction,\r\n requestEmailChangeAction,\r\n confirmEmailChangeAction,\r\n requestPhoneChangeAction,\r\n confirmPhoneChangeAction,\r\n generateTwoFactorAction,\r\n confirmTwoFactorAction,\r\n disableTwoFactorAction,\r\n} from './modules/accounts/actions/account-management.action';\r\n\r\n// Server Utils\r\nexport { getClientInfoFromRequest } from './infra/utils/client-info';\r\nexport { getUserContext } from './modules/auth/utils/get-user-context';\r\nexport { buildWlOverride, buildWlOverrideFromJwt } from './modules/auth/utils/build-wl-override';\r\nexport { safeServerAction } from './utils/safeServerAction';\r\n"],"mappings":"AAAA,OAAO;AAGP,SAAS,WAAW,KAAK,iBAAiB;AAG1C,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;AAC3C,SAAS,kCAAkC;AAC3C,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAGjC,SAAS,sBAAsB;AAC/B,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AACxC,SAAS,0BAA0B;AACnC,SAAS,mCAAmC;AAC5C,SAAS,oCAAoC;AAC7C,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,2BAA2B;AAGpC,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AACzC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AAGxC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB,8BAA8B;AACxD,SAAS,wBAAwB;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useModalManager } from "./useModalManager";
|
|
2
|
+
function usePaidPlanRequiredModal() {
|
|
3
|
+
const { activeModal, openModal, closeModal } = useModalManager();
|
|
4
|
+
const isOpen = activeModal === "paidPlanRequiredModal";
|
|
5
|
+
return {
|
|
6
|
+
open: isOpen,
|
|
7
|
+
openModal: (options) => openModal("paidPlanRequiredModal", options ?? {}),
|
|
8
|
+
closeModal
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
usePaidPlanRequiredModal
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=usePaidPlanRequiredModal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/store/usePaidPlanRequiredModal.ts"],"sourcesContent":["import { useModalManager } from './useModalManager';\n\ninterface PaidPlanRequiredModalOptions {\n title?: string;\n description?: string;\n}\n\nexport function usePaidPlanRequiredModal() {\n const { activeModal, openModal, closeModal } = useModalManager();\n\n const isOpen = activeModal === 'paidPlanRequiredModal';\n\n return {\n open: isOpen,\n openModal: (options?: PaidPlanRequiredModalOptions) =>\n openModal('paidPlanRequiredModal', options ?? {}),\n closeModal,\n };\n}\n"],"mappings":"AAAA,SAAS,uBAAuB;AAOzB,SAAS,2BAA2B;AACvC,QAAM,EAAE,aAAa,WAAW,WAAW,IAAI,gBAAgB;AAE/D,QAAM,SAAS,gBAAgB;AAE/B,SAAO;AAAA,IACH,MAAM;AAAA,IACN,WAAW,CAAC,YACR,UAAU,yBAAyB,WAAW,CAAC,CAAC;AAAA,IACpD;AAAA,EACJ;AACJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { IconLock } from '@tabler/icons-react';
|
|
4
|
+
import { Button } from '../ui/buttons/Button';
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogDescription,
|
|
9
|
+
DialogHeader,
|
|
10
|
+
DialogTitle,
|
|
11
|
+
} from '../ui/overlay/Dialog';
|
|
12
|
+
import { useWhitelabelUrls } from '../../modules/whitelabel/hooks/whitelabel.hook';
|
|
13
|
+
import { useModalManager } from '../../store/useModalManager';
|
|
14
|
+
import type { ModalData } from '../../store/useModalManager';
|
|
15
|
+
|
|
16
|
+
export default function PaidPlanRequiredModal() {
|
|
17
|
+
const { activeModal, modalData, closeModal } = useModalManager();
|
|
18
|
+
const isOpen = activeModal === 'paidPlanRequiredModal';
|
|
19
|
+
const data = modalData as ModalData & { title?: string; description?: string };
|
|
20
|
+
const { accountsUrl } = useWhitelabelUrls();
|
|
21
|
+
|
|
22
|
+
const title = (data.title as string) ?? "Recurso disponível em planos pagos";
|
|
23
|
+
const description = (data.description as string) ?? "Para acessar este recurso, faça upgrade para um plano pago";
|
|
24
|
+
|
|
25
|
+
const handleKnowPlans = () => {
|
|
26
|
+
closeModal();
|
|
27
|
+
window.open(`${accountsUrl}/signature?tab=plans`, '_blank');
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Dialog open={isOpen} onOpenChange={() => closeModal()}>
|
|
32
|
+
<DialogContent className="flex flex-col p-0 gap-0 w-full md:w-[410px] lg:w-[410px]">
|
|
33
|
+
<DialogHeader className="gap-3 text-left p-5">
|
|
34
|
+
<div className="flex items-center justify-center w-10 h-10 bg-zinc-50 rounded-lg">
|
|
35
|
+
<IconLock size={24} className="text-zinc-950" />
|
|
36
|
+
</div>
|
|
37
|
+
<div className="flex flex-col gap-2">
|
|
38
|
+
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
39
|
+
{title}
|
|
40
|
+
</DialogTitle>
|
|
41
|
+
<DialogDescription className="paragraph-small-regular text-zinc-600">
|
|
42
|
+
{description}
|
|
43
|
+
</DialogDescription>
|
|
44
|
+
</div>
|
|
45
|
+
</DialogHeader>
|
|
46
|
+
<div className="flex items-center gap-2 p-5 border-t border-zinc-200">
|
|
47
|
+
<Button
|
|
48
|
+
className="w-fit h-10!"
|
|
49
|
+
onClick={handleKnowPlans}
|
|
50
|
+
>
|
|
51
|
+
Conhecer planos
|
|
52
|
+
</Button>
|
|
53
|
+
</div>
|
|
54
|
+
</DialogContent>
|
|
55
|
+
</Dialog>
|
|
56
|
+
);
|
|
57
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -78,7 +78,9 @@ export { buildPlanExtras } from "./modules/subscriptions/utils/build-plan-extras
|
|
|
78
78
|
export { hasSubscriptionExpired } from "./modules/subscriptions/utils/has-subscription-expired";
|
|
79
79
|
export { getPriceFromCalculatedData, periodicityToBillingPeriod } from "./modules/subscriptions/utils/periodicity";
|
|
80
80
|
export { useBuyCreditsModal } from "./store/useBuyCreditsModal";
|
|
81
|
+
export { usePaidPlanRequiredModal } from "./store/usePaidPlanRequiredModal";
|
|
81
82
|
export { default as BuyCreditsModal } from "./components/modals/BuyCreditsModal";
|
|
83
|
+
export { default as PaidPlanRequiredModal } from "./components/modals/PaidPlanRequiredModal";
|
|
82
84
|
export { default as AddCardModal } from "./components/modals/cards/AddCardModal";
|
|
83
85
|
export { CardFormFields, cardFormSchema } from "./components/modals/cards/CardFormFields";
|
|
84
86
|
export type { CardFormData } from "./components/modals/cards/CardFormFields";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
|
|
3
|
+
import { ApiError } from "../../../infra/api/types";
|
|
4
|
+
import { listSubscriptionsAction } from "../../subscriptions/actions/list-subscriptions.action";
|
|
5
|
+
import { hasSubscriptionExpired } from "../../subscriptions/utils/has-subscription-expired";
|
|
6
|
+
|
|
7
|
+
export async function assertPaidSubscription() {
|
|
8
|
+
const result = await listSubscriptionsAction({ active: true });
|
|
9
|
+
|
|
10
|
+
if (!result.success) {
|
|
11
|
+
throw new ApiError(
|
|
12
|
+
result.error || "Não foi possível validar a assinatura atual",
|
|
13
|
+
"SUBSCRIPTION_CONTEXT_FAILED",
|
|
14
|
+
403,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const subscription = result.data?.data?.[0];
|
|
19
|
+
|
|
20
|
+
if (!subscription) {
|
|
21
|
+
throw new ApiError(
|
|
22
|
+
"Nenhuma assinatura ativa encontrada. Assine um plano para continuar.",
|
|
23
|
+
"SUBSCRIPTION_NOT_FOUND",
|
|
24
|
+
403,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (hasSubscriptionExpired(subscription.date_due)) {
|
|
29
|
+
throw new ApiError(
|
|
30
|
+
"Sua assinatura está vencida. Assine um novo plano para continuar.",
|
|
31
|
+
"SUBSCRIPTION_EXPIRED",
|
|
32
|
+
403,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (subscription.type === 'free' || subscription.id_plan === 5 || subscription.type === 'trial') {
|
|
37
|
+
throw new ApiError(
|
|
38
|
+
"Este recurso está disponível apenas para planos pagos. Faça upgrade do seu plano para continuar.",
|
|
39
|
+
"PAID_SUBSCRIPTION_REQUIRED",
|
|
40
|
+
403,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
package/src/server.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { revalidateWhitelabelAction } from './modules/whitelabel/actions/revalid
|
|
|
10
10
|
export { assertManagementPermission } from './modules/auth/utils/assert-management-permission';
|
|
11
11
|
export { assertManagementSubscription } from './modules/auth/utils/assert-management-subscription';
|
|
12
12
|
export { assertSubscriptionAddon } from './modules/auth/utils/assert-subscription-addon';
|
|
13
|
+
export { assertPaidSubscription } from './modules/auth/utils/assert-paid-subscription';
|
|
13
14
|
export { subscriptionsService } from './modules/subscriptions/services/subscriptions.service';
|
|
14
15
|
export { plansService } from './modules/plans/services/plans.service';
|
|
15
16
|
export { cardsService } from './modules/cards/services/cards.service';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useModalManager } from './useModalManager';
|
|
2
|
+
|
|
3
|
+
interface PaidPlanRequiredModalOptions {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function usePaidPlanRequiredModal() {
|
|
9
|
+
const { activeModal, openModal, closeModal } = useModalManager();
|
|
10
|
+
|
|
11
|
+
const isOpen = activeModal === 'paidPlanRequiredModal';
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
open: isOpen,
|
|
15
|
+
openModal: (options?: PaidPlanRequiredModalOptions) =>
|
|
16
|
+
openModal('paidPlanRequiredModal', options ?? {}),
|
|
17
|
+
closeModal,
|
|
18
|
+
};
|
|
19
|
+
}
|