@burdenoff/microfe-billing 2026.1108.1 → 2026.1109.1
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/billing/BillingAdminRoutes.d.ts +1 -2
- package/dist/billing/BillingAdminRoutes.js +11 -12
- package/dist/billing/BillingAdminRoutes.js.map +1 -1
- package/dist/billing/BillingRoot.d.ts +0 -1
- package/dist/billing/BillingRoot.js +10 -9
- package/dist/billing/BillingRoot.js.map +1 -1
- package/dist/billing/BillingUserRoutes.d.ts +1 -2
- package/dist/billing/BillingUserRoutes.js +13 -14
- package/dist/billing/BillingUserRoutes.js.map +1 -1
- package/dist/billing/hooks/useBillingAccountSelection.d.ts +0 -1
- package/dist/billing/hooks/useBillingAccountSelection.js +7 -5
- package/dist/billing/hooks/useBillingAccountSelection.js.map +1 -1
- package/dist/billing/hooks/useBillingEventEmitter.d.ts +0 -1
- package/dist/billing/hooks/useBillingEventEmitter.js +1 -2
- package/dist/billing/hooks/useBillingEventEmitter.js.map +1 -1
- package/dist/billing/hooks/useBillingNavigate.d.ts +0 -1
- package/dist/billing/hooks/useBillingNavigate.js +1 -2
- package/dist/billing/hooks/useBillingNavigate.js.map +1 -1
- package/dist/billing/hooks/useBillingPermissions.d.ts +0 -1
- package/dist/billing/hooks/useBillingPermissions.js +2 -3
- package/dist/billing/hooks/useBillingPermissions.js.map +1 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.d.ts +0 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.js +1 -2
- package/dist/billing/hooks/useDefaultBillingCurrency.js.map +1 -1
- package/dist/billing/hooks/useProducts.d.ts +0 -1
- package/dist/billing/hooks/useProducts.js +1 -2
- package/dist/billing/hooks/useProducts.js.map +1 -1
- package/dist/billing/index.d.ts +0 -1
- package/dist/billing/lib/native-purchases.d.ts +0 -1
- package/dist/billing/lib/native-purchases.js +1 -2
- package/dist/billing/lib/native-purchases.js.map +1 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts +0 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.js +4 -5
- package/dist/billing/modules/addons/components/FloatingCartDrawer.js.map +1 -1
- package/dist/billing/modules/addons/hooks/index.d.ts +0 -1
- package/dist/billing/modules/addons/hooks/index.js +3 -2
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts +0 -1
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js +1 -2
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.js.map +1 -1
- package/dist/billing/modules/addons/hooks/useAddons.d.ts +0 -1
- package/dist/billing/modules/addons/hooks/useAddons.js +1 -2
- package/dist/billing/modules/addons/hooks/useAddons.js.map +1 -1
- package/dist/billing/modules/addons/index.d.ts +0 -1
- package/dist/billing/modules/addons/index.js +10 -10
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +15 -16
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.js +11 -12
- package/dist/billing/modules/addons/pages/AddonCreatePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +16 -17
- package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +16 -17
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +111 -106
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.d.ts +0 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js +105 -100
- package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/index.d.ts +0 -1
- package/dist/billing/modules/addons/pages/index.js +7 -6
- package/dist/billing/modules/addons/store/addonCartStore.d.ts +0 -1
- package/dist/billing/modules/addons/store/addonCartStore.js +2 -7
- package/dist/billing/modules/addons/store/addonCartStore.js.map +1 -1
- package/dist/billing/modules/affiliate/api.d.ts +0 -1
- package/dist/billing/modules/affiliate/api.js +1 -2
- package/dist/billing/modules/affiliate/api.js.map +1 -1
- package/dist/billing/modules/affiliate/index.d.ts +0 -1
- package/dist/billing/modules/affiliate/index.js +1 -2
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts +0 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +29 -28
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/index.d.ts +0 -1
- package/dist/billing/modules/analytics/index.js +1 -2
- package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts +0 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +8 -9
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/index.d.ts +0 -1
- package/dist/billing/modules/analytics/pages/index.js +1 -1
- package/dist/billing/modules/billing/hooks/index.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/index.js +5 -4
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useInvoices.js +1 -2
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.js +1 -2
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.js.map +1 -1
- package/dist/billing/modules/billing/hooks/usePayments.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.js +1 -2
- package/dist/billing/modules/billing/hooks/useRefunds.js.map +1 -1
- package/dist/billing/modules/billing/hooks/useTransactions.d.ts +0 -1
- package/dist/billing/modules/billing/hooks/useTransactions.js +30 -31
- package/dist/billing/modules/billing/hooks/useTransactions.js.map +1 -1
- package/dist/billing/modules/billing/index.d.ts +0 -1
- package/dist/billing/modules/billing/index.js +15 -15
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +11 -12
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +53 -59
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +81 -87
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +11 -12
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +51 -54
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +33 -34
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/RefundsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/RefundsPage.js +92 -93
- package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +38 -39
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts +0 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -30
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/index.d.ts +0 -1
- package/dist/billing/modules/billing/pages/index.js +10 -9
- package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js +1 -2
- package/dist/billing/modules/checkout/components/BillingAccountSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +1 -2
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.js +1 -2
- package/dist/billing/modules/checkout/components/CreditsAmountInput.js.map +1 -1
- package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts +0 -1
- package/dist/billing/modules/checkout/components/CurrencySelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.js +1 -2
- package/dist/billing/modules/checkout/components/NativeCheckoutView.js.map +1 -1
- package/dist/billing/modules/checkout/components/OrderSummary.d.ts +0 -1
- package/dist/billing/modules/checkout/components/OrderSummary.js +35 -32
- package/dist/billing/modules/checkout/components/OrderSummary.js.map +1 -1
- package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.js +1 -2
- package/dist/billing/modules/checkout/components/PromoCodeInput.js.map +1 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts +0 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js +1 -2
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.js.map +1 -1
- package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js +1 -2
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.js.map +1 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts +0 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.js +5 -3
- package/dist/billing/modules/checkout/components/StoreShippingSection.js.map +1 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts +0 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.js +35 -41
- package/dist/billing/modules/checkout/components/StripePaymentForm.js.map +1 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js +1 -2
- package/dist/billing/modules/checkout/components/SubscriptionSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts +0 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js +1 -2
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.js.map +1 -1
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts +0 -1
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js +5 -6
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.js.map +1 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts +0 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js +7 -8
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.js.map +1 -1
- package/dist/billing/modules/checkout/components/index.d.ts +0 -1
- package/dist/billing/modules/checkout/components/index.js +12 -11
- package/dist/billing/modules/checkout/hooks/index.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/index.js +5 -4
- package/dist/billing/modules/checkout/hooks/useCheckout.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.js +182 -195
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.js +33 -32
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.js +1 -2
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js +1 -2
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.js.map +1 -1
- package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts +4 -8
- package/dist/billing/modules/checkout/hooks/useStoreShipping.js +1 -2
- package/dist/billing/modules/checkout/hooks/useStoreShipping.js.map +1 -1
- package/dist/billing/modules/checkout/index.d.ts +0 -1
- package/dist/billing/modules/checkout/index.js +19 -19
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts +0 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +730 -732
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/checkout/pages/index.d.ts +0 -1
- package/dist/billing/modules/checkout/pages/index.js +1 -1
- package/dist/billing/modules/checkout/types/index.d.ts +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.d.ts +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.js +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.js.map +1 -1
- package/dist/billing/modules/coupons/index.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +5 -6
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.js +15 -13
- package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js +12 -10
- package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.js +7 -11
- package/dist/billing/modules/coupons/pages/EditCouponPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/index.d.ts +0 -1
- package/dist/billing/modules/coupons/pages/index.js +5 -4
- package/dist/billing/modules/credits/hooks/index.d.ts +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.d.ts +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.js +20 -21
- package/dist/billing/modules/credits/hooks/useCredits.js.map +1 -1
- package/dist/billing/modules/credits/index.d.ts +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js +19 -24
- package/dist/billing/modules/credits/pages/AdminCreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +26 -27
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +54 -52
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.d.ts +0 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +37 -38
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/index.d.ts +0 -1
- package/dist/billing/modules/credits/pages/index.js +5 -4
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js +2 -3
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js +35 -43
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js +1 -2
- package/dist/billing/modules/dashboard/components/BillingAccountCard.js.map +1 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js +1 -2
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.js.map +1 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js +2 -5
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +1 -2
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
- package/dist/billing/modules/dashboard/components/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/components/index.js +7 -6
- package/dist/billing/modules/dashboard/hooks/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/hooks/index.js +3 -2
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts +0 -1
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js +2 -3
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.js.map +1 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts +0 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.js +2 -3
- package/dist/billing/modules/dashboard/hooks/useDashboard.js.map +1 -1
- package/dist/billing/modules/dashboard/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/index.js +11 -10
- package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts +0 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +266 -264
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/index.d.ts +0 -1
- package/dist/billing/modules/dashboard/pages/index.js +1 -1
- package/dist/billing/modules/discounts/index.d.ts +0 -1
- package/dist/billing/modules/discounts/index.js +1 -2
- package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts +0 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js +169 -176
- package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
- package/dist/billing/modules/discounts/pages/index.d.ts +0 -1
- package/dist/billing/modules/discounts/pages/index.js +1 -1
- package/dist/billing/modules/earnings/api.d.ts +0 -1
- package/dist/billing/modules/earnings/api.js +66 -67
- package/dist/billing/modules/earnings/api.js.map +1 -1
- package/dist/billing/modules/earnings/index.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +17 -17
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +188 -189
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.js +111 -111
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +29 -30
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts +0 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +103 -104
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/earnings/payoutAccountStatus.d.ts +0 -1
- package/dist/billing/modules/earnings/payoutAccountStatus.js +1 -2
- package/dist/billing/modules/earnings/payoutAccountStatus.js.map +1 -1
- package/dist/billing/modules/plans/constants/enterprise.d.ts +0 -1
- package/dist/billing/modules/plans/constants/enterprise.js +1 -2
- package/dist/billing/modules/plans/constants/enterprise.js.map +1 -1
- package/dist/billing/modules/plans/constants/featuredQuotas.d.ts +0 -1
- package/dist/billing/modules/plans/constants/featuredQuotas.js +1 -2
- package/dist/billing/modules/plans/constants/featuredQuotas.js.map +1 -1
- package/dist/billing/modules/plans/hooks/index.d.ts +0 -1
- package/dist/billing/modules/plans/hooks/index.js +3 -2
- package/dist/billing/modules/plans/hooks/usePlans.d.ts +0 -1
- package/dist/billing/modules/plans/hooks/usePlans.js +1 -2
- package/dist/billing/modules/plans/hooks/usePlans.js.map +1 -1
- package/dist/billing/modules/plans/hooks/useQuotas.d.ts +0 -1
- package/dist/billing/modules/plans/hooks/useQuotas.js +1 -2
- package/dist/billing/modules/plans/hooks/useQuotas.js.map +1 -1
- package/dist/billing/modules/plans/index.d.ts +0 -1
- package/dist/billing/modules/plans/index.js +11 -11
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +12 -15
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +38 -39
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.js +10 -11
- package/dist/billing/modules/plans/pages/PlanCreatePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +40 -41
- package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +15 -16
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +18 -19
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.d.ts +0 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +100 -101
- package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/index.d.ts +0 -1
- package/dist/billing/modules/plans/pages/index.js +8 -7
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts +0 -1
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.js +1 -2
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.js.map +1 -1
- package/dist/billing/modules/plans/utils/planSelector.d.ts +0 -1
- package/dist/billing/modules/plans/utils/planSelector.js +1 -2
- package/dist/billing/modules/plans/utils/planSelector.js.map +1 -1
- package/dist/billing/modules/promotions/index.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +5 -6
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js +5 -6
- package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -1
- package/dist/billing/modules/promotions/pages/index.d.ts +0 -1
- package/dist/billing/modules/promotions/pages/index.js +3 -2
- package/dist/billing/modules/quota/hooks/index.d.ts +0 -1
- package/dist/billing/modules/quota/hooks/index.js +1 -1
- package/dist/billing/modules/quota/hooks/useQuota.d.ts +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.js +1 -2
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.js.map +1 -1
- package/dist/billing/modules/quota/index.d.ts +0 -1
- package/dist/billing/modules/quota/index.js +8 -8
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +12 -15
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaPage.js +3 -3
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +13 -14
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +9 -10
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +12 -13
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +16 -17
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js.map +1 -1
- package/dist/billing/modules/quota/pages/index.d.ts +0 -1
- package/dist/billing/modules/quota/pages/index.js +6 -5
- package/dist/billing/modules/quota/utils/quotaSelector.d.ts +0 -1
- package/dist/billing/modules/quota/utils/quotaSelector.js +1 -2
- package/dist/billing/modules/quota/utils/quotaSelector.js.map +1 -1
- package/dist/billing/modules/settings/index.d.ts +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.d.ts +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.js +12 -13
- package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts +0 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +32 -32
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
- package/dist/billing/modules/settings/pages/index.d.ts +0 -1
- package/dist/billing/modules/settings/pages/index.js +3 -2
- package/dist/billing/modules/store/graphql/index.d.ts +0 -1
- package/dist/billing/modules/store/index.d.ts +0 -1
- package/dist/billing/modules/store/index.js +1 -2
- package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts +0 -1
- package/dist/billing/modules/store/pages/StoreCheckoutPage.js +1 -2
- package/dist/billing/modules/store/pages/StoreCheckoutPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts +0 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +9 -11
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js.map +1 -1
- package/dist/billing/modules/subscriptions/hooks/index.d.ts +0 -1
- package/dist/billing/modules/subscriptions/hooks/index.js +1 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts +0 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js +1 -2
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.js.map +1 -1
- package/dist/billing/modules/subscriptions/index.d.ts +0 -1
- package/dist/billing/modules/subscriptions/index.js +6 -6
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +311 -312
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +61 -62
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +30 -31
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
- package/dist/billing/modules/subscriptions/pages/index.d.ts +0 -1
- package/dist/billing/modules/subscriptions/pages/index.js +4 -3
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts +0 -1
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js +17 -18
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.js.map +1 -1
- package/dist/billing/modules/usage/hooks/index.d.ts +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.d.ts +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.js +72 -73
- package/dist/billing/modules/usage/hooks/useUsage.js.map +1 -1
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts +0 -1
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js +12 -13
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.js.map +1 -1
- package/dist/billing/modules/usage/index.d.ts +0 -1
- package/dist/billing/modules/usage/index.js +1 -2
- package/dist/billing/modules/usage/pages/UsagePage.d.ts +0 -1
- package/dist/billing/modules/usage/pages/UsagePage.js +229 -227
- package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
- package/dist/billing/modules/usage/pages/index.d.ts +0 -1
- package/dist/billing/modules/usage/pages/index.js +1 -1
- package/dist/billing/modules/usage/utils/aiSpend.d.ts +0 -1
- package/dist/billing/modules/usage/utils/aiSpend.js +2 -3
- package/dist/billing/modules/usage/utils/aiSpend.js.map +1 -1
- package/dist/billing/providers/BillingProvider.d.ts +0 -1
- package/dist/billing/providers/BillingProvider.js +3 -4
- package/dist/billing/providers/BillingProvider.js.map +1 -1
- package/dist/billing/shared/components/AccessDenied.d.ts +0 -1
- package/dist/billing/shared/components/AccessDenied.js +1 -2
- package/dist/billing/shared/components/AccessDenied.js.map +1 -1
- package/dist/billing/shared/components/ActorIdentity.d.ts +0 -1
- package/dist/billing/shared/components/ActorIdentity.js +2 -3
- package/dist/billing/shared/components/ActorIdentity.js.map +1 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts +0 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js +1 -2
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.js.map +1 -1
- package/dist/billing/shared/components/EmptyState.d.ts +0 -1
- package/dist/billing/shared/components/EmptyState.js +1 -2
- package/dist/billing/shared/components/EmptyState.js.map +1 -1
- package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts +0 -1
- package/dist/billing/shared/components/PageHeader.d.ts +0 -1
- package/dist/billing/shared/components/PageHeader.js +1 -2
- package/dist/billing/shared/components/PageHeader.js.map +1 -1
- package/dist/billing/shared/components/PushPermissionNudge.d.ts +0 -1
- package/dist/billing/shared/components/PushPermissionNudge.js +2 -3
- package/dist/billing/shared/components/PushPermissionNudge.js.map +1 -1
- package/dist/billing/shared/components/ServerError.d.ts +0 -1
- package/dist/billing/shared/components/ServerError.js +1 -2
- package/dist/billing/shared/components/ServerError.js.map +1 -1
- package/dist/billing/shared/components/StatCard.d.ts +0 -1
- package/dist/billing/shared/components/StatCard.js +1 -2
- package/dist/billing/shared/components/StatCard.js.map +1 -1
- package/dist/billing/shared/components/index.d.ts +0 -1
- package/dist/billing/shared/components/index.js +8 -7
- package/dist/billing/shared/hooks/index.d.ts +0 -1
- package/dist/billing/shared/hooks/index.js +1 -1
- package/dist/billing/shared/hooks/useActorProfiles.d.ts +0 -1
- package/dist/billing/shared/hooks/useActorProfiles.js +4 -8
- package/dist/billing/shared/hooks/useActorProfiles.js.map +1 -1
- package/dist/billing/shared/hooks/useTr.d.ts +0 -1
- package/dist/billing/shared/hooks/useTr.js +1 -2
- package/dist/billing/shared/hooks/useTr.js.map +1 -1
- package/dist/billing/shared/index.d.ts +0 -1
- package/dist/billing/shared/types/graphql.d.ts +0 -1
- package/dist/billing/shared/types/graphql.js +1 -2
- package/dist/billing/shared/types/graphql.js.map +1 -1
- package/dist/billing/shared/types/index.d.ts +0 -1
- package/dist/billing/shared/ui/Card.d.ts +1 -2
- package/dist/billing/shared/ui/Card.js +1 -2
- package/dist/billing/shared/ui/Card.js.map +1 -1
- package/dist/billing/shared/ui/MetricCard.d.ts +1 -2
- package/dist/billing/shared/ui/MetricCard.js +1 -2
- package/dist/billing/shared/ui/MetricCard.js.map +1 -1
- package/dist/billing/shared/ui/ProgressBar.d.ts +1 -2
- package/dist/billing/shared/ui/ProgressBar.js +1 -2
- package/dist/billing/shared/ui/ProgressBar.js.map +1 -1
- package/dist/billing/shared/ui/SectionHeader.d.ts +1 -2
- package/dist/billing/shared/ui/StatusPill.d.ts +1 -2
- package/dist/billing/shared/ui/StatusPill.js +1 -2
- package/dist/billing/shared/ui/StatusPill.js.map +1 -1
- package/dist/billing/shared/ui/index.d.ts +0 -1
- package/dist/billing/shared/ui/index.js +5 -4
- package/dist/billing/shared/utils/directActivityGraphql.d.ts +2 -1
- package/dist/billing/shared/utils/directActivityGraphql.js +1 -1
- package/dist/billing/shared/utils/directBillingGraphql.d.ts +2 -1
- package/dist/billing/shared/utils/directBillingGraphql.js +3 -3
- package/dist/billing/shared/utils/directBillingGraphql.js.map +1 -1
- package/dist/billing/shared/utils/error.d.ts +0 -1
- package/dist/billing/shared/utils/error.js +1 -2
- package/dist/billing/shared/utils/error.js.map +1 -1
- package/dist/billing/shared/utils/format.d.ts +0 -1
- package/dist/billing/shared/utils/format.js +1 -2
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/gatewayGraphql.d.ts +2 -1
- package/dist/billing/shared/utils/gatewayGraphql.js +4 -4
- package/dist/billing/shared/utils/gatewayGraphql.js.map +1 -1
- package/dist/billing/shared/utils/index.d.ts +0 -1
- package/dist/billing/shared/utils/index.js +9 -8
- package/dist/billing/shared/utils/navigation.d.ts +0 -1
- package/dist/billing/shared/utils/navigation.js +1 -2
- package/dist/billing/shared/utils/navigation.js.map +1 -1
- package/dist/billing/shared/utils/paymentTheme.d.ts +0 -1
- package/dist/billing/shared/utils/paymentTheme.js +2 -3
- package/dist/billing/shared/utils/paymentTheme.js.map +1 -1
- package/dist/billing/shared/utils/pinnedRequest.d.ts +48 -0
- package/dist/billing/shared/utils/pinnedRequest.js +63 -0
- package/dist/billing/shared/utils/pinnedRequest.js.map +1 -0
- package/dist/billing/shared/utils/planFeatureQuantity.d.ts +0 -1
- package/dist/billing/shared/utils/planFeatureQuantity.js +2 -3
- package/dist/billing/shared/utils/planFeatureQuantity.js.map +1 -1
- package/dist/billing/shared/utils/status.d.ts +0 -1
- package/dist/billing/shared/utils/status.js +24 -25
- package/dist/billing/shared/utils/status.js.map +1 -1
- package/dist/billing/shared/utils/tokens.d.ts +0 -1
- package/dist/billing/shared/utils/tokens.js +1 -2
- package/dist/billing/shared/utils/tokens.js.map +1 -1
- package/dist/billing/translations/en.d.ts +0 -1
- package/dist/billing/types/index.d.ts +0 -1
- package/dist/dev/main.d.ts +0 -1
- package/dist/generated/global-operations.d.ts +3252 -3206
- package/dist/generated/global-operations.js +445 -422
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/global-types.js +1 -2
- package/dist/generated/global-types.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +76 -47
- package/dist/generated/wspace-operations.js +2 -3
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/dist/node_modules/@capacitor/core/dist/index.js +12 -14
- package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -1
- package/dist/node_modules/sonner/dist/index.js +75 -69
- package/dist/node_modules/sonner/dist/index.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +0 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +66 -55
- package/dist/billing/BillingAdminRoutes.d.ts.map +0 -1
- package/dist/billing/BillingRoot.d.ts.map +0 -1
- package/dist/billing/BillingUserRoutes.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingAccountSelection.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingEventEmitter.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingNavigate.d.ts.map +0 -1
- package/dist/billing/hooks/useBillingPermissions.d.ts.map +0 -1
- package/dist/billing/hooks/useDefaultBillingCurrency.d.ts.map +0 -1
- package/dist/billing/hooks/useProducts.d.ts.map +0 -1
- package/dist/billing/index.d.ts.map +0 -1
- package/dist/billing/lib/native-purchases.d.ts.map +0 -1
- package/dist/billing/modules/addons/components/FloatingCartDrawer.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/useAddonPurchaseEligibility.d.ts.map +0 -1
- package/dist/billing/modules/addons/hooks/useAddons.d.ts.map +0 -1
- package/dist/billing/modules/addons/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.d.ts.map +0 -1
- package/dist/billing/modules/addons/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/addons/store/addonCartStore.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/api.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/index.d.ts.map +0 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.d.ts.map +0 -1
- package/dist/billing/modules/analytics/index.d.ts.map +0 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.d.ts.map +0 -1
- package/dist/billing/modules/analytics/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useInvoices.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useOrderCallbacks.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/usePayments.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useRefunds.d.ts.map +0 -1
- package/dist/billing/modules/billing/hooks/useTransactions.d.ts.map +0 -1
- package/dist/billing/modules/billing/index.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/InvoiceDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/PaymentMethodsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/RefundIssueLogsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/RefundsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/UserRefundsPage.d.ts.map +0 -1
- package/dist/billing/modules/billing/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/AutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/BillingAccountSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CompactAutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CreditsAmountInput.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CreditsPaymentOption.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/CurrencySelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/NativeCheckoutView.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/OrderSummary.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/PaymentProviderSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/PromoCodeInput.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/RazorpayPaymentButton.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SavedCardSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SimpleAutoPayToggle.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/StoreShippingSection.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/StripePaymentForm.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/SubscriptionSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/UnifiedPaymentMethodSelector.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/WebCheckoutRedirectView.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/WorkspaceQuotaAssignmentModal.d.ts.map +0 -1
- package/dist/billing/modules/checkout/components/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useCheckout.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useNativeCheckout.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentProviders.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/usePaymentStatusPolling.d.ts.map +0 -1
- package/dist/billing/modules/checkout/hooks/useStoreShipping.d.ts.map +0 -1
- package/dist/billing/modules/checkout/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/pages/CheckoutPage.d.ts.map +0 -1
- package/dist/billing/modules/checkout/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/types/index.d.ts.map +0 -1
- package/dist/billing/modules/checkout/utils/storeOrder.d.ts.map +0 -1
- package/dist/billing/modules/coupons/index.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CouponsListPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/CreateCouponPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/EditCouponPage.d.ts.map +0 -1
- package/dist/billing/modules/coupons/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/hooks/useCredits.d.ts.map +0 -1
- package/dist/billing/modules/credits/index.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/AdminCreditsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditTransactionsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/CreditsPage.d.ts.map +0 -1
- package/dist/billing/modules/credits/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/ActiveSubscriptionCard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/AddPaymentMethodModal.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/BillingAccountCard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/CreateBillingAccountModal.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/PaymentMethodsSection.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/components/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/useBillingOverviewData.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/hooks/useDashboard.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/index.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.d.ts.map +0 -1
- package/dist/billing/modules/dashboard/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/discounts/index.d.ts.map +0 -1
- package/dist/billing/modules/discounts/pages/DiscountsListPage.d.ts.map +0 -1
- package/dist/billing/modules/discounts/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/earnings/api.d.ts.map +0 -1
- package/dist/billing/modules/earnings/index.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/EarningsPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/PayoutAdminPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.d.ts.map +0 -1
- package/dist/billing/modules/earnings/payoutAccountStatus.d.ts.map +0 -1
- package/dist/billing/modules/plans/constants/enterprise.d.ts.map +0 -1
- package/dist/billing/modules/plans/constants/featuredQuotas.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/usePlans.d.ts.map +0 -1
- package/dist/billing/modules/plans/hooks/useQuotas.d.ts.map +0 -1
- package/dist/billing/modules/plans/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanAssignFreePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/PlansListPage.d.ts.map +0 -1
- package/dist/billing/modules/plans/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/plans/utils/currencyPriceOverrides.d.ts.map +0 -1
- package/dist/billing/modules/plans/utils/planSelector.d.ts.map +0 -1
- package/dist/billing/modules/promotions/index.d.ts.map +0 -1
- package/dist/billing/modules/promotions/pages/CreatePromotionPage.d.ts.map +0 -1
- package/dist/billing/modules/promotions/pages/PromotionsListPage.d.ts.map +0 -1
- package/dist/billing/modules/promotions/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/useQuota.d.ts.map +0 -1
- package/dist/billing/modules/quota/hooks/useQuotaTemplates.d.ts.map +0 -1
- package/dist/billing/modules/quota/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaAssignFreePage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.d.ts.map +0 -1
- package/dist/billing/modules/quota/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/quota/utils/quotaSelector.d.ts.map +0 -1
- package/dist/billing/modules/settings/index.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/SettingsPage.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/TeamPermissionsPage.d.ts.map +0 -1
- package/dist/billing/modules/settings/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/store/graphql/index.d.ts.map +0 -1
- package/dist/billing/modules/store/index.d.ts.map +0 -1
- package/dist/billing/modules/store/pages/StoreCheckoutPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/components/ManageSeatsModal.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/hooks/useSubscriptions.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/index.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.d.ts.map +0 -1
- package/dist/billing/modules/subscriptions/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/components/WorkspaceAiSpendPanel.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/useUsage.d.ts.map +0 -1
- package/dist/billing/modules/usage/hooks/useWorkspaceAiSpend.d.ts.map +0 -1
- package/dist/billing/modules/usage/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/pages/UsagePage.d.ts.map +0 -1
- package/dist/billing/modules/usage/pages/index.d.ts.map +0 -1
- package/dist/billing/modules/usage/utils/aiSpend.d.ts.map +0 -1
- package/dist/billing/providers/BillingProvider.d.ts.map +0 -1
- package/dist/billing/shared/components/AccessDenied.d.ts.map +0 -1
- package/dist/billing/shared/components/ActorIdentity.d.ts.map +0 -1
- package/dist/billing/shared/components/CurrencyPriceOverridesEditor.d.ts.map +0 -1
- package/dist/billing/shared/components/EmptyState.d.ts.map +0 -1
- package/dist/billing/shared/components/GeoPricingOverridesEditor.d.ts.map +0 -1
- package/dist/billing/shared/components/PageHeader.d.ts.map +0 -1
- package/dist/billing/shared/components/PushPermissionNudge.d.ts.map +0 -1
- package/dist/billing/shared/components/ServerError.d.ts.map +0 -1
- package/dist/billing/shared/components/StatCard.d.ts.map +0 -1
- package/dist/billing/shared/components/index.d.ts.map +0 -1
- package/dist/billing/shared/hooks/index.d.ts.map +0 -1
- package/dist/billing/shared/hooks/useActorProfiles.d.ts.map +0 -1
- package/dist/billing/shared/hooks/useTr.d.ts.map +0 -1
- package/dist/billing/shared/index.d.ts.map +0 -1
- package/dist/billing/shared/types/graphql.d.ts.map +0 -1
- package/dist/billing/shared/types/index.d.ts.map +0 -1
- package/dist/billing/shared/ui/Card.d.ts.map +0 -1
- package/dist/billing/shared/ui/MetricCard.d.ts.map +0 -1
- package/dist/billing/shared/ui/ProgressBar.d.ts.map +0 -1
- package/dist/billing/shared/ui/SectionHeader.d.ts.map +0 -1
- package/dist/billing/shared/ui/StatusPill.d.ts.map +0 -1
- package/dist/billing/shared/ui/index.d.ts.map +0 -1
- package/dist/billing/shared/utils/directActivityGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/directBillingGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/error.d.ts.map +0 -1
- package/dist/billing/shared/utils/format.d.ts.map +0 -1
- package/dist/billing/shared/utils/gatewayGraphql.d.ts.map +0 -1
- package/dist/billing/shared/utils/index.d.ts.map +0 -1
- package/dist/billing/shared/utils/navigation.d.ts.map +0 -1
- package/dist/billing/shared/utils/paymentTheme.d.ts.map +0 -1
- package/dist/billing/shared/utils/planFeatureQuantity.d.ts.map +0 -1
- package/dist/billing/shared/utils/status.d.ts.map +0 -1
- package/dist/billing/shared/utils/tokens.d.ts.map +0 -1
- package/dist/billing/translations/en.d.ts.map +0 -1
- package/dist/billing/types/index.d.ts.map +0 -1
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BillingUserRoutes.js","names":[],"sources":["../../src/billing/BillingUserRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, useEffect, type ReactNode } from 'react';\nimport { Navigate, Route, Routes, useLocation, useNavigate } from 'react-router';\nimport { FeatureGate } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { AccessDenied } from './shared/components';\nimport { useBillingEventEmitter, type BillingDomainEvent } from './hooks/useBillingEventEmitter';\nimport { useBillingPermissions } from './hooks/useBillingPermissions';\nimport { useBilling } from './providers/BillingProvider';\n\n// Eager load - main entry point\nimport { OverviewPage } from './modules/dashboard';\n\n// Lazy loaded pages - Subscriptions\nconst SubscriptionsListPage = lazy(() =>\n import('./modules/subscriptions').then((m) => ({ default: m.SubscriptionsListPage }))\n);\nconst SubscriptionDetailPage = lazy(() =>\n import('./modules/subscriptions').then((m) => ({ default: m.SubscriptionDetailPage }))\n);\nconst UpgradeSubscriptionPage = lazy(() =>\n import('./modules/subscriptions').then((m) => ({ default: m.UpgradeSubscriptionPage }))\n);\n\n// Lazy loaded pages - Plans (user browse pages, no create/edit/toggle)\nconst PlansBrowsePage = lazy(() =>\n import('./modules/plans').then((m) => ({ default: m.PlansBrowsePage }))\n);\nconst PlanBrowseDetailPage = lazy(() =>\n import('./modules/plans').then((m) => ({ default: m.PlanBrowseDetailPage }))\n);\n\n// Lazy loaded pages - Addons (user browse pages, no create/edit/toggle)\nconst AddonsBrowsePage = lazy(() =>\n import('./modules/addons').then((m) => ({ default: m.AddonsBrowsePage }))\n);\nconst AddonBrowseDetailPage = lazy(() =>\n import('./modules/addons').then((m) => ({ default: m.AddonBrowseDetailPage }))\n);\n\n// Lazy loaded pages - Billing (Invoices, Transactions, Payments, Refunds)\nconst InvoicesListPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.InvoicesListPage }))\n);\nconst InvoiceDetailPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.InvoiceDetailPage }))\n);\nconst TransactionsPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.TransactionsPage }))\n);\nconst UserRefundsPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.UserRefundsPage }))\n);\nconst PaymentMethodsPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.PaymentMethodsPage }))\n);\n\n// Lazy loaded pages - Credits\nconst CreditsPage = lazy(() =>\n import('./modules/credits').then((m) => ({ default: m.CreditsPage }))\n);\nconst CreditTransactionsPage = lazy(() =>\n import('./modules/credits').then((m) => ({ default: m.CreditTransactionsPage }))\n);\nconst CreditWithdrawalPage = lazy(() =>\n import('./modules/credits').then((m) => ({ default: m.CreditWithdrawalPage }))\n);\n\n// Lazy loaded pages - Usage\nconst UsagePage = lazy(() => import('./modules/usage').then((m) => ({ default: m.UsagePage })));\n\n// Lazy loaded pages - Checkout\nconst CheckoutPage = lazy(() =>\n import('./modules/checkout').then((m) => ({ default: m.CheckoutPage }))\n);\n\n// Lazy loaded pages - Store\nconst StoreCheckoutPage = lazy(() =>\n import('./modules/store').then((m) => ({ default: m.StoreCheckoutPage }))\n);\n\n// Lazy loaded pages - Settings\nconst SettingsPage = lazy(() =>\n import('./modules/settings').then((m) => ({ default: m.SettingsPage }))\n);\nconst TeamPermissionsPage = lazy(() =>\n import('./modules/settings').then((m) => ({ default: m.TeamPermissionsPage }))\n);\nconst AffiliateDashboardPage = lazy(() =>\n import('./modules/affiliate').then((m) => ({ default: m.AffiliateDashboardPage }))\n);\nconst EarningsPage = lazy(() =>\n import('./modules/earnings').then((m) => ({ default: m.EarningsPage }))\n);\nconst PayoutsPage = lazy(() =>\n import('./modules/earnings').then((m) => ({ default: m.PayoutsPage }))\n);\n\nfunction PageLoader() {\n return (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"size-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\nfunction DefaultRedirect() {\n const { basePath } = useBilling();\n const { search } = useLocation();\n const routerNavigate = useNavigate();\n const base = basePath && basePath !== '/' ? basePath.replace(/\\/$/, '') : '';\n useEffect(() => {\n routerNavigate(`${base}/overview${search}`, { replace: true });\n }, [base, routerNavigate, search]);\n return null;\n}\n\ntype BillingPermissions = ReturnType<typeof useBillingPermissions>;\ntype BillingPermissionKey = Exclude<\n {\n [K in keyof BillingPermissions]: BillingPermissions[K] extends boolean ? K : never;\n }[keyof BillingPermissions],\n 'isLoading'\n>;\n\ninterface BillingRouteGateProps {\n title: string;\n featureFlag: string;\n permission: BillingPermissionKey;\n eventName: BillingDomainEvent;\n children: ReactNode;\n}\n\nfunction FeatureDisabled({ title, featureFlag }: { title: string; featureFlag: string }) {\n return (\n <div className=\"flex min-h-[400px] items-center justify-center p-6\">\n <div className=\"max-w-md rounded-lg border border-border-subtle bg-bg-surface p-6 text-center shadow-sm\">\n <h2 className=\"text-lg font-semibold text-text-primary\">{title} is not enabled</h2>\n <p className=\"mt-2 text-sm text-text-secondary\">\n Ask an administrator to enable the <span className=\"font-mono\">{featureFlag}</span>{' '}\n feature flag for this organization.\n </p>\n </div>\n </div>\n );\n}\n\nfunction BillingRouteGate({\n title,\n featureFlag,\n permission,\n eventName,\n children,\n}: BillingRouteGateProps) {\n const permissions = useBillingPermissions();\n const { emit } = useBillingEventEmitter();\n const hasPermission = Boolean(permissions[permission]);\n\n useEffect(() => {\n if (hasPermission) {\n emit(eventName, { source: 'BillingUserRoutes' });\n }\n }, [emit, eventName, hasPermission]);\n\n if (permissions.isLoading) {\n return <PageLoader />;\n }\n\n return (\n <FeatureGate\n flag={featureFlag}\n defaultValue\n fallback={<FeatureDisabled title={title} featureFlag={featureFlag} />}\n >\n {hasPermission ? (\n children\n ) : (\n <AccessDenied message={`You don't have permission to access ${title}.`} />\n )}\n </FeatureGate>\n );\n}\n\nfunction guardedPage(props: BillingRouteGateProps): ReactNode {\n return <BillingRouteGate {...props} />;\n}\n\n/**\n * User-facing billing routes.\n * Includes overview, subscriptions, plan/addon browsing (read-only),\n * invoices, payments, credits, quota usage, checkout, and settings.\n */\nexport function BillingUserRoutes() {\n return (\n <Routes>\n <Route index element={<Navigate to=\"overview\" replace />} />\n\n {/* Dashboard */}\n <Route\n path=\"overview\"\n element={guardedPage({\n title: 'Billing overview',\n featureFlag: 'billing.overview',\n permission: 'canViewBillingAccount',\n eventName: 'billing.billing_account.viewed',\n children: <OverviewPage />,\n })}\n />\n\n {/* Subscriptions */}\n <Route\n path=\"subscriptions\"\n element={\n <BillingRouteGate\n title=\"Subscriptions\"\n featureFlag=\"billing.subscriptions\"\n permission=\"canViewSubscriptions\"\n eventName=\"billing.subscription.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <SubscriptionsListPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"subscriptions/:subscriptionId\"\n element={\n <BillingRouteGate\n title=\"Subscription details\"\n featureFlag=\"billing.subscriptions\"\n permission=\"canViewSubscriptions\"\n eventName=\"billing.subscription.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <SubscriptionDetailPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"subscriptions/:subscriptionId/upgrade\"\n element={\n <BillingRouteGate\n title=\"Subscription upgrade\"\n featureFlag=\"billing.subscriptions.upgrade\"\n permission=\"canCreateSubscription\"\n eventName=\"billing.subscription.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <UpgradeSubscriptionPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Plans - user browse pages */}\n <Route\n path=\"plans\"\n element={\n <BillingRouteGate\n title=\"Plans\"\n featureFlag=\"billing.plans\"\n permission=\"canViewPlans\"\n eventName=\"billing.plan.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PlansBrowsePage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"plans/:planId\"\n element={\n <BillingRouteGate\n title=\"Plan details\"\n featureFlag=\"billing.plans\"\n permission=\"canViewPlans\"\n eventName=\"billing.plan.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PlanBrowseDetailPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Addons - user browse pages */}\n <Route\n path=\"addons\"\n element={\n <BillingRouteGate\n title=\"Addons\"\n featureFlag=\"billing.addons\"\n permission=\"canViewAddons\"\n eventName=\"billing.addon.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <AddonsBrowsePage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"addons/:addonId\"\n element={\n <BillingRouteGate\n title=\"Addon details\"\n featureFlag=\"billing.addons\"\n permission=\"canViewAddons\"\n eventName=\"billing.addon.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <AddonBrowseDetailPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Checkout */}\n <Route\n path=\"checkout\"\n element={\n <BillingRouteGate\n title=\"Checkout\"\n featureFlag=\"billing.checkout\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/:planId\"\n element={\n <BillingRouteGate\n title=\"Plan checkout\"\n featureFlag=\"billing.checkout\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/credits\"\n element={\n <BillingRouteGate\n title=\"Credits checkout\"\n featureFlag=\"billing.checkout.credits\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/addon/:addonId\"\n element={\n <BillingRouteGate\n title=\"Addon checkout\"\n featureFlag=\"billing.checkout.addons\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/addons\"\n element={\n <BillingRouteGate\n title=\"Addons checkout\"\n featureFlag=\"billing.checkout.addons\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/store/:storeOrderId\"\n element={\n <BillingRouteGate\n title=\"Store order checkout\"\n featureFlag=\"billing.checkout.store\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Store Checkout - Legacy */}\n <Route\n path=\"store/:orderId\"\n element={\n <BillingRouteGate\n title=\"Store checkout\"\n featureFlag=\"billing.checkout.store\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <StoreCheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Refunds — user-facing request + history */}\n <Route\n path=\"refunds\"\n element={\n <BillingRouteGate\n title=\"Refunds\"\n featureFlag=\"billing.transactions\"\n permission=\"canViewPayments\"\n eventName=\"billing.transaction.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <UserRefundsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Invoices */}\n <Route\n path=\"invoices\"\n element={\n <BillingRouteGate\n title=\"Invoices\"\n featureFlag=\"billing.invoices\"\n permission=\"canViewInvoices\"\n eventName=\"billing.invoice.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <InvoicesListPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"invoices/:invoiceId\"\n element={\n <BillingRouteGate\n title=\"Invoice details\"\n featureFlag=\"billing.invoices\"\n permission=\"canViewInvoices\"\n eventName=\"billing.invoice.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <InvoiceDetailPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Payment Methods */}\n <Route\n path=\"payment-methods\"\n element={\n <BillingRouteGate\n title=\"Payment methods\"\n featureFlag=\"billing.payment_methods\"\n permission=\"canViewPaymentMethods\"\n eventName=\"billing.payment_method.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PaymentMethodsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"payment-methods/add\"\n element={\n <BillingRouteGate\n title=\"Add payment method\"\n featureFlag=\"billing.payment_methods\"\n permission=\"canManagePaymentMethods\"\n eventName=\"billing.payment_method.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PaymentMethodsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Credits */}\n <Route\n path=\"credits\"\n element={\n <BillingRouteGate\n title=\"Credits\"\n featureFlag=\"billing.credits\"\n permission=\"canViewCredits\"\n eventName=\"billing.credit.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CreditsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"credits/withdraw\"\n element={\n <BillingRouteGate\n title=\"Credit withdrawal\"\n featureFlag=\"billing.credits\"\n permission=\"canWithdrawCredits\"\n eventName=\"billing.credit.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CreditWithdrawalPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"creditTransactions/:billingAccountId\"\n element={\n <BillingRouteGate\n title=\"Credit transactions\"\n featureFlag=\"billing.credits\"\n permission=\"canViewCredits\"\n eventName=\"billing.credit.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CreditTransactionsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Usage */}\n <Route\n path=\"usage\"\n element={\n <BillingRouteGate\n title=\"Usage\"\n featureFlag=\"billing.usage\"\n permission=\"canViewUsage\"\n eventName=\"billing.usage.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <UsagePage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n <Route\n path=\"affiliate\"\n element={\n <BillingRouteGate\n title=\"Affiliate dashboard\"\n featureFlag=\"billing.affiliate\"\n permission=\"canManagePaymentMethods\"\n eventName=\"billing.affiliate.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <AffiliateDashboardPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n <Route\n path=\"earnings\"\n element={\n <BillingRouteGate\n title=\"Earnings\"\n featureFlag=\"billing.earnings\"\n permission=\"canViewBillingAccount\"\n eventName=\"billing.earning.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <EarningsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n <Route\n path=\"payouts\"\n element={\n <BillingRouteGate\n title=\"Payouts\"\n featureFlag=\"billing.payouts\"\n permission=\"canViewBillingAccount\"\n eventName=\"billing.payout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PayoutsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Transaction History */}\n <Route\n path=\"transactions/:billingAccountId\"\n element={\n <BillingRouteGate\n title=\"Transactions\"\n featureFlag=\"billing.transactions\"\n permission=\"canViewPayments\"\n eventName=\"billing.transaction.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <TransactionsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Settings */}\n <Route\n path=\"settings\"\n element={\n <BillingRouteGate\n title=\"Billing settings\"\n featureFlag=\"billing.settings\"\n permission=\"canManageBillingAccount\"\n eventName=\"billing.billing_account.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <SettingsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Team & Permissions — billing-scope role assignments.\n * Gated on `isBillingAdmin` (billing:manage), not the broader\n * `canManageBillingAccount` (billing:update), because role\n * assignment is a privilege-escalation surface and the server-side\n * RBAC contract reserves it for Billing Admins only. */}\n <Route\n path=\"team-permissions\"\n element={\n <BillingRouteGate\n title=\"Team & Permissions\"\n featureFlag=\"billing.team_permissions\"\n permission=\"isBillingAdmin\"\n eventName=\"billing.billing_account.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <TeamPermissionsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Catch-all */}\n <Route path=\"*\" element={<DefaultRedirect />} />\n </Routes>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAM,IAAwB,QAC5B,OAAO,oCAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,CACtF,GACM,IAAyB,QAC7B,OAAO,oCAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,CACvF,GACM,IAA0B,QAC9B,OAAO,oCAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,CACxF,GAGM,IAAkB,QACtB,OAAO,4BAAmB,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CACxE,GACM,IAAuB,QAC3B,OAAO,4BAAmB,MAAM,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAC7E,GAGM,IAAmB,QACvB,OAAO,6BAAoB,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAC1E,GACM,IAAwB,QAC5B,OAAO,6BAAoB,MAAM,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAC/E,GAGM,IAAmB,QACvB,OAAO,8BAAqB,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAC3E,GACM,IAAoB,QACxB,OAAO,8BAAqB,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC5E,GACM,IAAmB,QACvB,OAAO,8BAAqB,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAC3E,GACM,IAAkB,QACtB,OAAO,8BAAqB,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAC1E,GACM,IAAqB,QACzB,OAAO,8BAAqB,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAC7E,GAGM,IAAc,Q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A;IACP,CAAA;GACM,CAAA;EAErB,CAAA;EAOD,kBAAC,GAAD;GACE,MAAK;GACL,SACE,kBAAC,GAAD;IACE,OAAM;IACN,aAAY;IACZ,YAAW;IACX,WAAU;cAEV,kBAAC,GAAD;KAAU,UAAU,kBAAC,GAAD,CAAa,CAAA;eAC/B,kBAAC,GAAD,CAAsB,CAAA;IACd,CAAA;GACM,CAAA;EAErB,CAAA;EAGD,kBAAC,GAAD;GAAO,MAAK;GAAI,SAAS,kBAAC,GAAD,CAAkB,CAAA;EAAI,CAAA;CACzC,EAAA,CAAA;AAEZ"}
|
|
1
|
+
{"version":3,"file":"BillingUserRoutes.js","names":["SubscriptionsListPage","lazy","m","SubscriptionDetailPage","UpgradeSubscriptionPage","PlansBrowsePage","PlanBrowseDetailPage","AddonsBrowsePage","AddonBrowseDetailPage","InvoicesListPage","InvoiceDetailPage","TransactionsPage","UserRefundsPage","PaymentMethodsPage","CreditsPage","CreditTransactionsPage","CreditWithdrawalPage","UsagePage","CheckoutPage","StoreCheckoutPage","SettingsPage","TeamPermissionsPage","AffiliateDashboardPage","EarningsPage","PayoutsPage","PageLoader","DefaultRedirect","useBilling","useLocation","routerNavigate","useNavigate","base","basePath","useEffect","search","FeatureDisabled","title","featureFlag","BillingRouteGate","permissions","useBillingPermissions","useBillingEventEmitter","hasPermission","permission","emit","eventName","FeatureGate","children","AccessDenied","guardedPage","props","BillingUserRoutes","Routes","Route","Navigate","OverviewPage","Suspense"],"sources":["../../src/billing/BillingUserRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, useEffect, type ReactNode } from 'react';\nimport { Navigate, Route, Routes, useLocation, useNavigate } from 'react-router';\nimport { FeatureGate } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { AccessDenied } from './shared/components';\nimport { useBillingEventEmitter, type BillingDomainEvent } from './hooks/useBillingEventEmitter';\nimport { useBillingPermissions } from './hooks/useBillingPermissions';\nimport { useBilling } from './providers/BillingProvider';\n\n// Eager load - main entry point\nimport { OverviewPage } from './modules/dashboard';\n\n// Lazy loaded pages - Subscriptions\nconst SubscriptionsListPage = lazy(() =>\n import('./modules/subscriptions').then((m) => ({ default: m.SubscriptionsListPage }))\n);\nconst SubscriptionDetailPage = lazy(() =>\n import('./modules/subscriptions').then((m) => ({ default: m.SubscriptionDetailPage }))\n);\nconst UpgradeSubscriptionPage = lazy(() =>\n import('./modules/subscriptions').then((m) => ({ default: m.UpgradeSubscriptionPage }))\n);\n\n// Lazy loaded pages - Plans (user browse pages, no create/edit/toggle)\nconst PlansBrowsePage = lazy(() =>\n import('./modules/plans').then((m) => ({ default: m.PlansBrowsePage }))\n);\nconst PlanBrowseDetailPage = lazy(() =>\n import('./modules/plans').then((m) => ({ default: m.PlanBrowseDetailPage }))\n);\n\n// Lazy loaded pages - Addons (user browse pages, no create/edit/toggle)\nconst AddonsBrowsePage = lazy(() =>\n import('./modules/addons').then((m) => ({ default: m.AddonsBrowsePage }))\n);\nconst AddonBrowseDetailPage = lazy(() =>\n import('./modules/addons').then((m) => ({ default: m.AddonBrowseDetailPage }))\n);\n\n// Lazy loaded pages - Billing (Invoices, Transactions, Payments, Refunds)\nconst InvoicesListPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.InvoicesListPage }))\n);\nconst InvoiceDetailPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.InvoiceDetailPage }))\n);\nconst TransactionsPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.TransactionsPage }))\n);\nconst UserRefundsPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.UserRefundsPage }))\n);\nconst PaymentMethodsPage = lazy(() =>\n import('./modules/billing').then((m) => ({ default: m.PaymentMethodsPage }))\n);\n\n// Lazy loaded pages - Credits\nconst CreditsPage = lazy(() =>\n import('./modules/credits').then((m) => ({ default: m.CreditsPage }))\n);\nconst CreditTransactionsPage = lazy(() =>\n import('./modules/credits').then((m) => ({ default: m.CreditTransactionsPage }))\n);\nconst CreditWithdrawalPage = lazy(() =>\n import('./modules/credits').then((m) => ({ default: m.CreditWithdrawalPage }))\n);\n\n// Lazy loaded pages - Usage\nconst UsagePage = lazy(() => import('./modules/usage').then((m) => ({ default: m.UsagePage })));\n\n// Lazy loaded pages - Checkout\nconst CheckoutPage = lazy(() =>\n import('./modules/checkout').then((m) => ({ default: m.CheckoutPage }))\n);\n\n// Lazy loaded pages - Store\nconst StoreCheckoutPage = lazy(() =>\n import('./modules/store').then((m) => ({ default: m.StoreCheckoutPage }))\n);\n\n// Lazy loaded pages - Settings\nconst SettingsPage = lazy(() =>\n import('./modules/settings').then((m) => ({ default: m.SettingsPage }))\n);\nconst TeamPermissionsPage = lazy(() =>\n import('./modules/settings').then((m) => ({ default: m.TeamPermissionsPage }))\n);\nconst AffiliateDashboardPage = lazy(() =>\n import('./modules/affiliate').then((m) => ({ default: m.AffiliateDashboardPage }))\n);\nconst EarningsPage = lazy(() =>\n import('./modules/earnings').then((m) => ({ default: m.EarningsPage }))\n);\nconst PayoutsPage = lazy(() =>\n import('./modules/earnings').then((m) => ({ default: m.PayoutsPage }))\n);\n\nfunction PageLoader() {\n return (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <div className=\"size-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\nfunction DefaultRedirect() {\n const { basePath } = useBilling();\n const { search } = useLocation();\n const routerNavigate = useNavigate();\n const base = basePath && basePath !== '/' ? basePath.replace(/\\/$/, '') : '';\n useEffect(() => {\n routerNavigate(`${base}/overview${search}`, { replace: true });\n }, [base, routerNavigate, search]);\n return null;\n}\n\ntype BillingPermissions = ReturnType<typeof useBillingPermissions>;\ntype BillingPermissionKey = Exclude<\n {\n [K in keyof BillingPermissions]: BillingPermissions[K] extends boolean ? K : never;\n }[keyof BillingPermissions],\n 'isLoading'\n>;\n\ninterface BillingRouteGateProps {\n title: string;\n featureFlag: string;\n permission: BillingPermissionKey;\n eventName: BillingDomainEvent;\n children: ReactNode;\n}\n\nfunction FeatureDisabled({ title, featureFlag }: { title: string; featureFlag: string }) {\n return (\n <div className=\"flex min-h-[400px] items-center justify-center p-6\">\n <div className=\"max-w-md rounded-lg border border-border-subtle bg-bg-surface p-6 text-center shadow-sm\">\n <h2 className=\"text-lg font-semibold text-text-primary\">{title} is not enabled</h2>\n <p className=\"mt-2 text-sm text-text-secondary\">\n Ask an administrator to enable the <span className=\"font-mono\">{featureFlag}</span>{' '}\n feature flag for this organization.\n </p>\n </div>\n </div>\n );\n}\n\nfunction BillingRouteGate({\n title,\n featureFlag,\n permission,\n eventName,\n children,\n}: BillingRouteGateProps) {\n const permissions = useBillingPermissions();\n const { emit } = useBillingEventEmitter();\n const hasPermission = Boolean(permissions[permission]);\n\n useEffect(() => {\n if (hasPermission) {\n emit(eventName, { source: 'BillingUserRoutes' });\n }\n }, [emit, eventName, hasPermission]);\n\n if (permissions.isLoading) {\n return <PageLoader />;\n }\n\n return (\n <FeatureGate\n flag={featureFlag}\n defaultValue\n fallback={<FeatureDisabled title={title} featureFlag={featureFlag} />}\n >\n {hasPermission ? (\n children\n ) : (\n <AccessDenied message={`You don't have permission to access ${title}.`} />\n )}\n </FeatureGate>\n );\n}\n\nfunction guardedPage(props: BillingRouteGateProps): ReactNode {\n return <BillingRouteGate {...props} />;\n}\n\n/**\n * User-facing billing routes.\n * Includes overview, subscriptions, plan/addon browsing (read-only),\n * invoices, payments, credits, quota usage, checkout, and settings.\n */\nexport function BillingUserRoutes() {\n return (\n <Routes>\n <Route index element={<Navigate to=\"overview\" replace />} />\n\n {/* Dashboard */}\n <Route\n path=\"overview\"\n element={guardedPage({\n title: 'Billing overview',\n featureFlag: 'billing.overview',\n permission: 'canViewBillingAccount',\n eventName: 'billing.billing_account.viewed',\n children: <OverviewPage />,\n })}\n />\n\n {/* Subscriptions */}\n <Route\n path=\"subscriptions\"\n element={\n <BillingRouteGate\n title=\"Subscriptions\"\n featureFlag=\"billing.subscriptions\"\n permission=\"canViewSubscriptions\"\n eventName=\"billing.subscription.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <SubscriptionsListPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"subscriptions/:subscriptionId\"\n element={\n <BillingRouteGate\n title=\"Subscription details\"\n featureFlag=\"billing.subscriptions\"\n permission=\"canViewSubscriptions\"\n eventName=\"billing.subscription.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <SubscriptionDetailPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"subscriptions/:subscriptionId/upgrade\"\n element={\n <BillingRouteGate\n title=\"Subscription upgrade\"\n featureFlag=\"billing.subscriptions.upgrade\"\n permission=\"canCreateSubscription\"\n eventName=\"billing.subscription.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <UpgradeSubscriptionPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Plans - user browse pages */}\n <Route\n path=\"plans\"\n element={\n <BillingRouteGate\n title=\"Plans\"\n featureFlag=\"billing.plans\"\n permission=\"canViewPlans\"\n eventName=\"billing.plan.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PlansBrowsePage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"plans/:planId\"\n element={\n <BillingRouteGate\n title=\"Plan details\"\n featureFlag=\"billing.plans\"\n permission=\"canViewPlans\"\n eventName=\"billing.plan.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PlanBrowseDetailPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Addons - user browse pages */}\n <Route\n path=\"addons\"\n element={\n <BillingRouteGate\n title=\"Addons\"\n featureFlag=\"billing.addons\"\n permission=\"canViewAddons\"\n eventName=\"billing.addon.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <AddonsBrowsePage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"addons/:addonId\"\n element={\n <BillingRouteGate\n title=\"Addon details\"\n featureFlag=\"billing.addons\"\n permission=\"canViewAddons\"\n eventName=\"billing.addon.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <AddonBrowseDetailPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Checkout */}\n <Route\n path=\"checkout\"\n element={\n <BillingRouteGate\n title=\"Checkout\"\n featureFlag=\"billing.checkout\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/:planId\"\n element={\n <BillingRouteGate\n title=\"Plan checkout\"\n featureFlag=\"billing.checkout\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/credits\"\n element={\n <BillingRouteGate\n title=\"Credits checkout\"\n featureFlag=\"billing.checkout.credits\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/addon/:addonId\"\n element={\n <BillingRouteGate\n title=\"Addon checkout\"\n featureFlag=\"billing.checkout.addons\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/addons\"\n element={\n <BillingRouteGate\n title=\"Addons checkout\"\n featureFlag=\"billing.checkout.addons\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"checkout/store/:storeOrderId\"\n element={\n <BillingRouteGate\n title=\"Store order checkout\"\n featureFlag=\"billing.checkout.store\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Store Checkout - Legacy */}\n <Route\n path=\"store/:orderId\"\n element={\n <BillingRouteGate\n title=\"Store checkout\"\n featureFlag=\"billing.checkout.store\"\n permission=\"canProcessPayment\"\n eventName=\"billing.checkout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <StoreCheckoutPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Refunds — user-facing request + history */}\n <Route\n path=\"refunds\"\n element={\n <BillingRouteGate\n title=\"Refunds\"\n featureFlag=\"billing.transactions\"\n permission=\"canViewPayments\"\n eventName=\"billing.transaction.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <UserRefundsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Invoices */}\n <Route\n path=\"invoices\"\n element={\n <BillingRouteGate\n title=\"Invoices\"\n featureFlag=\"billing.invoices\"\n permission=\"canViewInvoices\"\n eventName=\"billing.invoice.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <InvoicesListPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"invoices/:invoiceId\"\n element={\n <BillingRouteGate\n title=\"Invoice details\"\n featureFlag=\"billing.invoices\"\n permission=\"canViewInvoices\"\n eventName=\"billing.invoice.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <InvoiceDetailPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Payment Methods */}\n <Route\n path=\"payment-methods\"\n element={\n <BillingRouteGate\n title=\"Payment methods\"\n featureFlag=\"billing.payment_methods\"\n permission=\"canViewPaymentMethods\"\n eventName=\"billing.payment_method.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PaymentMethodsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"payment-methods/add\"\n element={\n <BillingRouteGate\n title=\"Add payment method\"\n featureFlag=\"billing.payment_methods\"\n permission=\"canManagePaymentMethods\"\n eventName=\"billing.payment_method.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PaymentMethodsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Credits */}\n <Route\n path=\"credits\"\n element={\n <BillingRouteGate\n title=\"Credits\"\n featureFlag=\"billing.credits\"\n permission=\"canViewCredits\"\n eventName=\"billing.credit.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CreditsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"credits/withdraw\"\n element={\n <BillingRouteGate\n title=\"Credit withdrawal\"\n featureFlag=\"billing.credits\"\n permission=\"canWithdrawCredits\"\n eventName=\"billing.credit.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CreditWithdrawalPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n <Route\n path=\"creditTransactions/:billingAccountId\"\n element={\n <BillingRouteGate\n title=\"Credit transactions\"\n featureFlag=\"billing.credits\"\n permission=\"canViewCredits\"\n eventName=\"billing.credit.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <CreditTransactionsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Usage */}\n <Route\n path=\"usage\"\n element={\n <BillingRouteGate\n title=\"Usage\"\n featureFlag=\"billing.usage\"\n permission=\"canViewUsage\"\n eventName=\"billing.usage.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <UsagePage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n <Route\n path=\"affiliate\"\n element={\n <BillingRouteGate\n title=\"Affiliate dashboard\"\n featureFlag=\"billing.affiliate\"\n permission=\"canManagePaymentMethods\"\n eventName=\"billing.affiliate.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <AffiliateDashboardPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n <Route\n path=\"earnings\"\n element={\n <BillingRouteGate\n title=\"Earnings\"\n featureFlag=\"billing.earnings\"\n permission=\"canViewBillingAccount\"\n eventName=\"billing.earning.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <EarningsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n <Route\n path=\"payouts\"\n element={\n <BillingRouteGate\n title=\"Payouts\"\n featureFlag=\"billing.payouts\"\n permission=\"canViewBillingAccount\"\n eventName=\"billing.payout.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <PayoutsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Transaction History */}\n <Route\n path=\"transactions/:billingAccountId\"\n element={\n <BillingRouteGate\n title=\"Transactions\"\n featureFlag=\"billing.transactions\"\n permission=\"canViewPayments\"\n eventName=\"billing.transaction.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <TransactionsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Settings */}\n <Route\n path=\"settings\"\n element={\n <BillingRouteGate\n title=\"Billing settings\"\n featureFlag=\"billing.settings\"\n permission=\"canManageBillingAccount\"\n eventName=\"billing.billing_account.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <SettingsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Team & Permissions — billing-scope role assignments.\n * Gated on `isBillingAdmin` (billing:manage), not the broader\n * `canManageBillingAccount` (billing:update), because role\n * assignment is a privilege-escalation surface and the server-side\n * RBAC contract reserves it for Billing Admins only. */}\n <Route\n path=\"team-permissions\"\n element={\n <BillingRouteGate\n title=\"Team & Permissions\"\n featureFlag=\"billing.team_permissions\"\n permission=\"isBillingAdmin\"\n eventName=\"billing.billing_account.viewed\"\n >\n <Suspense fallback={<PageLoader />}>\n <TeamPermissionsPage />\n </Suspense>\n </BillingRouteGate>\n }\n />\n\n {/* Catch-all */}\n <Route path=\"*\" element={<DefaultRedirect />} />\n </Routes>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAMA,IAAwBC,QAC5B,OAAO,mCAA0B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,sBAAsB,EAAE,CACtF,GACMC,IA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,UAAA,kBAACD,GAAD,CAAc,CAAA;IACN,CAAA;GACM,CAAA;EAErB,CAAA;EAGD,kBAAC6B,GAAD;GACE,MAAK;GACL,SACE,kBAACf,GAAD;IACE,OAAM;IACN,aAAY;IACZ,YAAW;IACX,WAAU;IAEV,UAAA,kBAACkB,GAAD;KAAU,UAAU,kBAAC/B,GAAD,CAAa,CAAA;KAC/B,UAAA,kBAACd,GAAD,CAAmB,CAAA;IACX,CAAA;GACM,CAAA;EAErB,CAAA;EAGD,kBAAC0C,GAAD;GACE,MAAK;GACL,SACE,kBAACf,GAAD;IACE,OAAM;IACN,aAAY;IACZ,YAAW;IACX,WAAU;IAEV,UAAA,kBAACkB,GAAD;KAAU,UAAU,kBAAC/B,GAAD,CAAa,CAAA;KAC/B,UAAA,kBAACL,GAAD,CAAe,CAAA;IACP,CAAA;GACM,CAAA;EAErB,CAAA;EAOD,kBAACiC,GAAD;GACE,MAAK;GACL,SACE,kBAACf,GAAD;IACE,OAAM;IACN,aAAY;IACZ,YAAW;IACX,WAAU;IAEV,UAAA,kBAACkB,GAAD;KAAU,UAAU,kBAAC/B,GAAD,CAAa,CAAA;KAC/B,UAAA,kBAACJ,GAAD,CAAsB,CAAA;IACd,CAAA;GACM,CAAA;EAErB,CAAA;EAGD,kBAACgC,GAAD;GAAO,MAAK;GAAI,SAAS,kBAAC3B,GAAD,CAAkB,CAAA;EAAI,CAAA;CACzC,EAAA,CAAA;AAEZ"}
|
|
@@ -33,4 +33,3 @@ interface UseBillingAccountSelectionResult {
|
|
|
33
33
|
}
|
|
34
34
|
export declare function useBillingAccountSelection({ orgId, billingAccounts, syncFromUrl, urlParamName, }: UseBillingAccountSelectionOptions): UseBillingAccountSelectionResult;
|
|
35
35
|
export {};
|
|
36
|
-
//# sourceMappingURL=useBillingAccountSelection.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useState as n } from "react";
|
|
2
2
|
import { useLocation as r } from "react-router";
|
|
3
3
|
import { getProfileScopedKey as i } from "@burdenoff/fe-libs/shared/utils";
|
|
4
|
-
|
|
4
|
+
// src/billing/hooks/useBillingAccountSelection.ts
|
|
5
5
|
var a = "billing_selected_account_";
|
|
6
6
|
function o(e) {
|
|
7
|
-
if (
|
|
7
|
+
if (typeof window < "u") try {
|
|
8
8
|
let t = `${a}${e}`;
|
|
9
9
|
localStorage.getItem(t) && localStorage.removeItem(t);
|
|
10
10
|
} catch {}
|
|
@@ -18,7 +18,7 @@ var s = (e) => {
|
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
}, c = (e, t) => {
|
|
21
|
-
if (
|
|
21
|
+
if (typeof window < "u") try {
|
|
22
22
|
let n = i(`billing-account-${e}`);
|
|
23
23
|
t ? localStorage.setItem(n, t) : localStorage.removeItem(n);
|
|
24
24
|
} catch {}
|
|
@@ -64,7 +64,10 @@ function l({ orgId: i, billingAccounts: a, syncFromUrl: l = !1, urlParamName: u
|
|
|
64
64
|
a,
|
|
65
65
|
h
|
|
66
66
|
]), t(() => {
|
|
67
|
-
!f && a && a.length > 0
|
|
67
|
+
if (!f && a && a.length > 0) {
|
|
68
|
+
let e = a.find((e) => e.isDefault) || a[0];
|
|
69
|
+
m(e.id);
|
|
70
|
+
}
|
|
68
71
|
}, [
|
|
69
72
|
f,
|
|
70
73
|
a,
|
|
@@ -75,7 +78,6 @@ function l({ orgId: i, billingAccounts: a, syncFromUrl: l = !1, urlParamName: u
|
|
|
75
78
|
clearSelection: h
|
|
76
79
|
};
|
|
77
80
|
}
|
|
78
|
-
//#endregion
|
|
79
81
|
export { s as getStoredBillingAccountId, c as setStoredBillingAccountId, l as useBillingAccountSelection };
|
|
80
82
|
|
|
81
83
|
//# sourceMappingURL=useBillingAccountSelection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBillingAccountSelection.js","names":[],"sources":["../../../src/billing/hooks/useBillingAccountSelection.ts"],"sourcesContent":["/**\n * Hook for managing billing account selection per org\n * Persists the selected account to localStorage and syncs across pages.\n * Keys are scoped by profile and org to support multi-user/multi-org usage.\n */\n\nimport { useState, useCallback, useEffect } from 'react';\nimport { useLocation } from 'react-router';\nimport { getProfileScopedKey } from '@burdenoff/fe-libs/shared/utils';\n\nconst LEGACY_KEY_PREFIX = 'billing_selected_account_';\n\n/**\n * Clean up legacy non-profile-scoped keys\n */\nfunction cleanupLegacyKeys(tenantId: string): void {\n if (typeof window === 'undefined') return;\n try {\n const key = `${LEGACY_KEY_PREFIX}${tenantId}`;\n if (localStorage.getItem(key)) {\n localStorage.removeItem(key);\n }\n } catch {\n // Ignore errors\n }\n}\n\n/**\n * Get stored account ID (handles finding active profile)\n */\nexport const getStoredBillingAccountId = (orgId: string): string | null => {\n if (typeof window === 'undefined') return null;\n try {\n const key = getProfileScopedKey(`billing-account-${orgId}`);\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n};\n\n/**\n * Set stored account ID\n */\nexport const setStoredBillingAccountId = (orgId: string, accountId: string | null) => {\n if (typeof window === 'undefined') return;\n try {\n const key = getProfileScopedKey(`billing-account-${orgId}`);\n if (accountId) {\n localStorage.setItem(key, accountId);\n } else {\n localStorage.removeItem(key);\n }\n } catch {\n // Ignore localStorage errors\n }\n};\n\ninterface UseBillingAccountSelectionOptions {\n orgId: string;\n /** Available billing accounts to validate against */\n billingAccounts?: Array<{ id: string; isDefault?: boolean }>;\n /** Whether to sync from URL query param on navigation */\n syncFromUrl?: boolean;\n /** URL query param name (default: 'billingAccountId') */\n urlParamName?: string;\n}\n\ninterface UseBillingAccountSelectionResult {\n /** Currently selected billing account ID */\n selectedAccountId: string | null;\n /** Set the selected billing account (persists to localStorage) */\n setSelectedAccountId: (accountId: string | null) => void;\n /** Clear the stored selection */\n clearSelection: () => void;\n}\n\nexport function useBillingAccountSelection({\n orgId,\n billingAccounts,\n syncFromUrl = false,\n urlParamName = 'billingAccountId',\n}: UseBillingAccountSelectionOptions): UseBillingAccountSelectionResult {\n const location = useLocation();\n\n // Cleanup legacy keys on mount (still cleans old tenantId-based keys)\n useEffect(() => {\n cleanupLegacyKeys(orgId);\n }, [orgId]);\n\n // Initialize from URL (if syncFromUrl) or localStorage\n const [selectedAccountId, setSelectedAccountIdState] = useState<string | null>(() => {\n if (typeof window === 'undefined') return null;\n\n if (syncFromUrl) {\n const urlParams = new URLSearchParams(window.location.search);\n const urlAccountId = urlParams.get(urlParamName);\n if (urlAccountId) return urlAccountId;\n }\n\n return getStoredBillingAccountId(orgId);\n });\n\n // Set selected account and persist to localStorage\n const setSelectedAccountId = useCallback(\n (accountId: string | null) => {\n setSelectedAccountIdState(accountId);\n setStoredBillingAccountId(orgId, accountId);\n },\n [orgId]\n );\n\n // Clear stored selection\n const clearSelection = useCallback(() => {\n setSelectedAccountIdState(null);\n setStoredBillingAccountId(orgId, null);\n }, [orgId]);\n\n // Sync from URL/localStorage on navigation changes\n useEffect(() => {\n if (syncFromUrl) {\n const urlParams = new URLSearchParams(location.search);\n const urlAccountId = urlParams.get(urlParamName);\n if (urlAccountId) {\n setSelectedAccountIdState(urlAccountId);\n setStoredBillingAccountId(orgId, urlAccountId);\n return;\n }\n }\n\n const storedId = getStoredBillingAccountId(orgId);\n if (storedId !== selectedAccountId) {\n setSelectedAccountIdState(storedId);\n }\n }, [location.pathname, location.search, orgId, syncFromUrl, urlParamName, selectedAccountId]);\n\n // Validate stored account exists - if not, clear it\n useEffect(() => {\n if (selectedAccountId && billingAccounts && billingAccounts.length > 0) {\n const accountExists = billingAccounts.some((a) => a.id === selectedAccountId);\n if (!accountExists) {\n clearSelection();\n }\n }\n }, [selectedAccountId, billingAccounts, clearSelection]);\n\n // Auto-select default account if none selected\n useEffect(() => {\n if (!selectedAccountId && billingAccounts && billingAccounts.length > 0) {\n const defaultAccount = billingAccounts.find((a) => a.isDefault);\n const accountToSelect = defaultAccount || billingAccounts[0];\n setSelectedAccountId(accountToSelect.id);\n }\n }, [selectedAccountId, billingAccounts, setSelectedAccountId]);\n\n return {\n selectedAccountId,\n setSelectedAccountId,\n clearSelection,\n };\n}\n"],"mappings":";;;;AAUA,
|
|
1
|
+
{"version":3,"file":"useBillingAccountSelection.js","names":["LEGACY_KEY_PREFIX","cleanupLegacyKeys","key","tenantId","getStoredBillingAccountId","getProfileScopedKey","orgId","setStoredBillingAccountId","accountId","useBillingAccountSelection","location","useLocation","selectedAccountId","setSelectedAccountIdState","useState","syncFromUrl","urlAccountId","urlParamName","setSelectedAccountId","useCallback","clearSelection","useEffect","storedId","billingAccounts","a","accountToSelect"],"sources":["../../../src/billing/hooks/useBillingAccountSelection.ts"],"sourcesContent":["/**\n * Hook for managing billing account selection per org\n * Persists the selected account to localStorage and syncs across pages.\n * Keys are scoped by profile and org to support multi-user/multi-org usage.\n */\n\nimport { useState, useCallback, useEffect } from 'react';\nimport { useLocation } from 'react-router';\nimport { getProfileScopedKey } from '@burdenoff/fe-libs/shared/utils';\n\nconst LEGACY_KEY_PREFIX = 'billing_selected_account_';\n\n/**\n * Clean up legacy non-profile-scoped keys\n */\nfunction cleanupLegacyKeys(tenantId: string): void {\n if (typeof window === 'undefined') return;\n try {\n const key = `${LEGACY_KEY_PREFIX}${tenantId}`;\n if (localStorage.getItem(key)) {\n localStorage.removeItem(key);\n }\n } catch {\n // Ignore errors\n }\n}\n\n/**\n * Get stored account ID (handles finding active profile)\n */\nexport const getStoredBillingAccountId = (orgId: string): string | null => {\n if (typeof window === 'undefined') return null;\n try {\n const key = getProfileScopedKey(`billing-account-${orgId}`);\n return localStorage.getItem(key);\n } catch {\n return null;\n }\n};\n\n/**\n * Set stored account ID\n */\nexport const setStoredBillingAccountId = (orgId: string, accountId: string | null) => {\n if (typeof window === 'undefined') return;\n try {\n const key = getProfileScopedKey(`billing-account-${orgId}`);\n if (accountId) {\n localStorage.setItem(key, accountId);\n } else {\n localStorage.removeItem(key);\n }\n } catch {\n // Ignore localStorage errors\n }\n};\n\ninterface UseBillingAccountSelectionOptions {\n orgId: string;\n /** Available billing accounts to validate against */\n billingAccounts?: Array<{ id: string; isDefault?: boolean }>;\n /** Whether to sync from URL query param on navigation */\n syncFromUrl?: boolean;\n /** URL query param name (default: 'billingAccountId') */\n urlParamName?: string;\n}\n\ninterface UseBillingAccountSelectionResult {\n /** Currently selected billing account ID */\n selectedAccountId: string | null;\n /** Set the selected billing account (persists to localStorage) */\n setSelectedAccountId: (accountId: string | null) => void;\n /** Clear the stored selection */\n clearSelection: () => void;\n}\n\nexport function useBillingAccountSelection({\n orgId,\n billingAccounts,\n syncFromUrl = false,\n urlParamName = 'billingAccountId',\n}: UseBillingAccountSelectionOptions): UseBillingAccountSelectionResult {\n const location = useLocation();\n\n // Cleanup legacy keys on mount (still cleans old tenantId-based keys)\n useEffect(() => {\n cleanupLegacyKeys(orgId);\n }, [orgId]);\n\n // Initialize from URL (if syncFromUrl) or localStorage\n const [selectedAccountId, setSelectedAccountIdState] = useState<string | null>(() => {\n if (typeof window === 'undefined') return null;\n\n if (syncFromUrl) {\n const urlParams = new URLSearchParams(window.location.search);\n const urlAccountId = urlParams.get(urlParamName);\n if (urlAccountId) return urlAccountId;\n }\n\n return getStoredBillingAccountId(orgId);\n });\n\n // Set selected account and persist to localStorage\n const setSelectedAccountId = useCallback(\n (accountId: string | null) => {\n setSelectedAccountIdState(accountId);\n setStoredBillingAccountId(orgId, accountId);\n },\n [orgId]\n );\n\n // Clear stored selection\n const clearSelection = useCallback(() => {\n setSelectedAccountIdState(null);\n setStoredBillingAccountId(orgId, null);\n }, [orgId]);\n\n // Sync from URL/localStorage on navigation changes\n useEffect(() => {\n if (syncFromUrl) {\n const urlParams = new URLSearchParams(location.search);\n const urlAccountId = urlParams.get(urlParamName);\n if (urlAccountId) {\n setSelectedAccountIdState(urlAccountId);\n setStoredBillingAccountId(orgId, urlAccountId);\n return;\n }\n }\n\n const storedId = getStoredBillingAccountId(orgId);\n if (storedId !== selectedAccountId) {\n setSelectedAccountIdState(storedId);\n }\n }, [location.pathname, location.search, orgId, syncFromUrl, urlParamName, selectedAccountId]);\n\n // Validate stored account exists - if not, clear it\n useEffect(() => {\n if (selectedAccountId && billingAccounts && billingAccounts.length > 0) {\n const accountExists = billingAccounts.some((a) => a.id === selectedAccountId);\n if (!accountExists) {\n clearSelection();\n }\n }\n }, [selectedAccountId, billingAccounts, clearSelection]);\n\n // Auto-select default account if none selected\n useEffect(() => {\n if (!selectedAccountId && billingAccounts && billingAccounts.length > 0) {\n const defaultAccount = billingAccounts.find((a) => a.isDefault);\n const accountToSelect = defaultAccount || billingAccounts[0];\n setSelectedAccountId(accountToSelect.id);\n }\n }, [selectedAccountId, billingAccounts, setSelectedAccountId]);\n\n return {\n selectedAccountId,\n setSelectedAccountId,\n clearSelection,\n };\n}\n"],"mappings":";;;;AAUA,IAAMA,IAAoB;AAK1B,SAASC,EAAkB,GAAwB;CACjD,IAAI,OAAO,SAAW,KACtB,IAAI;EACF,IAAMC,IAAM,GAAGF,IAAoBG;EACnC,AAAI,aAAa,QAAQD,CAAG,KAC1B,aAAa,WAAWA,CAAG;CAE/B,QAAQ,CAER;AACF;AAKA,IAAaE,KAA6B,MAAiC;CACzE,IAAI,OAAO,SAAW,KAAa,OAAO;CAC1C,IAAI;EACF,IAAMF,IAAMG,EAAoB,mBAAmBC,GAAO;EAC1D,OAAO,aAAa,QAAQJ,CAAG;CACjC,QAAQ;EACN,OAAO;CACT;AACF,GAKaK,KAA6B,GAAe,MAA6B;CACpF,IAAI,OAAO,SAAW,KACtB,IAAI;EACF,IAAML,IAAMG,EAAoB,mBAAmBC,GAAO;EAC1D,AAAIE,IACF,aAAa,QAAQN,GAAKM,CAAS,IAEnC,aAAa,WAAWN,CAAG;CAE/B,QAAQ,CAER;AACF;AAqBA,SAAgBO,EAA2B,EACzC,UACA,oBACA,iBAAc,IACd,kBAAe,sBACuD;CACtE,IAAMC,IAAWC,EAAY;CAG7B,QAAgB;EACd,EAAkBL,CAAK;CACzB,GAAG,CAACA,CAAK,CAAC;CAGV,IAAM,CAACM,GAAmBC,KAA6BC,QAA8B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,6 +1,6 @@
|
|
|
1
1
|
import { useCallback as e } from "react";
|
|
2
2
|
import { useEventBus as t } from "@burdenoff/fe-libs/shared/events";
|
|
3
|
-
|
|
3
|
+
// src/billing/hooks/useBillingEventEmitter.ts
|
|
4
4
|
function n() {
|
|
5
5
|
let n = t();
|
|
6
6
|
return { emit: e((e, t = {}) => {
|
|
@@ -9,7 +9,6 @@ function n() {
|
|
|
9
9
|
} catch {}
|
|
10
10
|
}, [n]) };
|
|
11
11
|
}
|
|
12
|
-
//#endregion
|
|
13
12
|
export { n as useBillingEventEmitter };
|
|
14
13
|
|
|
15
14
|
//# sourceMappingURL=useBillingEventEmitter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBillingEventEmitter.js","names":[],"sources":["../../../src/billing/hooks/useBillingEventEmitter.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useEventBus, type BillingLifecyclePayload } from '@burdenoff/fe-libs/shared/events';\n\nexport type BillingDomainEvent =\n | 'billing.billing_account.viewed'\n | 'billing.billing_account.created'\n | 'billing.billing_account.updated'\n | 'billing.billing_account.archived'\n | 'billing.subscription.viewed'\n | 'billing.subscription.cancelled'\n | 'billing.plan.viewed'\n | 'billing.addon.viewed'\n | 'billing.checkout.viewed'\n | 'billing.checkout.initiated'\n | 'billing.checkout.failed'\n | 'billing.payment.succeeded'\n | 'billing.payment.failed'\n | 'billing.invoice.viewed'\n | 'billing.payment_method.viewed'\n | 'billing.payment_method.added'\n | 'billing.payment_method.default_set'\n | 'billing.payment_method.deleted'\n | 'billing.credit.viewed'\n | 'billing.credits.spent'\n | 'billing.credits.granted'\n | 'billing.credits.withdrawal_requested'\n | 'billing.quota.viewed'\n | 'billing.usage.viewed'\n | 'billing.transaction.viewed'\n | 'billing.affiliate.viewed'\n | 'billing.affiliate_code.created'\n | 'billing.affiliate_code.updated'\n | 'billing.affiliate_code.deactivated'\n | 'billing.affiliate_code.note_added'\n | 'billing.earning.viewed'\n | 'billing.payout.viewed'\n | 'billing.payout_account.added'\n | 'billing.payout_account.updated'\n | 'billing.payout_account.archived'\n | 'billing.payout.requested'\n | 'billing.payout.approved'\n | 'billing.payout.rejected'\n | 'billing.payout.processed';\n\nexport type BillingEventPayload = BillingLifecyclePayload;\n\nexport function useBillingEventEmitter(): {\n emit: (event: BillingDomainEvent, payload?: BillingEventPayload) => void;\n} {\n const bus = useEventBus();\n\n const emit = useCallback(\n (event: BillingDomainEvent, payload: BillingEventPayload = {}) => {\n try {\n bus.emit(event, payload);\n } catch {\n // Event bus failures must never break billing user journeys.\n }\n },\n [bus]\n );\n\n return { emit };\n}\n"],"mappings":";;;AA8CA,
|
|
1
|
+
{"version":3,"file":"useBillingEventEmitter.js","names":["useBillingEventEmitter","bus","useEventBus","useCallback","event","payload"],"sources":["../../../src/billing/hooks/useBillingEventEmitter.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useEventBus, type BillingLifecyclePayload } from '@burdenoff/fe-libs/shared/events';\n\nexport type BillingDomainEvent =\n | 'billing.billing_account.viewed'\n | 'billing.billing_account.created'\n | 'billing.billing_account.updated'\n | 'billing.billing_account.archived'\n | 'billing.subscription.viewed'\n | 'billing.subscription.cancelled'\n | 'billing.plan.viewed'\n | 'billing.addon.viewed'\n | 'billing.checkout.viewed'\n | 'billing.checkout.initiated'\n | 'billing.checkout.failed'\n | 'billing.payment.succeeded'\n | 'billing.payment.failed'\n | 'billing.invoice.viewed'\n | 'billing.payment_method.viewed'\n | 'billing.payment_method.added'\n | 'billing.payment_method.default_set'\n | 'billing.payment_method.deleted'\n | 'billing.credit.viewed'\n | 'billing.credits.spent'\n | 'billing.credits.granted'\n | 'billing.credits.withdrawal_requested'\n | 'billing.quota.viewed'\n | 'billing.usage.viewed'\n | 'billing.transaction.viewed'\n | 'billing.affiliate.viewed'\n | 'billing.affiliate_code.created'\n | 'billing.affiliate_code.updated'\n | 'billing.affiliate_code.deactivated'\n | 'billing.affiliate_code.note_added'\n | 'billing.earning.viewed'\n | 'billing.payout.viewed'\n | 'billing.payout_account.added'\n | 'billing.payout_account.updated'\n | 'billing.payout_account.archived'\n | 'billing.payout.requested'\n | 'billing.payout.approved'\n | 'billing.payout.rejected'\n | 'billing.payout.processed';\n\nexport type BillingEventPayload = BillingLifecyclePayload;\n\nexport function useBillingEventEmitter(): {\n emit: (event: BillingDomainEvent, payload?: BillingEventPayload) => void;\n} {\n const bus = useEventBus();\n\n const emit = useCallback(\n (event: BillingDomainEvent, payload: BillingEventPayload = {}) => {\n try {\n bus.emit(event, payload);\n } catch {\n // Event bus failures must never break billing user journeys.\n }\n },\n [bus]\n );\n\n return { emit };\n}\n"],"mappings":";;;AA8CA,SAAgBA,IAEd;CACA,IAAMC,IAAMC,EAAY;CAaxB,OAAO,EAAE,MAXIC,GACV,GAA2B,IAA+B,CAAC,MAAM;EAChE,IAAI;GACF,EAAI,KAAKC,GAAOC,CAAO;EACzB,QAAQ,CAER;CACF,GACA,CAACJ,CAAG,CAGG,EAAK;AAChB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useBilling as e } from "../providers/BillingProvider.js";
|
|
2
2
|
import { useCallback as t } from "react";
|
|
3
3
|
import { useNavigate as n } from "react-router";
|
|
4
|
-
|
|
4
|
+
// src/billing/hooks/useBillingNavigate.ts
|
|
5
5
|
function r() {
|
|
6
6
|
let { navigate: r, basePath: i } = e(), a = n();
|
|
7
7
|
return t((e, t) => {
|
|
@@ -17,7 +17,6 @@ function r() {
|
|
|
17
17
|
a
|
|
18
18
|
]);
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { r as useBillingNavigate };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=useBillingNavigate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBillingNavigate.js","names":[],"sources":["../../../src/billing/hooks/useBillingNavigate.ts"],"sourcesContent":["/**\n * Custom navigation hook for the Billing microfrontend.\n * Properly handles basePath when navigating within billing routes.\n */\n\nimport { useCallback } from 'react';\nimport { useNavigate } from 'react-router';\nimport { useBilling } from '../providers/BillingProvider';\n\nexport interface NavigateOptions {\n replace?: boolean;\n state?: unknown;\n}\n\n/**\n * Hook that returns a navigation function that properly prepends the basePath.\n * This ensures all navigation within the billing microfrontend works correctly\n * when integrated into a shell application with a basePath (e.g., '/billing').\n *\n * @example\n * ```tsx\n * const navigateTo = useBillingNavigate();\n *\n * // Navigate to checkout\n * navigateTo('/checkout/credits');\n * // When basePath is '/billing', this navigates to '/billing/checkout/credits'\n *\n * // Navigate with state\n * navigateTo('/checkout/plan-123', { state: { fromUpgrade: true } });\n *\n * // Navigate back in history\n * navigateTo(-1);\n * ```\n */\nexport function useBillingNavigate() {\n const { navigate, basePath } = useBilling();\n const routerNavigate = useNavigate();\n\n const navigateTo = useCallback(\n (pathOrDelta: string | number, options?: NavigateOptions) => {\n // Handle numeric delta (for back/forward navigation like navigate(-1))\n if (typeof pathOrDelta === 'number') {\n routerNavigate(pathOrDelta);\n return;\n }\n\n const path = pathOrDelta;\n\n // Handle path joining to avoid double slashes (e.g., / + /plans = //plans)\n let fullPath = path;\n\n if (basePath && basePath !== '/') {\n // Remove trailing slash from basePath and ensure path has leading slash\n const base = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;\n const suffix = path.startsWith('/') ? path : `/${path}`;\n fullPath = `${base}${suffix}`;\n }\n\n // The shell navigate function only accepts a path (no options)\n // For navigation with options (replace, state), use the router navigate directly\n if (options && (options.replace || options.state)) {\n // Use router navigate for options support\n routerNavigate(fullPath, options);\n } else if (navigate) {\n // Use shell navigate for simple navigation\n navigate(fullPath);\n } else {\n // Fallback to router navigate\n routerNavigate(fullPath);\n }\n },\n [navigate, basePath, routerNavigate]\n );\n\n return navigateTo;\n}\n"],"mappings":";;;;AAkCA,
|
|
1
|
+
{"version":3,"file":"useBillingNavigate.js","names":["useBillingNavigate","useBilling","routerNavigate","useNavigate","useCallback","pathOrDelta","path","fullPath","basePath","options","navigate"],"sources":["../../../src/billing/hooks/useBillingNavigate.ts"],"sourcesContent":["/**\n * Custom navigation hook for the Billing microfrontend.\n * Properly handles basePath when navigating within billing routes.\n */\n\nimport { useCallback } from 'react';\nimport { useNavigate } from 'react-router';\nimport { useBilling } from '../providers/BillingProvider';\n\nexport interface NavigateOptions {\n replace?: boolean;\n state?: unknown;\n}\n\n/**\n * Hook that returns a navigation function that properly prepends the basePath.\n * This ensures all navigation within the billing microfrontend works correctly\n * when integrated into a shell application with a basePath (e.g., '/billing').\n *\n * @example\n * ```tsx\n * const navigateTo = useBillingNavigate();\n *\n * // Navigate to checkout\n * navigateTo('/checkout/credits');\n * // When basePath is '/billing', this navigates to '/billing/checkout/credits'\n *\n * // Navigate with state\n * navigateTo('/checkout/plan-123', { state: { fromUpgrade: true } });\n *\n * // Navigate back in history\n * navigateTo(-1);\n * ```\n */\nexport function useBillingNavigate() {\n const { navigate, basePath } = useBilling();\n const routerNavigate = useNavigate();\n\n const navigateTo = useCallback(\n (pathOrDelta: string | number, options?: NavigateOptions) => {\n // Handle numeric delta (for back/forward navigation like navigate(-1))\n if (typeof pathOrDelta === 'number') {\n routerNavigate(pathOrDelta);\n return;\n }\n\n const path = pathOrDelta;\n\n // Handle path joining to avoid double slashes (e.g., / + /plans = //plans)\n let fullPath = path;\n\n if (basePath && basePath !== '/') {\n // Remove trailing slash from basePath and ensure path has leading slash\n const base = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath;\n const suffix = path.startsWith('/') ? path : `/${path}`;\n fullPath = `${base}${suffix}`;\n }\n\n // The shell navigate function only accepts a path (no options)\n // For navigation with options (replace, state), use the router navigate directly\n if (options && (options.replace || options.state)) {\n // Use router navigate for options support\n routerNavigate(fullPath, options);\n } else if (navigate) {\n // Use shell navigate for simple navigation\n navigate(fullPath);\n } else {\n // Fallback to router navigate\n routerNavigate(fullPath);\n }\n },\n [navigate, basePath, routerNavigate]\n );\n\n return navigateTo;\n}\n"],"mappings":";;;;AAkCA,SAAgBA,IAAqB;CACnC,IAAM,EAAE,aAAU,gBAAaC,EAAW,GACpCC,IAAiBC,EAAY;CAsCnC,OApCmBC,GAChB,GAA8B,MAA8B;EAE3D,IAAI,OAAOC,KAAgB,UAAU;GACnC,EAAeA,CAAW;GAC1B;EACF;EAEA,IAAMC,IAAOD,GAGTE,IAAWD;EAWf,AATIE,KAAYA,MAAa,QAI3B,IAAW,GAFEA,EAAS,SAAS,GAAG,IAAIA,EAAS,MAAM,GAAG,EAAE,IAAIA,IAC/CF,EAAK,WAAW,GAAG,IAAIA,IAAO,IAAIA,QAM/CG,MAAYA,EAAQ,WAAWA,EAAQ,SAEzCP,EAAeK,GAAUE,CAAO,IACvBC,IAETA,EAASH,CAAQ,IAGjBL,EAAeK,CAAQ;CAE3B,GACA;EAACG;EAAUF;EAAUN;CAAc,CAG9B;AACT"}
|
|
@@ -5,7 +5,7 @@ import "../shared/utils/index.js";
|
|
|
5
5
|
import { useMemo as r } from "react";
|
|
6
6
|
import { useAuth as i, usePermissions as a } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
7
7
|
import { useQuery as o } from "@tanstack/react-query";
|
|
8
|
-
|
|
8
|
+
// src/billing/hooks/useBillingPermissions.ts
|
|
9
9
|
var s = ["billing:read", "billing.read"], c = ["billing:create", "billing.create"], l = ["billing:update", "billing.update"], u = ["billing:delete", "billing.delete"], d = ["billing:manage", "billing.manage"], f = "\n query BillingScopeMyPermissions($scopeId: String!) {\n myPermissions(scopeId: $scopeId) {\n actorId\n scopeId\n permissions {\n resourceType\n level\n allowedActions\n }\n }\n }\n";
|
|
10
10
|
function p(e) {
|
|
11
11
|
return e.flatMap((e) => {
|
|
@@ -21,7 +21,7 @@ function m(m) {
|
|
|
21
21
|
}), S = m?.billingAccountIdOverride ?? x ?? void 0, C = o({
|
|
22
22
|
queryKey: ["billing-scope-permissions", S],
|
|
23
23
|
enabled: h && !!S,
|
|
24
|
-
staleTime:
|
|
24
|
+
staleTime: 3e5,
|
|
25
25
|
queryFn: async () => p((await n({
|
|
26
26
|
apiGatewayUrl: v,
|
|
27
27
|
authToken: y,
|
|
@@ -72,7 +72,6 @@ function m(m) {
|
|
|
72
72
|
isLoading: _ || !!S && C.isLoading
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
//#endregion
|
|
76
75
|
export { m as useBillingPermissions };
|
|
77
76
|
|
|
78
77
|
//# sourceMappingURL=useBillingPermissions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBillingPermissions.js","names":[],"sources":["../../../src/billing/hooks/useBillingPermissions.ts"],"sourcesContent":["import { useQuery } from '@tanstack/react-query';\nimport { useMemo } from 'react';\nimport { useAuth, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useBilling } from '../providers/BillingProvider';\nimport { useBillingAccountSelection } from './useBillingAccountSelection';\nimport { directBillingGraphqlRequest } from '../shared/utils';\n\n// Permission strings emitted by global-billing-svc @rbac directives.\n// We accept both `:` and `.` separators because the RBAC service has\n// historically returned both shapes in `myPermissions.permissions[]`.\nconst BILLING_READ = ['billing:read', 'billing.read'];\nconst BILLING_CREATE = ['billing:create', 'billing.create'];\nconst BILLING_UPDATE = ['billing:update', 'billing.update'];\nconst BILLING_DELETE = ['billing:delete', 'billing.delete'];\nconst BILLING_MANAGE = ['billing:manage', 'billing.manage'];\n\nconst BILLING_SCOPE_PERMISSIONS_QUERY = `\n query BillingScopeMyPermissions($scopeId: String!) {\n myPermissions(scopeId: $scopeId) {\n actorId\n scopeId\n permissions {\n resourceType\n level\n allowedActions\n }\n }\n }\n`;\n\ninterface RawPerm {\n resourceType: string;\n level: string;\n allowedActions: string[];\n}\n\nfunction permsToStrings(perms: RawPerm[]): string[] {\n return perms.flatMap((p) => {\n const out: string[] = [];\n if (p.level === 'ADMIN') out.push(`${p.resourceType}:*`);\n out.push(...p.allowedActions.map((a) => `${p.resourceType}:${a}`));\n return out;\n });\n}\n\n/**\n * Hook for billing-specific RBAC permissions.\n *\n * Permission model aligns with the `@rbac` directives on global-billing-svc:\n * resource: \"billing\"\n * actions: \"read\" – view billing data\n * \"create\" – create billing accounts, initiate payments\n * \"update\" – modify billing accounts, payment methods, usage\n * \"delete\" – remove payment methods, cancel subscriptions\n * \"manage\" – admin-only (plans, addons, quotas, discounts, refunds, tax rates)\n *\n * The RBAC service resolves these via `billingAccount.*` permission strings:\n * billingAccount.read → action: \"read\"\n * billingAccount.create → action: \"create\"\n * billingAccount.update → action: \"update\"\n * billingAccount.delete → action: \"delete\"\n * billingAccount.all → action: \"manage\" (admin bypass)\n *\n */\nexport interface UseBillingPermissionsOptions {\n /**\n * Caller-resolved billing account ID. When provided, this overrides the\n * hook's internal `useBillingAccountSelection` resolution. Use this when\n * the calling page already resolves a billing account (e.g. via the\n * `useBillingAccounts` + `useBillingAccountSelection` pair) so the\n * billing-scope permission fetch observes the *same* account ID and\n * doesn't lag behind for first-time users whose default account only\n * resolves once the accounts list loads.\n */\n billingAccountIdOverride?: string | null;\n}\n\nexport function useBillingPermissions(options?: UseBillingPermissionsOptions) {\n const { isAuthenticated } = useAuth();\n // Org-scope permissions from the top-level PermissionProvider. Covers\n // Org Owner / Org Admin permissions on the `billing` resource.\n const { hasPermission: hasOrgPermission, isLoading: orgIsLoading } = usePermissions();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n\n // Billing-account-scope permissions. Covers Billing Admin / Billing Viewer\n // role assignments on the currently-active billing account. Required\n // because PermissionProvider only fetches a single scope (org), so a\n // user who is *only* a Billing Admin (not Org Owner) would otherwise see\n // empty perms on the billing pages.\n // Resolve account scope from the current URL when present, otherwise fall\n // back to the last selected billing account stored for this org. That keeps\n // route guards aligned with SPA navigation *and* with list/detail flows that\n // rely on persisted account selection. Callers that already resolve the\n // account (e.g. with a `useBillingAccounts`-backed `useBillingAccountSelection`\n // instance) can pass `billingAccountIdOverride` to keep both observers in sync.\n const { selectedAccountId } = useBillingAccountSelection({\n orgId,\n syncFromUrl: true,\n urlParamName: 'billingAccountId',\n });\n const billingAccountId = options?.billingAccountIdOverride ?? selectedAccountId ?? undefined;\n const billingScopeQuery = useQuery({\n queryKey: ['billing-scope-permissions', billingAccountId],\n enabled: isAuthenticated && Boolean(billingAccountId),\n staleTime: 5 * 60 * 1000,\n queryFn: async () => {\n const data = await directBillingGraphqlRequest<{\n myPermissions: { permissions: RawPerm[] };\n }>({\n apiGatewayUrl,\n authToken,\n orgId,\n query: BILLING_SCOPE_PERMISSIONS_QUERY,\n variables: { scopeId: billingAccountId },\n });\n return permsToStrings(data?.myPermissions?.permissions ?? []);\n },\n });\n\n const billingScopeStrings = useMemo<string[]>(\n () => billingScopeQuery.data ?? [],\n [billingScopeQuery.data]\n );\n\n const matchesBillingScope = (permission: string): boolean => {\n // Wildcard match: e.g. `billing:read` matches stored `billing:*`.\n const [resource] = permission.split(/[:.]/);\n return (\n billingScopeStrings.includes(permission) || billingScopeStrings.includes(`${resource}:*`)\n );\n };\n\n // Pure RBAC: every check goes through the gateway-evaluated permission\n // set returned by `myPermissions`. No email-domain or role-name fallback —\n // those legacy escape hatches caused divergence between UI and gateway\n // enforcement and have been removed now that billing-scope roles\n // (Billing Admin / Billing Viewer) are auto-assigned on account creation.\n const hasAnyPermission = (permissions: string[]): boolean =>\n permissions.some((p) => hasOrgPermission(p) || matchesBillingScope(p));\n\n const canRead = isAuthenticated && hasAnyPermission(BILLING_READ);\n const canCreate = isAuthenticated && hasAnyPermission(BILLING_CREATE);\n const canUpdate = isAuthenticated && hasAnyPermission(BILLING_UPDATE);\n const canDelete = isAuthenticated && hasAnyPermission(BILLING_DELETE);\n const canManage = isAuthenticated && hasAnyPermission(BILLING_MANAGE);\n\n const isLoading = orgIsLoading || (Boolean(billingAccountId) && billingScopeQuery.isLoading);\n\n return {\n // ── Billing account ───────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewBillingAccount: canRead,\n /** @rbac(action: \"create\", resource: \"billing\") */\n canCreateBillingAccount: canCreate,\n /** @rbac(action: \"update\", resource: \"billing\") */\n canManageBillingAccount: canUpdate,\n /** @rbac(action: \"delete\", resource: \"billing\") — archiveBillingAccount */\n canArchiveBillingAccount: canDelete,\n\n // ── Subscriptions ─────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewSubscriptions: canRead,\n /** @rbac(action: \"create\", resource: \"billing\") — initiatePayment for plans */\n canCreateSubscription: canCreate,\n /** @rbac(action: \"update\", resource: \"billing\") */\n canUpdateSubscription: canUpdate,\n /** @rbac(action: \"delete\", resource: \"billing\") — cancelSubscription */\n canCancelSubscription: canDelete,\n\n // ── Plans (admin-only management) ─────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewPlans: canRead,\n /** @rbac(action: \"manage\", resource: \"billing\") — createPlan, updatePlan, togglePlan */\n canManagePlans: canManage,\n\n // ── Addons (admin-only management) ────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewAddons: canRead,\n /** @rbac(action: \"manage\", resource: \"billing\") — createAddOns, updateAddOnDetails, toggleAddOn */\n canManageAddons: canManage,\n\n // ── Quotas (admin-only management) ────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewQuotas: canRead,\n /** @rbac(action: \"manage\", resource: \"billing\") — createQuota, updateQuota */\n canManageQuotas: canManage,\n\n // ── Invoices ──────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewInvoices: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — payInvoice */\n canPayInvoice: canUpdate,\n /** @rbac(action: \"manage\", resource: \"billing\") — voidInvoice, generateInvoice */\n canVoidInvoice: canManage,\n\n // ── Payments ──────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewPayments: canRead,\n /** @rbac(action: \"create\", resource: \"billing\") — initiatePayment */\n canProcessPayment: canCreate,\n\n // ── Payment Methods ───────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewPaymentMethods: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — addPaymentMethod, updatePaymentMethod */\n canManagePaymentMethods: canUpdate,\n\n // ── Usage ─────────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewUsage: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — addUsage, freeUpUsage */\n canRecordUsage: canUpdate,\n\n // ── Credits ───────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewCredits: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — spendCredits */\n canIssueCredit: canUpdate,\n /** @rbac(action: \"update\", resource: \"billing\") — requestCreditWithdrawal */\n canWithdrawCredits: canUpdate,\n /** @rbac(action: \"manage\", resource: \"billing\") — grantCredits */\n canGrantCredits: canManage,\n\n // ── Discounts ─────────────────────────────────────────────────────\n /** @rbac(action: \"update\", resource: \"billing\") — applyBillingDiscount */\n canApplyDiscount: canUpdate,\n /** @rbac(action: \"manage\", resource: \"billing\") — createDiscount, updateDiscount, deleteDiscount */\n canManageDiscounts: canManage,\n\n // ── Analytics ─────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewAnalytics: canRead,\n\n // ── Refunds (admin-only) ──────────────────────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") — processRefund, skipRefund, retryRefund */\n canProcessRefund: canManage,\n\n // ── Recurring Billing (admin/service-only) ────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") */\n canManageRecurringBilling: canManage,\n\n // ── Entitlements (admin-only) ─────────────────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") — createEntitlement, updateEntitlement, deleteEntitlement */\n canManageEntitlements: canManage,\n\n // ── Tax Rates (admin-only) ────────────────────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") — createTaxRate, updateTaxRate, deleteTaxRate */\n canManageTaxRates: canManage,\n\n // ── Admin check ───────────────────────────────────────────────────\n /** Full billing admin (billing:manage) */\n isBillingAdmin: canManage,\n\n // ── Loading state ─────────────────────────────────────────────────\n /** Whether permissions are still being loaded from RBAC service */\n isLoading,\n };\n}\n"],"mappings":";;;;;;;;AAUA,IAAM,IAAe,CAAC,gBAAgB,cAAc,GAC9C,IAAiB,CAAC,kBAAkB,gBAAgB,GACpD,IAAiB,CAAC,kBAAkB,gBAAgB,GACpD,IAAiB,CAAC,kBAAkB,gBAAgB,GACpD,IAAiB,CAAC,kBAAkB,gBAAgB,GAEpD,IAAkC;AAoBxC,SAAS,EAAe,GAA4B;CAClD,OAAO,EAAM,SAAS,MAAM;EAC1B,IAAM,IAAgB,CAAC;EAGvB,OAFI,EAAE,UAAU,WAAS,EAAI,KAAK,GAAG,EAAE,aAAa,GAAG,GACvD,EAAI,KAAK,GAAG,EAAE,eAAe,KAAK,MAAM,GAAG,EAAE,aAAa,GAAG,GAAG,CAAC,GAC1D;CACT,CAAC;AACH;AAkCA,SAAgB,EAAsB,GAAwC;CAC5E,IAAM,EAAE,uBAAoB,EAAQ,GAG9B,EAAE,eAAe,GAAkB,WAAW,MAAiB,EAAe,GAC9E,EAAE,kBAAe,cAAW,aAAU,EAAW,GAajD,EAAE,yBAAsB,EAA2B;EACvD;EACA,aAAa;EACb,cAAc;CAChB,CAAC,GACK,IAAmB,GAAS,4BAA4B,KAAqB,KAAA,GAC7E,IAAoB,EAAS;EACjC,UAAU,CAAC,6BAA6B,CAAgB;EACxD,SAAS,KAAmB,EAAQ;EACpC,WAAW,MAAS;EACpB,SAAS,YAUA,GAAe,MATH,EAEhB;GACD;GACA;GACA;GACA,OAAO;GACP,WAAW,EAAE,SAAS,EAAiB;EACzC,CAAC,IAC2B,eAAe,eAAe,CAAC,CAAC;CAEhE,CAAC,GAEK,IAAsB,QACpB,EAAkB,QAAQ,CAAC,GACjC,CAAC,EAAkB,IAAI,CACzB,GAEM,KAAuB,MAAgC;EAE3D,IAAM,CAAC,KAAY,EAAW,MAAM,MAAM;EAC1C,OACE,EAAoB,SAAS,CAAU,KAAK,EAAoB,SAAS,GAAG,EAAS,GAAG;CAE5F,GAOM,KAAoB,MACxB,EAAY,MAAM,MAAM,EAAiB,CAAC,KAAK,EAAoB,CAAC,CAAC,GAEjE,IAAU,KAAmB,EAAiB,CAAY,GAC1D,IAAY,KAAmB,EAAiB,CAAc,GAC9D,IAAY,KAAmB,EAAiB,CAAc,GAC9D,IAAY,KAAmB,EAAiB,CAAc,GAC9D,IAAY,KAAmB,EAAiB,CAAc;CAIpE,OAAO;EAGL,uBAAuB;EAEvB,yBAAyB;EAEzB,yBAAyB;EAEzB,0BAA0B;EAI1B,sBAAsB;EAEtB,uBAAuB;EAEvB,uBAAuB;EAEvB,uBAAuB;EAIvB,cAAc;EAEd,gBAAgB;EAIhB,eAAe;EAEf,iBAAiB;EAIjB,eAAe;EAEf,iBAAiB;EAIjB,iBAAiB;EAEjB,eAAe;EAEf,gBAAgB;EAIhB,iBAAiB;EAEjB,mBAAmB;EAInB,uBAAuB;EAEvB,yBAAyB;EAIzB,cAAc;EAEd,gBAAgB;EAIhB,gBAAgB;EAEhB,gBAAgB;EAEhB,oBAAoB;EAEpB,iBAAiB;EAIjB,kBAAkB;EAElB,oBAAoB;EAIpB,kBAAkB;EAIlB,kBAAkB;EAIlB,2BAA2B;EAI3B,uBAAuB;EAIvB,mBAAmB;EAInB,gBAAgB;EAIhB,WA7GgB,KAAiB,EAAQ,KAAqB,EAAkB;CA8GlF;AACF"}
|
|
1
|
+
{"version":3,"file":"useBillingPermissions.js","names":["BILLING_READ","BILLING_CREATE","BILLING_UPDATE","BILLING_DELETE","BILLING_MANAGE","BILLING_SCOPE_PERMISSIONS_QUERY","permsToStrings","perms","out","p","a","useBillingPermissions","useAuth","hasOrgPermission","orgIsLoading","usePermissions","useBilling","useBillingAccountSelection","billingAccountId","options","selectedAccountId","billingScopeQuery","useQuery","isAuthenticated","directBillingGraphqlRequest","billingScopeStrings","useMemo","matchesBillingScope","resource","permission","hasAnyPermission","permissions","canRead","canCreate","canUpdate","canDelete","canManage"],"sources":["../../../src/billing/hooks/useBillingPermissions.ts"],"sourcesContent":["import { useQuery } from '@tanstack/react-query';\nimport { useMemo } from 'react';\nimport { useAuth, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useBilling } from '../providers/BillingProvider';\nimport { useBillingAccountSelection } from './useBillingAccountSelection';\nimport { directBillingGraphqlRequest } from '../shared/utils';\n\n// Permission strings emitted by global-billing-svc @rbac directives.\n// We accept both `:` and `.` separators because the RBAC service has\n// historically returned both shapes in `myPermissions.permissions[]`.\nconst BILLING_READ = ['billing:read', 'billing.read'];\nconst BILLING_CREATE = ['billing:create', 'billing.create'];\nconst BILLING_UPDATE = ['billing:update', 'billing.update'];\nconst BILLING_DELETE = ['billing:delete', 'billing.delete'];\nconst BILLING_MANAGE = ['billing:manage', 'billing.manage'];\n\nconst BILLING_SCOPE_PERMISSIONS_QUERY = `\n query BillingScopeMyPermissions($scopeId: String!) {\n myPermissions(scopeId: $scopeId) {\n actorId\n scopeId\n permissions {\n resourceType\n level\n allowedActions\n }\n }\n }\n`;\n\ninterface RawPerm {\n resourceType: string;\n level: string;\n allowedActions: string[];\n}\n\nfunction permsToStrings(perms: RawPerm[]): string[] {\n return perms.flatMap((p) => {\n const out: string[] = [];\n if (p.level === 'ADMIN') out.push(`${p.resourceType}:*`);\n out.push(...p.allowedActions.map((a) => `${p.resourceType}:${a}`));\n return out;\n });\n}\n\n/**\n * Hook for billing-specific RBAC permissions.\n *\n * Permission model aligns with the `@rbac` directives on global-billing-svc:\n * resource: \"billing\"\n * actions: \"read\" – view billing data\n * \"create\" – create billing accounts, initiate payments\n * \"update\" – modify billing accounts, payment methods, usage\n * \"delete\" – remove payment methods, cancel subscriptions\n * \"manage\" – admin-only (plans, addons, quotas, discounts, refunds, tax rates)\n *\n * The RBAC service resolves these via `billingAccount.*` permission strings:\n * billingAccount.read → action: \"read\"\n * billingAccount.create → action: \"create\"\n * billingAccount.update → action: \"update\"\n * billingAccount.delete → action: \"delete\"\n * billingAccount.all → action: \"manage\" (admin bypass)\n *\n */\nexport interface UseBillingPermissionsOptions {\n /**\n * Caller-resolved billing account ID. When provided, this overrides the\n * hook's internal `useBillingAccountSelection` resolution. Use this when\n * the calling page already resolves a billing account (e.g. via the\n * `useBillingAccounts` + `useBillingAccountSelection` pair) so the\n * billing-scope permission fetch observes the *same* account ID and\n * doesn't lag behind for first-time users whose default account only\n * resolves once the accounts list loads.\n */\n billingAccountIdOverride?: string | null;\n}\n\nexport function useBillingPermissions(options?: UseBillingPermissionsOptions) {\n const { isAuthenticated } = useAuth();\n // Org-scope permissions from the top-level PermissionProvider. Covers\n // Org Owner / Org Admin permissions on the `billing` resource.\n const { hasPermission: hasOrgPermission, isLoading: orgIsLoading } = usePermissions();\n const { apiGatewayUrl, authToken, orgId } = useBilling();\n\n // Billing-account-scope permissions. Covers Billing Admin / Billing Viewer\n // role assignments on the currently-active billing account. Required\n // because PermissionProvider only fetches a single scope (org), so a\n // user who is *only* a Billing Admin (not Org Owner) would otherwise see\n // empty perms on the billing pages.\n // Resolve account scope from the current URL when present, otherwise fall\n // back to the last selected billing account stored for this org. That keeps\n // route guards aligned with SPA navigation *and* with list/detail flows that\n // rely on persisted account selection. Callers that already resolve the\n // account (e.g. with a `useBillingAccounts`-backed `useBillingAccountSelection`\n // instance) can pass `billingAccountIdOverride` to keep both observers in sync.\n const { selectedAccountId } = useBillingAccountSelection({\n orgId,\n syncFromUrl: true,\n urlParamName: 'billingAccountId',\n });\n const billingAccountId = options?.billingAccountIdOverride ?? selectedAccountId ?? undefined;\n const billingScopeQuery = useQuery({\n queryKey: ['billing-scope-permissions', billingAccountId],\n enabled: isAuthenticated && Boolean(billingAccountId),\n staleTime: 5 * 60 * 1000,\n queryFn: async () => {\n const data = await directBillingGraphqlRequest<{\n myPermissions: { permissions: RawPerm[] };\n }>({\n apiGatewayUrl,\n authToken,\n orgId,\n query: BILLING_SCOPE_PERMISSIONS_QUERY,\n variables: { scopeId: billingAccountId },\n });\n return permsToStrings(data?.myPermissions?.permissions ?? []);\n },\n });\n\n const billingScopeStrings = useMemo<string[]>(\n () => billingScopeQuery.data ?? [],\n [billingScopeQuery.data]\n );\n\n const matchesBillingScope = (permission: string): boolean => {\n // Wildcard match: e.g. `billing:read` matches stored `billing:*`.\n const [resource] = permission.split(/[:.]/);\n return (\n billingScopeStrings.includes(permission) || billingScopeStrings.includes(`${resource}:*`)\n );\n };\n\n // Pure RBAC: every check goes through the gateway-evaluated permission\n // set returned by `myPermissions`. No email-domain or role-name fallback —\n // those legacy escape hatches caused divergence between UI and gateway\n // enforcement and have been removed now that billing-scope roles\n // (Billing Admin / Billing Viewer) are auto-assigned on account creation.\n const hasAnyPermission = (permissions: string[]): boolean =>\n permissions.some((p) => hasOrgPermission(p) || matchesBillingScope(p));\n\n const canRead = isAuthenticated && hasAnyPermission(BILLING_READ);\n const canCreate = isAuthenticated && hasAnyPermission(BILLING_CREATE);\n const canUpdate = isAuthenticated && hasAnyPermission(BILLING_UPDATE);\n const canDelete = isAuthenticated && hasAnyPermission(BILLING_DELETE);\n const canManage = isAuthenticated && hasAnyPermission(BILLING_MANAGE);\n\n const isLoading = orgIsLoading || (Boolean(billingAccountId) && billingScopeQuery.isLoading);\n\n return {\n // ── Billing account ───────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewBillingAccount: canRead,\n /** @rbac(action: \"create\", resource: \"billing\") */\n canCreateBillingAccount: canCreate,\n /** @rbac(action: \"update\", resource: \"billing\") */\n canManageBillingAccount: canUpdate,\n /** @rbac(action: \"delete\", resource: \"billing\") — archiveBillingAccount */\n canArchiveBillingAccount: canDelete,\n\n // ── Subscriptions ─────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewSubscriptions: canRead,\n /** @rbac(action: \"create\", resource: \"billing\") — initiatePayment for plans */\n canCreateSubscription: canCreate,\n /** @rbac(action: \"update\", resource: \"billing\") */\n canUpdateSubscription: canUpdate,\n /** @rbac(action: \"delete\", resource: \"billing\") — cancelSubscription */\n canCancelSubscription: canDelete,\n\n // ── Plans (admin-only management) ─────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewPlans: canRead,\n /** @rbac(action: \"manage\", resource: \"billing\") — createPlan, updatePlan, togglePlan */\n canManagePlans: canManage,\n\n // ── Addons (admin-only management) ────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewAddons: canRead,\n /** @rbac(action: \"manage\", resource: \"billing\") — createAddOns, updateAddOnDetails, toggleAddOn */\n canManageAddons: canManage,\n\n // ── Quotas (admin-only management) ────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewQuotas: canRead,\n /** @rbac(action: \"manage\", resource: \"billing\") — createQuota, updateQuota */\n canManageQuotas: canManage,\n\n // ── Invoices ──────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewInvoices: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — payInvoice */\n canPayInvoice: canUpdate,\n /** @rbac(action: \"manage\", resource: \"billing\") — voidInvoice, generateInvoice */\n canVoidInvoice: canManage,\n\n // ── Payments ──────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewPayments: canRead,\n /** @rbac(action: \"create\", resource: \"billing\") — initiatePayment */\n canProcessPayment: canCreate,\n\n // ── Payment Methods ───────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewPaymentMethods: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — addPaymentMethod, updatePaymentMethod */\n canManagePaymentMethods: canUpdate,\n\n // ── Usage ─────────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewUsage: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — addUsage, freeUpUsage */\n canRecordUsage: canUpdate,\n\n // ── Credits ───────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewCredits: canRead,\n /** @rbac(action: \"update\", resource: \"billing\") — spendCredits */\n canIssueCredit: canUpdate,\n /** @rbac(action: \"update\", resource: \"billing\") — requestCreditWithdrawal */\n canWithdrawCredits: canUpdate,\n /** @rbac(action: \"manage\", resource: \"billing\") — grantCredits */\n canGrantCredits: canManage,\n\n // ── Discounts ─────────────────────────────────────────────────────\n /** @rbac(action: \"update\", resource: \"billing\") — applyBillingDiscount */\n canApplyDiscount: canUpdate,\n /** @rbac(action: \"manage\", resource: \"billing\") — createDiscount, updateDiscount, deleteDiscount */\n canManageDiscounts: canManage,\n\n // ── Analytics ─────────────────────────────────────────────────────\n /** @rbac(action: \"read\", resource: \"billing\") */\n canViewAnalytics: canRead,\n\n // ── Refunds (admin-only) ──────────────────────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") — processRefund, skipRefund, retryRefund */\n canProcessRefund: canManage,\n\n // ── Recurring Billing (admin/service-only) ────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") */\n canManageRecurringBilling: canManage,\n\n // ── Entitlements (admin-only) ─────────────────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") — createEntitlement, updateEntitlement, deleteEntitlement */\n canManageEntitlements: canManage,\n\n // ── Tax Rates (admin-only) ────────────────────────────────────────\n /** @rbac(action: \"manage\", resource: \"billing\") — createTaxRate, updateTaxRate, deleteTaxRate */\n canManageTaxRates: canManage,\n\n // ── Admin check ───────────────────────────────────────────────────\n /** Full billing admin (billing:manage) */\n isBillingAdmin: canManage,\n\n // ── Loading state ─────────────────────────────────────────────────\n /** Whether permissions are still being loaded from RBAC service */\n isLoading,\n };\n}\n"],"mappings":";;;;;;;;AAUA,IAAMA,IAAe,CAAC,gBAAgB,cAAc,GAC9CC,IAAiB,CAAC,kBAAkB,gBAAgB,GACpDC,IAAiB,CAAC,kBAAkB,gBAAgB,GACpDC,IAAiB,CAAC,kBAAkB,gBAAgB,GACpDC,IAAiB,CAAC,kBAAkB,gBAAgB,GAEpDC,IAAkC;AAoBxC,SAASC,EAAe,GAA4B;CAClD,OAAOC,EAAM,SAAS,MAAM;EAC1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AiB1B,CAAc;CAIpE,OAAO;EAGL,uBAAuB4B;EAEvB,yBAAyBC;EAEzB,yBAAyBC;EAEzB,0BAA0BC;EAI1B,sBAAsBH;EAEtB,uBAAuBC;EAEvB,uBAAuBC;EAEvB,uBAAuBC;EAIvB,cAAcH;EAEd,gBAAgBI;EAIhB,eAAeJ;EAEf,iBAAiBI;EAIjB,eAAeJ;EAEf,iBAAiBI;EAIjB,iBAAiBJ;EAEjB,eAAeE;EAEf,gBAAgBE;EAIhB,iBAAiBJ;EAEjB,mBAAmBC;EAInB,uBAAuBD;EAEvB,yBAAyBE;EAIzB,cAAcF;EAEd,gBAAgBE;EAIhB,gBAAgBF;EAEhB,gBAAgBE;EAEhB,oBAAoBA;EAEpB,iBAAiBE;EAIjB,kBAAkBF;EAElB,oBAAoBE;EAIpB,kBAAkBJ;EAIlB,kBAAkBI;EAIlB,2BAA2BA;EAI3B,uBAAuBA;EAIvB,mBAAmBA;EAInB,gBAAgBA;EAIhB,WA7GgBtB,KAAiB,EAAQI,KAAqBG,EAAkB;CA8GlF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useGetDefaultBillingAccountCheckoutQuery as e } from "../../generated/global-operations.js";
|
|
2
|
-
|
|
2
|
+
// src/billing/hooks/useDefaultBillingCurrency.ts
|
|
3
3
|
function t() {
|
|
4
4
|
let { data: t } = e();
|
|
5
5
|
return t?.getDefaultBillingAccount?.currency ?? "USD";
|
|
@@ -17,7 +17,6 @@ function n(e, t, n, r) {
|
|
|
17
17
|
currency: t || "USD"
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { n as getDisplayPrice, t as useDefaultBillingCurrency };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=useDefaultBillingCurrency.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDefaultBillingCurrency.js","names":[],"sources":["../../../src/billing/hooks/useDefaultBillingCurrency.ts"],"sourcesContent":["import { useGetDefaultBillingAccountCheckoutQuery } from '../../generated/global-operations';\n\n/**\n * Returns the currency of the user's default billing account (e.g. \"INR\", \"USD\").\n * Falls back to \"USD\" while loading or if no billing account exists.\n */\nexport function useDefaultBillingCurrency(): string {\n const { data } = useGetDefaultBillingAccountCheckoutQuery();\n return data?.getDefaultBillingAccount?.currency ?? 'USD';\n}\n\n/**\n * Given a plan/addon's base price + currency and an optional currencyPrices map,\n * returns the best price/currency to display for the given target currency.\n */\nexport function getDisplayPrice(\n basePrice: number,\n baseCurrency: string,\n currencyPrices: Record<string, number> | null | undefined,\n targetCurrency: string\n): { price: number; currency: string } {\n if (targetCurrency && targetCurrency !== baseCurrency && currencyPrices) {\n const override = (currencyPrices as Record<string, number>)[targetCurrency];\n if (override != null && override > 0) {\n return { price: override, currency: targetCurrency };\n }\n }\n return { price: basePrice, currency: baseCurrency || 'USD' };\n}\n"],"mappings":";;AAMA,
|
|
1
|
+
{"version":3,"file":"useDefaultBillingCurrency.js","names":["useDefaultBillingCurrency","useGetDefaultBillingAccountCheckoutQuery","data","getDisplayPrice","targetCurrency","baseCurrency","currencyPrices","override","basePrice"],"sources":["../../../src/billing/hooks/useDefaultBillingCurrency.ts"],"sourcesContent":["import { useGetDefaultBillingAccountCheckoutQuery } from '../../generated/global-operations';\n\n/**\n * Returns the currency of the user's default billing account (e.g. \"INR\", \"USD\").\n * Falls back to \"USD\" while loading or if no billing account exists.\n */\nexport function useDefaultBillingCurrency(): string {\n const { data } = useGetDefaultBillingAccountCheckoutQuery();\n return data?.getDefaultBillingAccount?.currency ?? 'USD';\n}\n\n/**\n * Given a plan/addon's base price + currency and an optional currencyPrices map,\n * returns the best price/currency to display for the given target currency.\n */\nexport function getDisplayPrice(\n basePrice: number,\n baseCurrency: string,\n currencyPrices: Record<string, number> | null | undefined,\n targetCurrency: string\n): { price: number; currency: string } {\n if (targetCurrency && targetCurrency !== baseCurrency && currencyPrices) {\n const override = (currencyPrices as Record<string, number>)[targetCurrency];\n if (override != null && override > 0) {\n return { price: override, currency: targetCurrency };\n }\n }\n return { price: basePrice, currency: baseCurrency || 'USD' };\n}\n"],"mappings":";;AAMA,SAAgBA,IAAoC;CAClD,IAAM,EAAE,YAASC,EAAyC;CAC1D,OAAOC,GAAM,0BAA0B,YAAY;AACrD;AAMA,SAAgBC,EACd,GACA,GACA,GACA,GACqC;CACrC,IAAIC,KAAkBA,MAAmBC,KAAgBC,GAAgB;EACvE,IAAMC,IAAYD,EAA0CF;EAC5D,IAAIG,KAAY,QAAQA,IAAW,GACjC,OAAO;GAAE,OAAOA;GAAU,UAAUH;EAAe;CAEvD;CACA,OAAO;EAAE,OAAOI;EAAW,UAAUH,KAAgB;CAAM;AAC7D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useListProductsForSelectorQuery as e } from "../../generated/global-operations.js";
|
|
2
|
-
|
|
2
|
+
// src/billing/hooks/useProducts.ts
|
|
3
3
|
function t() {
|
|
4
4
|
let { data: t, loading: n, error: r } = e({ fetchPolicy: "cache-and-network" });
|
|
5
5
|
return {
|
|
@@ -8,7 +8,6 @@ function t() {
|
|
|
8
8
|
error: r
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { t as useProducts };
|
|
13
12
|
|
|
14
13
|
//# sourceMappingURL=useProducts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProducts.js","names":[],"sources":["../../../src/billing/hooks/useProducts.ts"],"sourcesContent":["/**\n * Shared hook for fetching the active platform products list — used to back\n * product selectors (e.g. the addon create form) so admins pick a product by\n * name instead of typing its ID by hand.\n */\nimport { useListProductsForSelectorQuery } from '../../generated/global-operations';\n\nexport interface ProductOption {\n id: string;\n /**\n * The slug is what actually gets stored as Addon/Plan.productID and what\n * every read path (addon/plan browse filters, quota context) matches\n * against — never the catalog row's `id`, which is a different UUID.\n */\n slug: string;\n name: string;\n}\n\ninterface UseProductsResult {\n products: ProductOption[];\n isLoading: boolean;\n error: Error | undefined;\n}\n\nexport function useProducts(): UseProductsResult {\n const { data, loading, error } = useListProductsForSelectorQuery({\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n products: data?.platformProducts.items ?? [],\n isLoading: loading,\n error: error as Error | undefined,\n };\n}\n"],"mappings":";;AAwBA,
|
|
1
|
+
{"version":3,"file":"useProducts.js","names":["useProducts","useListProductsForSelectorQuery","data","loading"],"sources":["../../../src/billing/hooks/useProducts.ts"],"sourcesContent":["/**\n * Shared hook for fetching the active platform products list — used to back\n * product selectors (e.g. the addon create form) so admins pick a product by\n * name instead of typing its ID by hand.\n */\nimport { useListProductsForSelectorQuery } from '../../generated/global-operations';\n\nexport interface ProductOption {\n id: string;\n /**\n * The slug is what actually gets stored as Addon/Plan.productID and what\n * every read path (addon/plan browse filters, quota context) matches\n * against — never the catalog row's `id`, which is a different UUID.\n */\n slug: string;\n name: string;\n}\n\ninterface UseProductsResult {\n products: ProductOption[];\n isLoading: boolean;\n error: Error | undefined;\n}\n\nexport function useProducts(): UseProductsResult {\n const { data, loading, error } = useListProductsForSelectorQuery({\n fetchPolicy: 'cache-and-network',\n });\n\n return {\n products: data?.platformProducts.items ?? [],\n isLoading: loading,\n error: error as Error | undefined,\n };\n}\n"],"mappings":";;AAwBA,SAAgBA,IAAiC;CAC/C,IAAM,EAAE,SAAM,YAAS,aAAUC,EAAgC,EAC/D,aAAa,oBACf,CAAC;CAED,OAAO;EACL,UAAUC,GAAM,iBAAiB,SAAS,CAAC;EAC3C,WAAWC;EACJ;CACT;AACF"}
|
package/dist/billing/index.d.ts
CHANGED
|
@@ -28,4 +28,3 @@
|
|
|
28
28
|
export { BillingRoot } from './BillingRoot';
|
|
29
29
|
export type { BillingRootProps, SubscriptionSummary, PaymentSummary, SubscriptionStatus, InvoiceStatus, PaymentStatus, PaymentMethodType, PaymentGateway, PlanInterval, PricingModel, TransactionType, UsageDimension, UsagePeriod, ViewMode, BillingAccount, Plan, PlanFeature, Subscription, Invoice, InvoiceLineItem, Payment, PaymentMethod, UsageRecord, Transaction, RevenueMetrics, } from './types';
|
|
30
30
|
export { useBilling } from './providers/BillingProvider';
|
|
31
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -7,4 +7,3 @@ import { getNativeProducts, purchaseNativeProduct, acknowledgeNativePurchase, re
|
|
|
7
7
|
export declare function isNativeIAPAvailable(): boolean;
|
|
8
8
|
export { getNativeProducts, purchaseNativeProduct, acknowledgeNativePurchase, restoreNativePurchases, getNativePurchases, installNativeIAP, };
|
|
9
9
|
export type { NativeProduct, NativeTransaction, NativePurchaseType };
|
|
10
|
-
//# sourceMappingURL=native-purchases.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { acknowledgeNativePurchase as e, getNativeProducts as t, getNativePurchases as n, installNativeIAP as r, isNativeIAPAvailable as i, purchaseNativeProduct as a, restoreNativePurchases as o } from "@burdenoff/fe-libs/shared/native/purchases";
|
|
2
|
-
|
|
2
|
+
// src/billing/lib/native-purchases.ts
|
|
3
3
|
function s() {
|
|
4
4
|
if (typeof window > "u") return !1;
|
|
5
5
|
let e = window.Capacitor;
|
|
@@ -13,7 +13,6 @@ function s() {
|
|
|
13
13
|
function c() {
|
|
14
14
|
return i() || s();
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { e as acknowledgeNativePurchase, t as getNativeProducts, n as getNativePurchases, r as installNativeIAP, c as isNativeIAPAvailable, a as purchaseNativeProduct, o as restoreNativePurchases };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=native-purchases.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-purchases.js","names":[],"sources":["../../../src/billing/lib/native-purchases.ts"],"sourcesContent":["/**\n * Native in-app purchase bridge for Apple StoreKit and Google Play Billing.\n *\n * The implementation now lives in the shared layer at\n * `@burdenoff/fe-libs/shared/native` so every app shell and the billing MFE use\n * one source of truth. This module re-exports it under the billing-domain path\n * the checkout hooks already import from, keeping their imports stable.\n *\n * On web the plugin is absent and every call is a safe no-op / empty result, so\n * callers route to the normal Stripe/Razorpay web checkout. After a successful\n * native purchase the receipt / JWS / purchaseToken is sent to the backend via\n * POST /rest/billing/iap/validate for server-side validation and activation.\n */\nimport {\n isNativeIAPAvailable as isSharedNativeIAPAvailable,\n getNativeProducts,\n purchaseNativeProduct,\n acknowledgeNativePurchase,\n restoreNativePurchases,\n getNativePurchases,\n installNativeIAP,\n type NativeProduct,\n type NativeTransaction,\n type NativePurchaseType,\n} from '@burdenoff/fe-libs/shared/native/purchases';\n\nfunction isCapacitorNativeRuntime(): boolean {\n if (typeof window === 'undefined') return false;\n\n const capacitor = (\n window as Window & {\n Capacitor?: {\n isNativePlatform?: () => boolean;\n getPlatform?: () => string;\n platform?: string;\n };\n }\n ).Capacitor;\n if (!capacitor) return window.location.protocol === 'capacitor:';\n\n try {\n if (capacitor.isNativePlatform?.() === true) return true;\n } catch {\n // Fall through to the platform-name check.\n }\n\n const platform = capacitor.getPlatform?.() ?? capacitor.platform;\n return platform === 'ios' || platform === 'android';\n}\n\n/**\n * Capacitor injects its platform global before the shell's custom bridge is\n * installed. Accept both signals so checkout cannot fall back to Razorpay\n * during native boot.\n */\nexport function isNativeIAPAvailable(): boolean {\n return isSharedNativeIAPAvailable() || isCapacitorNativeRuntime();\n}\n\nexport {\n getNativeProducts,\n purchaseNativeProduct,\n acknowledgeNativePurchase,\n restoreNativePurchases,\n getNativePurchases,\n installNativeIAP,\n};\n\nexport type { NativeProduct, NativeTransaction, NativePurchaseType };\n"],"mappings":";;AA0BA,
|
|
1
|
+
{"version":3,"file":"native-purchases.js","names":["isNativeIAPAvailable","isSharedNativeIAPAvailable","isCapacitorNativeRuntime","capacitor","platform","isNativeIAPAvailable$1","isNativeIAPAvailable","acknowledgeNativePurchase","getNativeProducts","getNativePurchases","installNativeIAP","purchaseNativeProduct","restoreNativePurchases"],"sources":["../../../src/billing/lib/native-purchases.ts"],"sourcesContent":["/**\n * Native in-app purchase bridge for Apple StoreKit and Google Play Billing.\n *\n * The implementation now lives in the shared layer at\n * `@burdenoff/fe-libs/shared/native` so every app shell and the billing MFE use\n * one source of truth. This module re-exports it under the billing-domain path\n * the checkout hooks already import from, keeping their imports stable.\n *\n * On web the plugin is absent and every call is a safe no-op / empty result, so\n * callers route to the normal Stripe/Razorpay web checkout. After a successful\n * native purchase the receipt / JWS / purchaseToken is sent to the backend via\n * POST /rest/billing/iap/validate for server-side validation and activation.\n */\nimport {\n isNativeIAPAvailable as isSharedNativeIAPAvailable,\n getNativeProducts,\n purchaseNativeProduct,\n acknowledgeNativePurchase,\n restoreNativePurchases,\n getNativePurchases,\n installNativeIAP,\n type NativeProduct,\n type NativeTransaction,\n type NativePurchaseType,\n} from '@burdenoff/fe-libs/shared/native/purchases';\n\nfunction isCapacitorNativeRuntime(): boolean {\n if (typeof window === 'undefined') return false;\n\n const capacitor = (\n window as Window & {\n Capacitor?: {\n isNativePlatform?: () => boolean;\n getPlatform?: () => string;\n platform?: string;\n };\n }\n ).Capacitor;\n if (!capacitor) return window.location.protocol === 'capacitor:';\n\n try {\n if (capacitor.isNativePlatform?.() === true) return true;\n } catch {\n // Fall through to the platform-name check.\n }\n\n const platform = capacitor.getPlatform?.() ?? capacitor.platform;\n return platform === 'ios' || platform === 'android';\n}\n\n/**\n * Capacitor injects its platform global before the shell's custom bridge is\n * installed. Accept both signals so checkout cannot fall back to Razorpay\n * during native boot.\n */\nexport function isNativeIAPAvailable(): boolean {\n return isSharedNativeIAPAvailable() || isCapacitorNativeRuntime();\n}\n\nexport {\n getNativeProducts,\n purchaseNativeProduct,\n acknowledgeNativePurchase,\n restoreNativePurchases,\n getNativePurchases,\n installNativeIAP,\n};\n\nexport type { NativeProduct, NativeTransaction, NativePurchaseType };\n"],"mappings":";;AA0BA,SAASE,IAAoC;CAC3C,IAAI,OAAO,SAAW,KAAa,OAAO;CAE1C,IAAMC,IACJ,OAOA;CACF,IAAI,CAACA,GAAW,OAAO,OAAO,SAAS,aAAa;CAEpD,IAAI;EACF,IAAIA,EAAU,mBAAmB,MAAM,IAAM,OAAO;CACtD,QAAQ,CAER;CAEA,IAAMC,IAAWD,EAAU,cAAc,KAAKA,EAAU;CACxD,OAAOC,MAAa,SAASA,MAAa;AAC5C;AAOA,SAAgBJ,IAAgC;CAC9C,OAAOC,EAA2B,KAAKC,EAAyB;AAClE"}
|