@greatapps/common 1.1.731 → 1.1.734
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/AccountDeletionWarningModal.mjs +50 -0
- package/dist/components/modals/AccountDeletionWarningModal.mjs.map +1 -0
- package/dist/i18n/messages/en-us.mjs +6 -0
- package/dist/i18n/messages/en-us.mjs.map +1 -1
- package/dist/i18n/messages/es-es.mjs +6 -0
- package/dist/i18n/messages/es-es.mjs.map +1 -1
- package/dist/i18n/messages/pt-br.mjs +6 -0
- package/dist/i18n/messages/pt-br.mjs.map +1 -1
- package/dist/index.mjs +36 -32
- package/dist/index.mjs.map +1 -1
- package/dist/modules/whitelabel/services/whitelabel.service.mjs +3 -22
- package/dist/modules/whitelabel/services/whitelabel.service.mjs.map +1 -1
- package/dist/modules/whitelabel/utils/normalize-hostname.mjs +0 -1
- package/dist/modules/whitelabel/utils/normalize-hostname.mjs.map +1 -1
- package/dist/store/useAccountDeletionWarningModal.mjs +13 -0
- package/dist/store/useAccountDeletionWarningModal.mjs.map +1 -0
- package/dist/utils/browser/safe-storage.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/modals/AccountDeletionWarningModal.tsx +67 -0
- package/src/i18n/messages/en-us.ts +8 -0
- package/src/i18n/messages/es-es.ts +8 -0
- package/src/i18n/messages/pt-br.ts +8 -0
- package/src/index.ts +2 -0
- package/src/modules/whitelabel/services/whitelabel.service.ts +5 -29
- package/src/modules/whitelabel/utils/normalize-hostname.ts +0 -1
- package/src/store/useAccountDeletionWarningModal.ts +17 -0
- package/src/utils/browser/safe-storage.ts +0 -4
package/dist/index.mjs
CHANGED
|
@@ -137,10 +137,12 @@ import {
|
|
|
137
137
|
import { useBuyCreditsModal } from "./store/useBuyCreditsModal";
|
|
138
138
|
import { useCreditsDisabledModal } from "./store/useCreditsDisabledModal";
|
|
139
139
|
import { usePaidPlanRequiredModal } from "./store/usePaidPlanRequiredModal";
|
|
140
|
+
import { useAccountDeletionWarningModal } from "./store/useAccountDeletionWarningModal";
|
|
140
141
|
import { default as default2 } from "./components/modals/BuyCreditsModal";
|
|
141
142
|
import { default as default3 } from "./components/modals/CreditsDisabledModal";
|
|
142
143
|
import { default as default4 } from "./components/modals/PaidPlanRequiredModal";
|
|
143
|
-
import { default as default5 } from "./components/modals/
|
|
144
|
+
import { default as default5 } from "./components/modals/AccountDeletionWarningModal";
|
|
145
|
+
import { default as default6 } from "./components/modals/cards/AddCardModal";
|
|
144
146
|
import { DeleteCardModal } from "./components/modals/cards/DeleteCardModal";
|
|
145
147
|
import { CannotDeleteCardModal } from "./components/modals/cards/CannotDeleteCardModal";
|
|
146
148
|
import {
|
|
@@ -174,13 +176,13 @@ import { AppNavBar } from "./components/layouts/AppNavBar";
|
|
|
174
176
|
import { AppMobileNavBar } from "./components/layouts/AppMobileNavBar";
|
|
175
177
|
import { SideBarNavigation } from "./components/layouts/SideBarNavigation";
|
|
176
178
|
import { MdSideBarNavigation } from "./components/layouts/MdSideBarNavigation";
|
|
177
|
-
import { default as
|
|
179
|
+
import { default as default7 } from "./components/widgets/notifications/NotificationCard";
|
|
178
180
|
import { NotificationsPopover } from "./components/layouts/NotificationsPopover";
|
|
179
181
|
import { NotificationPageContent } from "./components/pages/notifications/Notifications";
|
|
180
182
|
import { NotFoundPage } from "./components/pages/NotFoundPage";
|
|
181
183
|
import { UsersSelectorPopover } from "./components/layouts/UsersSelectorPopover";
|
|
182
184
|
import { ProfilePopover } from "./components/layouts/ProfilePopover";
|
|
183
|
-
import { default as
|
|
185
|
+
import { default as default8 } from "./components/layouts/WhitelabelCodes";
|
|
184
186
|
import { NavBarItem } from "./components/layouts/NavBarItem";
|
|
185
187
|
import { AppNavigation } from "./components/navigation/AppNavigation";
|
|
186
188
|
import { CancelledSubscriptionBanner } from "./components/navigation/CancelledSubscriptionBanner";
|
|
@@ -194,10 +196,10 @@ import {
|
|
|
194
196
|
useWlQueryKey,
|
|
195
197
|
useWlId
|
|
196
198
|
} from "./hooks/useAuthQueryKey";
|
|
197
|
-
import { default as
|
|
199
|
+
import { default as default9 } from "./hooks/copy-to-clipboard.hook";
|
|
198
200
|
import { Button, buttonVariants } from "./components/ui/buttons/Button";
|
|
199
201
|
import { CopyButton } from "./components/ui/buttons/CopyButton";
|
|
200
|
-
import { default as
|
|
202
|
+
import { default as default10 } from "./components/ui/buttons/CancelButton";
|
|
201
203
|
import {
|
|
202
204
|
Accordion,
|
|
203
205
|
AccordionItem,
|
|
@@ -242,8 +244,8 @@ import {
|
|
|
242
244
|
TabsContent
|
|
243
245
|
} from "./components/ui/data-display/Tabs";
|
|
244
246
|
import { UserAvatar } from "./components/ui/data-display/UserAvatar";
|
|
245
|
-
import { default as
|
|
246
|
-
import { default as
|
|
247
|
+
import { default as default11 } from "./components/ui/feedback/CircularProgress";
|
|
248
|
+
import { default as default12 } from "./components/ui/feedback/DefaultCircularProgress";
|
|
247
249
|
import { Progress } from "./components/ui/feedback/Progress";
|
|
248
250
|
import { LoadingOverlay } from "./components/ui/feedback/LoadingOverlay";
|
|
249
251
|
import { useBrandLoadingIcon } from "./hooks/useBrandLoadingIcon";
|
|
@@ -337,9 +339,9 @@ import { useMdSidebarStore } from "./store/useMdSidebarStore";
|
|
|
337
339
|
import { useDesktopSidebarStore } from "./store/useDesktopSidebarStore";
|
|
338
340
|
import { useModalManager } from "./store/useModalManager";
|
|
339
341
|
import { AccountSectionType } from "./enums/AccountSectionType";
|
|
340
|
-
import { default as
|
|
341
|
-
import { default as
|
|
342
|
-
import { default as
|
|
342
|
+
import { default as default13 } from "./hooks/usePasswordVisibility";
|
|
343
|
+
import { default as default14 } from "./hooks/useCountdownTimer";
|
|
344
|
+
import { default as default15 } from "./hooks/useIsMobile";
|
|
343
345
|
import { useDebounce } from "./hooks/useDebounce";
|
|
344
346
|
import { useDebouncedEffect } from "./hooks/useDebouncedEffect";
|
|
345
347
|
import { useDebounceState } from "./hooks/useDebounceState";
|
|
@@ -367,8 +369,8 @@ import { copyToClipboard, readFromClipboard } from "./utils/browser/clipboard";
|
|
|
367
369
|
import { FormField } from "./components/ui/form/FormField";
|
|
368
370
|
import { SelectField } from "./components/ui/form/SelectField";
|
|
369
371
|
import { ComboboxField } from "./components/ui/form/ComboboxField";
|
|
370
|
-
import { default as
|
|
371
|
-
import { default as
|
|
372
|
+
import { default as default16 } from "./components/ui/form/PhoneInput";
|
|
373
|
+
import { default as default17 } from "./components/ui/form/SwitchOptionFieldWithIcon";
|
|
372
374
|
import { TextAreaField } from "./components/ui/form/TextAreaField";
|
|
373
375
|
import {
|
|
374
376
|
useCurrentAccount,
|
|
@@ -385,13 +387,13 @@ import {
|
|
|
385
387
|
} from "./modules/accounts/hooks/useAccountManagement";
|
|
386
388
|
import { useViaCep } from "./modules/accounts/hooks/useViaCep";
|
|
387
389
|
import { useAccountToken } from "./modules/accounts/hooks/use-account-token.hook";
|
|
388
|
-
import { default as
|
|
390
|
+
import { default as default18 } from "./components/account/AccountModals";
|
|
389
391
|
import { useAccountModals } from "./store/useAccountModals";
|
|
390
392
|
import { ModalManager } from "./components/modals/ModalManager";
|
|
391
393
|
import { Modals } from "./components/modals/Modals";
|
|
392
|
-
import { default as
|
|
393
|
-
import { default as
|
|
394
|
-
import { default as
|
|
394
|
+
import { default as default19 } from "./components/account/TwoFactorAuthModal";
|
|
395
|
+
import { default as default20 } from "./components/account/DisableTwoFactorAuthModal";
|
|
396
|
+
import { default as default21 } from "./components/account/ConfirmGlobalPreferencesModal";
|
|
395
397
|
import { MyProfileSection } from "./components/account/sections/MyProfileSection";
|
|
396
398
|
import { PreferencesSection } from "./components/account/sections/PreferencesSection";
|
|
397
399
|
import { SecuritySection } from "./components/account/sections/SecuritySection";
|
|
@@ -439,9 +441,10 @@ export {
|
|
|
439
441
|
AccordionContent,
|
|
440
442
|
AccordionItem,
|
|
441
443
|
AccordionTrigger,
|
|
442
|
-
|
|
444
|
+
default5 as AccountDeletionWarningModal,
|
|
445
|
+
default18 as AccountModals,
|
|
443
446
|
AccountSectionType,
|
|
444
|
-
|
|
447
|
+
default6 as AddCardModal,
|
|
445
448
|
AppMobileNavBar,
|
|
446
449
|
AppNavBar,
|
|
447
450
|
AppNavigation,
|
|
@@ -456,7 +459,7 @@ export {
|
|
|
456
459
|
CURRENCY_OPTIONS,
|
|
457
460
|
Calendar,
|
|
458
461
|
CalendarDayButton,
|
|
459
|
-
|
|
462
|
+
default10 as CancelButton,
|
|
460
463
|
CancelledSubscriptionBanner,
|
|
461
464
|
CannotDeleteCardModal,
|
|
462
465
|
Card,
|
|
@@ -474,7 +477,7 @@ export {
|
|
|
474
477
|
ChangePhoneModal,
|
|
475
478
|
ChargeSchema,
|
|
476
479
|
Checkbox,
|
|
477
|
-
|
|
480
|
+
default11 as CircularProgress,
|
|
478
481
|
ClarityEmbed,
|
|
479
482
|
ComboboxField,
|
|
480
483
|
Command,
|
|
@@ -486,14 +489,14 @@ export {
|
|
|
486
489
|
CommandList,
|
|
487
490
|
CommandSeparator,
|
|
488
491
|
CommandShortcut,
|
|
489
|
-
|
|
492
|
+
default21 as ConfirmGlobalPreferencesModal,
|
|
490
493
|
CopyButton,
|
|
491
494
|
CreateCardRequestSchema,
|
|
492
495
|
default3 as CreditsDisabledModal,
|
|
493
496
|
CrispEmbed,
|
|
494
497
|
DatePicker,
|
|
495
498
|
DateRangePicker,
|
|
496
|
-
|
|
499
|
+
default12 as DefaultCircularProgress,
|
|
497
500
|
DeleteCardModal,
|
|
498
501
|
Dialog,
|
|
499
502
|
DialogClose,
|
|
@@ -505,7 +508,7 @@ export {
|
|
|
505
508
|
DialogPortal,
|
|
506
509
|
DialogTitle,
|
|
507
510
|
DialogTrigger,
|
|
508
|
-
|
|
511
|
+
default20 as DisableTwoFactorAuthModal,
|
|
509
512
|
EmbedWidgets,
|
|
510
513
|
FindCardsParamsSchema,
|
|
511
514
|
FindChargesParamsSchema,
|
|
@@ -544,7 +547,7 @@ export {
|
|
|
544
547
|
NavBarItem,
|
|
545
548
|
NavigationProvider,
|
|
546
549
|
NotFoundPage,
|
|
547
|
-
|
|
550
|
+
default7 as NotificationCard,
|
|
548
551
|
NotificationPageContent,
|
|
549
552
|
NotificationsPopover,
|
|
550
553
|
OverdueInvoiceBanner,
|
|
@@ -564,7 +567,7 @@ export {
|
|
|
564
567
|
PaymentAuthenticationError,
|
|
565
568
|
CardSchema as PaymentCardSchema,
|
|
566
569
|
PaymentInfoCard,
|
|
567
|
-
|
|
570
|
+
default16 as PhoneInput,
|
|
568
571
|
PixPendingDataSchema,
|
|
569
572
|
PlanItemSchema,
|
|
570
573
|
PlanSchema,
|
|
@@ -612,7 +615,7 @@ export {
|
|
|
612
615
|
SubscriptionPendingPixResponseSchema,
|
|
613
616
|
SubscriptionSchema,
|
|
614
617
|
Switch,
|
|
615
|
-
|
|
618
|
+
default17 as SwitchOptionFieldWithIcon,
|
|
616
619
|
TIME_FORMAT_OPTIONS,
|
|
617
620
|
Table,
|
|
618
621
|
TableBody,
|
|
@@ -634,12 +637,12 @@ export {
|
|
|
634
637
|
TooltipProvider,
|
|
635
638
|
TooltipTrigger,
|
|
636
639
|
TrialBanner,
|
|
637
|
-
|
|
640
|
+
default19 as TwoFactorAuthModal,
|
|
638
641
|
USER_QUERY_KEY,
|
|
639
642
|
UpcomingInvoiceBanner,
|
|
640
643
|
UserAvatar,
|
|
641
644
|
UsersSelectorPopover,
|
|
642
|
-
|
|
645
|
+
default8 as WhitelabelCodes,
|
|
643
646
|
badgeVariants,
|
|
644
647
|
base64ToFile,
|
|
645
648
|
buildCardFormSchema,
|
|
@@ -699,6 +702,7 @@ export {
|
|
|
699
702
|
toastIconContainerVariants,
|
|
700
703
|
toastVariants,
|
|
701
704
|
updateCrispUser,
|
|
705
|
+
useAccountDeletionWarningModal,
|
|
702
706
|
useAccountModals,
|
|
703
707
|
useAccountToken,
|
|
704
708
|
useActiveSubscription,
|
|
@@ -712,9 +716,9 @@ export {
|
|
|
712
716
|
useChargeAction,
|
|
713
717
|
useChargeById,
|
|
714
718
|
useCharges,
|
|
715
|
-
|
|
719
|
+
default9 as useCopyToClipboard,
|
|
716
720
|
useCountPages,
|
|
717
|
-
|
|
721
|
+
default14 as useCountdownTimer,
|
|
718
722
|
useCreateCard,
|
|
719
723
|
useCreateProject,
|
|
720
724
|
useCreateSetupIntent,
|
|
@@ -736,7 +740,7 @@ export {
|
|
|
736
740
|
useImageUpload,
|
|
737
741
|
useInfiniteProjects,
|
|
738
742
|
useInvalidateUser,
|
|
739
|
-
|
|
743
|
+
default15 as useIsMobile,
|
|
740
744
|
useListAllAccountUsers,
|
|
741
745
|
useListAvailableUsers,
|
|
742
746
|
useListProjectUsers,
|
|
@@ -747,7 +751,7 @@ export {
|
|
|
747
751
|
useNavigationFallback,
|
|
748
752
|
usePaidPlanRequiredModal,
|
|
749
753
|
useParams,
|
|
750
|
-
|
|
754
|
+
default13 as usePasswordVisibility,
|
|
751
755
|
usePathname,
|
|
752
756
|
usePlanById,
|
|
753
757
|
usePlans,
|
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\";\nexport {\n NavigationProvider,\n useNavigationFallback,\n} from \"./providers/navigation.provider\";\n\n// Navigation (safe drop-in replacement for next/navigation)\nexport { useRouter } from \"./hooks/useRouter\";\nexport type { SafeAppRouter } from \"./hooks/useRouter\";\nexport {\n usePathname,\n useSearchParams,\n useParams,\n redirect,\n notFound,\n} from \"./utils/next-navigation\";\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 { useSocialGoogleLogin } from \"./modules/auth/hooks/social-google-login.hook\";\nexport { useSocialGoogleOnboarding } from \"./modules/auth/hooks/social-google-onboarding.hook\";\nexport { useUnlinkGoogle } from \"./modules/auth/hooks/unlink-google.hook\";\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 { useUpdateSubscriptionPayment } from \"./modules/subscriptions/hooks/update-subscription-payment.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 { useCreateSetupIntent } from \"./modules/cards/hooks/create-setup-intent.hook\";\nexport { useSetDefaultCard } from \"./modules/cards/hooks/set-default-card.hook\";\nexport { useDeleteCard } from \"./modules/cards/hooks/delete-card.hook\";\nexport { useDeleteConfirmation } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport type { DeleteConfirmationFormData } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport { useHandleDeleteCard } from \"./modules/cards/hooks/handle-delete-card.hook\";\nexport { useCharges } from \"./modules/charges/hooks/charges.hook\";\nexport { useChargeById } from \"./modules/charges/hooks/charge-by-id.hook\";\nexport { useChargeAction } from \"./modules/charges/hooks/charge-action.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditsSummaryData,\n IaCreditAddBatch,\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 {\n mapApiPlanToUiPlan,\n mapApiPlanToUiPlanForCurrency,\n} 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 {\n PixPendingDataSchema,\n SubscriptionPendingPixResponseSchema,\n isSubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n PixPendingData,\n SubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n Card as PaymentCard,\n CreateCardRequest,\n FindCardsParams,\n SetupIntent,\n} from \"./modules/cards/types\";\nexport {\n CardSchema as PaymentCardSchema,\n CreateCardRequestSchema,\n FindCardsParamsSchema,\n SetupIntentSchema,\n} from \"./modules/cards/types\";\nexport type {\n Charge,\n FindChargesParams,\n PayChargeInput,\n} from \"./modules/charges/types/charge.type\";\nexport {\n ChargeSchema,\n FindChargesParamsSchema,\n PayChargeInputSchema,\n} from \"./modules/charges/types/charge.type\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport { hasActivePaidSubscription } from \"./modules/subscriptions/utils/has-active-paid-subscription\";\nexport {\n confirmPaymentIfRequired,\n PaymentAuthenticationError,\n} from \"./modules/subscriptions/utils/confirm-payment-if-required\";\nexport { SUBSCRIPTION_GRACE_PERIOD_DAYS } from \"./modules/subscriptions/constants/subscription.constants\";\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 { useCreditsDisabledModal } from \"./store/useCreditsDisabledModal\";\nexport { usePaidPlanRequiredModal } from \"./store/usePaidPlanRequiredModal\";\nexport { default as BuyCreditsModal } from \"./components/modals/BuyCreditsModal\";\nexport { default as CreditsDisabledModal } from \"./components/modals/CreditsDisabledModal\";\nexport { default as PaidPlanRequiredModal } from \"./components/modals/PaidPlanRequiredModal\";\nexport { default as AddCardModal } from \"./components/modals/cards/AddCardModal\";\nexport { DeleteCardModal } from \"./components/modals/cards/DeleteCardModal\";\nexport { CannotDeleteCardModal } from \"./components/modals/cards/CannotDeleteCardModal\";\nexport {\n CardFormFields,\n cardFormSchema,\n buildCardFormSchema,\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, calendarDateSchema, toCalendarDate, daysBetween } from \"./infra/utils/date\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\nexport { withAction } from \"./utils/withAction\";\nexport { resolveSafeRedirect, sameHostOr } from \"./utils/redirect\";\nexport { COUNTRIES, flagUrl } from \"./utils/countries\";\nexport type { Country } from \"./utils/countries\";\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 { SubscriptionBanner } from \"./components/navigation/SubscriptionBanner\";\nexport { OverdueInvoiceBanner } from \"./components/navigation/OverdueInvoiceBanner\";\nexport { UpcomingInvoiceBanner } from \"./components/navigation/UpcomingInvoiceBanner\";\nexport { TrialBanner } from \"./components/navigation/TrialBanner\";\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 { useBrandLoadingIcon } from \"./hooks/useBrandLoadingIcon\";\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 {\n formatCurrency,\n formatCurrencyNumber,\n parseCurrencyToNumber,\n getCurrencyForGateway,\n} from \"./utils/format/currency\";\nexport type { CurrencyCode } from \"./utils/format/currency\";\nexport { isValidCPF, isValidCNPJ, isValidTaxId } from \"./utils/validators/common\";\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 { useCurrencyFormatter } from \"./modules/accounts/hooks/use-currency-formatter.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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A,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\";\nexport {\n NavigationProvider,\n useNavigationFallback,\n} from \"./providers/navigation.provider\";\n\n// Navigation (safe drop-in replacement for next/navigation)\nexport { useRouter } from \"./hooks/useRouter\";\nexport type { SafeAppRouter } from \"./hooks/useRouter\";\nexport {\n usePathname,\n useSearchParams,\n useParams,\n redirect,\n notFound,\n} from \"./utils/next-navigation\";\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 { useSocialGoogleLogin } from \"./modules/auth/hooks/social-google-login.hook\";\nexport { useSocialGoogleOnboarding } from \"./modules/auth/hooks/social-google-onboarding.hook\";\nexport { useUnlinkGoogle } from \"./modules/auth/hooks/unlink-google.hook\";\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 { useUpdateSubscriptionPayment } from \"./modules/subscriptions/hooks/update-subscription-payment.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 { useCreateSetupIntent } from \"./modules/cards/hooks/create-setup-intent.hook\";\nexport { useSetDefaultCard } from \"./modules/cards/hooks/set-default-card.hook\";\nexport { useDeleteCard } from \"./modules/cards/hooks/delete-card.hook\";\nexport { useDeleteConfirmation } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport type { DeleteConfirmationFormData } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport { useHandleDeleteCard } from \"./modules/cards/hooks/handle-delete-card.hook\";\nexport { useCharges } from \"./modules/charges/hooks/charges.hook\";\nexport { useChargeById } from \"./modules/charges/hooks/charge-by-id.hook\";\nexport { useChargeAction } from \"./modules/charges/hooks/charge-action.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditsSummaryData,\n IaCreditAddBatch,\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 {\n mapApiPlanToUiPlan,\n mapApiPlanToUiPlanForCurrency,\n} 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 {\n PixPendingDataSchema,\n SubscriptionPendingPixResponseSchema,\n isSubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n PixPendingData,\n SubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n Card as PaymentCard,\n CreateCardRequest,\n FindCardsParams,\n SetupIntent,\n} from \"./modules/cards/types\";\nexport {\n CardSchema as PaymentCardSchema,\n CreateCardRequestSchema,\n FindCardsParamsSchema,\n SetupIntentSchema,\n} from \"./modules/cards/types\";\nexport type {\n Charge,\n FindChargesParams,\n PayChargeInput,\n} from \"./modules/charges/types/charge.type\";\nexport {\n ChargeSchema,\n FindChargesParamsSchema,\n PayChargeInputSchema,\n} from \"./modules/charges/types/charge.type\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport { hasActivePaidSubscription } from \"./modules/subscriptions/utils/has-active-paid-subscription\";\nexport {\n confirmPaymentIfRequired,\n PaymentAuthenticationError,\n} from \"./modules/subscriptions/utils/confirm-payment-if-required\";\nexport { SUBSCRIPTION_GRACE_PERIOD_DAYS } from \"./modules/subscriptions/constants/subscription.constants\";\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 { useCreditsDisabledModal } from \"./store/useCreditsDisabledModal\";\nexport { usePaidPlanRequiredModal } from \"./store/usePaidPlanRequiredModal\";\nexport { useAccountDeletionWarningModal } from \"./store/useAccountDeletionWarningModal\";\nexport { default as BuyCreditsModal } from \"./components/modals/BuyCreditsModal\";\nexport { default as CreditsDisabledModal } from \"./components/modals/CreditsDisabledModal\";\nexport { default as PaidPlanRequiredModal } from \"./components/modals/PaidPlanRequiredModal\";\nexport { default as AccountDeletionWarningModal } from \"./components/modals/AccountDeletionWarningModal\";\nexport { default as AddCardModal } from \"./components/modals/cards/AddCardModal\";\nexport { DeleteCardModal } from \"./components/modals/cards/DeleteCardModal\";\nexport { CannotDeleteCardModal } from \"./components/modals/cards/CannotDeleteCardModal\";\nexport {\n CardFormFields,\n cardFormSchema,\n buildCardFormSchema,\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, calendarDateSchema, toCalendarDate, daysBetween } from \"./infra/utils/date\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\nexport { withAction } from \"./utils/withAction\";\nexport { resolveSafeRedirect, sameHostOr } from \"./utils/redirect\";\nexport { COUNTRIES, flagUrl } from \"./utils/countries\";\nexport type { Country } from \"./utils/countries\";\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 { SubscriptionBanner } from \"./components/navigation/SubscriptionBanner\";\nexport { OverdueInvoiceBanner } from \"./components/navigation/OverdueInvoiceBanner\";\nexport { UpcomingInvoiceBanner } from \"./components/navigation/UpcomingInvoiceBanner\";\nexport { TrialBanner } from \"./components/navigation/TrialBanner\";\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 { useBrandLoadingIcon } from \"./hooks/useBrandLoadingIcon\";\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 {\n formatCurrency,\n formatCurrencyNumber,\n parseCurrencyToNumber,\n getCurrencyForGateway,\n} from \"./utils/format/currency\";\nexport type { CurrencyCode } from \"./utils/format/currency\";\nexport { isValidCPF, isValidCNPJ, isValidTaxId } from \"./utils/validators/common\";\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 { useCurrencyFormatter } from \"./modules/accounts/hooks/use-currency-formatter.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;AACd;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,iBAAiB;AAE1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;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,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,wBAAw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SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAgBhC,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;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,cAAc,oBAAoB;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import greatCache from "@greatapps/cache";
|
|
2
2
|
import { ApiError } from "../../../infra/api/types";
|
|
3
3
|
import { normalizeHostname } from "../utils/normalize-hostname";
|
|
4
|
-
const NOT_FOUND_SENTINEL = "__WL_TOKEN_NOT_FOUND__";
|
|
5
4
|
class WhitelabelService {
|
|
6
5
|
getApiUrl() {
|
|
7
6
|
const apiUrl = process.env.GAPPS_R3_API_URL;
|
|
@@ -48,10 +47,6 @@ class WhitelabelService {
|
|
|
48
47
|
}
|
|
49
48
|
});
|
|
50
49
|
if (!response.ok) {
|
|
51
|
-
const body = await response.json().catch(() => null);
|
|
52
|
-
if (response.status === 404 || body?.message === "Whitelabel not found") {
|
|
53
|
-
throw new ApiError("Whitelabel token not found", "TOKEN_NOT_FOUND", 404);
|
|
54
|
-
}
|
|
55
50
|
console.error("[WhitelabelService] Failed to fetch whitelabel token", {
|
|
56
51
|
response
|
|
57
52
|
});
|
|
@@ -81,26 +76,12 @@ class WhitelabelService {
|
|
|
81
76
|
cachedData
|
|
82
77
|
});
|
|
83
78
|
if (cachedData.status == 1 && "data" in cachedData && cachedData.data) {
|
|
84
|
-
if (cachedData.data === NOT_FOUND_SENTINEL) {
|
|
85
|
-
console.log("[WhitelabelService] Negative cache hit for domain", { hostname });
|
|
86
|
-
throw new ApiError("Whitelabel token not found", "TOKEN_NOT_FOUND", 404);
|
|
87
|
-
}
|
|
88
79
|
console.log("[WhitelabelService] Cache hit for domain", { hostname });
|
|
89
80
|
return JSON.parse(cachedData.data);
|
|
90
81
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return data;
|
|
95
|
-
} catch (error) {
|
|
96
|
-
if (ApiError.isApiError(error) && error.code === "TOKEN_NOT_FOUND") {
|
|
97
|
-
try {
|
|
98
|
-
await cache.insert(cacheKey, NOT_FOUND_SENTINEL, 60);
|
|
99
|
-
} catch {
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
throw error;
|
|
103
|
-
}
|
|
82
|
+
const data = await this.fetchFromApi(hostname);
|
|
83
|
+
await cache.insert(cacheKey, JSON.stringify(data), 604800);
|
|
84
|
+
return data;
|
|
104
85
|
}
|
|
105
86
|
async getTokenByWhitelabelId(idWl) {
|
|
106
87
|
const apiUrl = this.getApiUrl();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/whitelabel/services/whitelabel.service.ts"],"sourcesContent":["import greatCache from \"@greatapps/cache\";\r\nimport { ApiError } from \"../../../infra/api/types\";\r\nimport { WhitelabelTokenApiResponse, WhitelabelTokenData } from \"../schema\";\r\nimport { normalizeHostname } from \"../utils/normalize-hostname\";\r\n\r\
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/whitelabel/services/whitelabel.service.ts"],"sourcesContent":["import greatCache from \"@greatapps/cache\";\r\nimport { ApiError } from \"../../../infra/api/types\";\r\nimport { WhitelabelTokenApiResponse, WhitelabelTokenData } from \"../schema\";\r\nimport { normalizeHostname } from \"../utils/normalize-hostname\";\r\n\r\nclass WhitelabelService {\r\n private getApiUrl(): string {\r\n const apiUrl = process.env.GAPPS_R3_API_URL;\r\n if (!apiUrl) {\r\n throw new ApiError(\r\n \"GAPPS_R3_API_URL not configured\",\r\n \"CONFIG_ERROR\",\r\n 500,\r\n );\r\n }\r\n return apiUrl;\r\n }\r\n\r\n private getToken(): string {\r\n const token = process.env.WHITELABEL_TOKEN_MASTER;\r\n if (!token) {\r\n throw new ApiError(\r\n \"WHITELABEL_TOKEN_MASTER not configured\",\r\n \"CONFIG_ERROR\",\r\n 500,\r\n );\r\n }\r\n return token;\r\n }\r\n\r\n private createCache() {\r\n return new greatCache({\r\n service: \"whitelabel-service\",\r\n version: \"1.0.3\",\r\n domain: \"whitelabel-cache.greatapps.com.br\",\r\n ambient: process.env.NODE_ENV || \"development\",\r\n });\r\n }\r\n\r\n private getCacheKey(hostname: string): string {\r\n return `whitelabel-token-${hostname}`;\r\n }\r\n\r\n private async fetchFromApi(hostname: string): Promise<WhitelabelTokenData> {\r\n const apiUrl = this.getApiUrl();\r\n const whitelabelMasterToken = this.getToken();\r\n const url = `${apiUrl}/v1/pt-br/1/whitelabel/${hostname}/token`;\r\n\r\n console.log(\"[WhitelabelService] Fetching token for domain\", { url });\r\n\r\n const response = await fetch(url, {\r\n method: \"GET\",\r\n headers: {\r\n authorization: whitelabelMasterToken,\r\n },\r\n });\r\n\r\n if (!response.ok) {\r\n console.error(\"[WhitelabelService] Failed to fetch whitelabel token\", {\r\n response,\r\n });\r\n throw new ApiError(\r\n `Failed to fetch whitelabel token: ${response.status}`,\r\n \"FETCH_ERROR\",\r\n response.status,\r\n );\r\n }\r\n\r\n const result: WhitelabelTokenApiResponse = await response.json();\r\n\r\n if (result.status !== 1 || !result.data?.length) {\r\n throw new ApiError(\"Whitelabel token not found\", \"TOKEN_NOT_FOUND\", 404);\r\n }\r\n\r\n return result.data[0];\r\n }\r\n\r\n async getTokenByDomain(hostname: string): Promise<WhitelabelTokenData> {\r\n hostname = `${normalizeHostname(process.env.WHITELABEL_DOMAIN || hostname)}`;\r\n console.debug(\"[WhitelabelService] Getting token for domain\", {\r\n hostname,\r\n byEnv: process.env.WHITELABEL_DOMAIN,\r\n });\r\n\r\n const cache = this.createCache();\r\n const cacheKey = this.getCacheKey(hostname);\r\n\r\n const cachedData = await cache.select(cacheKey);\r\n console.debug(\"[WhitelabelService] Cache lookup for domain\", {\r\n cacheKey,\r\n cachedData,\r\n });\r\n\r\n if (cachedData.status == 1 && \"data\" in cachedData && cachedData.data) {\r\n console.log(\"[WhitelabelService] Cache hit for domain\", { hostname });\r\n return JSON.parse(cachedData.data) as WhitelabelTokenData;\r\n }\r\n\r\n const data = await this.fetchFromApi(hostname);\r\n\r\n await cache.insert(cacheKey, JSON.stringify(data), 604800);\r\n\r\n return data;\r\n }\r\n\r\n async getTokenByWhitelabelId(idWl: number): Promise<string> {\r\n const apiUrl = this.getApiUrl();\r\n const masterToken = this.getToken();\r\n const url = `${apiUrl}/v1/pt-br/${idWl}/tokens?limit=1&page=1&sort=id:desc`;\r\n console.debug(\"[WhitelabelService] Fetching token by whitelabel ID\", {\r\n url,\r\n config: {\r\n method: \"GET\",\r\n headers: { authorization: masterToken },\r\n },\r\n });\r\n\r\n const response = await fetch(url, {\r\n method: \"GET\",\r\n headers: { authorization: masterToken },\r\n });\r\n\r\n console.debug(\"[WhitelabelService] Response received for whitelabel ID\", {\r\n response,\r\n });\r\n\r\n if (!response.ok) {\r\n throw new ApiError(\r\n `Failed to fetch whitelabel token: ${response.status}`,\r\n \"WL_TOKEN_NOT_FOUND\",\r\n response.status,\r\n );\r\n }\r\n\r\n const result: WhitelabelTokenApiResponse = await response.json();\r\n\r\n if (result.status !== 1 || !result.data?.length) {\r\n throw new ApiError(\r\n \"Token do whitelabel não encontrado\",\r\n \"WL_TOKEN_NOT_FOUND\",\r\n 404,\r\n );\r\n }\r\n\r\n return result.data[0].token;\r\n }\r\n\r\n async revalidateByDomain(hostname: string): Promise<WhitelabelTokenData> {\r\n hostname = `${normalizeHostname(process.env.WHITELABEL_DOMAIN || hostname)}`;\r\n console.debug(\"[WhitelabelService] Getting token for domain\", {\r\n hostname,\r\n byEnv: process.env.WHITELABEL_DOMAIN,\r\n });\r\n\r\n const cache = this.createCache();\r\n const cacheKey = this.getCacheKey(hostname);\r\n\r\n console.log(\"[WhitelabelService] Revalidating cache for domain\", {\r\n hostname,\r\n cacheKey,\r\n });\r\n \r\n await cache.delete(cacheKey);\r\n\r\n const data = await this.fetchFromApi(hostname);\r\n\r\n await cache.insert(cacheKey, JSON.stringify(data), 604800);\r\n\r\n console.log(\"[WhitelabelService] Cache revalidated for domain\", {\r\n hostname,\r\n });\r\n\r\n return data;\r\n }\r\n}\r\n\r\nexport const whitelabelService = new WhitelabelService();\r\n"],"mappings":"AAAA,OAAO,gBAAgB;AACvB,SAAS,gBAAgB;AAEzB,SAAS,yBAAyB;AAElC,MAAM,kBAAkB;AAAA,EACd,YAAoB;AAC1B,UAAM,SAAS,QAAQ,IAAI;AAC3B,QAAI,CAAC,QAAQ;AACX,YAAM,IAAI;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAAA,EAEQ,WAAmB;AACzB,UAAM,QAAQ,QAAQ,IAAI;AAC1B,QAAI,CAAC,OAAO;AACV,YAAM,IAAI;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAAA,EAEQ,cAAc;AACpB,WAAO,IAAI,WAAW;AAAA,MACpB,SAAS;AAAA,MACT,SAAS;AAAA,MACT,QA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AAY;AAC/B,UAAM,WAAW,KAAK,YAAY,QAAQ;AAE1C,YAAQ,IAAI,qDAAqD;AAAA,MAC/D;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,MAAM,OAAO,QAAQ;AAE3B,UAAM,OAAO,MAAM,KAAK,aAAa,QAAQ;AAE7C,UAAM,MAAM,OAAO,UAAU,KAAK,UAAU,IAAI,GAAG,MAAM;AAEzD,YAAQ,IAAI,oDAAoD;AAAA,MAC9D;AAAA,IACF,CAAC;AAED,WAAO;AAAA,EACT;AACF;AAEO,MAAM,oBAAoB,IAAI,kBAAkB;","names":[]}
|
|
@@ -17,7 +17,6 @@ const CATEGORY_PREFIXES = /* @__PURE__ */ new Set([
|
|
|
17
17
|
]);
|
|
18
18
|
const SIMPLE_TLDS = /* @__PURE__ */ new Set(["online"]);
|
|
19
19
|
function normalizeHostname(hostname) {
|
|
20
|
-
hostname = hostname.split(":")[0];
|
|
21
20
|
const parts = hostname.split(".");
|
|
22
21
|
if (parts.length <= 2) return hostname;
|
|
23
22
|
const last = parts[parts.length - 1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/whitelabel/utils/normalize-hostname.ts"],"sourcesContent":["const CATEGORY_PREFIXES = new Set([\n \"com\", \"dev\", \"net\", \"org\", \"edu\", \"gov\",\n \"mil\", \"co\", \"art\", \"inf\", \"blog\", \"wiki\", \"app\", \"online\", \"site\"\n]);\n\nconst SIMPLE_TLDS = new Set([\"online\"]);\n\nexport function normalizeHostname(hostname: string): string {\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/whitelabel/utils/normalize-hostname.ts"],"sourcesContent":["const CATEGORY_PREFIXES = new Set([\n \"com\", \"dev\", \"net\", \"org\", \"edu\", \"gov\",\n \"mil\", \"co\", \"art\", \"inf\", \"blog\", \"wiki\", \"app\", \"online\", \"site\"\n]);\n\nconst SIMPLE_TLDS = new Set([\"online\"]);\n\nexport function normalizeHostname(hostname: string): string {\n const parts = hostname.split(\".\");\n if (parts.length <= 2) return hostname;\n\n const last = parts[parts.length - 1];\n const secondLast = parts[parts.length - 2];\n\n const isCompoundTld =\n last.length <= 3 && CATEGORY_PREFIXES.has(secondLast);\n\n const rootParts = isCompoundTld ? 3 : 2;\n\n if (SIMPLE_TLDS.has(last) || !isCompoundTld) {\n return parts.slice(-2).join(\".\");\n }\n\n if (parts.length <= rootParts) return hostname;\n return parts.slice(-rootParts).join(\".\");\n}\n"],"mappings":"AAAA,MAAM,oBAAoB,oBAAI,IAAI;AAAA,EAChC;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EAAO;AAAA,EACnC;AAAA,EAAO;AAAA,EAAM;AAAA,EAAO;AAAA,EAAO;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAO;AAAA,EAAU;AAC9D,CAAC;AAED,MAAM,cAAc,oBAAI,IAAI,CAAC,QAAQ,CAAC;AAE/B,SAAS,kBAAkB,UAA0B;AAC1D,QAAM,QAAQ,SAAS,MAAM,GAAG;AAChC,MAAI,MAAM,UAAU,EAAG,QAAO;AAE9B,QAAM,OAAO,MAAM,MAAM,SAAS,CAAC;AACnC,QAAM,aAAa,MAAM,MAAM,SAAS,CAAC;AAEzC,QAAM,gBACJ,KAAK,UAAU,KAAK,kBAAkB,IAAI,UAAU;AAEtD,QAAM,YAAY,gBAAgB,IAAI;AAEtC,MAAI,YAAY,IAAI,IAAI,KAAK,CAAC,eAAe;AAC3C,WAAO,MAAM,MAAM,EAAE,EAAE,KAAK,GAAG;AAAA,EACjC;AAEA,MAAI,MAAM,UAAU,UAAW,QAAO;AACtC,SAAO,MAAM,MAAM,CAAC,SAAS,EAAE,KAAK,GAAG;AACzC;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useModalManager } from "./useModalManager";
|
|
2
|
+
function useAccountDeletionWarningModal() {
|
|
3
|
+
const { activeModal, openModal, closeModal } = useModalManager();
|
|
4
|
+
return {
|
|
5
|
+
open: activeModal === "accountDeletionWarningModal",
|
|
6
|
+
openModal: (options) => openModal("accountDeletionWarningModal", options ?? {}),
|
|
7
|
+
closeModal
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
useAccountDeletionWarningModal
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useAccountDeletionWarningModal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/store/useAccountDeletionWarningModal.ts"],"sourcesContent":["import { useModalManager } from './useModalManager';\n\ninterface AccountDeletionWarningModalOptions {\n /** Sobrescreve o redirecionamento padrão para a área de assinatura. */\n onReactivate?: () => void;\n}\n\nexport function useAccountDeletionWarningModal() {\n const { activeModal, openModal, closeModal } = useModalManager();\n\n return {\n open: activeModal === 'accountDeletionWarningModal',\n openModal: (options?: AccountDeletionWarningModalOptions) =>\n openModal('accountDeletionWarningModal', options ?? {}),\n closeModal,\n };\n}\n"],"mappings":"AAAA,SAAS,uBAAuB;AAOzB,SAAS,iCAAiC;AAC/C,QAAM,EAAE,aAAa,WAAW,WAAW,IAAI,gBAAgB;AAE/D,SAAO;AAAA,IACL,MAAM,gBAAgB;AAAA,IACtB,WAAW,CAAC,YACV,UAAU,+BAA+B,WAAW,CAAC,CAAC;AAAA,IACxD;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/browser/safe-storage.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/browser/safe-storage.ts"],"sourcesContent":["export function readStorage(key: string): string | null {\n if (typeof window === 'undefined') return null;\n try {\n return window.localStorage?.getItem(key) ?? null;\n } catch {\n return null;\n }\n}\n\nexport function writeStorage(key: string, value: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage?.setItem(key, value);\n } catch {\n }\n}\n"],"mappings":"AAAO,SAAS,YAAY,KAA4B;AACtD,MAAI,OAAO,WAAW,YAAa,QAAO;AAC1C,MAAI;AACF,WAAO,OAAO,cAAc,QAAQ,GAAG,KAAK;AAAA,EAC9C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEO,SAAS,aAAa,KAAa,OAAqB;AAC7D,MAAI,OAAO,WAAW,YAAa;AACnC,MAAI;AACF,WAAO,cAAc,QAAQ,KAAK,KAAK;AAAA,EACzC,QAAQ;AAAA,EACR;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { IconAlertTriangle } from '@tabler/icons-react';
|
|
4
|
+
import { useTranslations } from 'next-intl';
|
|
5
|
+
import { Button } from '../ui/buttons/Button';
|
|
6
|
+
import { Separator } from '../ui/data-display/Separator';
|
|
7
|
+
import {
|
|
8
|
+
Dialog,
|
|
9
|
+
DialogContent,
|
|
10
|
+
DialogDescription,
|
|
11
|
+
DialogHeader,
|
|
12
|
+
DialogTitle,
|
|
13
|
+
} from '../ui/overlay/Dialog';
|
|
14
|
+
import { useExternalContracting, useWhitelabelUrls } from '../../providers/whitelabel.provider';
|
|
15
|
+
import { useModalManager } from '../../store/useModalManager';
|
|
16
|
+
|
|
17
|
+
export default function AccountDeletionWarningModal() {
|
|
18
|
+
const translate = useTranslations();
|
|
19
|
+
const { activeModal, modalData, closeModal } = useModalManager();
|
|
20
|
+
const { accountsUrl } = useWhitelabelUrls();
|
|
21
|
+
const { redirectToExternal } = useExternalContracting();
|
|
22
|
+
|
|
23
|
+
const isOpen = activeModal === 'accountDeletionWarningModal';
|
|
24
|
+
const onReactivate = modalData.onReactivate as (() => void) | undefined;
|
|
25
|
+
|
|
26
|
+
const handleReactivate = () => {
|
|
27
|
+
if (onReactivate) {
|
|
28
|
+
onReactivate();
|
|
29
|
+
closeModal();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (redirectToExternal('plans')) return;
|
|
34
|
+
window.location.href = `${accountsUrl}/subscriptions?tab=plans`;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Dialog open={isOpen} onOpenChange={(open: boolean) => !open && closeModal()}>
|
|
39
|
+
<DialogContent className="flex flex-col p-0 gap-0 md:w-[410px]! lg:w-[410px]! max-w-[410px]! max-[410px]:w-[calc(100%-32px)]">
|
|
40
|
+
<DialogHeader className="gap-3 text-left p-5">
|
|
41
|
+
<div className="flex items-center justify-center w-10 h-10 bg-red-50 rounded-lg">
|
|
42
|
+
<IconAlertTriangle size={20} className="text-red-500" />
|
|
43
|
+
</div>
|
|
44
|
+
<div className="flex flex-col gap-2">
|
|
45
|
+
<DialogTitle className="paragraph-medium-semibold text-zinc-950">
|
|
46
|
+
{translate('common.account.deletionWarning.title')}
|
|
47
|
+
</DialogTitle>
|
|
48
|
+
<DialogDescription className="paragraph-small-regular text-zinc-600" asChild>
|
|
49
|
+
<div className="flex flex-col gap-3">
|
|
50
|
+
<p>{translate('common.account.deletionWarning.descriptionLine1')}</p>
|
|
51
|
+
<p>{translate('common.account.deletionWarning.descriptionLine2')}</p>
|
|
52
|
+
</div>
|
|
53
|
+
</DialogDescription>
|
|
54
|
+
</div>
|
|
55
|
+
</DialogHeader>
|
|
56
|
+
|
|
57
|
+
<Separator />
|
|
58
|
+
|
|
59
|
+
<div className="flex items-center gap-2 p-5">
|
|
60
|
+
<Button className="w-fit h-10!" onClick={handleReactivate}>
|
|
61
|
+
{translate('common.account.deletionWarning.reactivate')}
|
|
62
|
+
</Button>
|
|
63
|
+
</div>
|
|
64
|
+
</DialogContent>
|
|
65
|
+
</Dialog>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -83,6 +83,14 @@ const messages = {
|
|
|
83
83
|
other: 'Other reason',
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
|
+
deletionWarning: {
|
|
87
|
+
title: 'Your account will be deleted',
|
|
88
|
+
descriptionLine1:
|
|
89
|
+
'Your subscription has been cancelled for 90 days or more. Your account and all data will be permanently deleted.',
|
|
90
|
+
descriptionLine2:
|
|
91
|
+
'To keep your information, reactivate your subscription before the deletion. After this period, the data cannot be recovered.',
|
|
92
|
+
reactivate: 'Reactivate subscription',
|
|
93
|
+
},
|
|
86
94
|
confirmDelete: {
|
|
87
95
|
title: 'Sorry to see you go!',
|
|
88
96
|
warning:
|