@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
|
@@ -30,4 +30,3 @@ export declare function formatInvoiceNumber(number: string): string;
|
|
|
30
30
|
* raw byte count — everything else falls back to a plain localized number.
|
|
31
31
|
*/
|
|
32
32
|
export declare function formatQuotaValue(value: number, unit?: string): string;
|
|
33
|
-
//# sourceMappingURL=format.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreditTransactionType as e, InvoiceStatus as t, PlanDuration as n, SubscriptionStatus as r } from "../types/graphql.js";
|
|
2
2
|
import { formatBytes as i, formatBytes as a, formatCurrency as o, formatDate as s, formatDateTime as c, formatNumber as l, formatPercentage as u, formatRelativeTime as d } from "@burdenoff/fe-libs/shared/utils";
|
|
3
|
-
|
|
3
|
+
// src/billing/shared/utils/format.ts
|
|
4
4
|
function f(e, t = "USD", n = "en-US") {
|
|
5
5
|
return t.toUpperCase() === "CREDITS" ? p(e) : o(e, t, n);
|
|
6
6
|
}
|
|
@@ -53,7 +53,6 @@ function y(e) {
|
|
|
53
53
|
function b(e, t) {
|
|
54
54
|
return t === "bytes" ? i(e) : e.toLocaleString();
|
|
55
55
|
}
|
|
56
|
-
//#endregion
|
|
57
56
|
export { a as formatBytes, v as formatCreditTransactionType, p as formatCredits, f as formatCurrency, s as formatDate, c as formatDateTime, y as formatInvoiceNumber, h as formatInvoiceStatus, l as formatNumber, u as formatPercentage, g as formatPlanDuration, _ as formatPlanDurationLabel, b as formatQuotaValue, d as formatRelativeTime, m as formatSubscriptionStatus };
|
|
58
57
|
|
|
59
58
|
//# sourceMappingURL=format.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","names":[],"sources":["../../../../src/billing/shared/utils/format.ts"],"sourcesContent":["/**\n * Formatting utilities for the billing module\n *\n * Re-exports common formatting utilities from fe-libs and adds billing-specific ones.\n */\n\nimport {\n SubscriptionStatus,\n InvoiceStatus,\n PaymentStatus,\n ChargeStatus,\n QuotaStatus,\n PlanDuration,\n PaymentMethodType,\n TransactionType,\n CreditTransactionType,\n} from '../types';\n\n// Re-export common formatting utilities from fe-libs\nexport {\n formatCurrency as formatCurrencyBase,\n formatCurrencyCompact as formatCurrencyCompactBase,\n formatDate,\n formatDateTime,\n formatRelativeTime,\n formatDuration,\n formatNumber,\n formatPercentage,\n formatBytes,\n formatCompactNumber,\n} from '@burdenoff/fe-libs/shared/utils';\n\n// Import for internal use\nimport {\n formatCurrency as formatCurrencyBase,\n formatCurrencyCompact as formatCurrencyCompactBase,\n formatBytes,\n} from '@burdenoff/fe-libs/shared/utils';\n\n// ============================================================================\n// Billing-specific Currency Formatting (handles CREDITS)\n// ============================================================================\n\nexport function formatCurrency(amount: number, currency = 'USD', locale = 'en-US'): string {\n // Handle CREDITS specially - credits are not a real currency\n if (currency.toUpperCase() === 'CREDITS') {\n return formatCredits(amount);\n }\n return formatCurrencyBase(amount, currency, locale);\n}\n\n/**\n * Format credits as \"X Credits\" or \"X.XX Credits\"\n * Credits are always displayed as a unit count, not as currency\n */\nexport function formatCredits(amount: number): string {\n // For whole numbers, show without decimals\n if (Number.isInteger(amount)) {\n return `${amount.toLocaleString()} Credits`;\n }\n // For fractional credits, show up to 2 decimals\n return `${amount.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 2 })} Credits`;\n}\n\nexport function formatCurrencyCompact(amount: number, currency = 'USD'): string {\n if (currency.toUpperCase() === 'CREDITS') {\n return formatCredits(amount);\n }\n return formatCurrencyCompactBase(amount, currency);\n}\n\n// ============================================================================\n// Status Formatting\n// ============================================================================\n\nexport function formatSubscriptionStatus(status: SubscriptionStatus): string {\n const labels: Record<SubscriptionStatus, string> = {\n [SubscriptionStatus.ACTIVE]: 'Active',\n [SubscriptionStatus.CANCELED]: 'Canceled',\n [SubscriptionStatus.EXPIRED]: 'Expired',\n [SubscriptionStatus.UPGRADED]: 'Upgraded',\n };\n return labels[status] || status;\n}\n\nexport function formatInvoiceStatus(status: InvoiceStatus): string {\n const labels: Record<InvoiceStatus, string> = {\n [InvoiceStatus.DRAFT]: 'Draft',\n [InvoiceStatus.OPEN]: 'Open',\n [InvoiceStatus.PAID]: 'Paid',\n [InvoiceStatus.VOID]: 'Void',\n [InvoiceStatus.UNCOLLECTIBLE]: 'Uncollectible',\n };\n return labels[status] || status;\n}\n\nexport function formatPaymentStatus(status: PaymentStatus): string {\n const labels: Record<PaymentStatus, string> = {\n [PaymentStatus.PENDING]: 'Pending',\n [PaymentStatus.SUCCEEDED]: 'Succeeded',\n [PaymentStatus.FAILED]: 'Failed',\n [PaymentStatus.CANCELED]: 'Canceled',\n [PaymentStatus.REFUNDED]: 'Refunded',\n };\n return labels[status] || status;\n}\n\nexport function formatChargeStatus(status: ChargeStatus): string {\n const labels: Record<ChargeStatus, string> = {\n [ChargeStatus.PENDING]: 'Pending',\n [ChargeStatus.SUCCEEDED]: 'Succeeded',\n [ChargeStatus.FAILED]: 'Failed',\n [ChargeStatus.REFUNDED]: 'Refunded',\n };\n return labels[status] || status;\n}\n\nexport function formatQuotaStatus(status: QuotaStatus): string {\n const labels: Record<QuotaStatus, string> = {\n [QuotaStatus.HEALTHY]: 'Healthy',\n [QuotaStatus.WARNING]: 'Warning',\n [QuotaStatus.CRITICAL]: 'Critical',\n [QuotaStatus.EXHAUSTED]: 'Exhausted',\n [QuotaStatus.INACTIVE]: 'Inactive',\n };\n return labels[status] || status;\n}\n\n// ============================================================================\n// Plan & Duration Formatting\n// ============================================================================\n\nexport function formatPlanDuration(duration: PlanDuration): string {\n const labels: Record<PlanDuration, string> = {\n [PlanDuration.MONTHLY]: 'month',\n [PlanDuration.YEARLY]: 'year',\n };\n return labels[duration] || duration;\n}\n\nexport function formatPlanDurationLabel(duration: PlanDuration): string {\n const labels: Record<PlanDuration, string> = {\n [PlanDuration.MONTHLY]: 'Monthly',\n [PlanDuration.YEARLY]: 'Yearly',\n };\n return labels[duration] || duration;\n}\n\nexport function formatPlanPrice(price: number, currency: string, duration: PlanDuration): string {\n return `${formatCurrency(price, currency)}/${formatPlanDuration(duration)}`;\n}\n\n// ============================================================================\n// Payment Method Formatting\n// ============================================================================\n\nexport function formatPaymentMethodType(type: PaymentMethodType): string {\n const labels: Record<PaymentMethodType, string> = {\n [PaymentMethodType.CREDIT_CARD]: 'Credit Card',\n [PaymentMethodType.DEBIT_CARD]: 'Debit Card',\n [PaymentMethodType.BANK_TRANSFER]: 'Bank Transfer',\n [PaymentMethodType.PAYPAL]: 'PayPal',\n [PaymentMethodType.CRYPTO]: 'Cryptocurrency',\n [PaymentMethodType.WALLET]: 'Wallet',\n [PaymentMethodType.NETBANKING]: 'Netbanking',\n };\n return labels[type] || type;\n}\n\nexport function formatCardBrand(brand?: string): string {\n if (!brand) return 'Card';\n return brand.charAt(0).toUpperCase() + brand.slice(1).toLowerCase();\n}\n\nexport function formatCardNumber(last4?: string): string {\n if (!last4) return '****';\n return `•••• ${last4}`;\n}\n\nexport function formatCardExpiry(month?: number, year?: number): string {\n if (!month || !year) return '';\n return `${month.toString().padStart(2, '0')}/${year.toString().slice(-2)}`;\n}\n\n// ============================================================================\n// Transaction Formatting\n// ============================================================================\n\nexport function formatTransactionType(type: TransactionType): string {\n const labels: Record<TransactionType, string> = {\n [TransactionType.PAYMENT]: 'Payment',\n [TransactionType.REFUND]: 'Refund',\n [TransactionType.ADJUSTMENT]: 'Adjustment',\n };\n return labels[type] || type;\n}\n\nexport function formatCreditTransactionType(type: CreditTransactionType): string {\n const labels: Record<CreditTransactionType, string> = {\n [CreditTransactionType.PURCHASE]: 'Purchase',\n [CreditTransactionType.USAGE]: 'Usage',\n [CreditTransactionType.ADJUSTMENT]: 'Earned',\n [CreditTransactionType.GRANTED]: 'Granted',\n };\n return labels[type] || type;\n}\n\n// ============================================================================\n// Text Formatting\n// ============================================================================\n\nexport function truncateText(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text;\n return `${text.slice(0, maxLength - 3)}...`;\n}\n\nexport function capitalizeFirst(text: string): string {\n if (!text) return '';\n return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();\n}\n\nexport function formatInvoiceNumber(number: string): string {\n return `#${number}`;\n}\n\n// ============================================================================\n// Quota Value Formatting\n// ============================================================================\n\n/**\n * Format a quota's total value for display, unit-aware. Byte-denominated\n * quotas (storage, upload caps) render as MB/GB via formatBytes instead of a\n * raw byte count — everything else falls back to a plain localized number.\n */\nexport function formatQuotaValue(value: number, unit?: string): string {\n if (unit === 'bytes') return formatBytes(value);\n return value.toLocaleString();\n}\n"],"mappings":";;;AA2CA,
|
|
1
|
+
{"version":3,"file":"format.js","names":["formatCurrency","formatCurrencyBase","formatBytes$1","formatCurrency$1","currency","formatCredits","amount","formatCurrency","locale","formatSubscriptionStatus","SubscriptionStatus","status","formatInvoiceStatus","InvoiceStatus","formatPlanDuration","PlanDuration","duration","formatPlanDurationLabel","formatCreditTransactionType","CreditTransactionType","type","formatInvoiceNumber","number","formatQuotaValue","unit","formatBytes","value","formatDate","formatDateTime","formatNumber","formatPercentage","formatRelativeTime"],"sources":["../../../../src/billing/shared/utils/format.ts"],"sourcesContent":["/**\n * Formatting utilities for the billing module\n *\n * Re-exports common formatting utilities from fe-libs and adds billing-specific ones.\n */\n\nimport {\n SubscriptionStatus,\n InvoiceStatus,\n PaymentStatus,\n ChargeStatus,\n QuotaStatus,\n PlanDuration,\n PaymentMethodType,\n TransactionType,\n CreditTransactionType,\n} from '../types';\n\n// Re-export common formatting utilities from fe-libs\nexport {\n formatCurrency as formatCurrencyBase,\n formatCurrencyCompact as formatCurrencyCompactBase,\n formatDate,\n formatDateTime,\n formatRelativeTime,\n formatDuration,\n formatNumber,\n formatPercentage,\n formatBytes,\n formatCompactNumber,\n} from '@burdenoff/fe-libs/shared/utils';\n\n// Import for internal use\nimport {\n formatCurrency as formatCurrencyBase,\n formatCurrencyCompact as formatCurrencyCompactBase,\n formatBytes,\n} from '@burdenoff/fe-libs/shared/utils';\n\n// ============================================================================\n// Billing-specific Currency Formatting (handles CREDITS)\n// ============================================================================\n\nexport function formatCurrency(amount: number, currency = 'USD', locale = 'en-US'): string {\n // Handle CREDITS specially - credits are not a real currency\n if (currency.toUpperCase() === 'CREDITS') {\n return formatCredits(amount);\n }\n return formatCurrencyBase(amount, currency, locale);\n}\n\n/**\n * Format credits as \"X Credits\" or \"X.XX Credits\"\n * Credits are always displayed as a unit count, not as currency\n */\nexport function formatCredits(amount: number): string {\n // For whole numbers, show without decimals\n if (Number.isInteger(amount)) {\n return `${amount.toLocaleString()} Credits`;\n }\n // For fractional credits, show up to 2 decimals\n return `${amount.toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 2 })} Credits`;\n}\n\nexport function formatCurrencyCompact(amount: number, currency = 'USD'): string {\n if (currency.toUpperCase() === 'CREDITS') {\n return formatCredits(amount);\n }\n return formatCurrencyCompactBase(amount, currency);\n}\n\n// ============================================================================\n// Status Formatting\n// ============================================================================\n\nexport function formatSubscriptionStatus(status: SubscriptionStatus): string {\n const labels: Record<SubscriptionStatus, string> = {\n [SubscriptionStatus.ACTIVE]: 'Active',\n [SubscriptionStatus.CANCELED]: 'Canceled',\n [SubscriptionStatus.EXPIRED]: 'Expired',\n [SubscriptionStatus.UPGRADED]: 'Upgraded',\n };\n return labels[status] || status;\n}\n\nexport function formatInvoiceStatus(status: InvoiceStatus): string {\n const labels: Record<InvoiceStatus, string> = {\n [InvoiceStatus.DRAFT]: 'Draft',\n [InvoiceStatus.OPEN]: 'Open',\n [InvoiceStatus.PAID]: 'Paid',\n [InvoiceStatus.VOID]: 'Void',\n [InvoiceStatus.UNCOLLECTIBLE]: 'Uncollectible',\n };\n return labels[status] || status;\n}\n\nexport function formatPaymentStatus(status: PaymentStatus): string {\n const labels: Record<PaymentStatus, string> = {\n [PaymentStatus.PENDING]: 'Pending',\n [PaymentStatus.SUCCEEDED]: 'Succeeded',\n [PaymentStatus.FAILED]: 'Failed',\n [PaymentStatus.CANCELED]: 'Canceled',\n [PaymentStatus.REFUNDED]: 'Refunded',\n };\n return labels[status] || status;\n}\n\nexport function formatChargeStatus(status: ChargeStatus): string {\n const labels: Record<ChargeStatus, string> = {\n [ChargeStatus.PENDING]: 'Pending',\n [ChargeStatus.SUCCEEDED]: 'Succeeded',\n [ChargeStatus.FAILED]: 'Failed',\n [ChargeStatus.REFUNDED]: 'Refunded',\n };\n return labels[status] || status;\n}\n\nexport function formatQuotaStatus(status: QuotaStatus): string {\n const labels: Record<QuotaStatus, string> = {\n [QuotaStatus.HEALTHY]: 'Healthy',\n [QuotaStatus.WARNING]: 'Warning',\n [QuotaStatus.CRITICAL]: 'Critical',\n [QuotaStatus.EXHAUSTED]: 'Exhausted',\n [QuotaStatus.INACTIVE]: 'Inactive',\n };\n return labels[status] || status;\n}\n\n// ============================================================================\n// Plan & Duration Formatting\n// ============================================================================\n\nexport function formatPlanDuration(duration: PlanDuration): string {\n const labels: Record<PlanDuration, string> = {\n [PlanDuration.MONTHLY]: 'month',\n [PlanDuration.YEARLY]: 'year',\n };\n return labels[duration] || duration;\n}\n\nexport function formatPlanDurationLabel(duration: PlanDuration): string {\n const labels: Record<PlanDuration, string> = {\n [PlanDuration.MONTHLY]: 'Monthly',\n [PlanDuration.YEARLY]: 'Yearly',\n };\n return labels[duration] || duration;\n}\n\nexport function formatPlanPrice(price: number, currency: string, duration: PlanDuration): string {\n return `${formatCurrency(price, currency)}/${formatPlanDuration(duration)}`;\n}\n\n// ============================================================================\n// Payment Method Formatting\n// ============================================================================\n\nexport function formatPaymentMethodType(type: PaymentMethodType): string {\n const labels: Record<PaymentMethodType, string> = {\n [PaymentMethodType.CREDIT_CARD]: 'Credit Card',\n [PaymentMethodType.DEBIT_CARD]: 'Debit Card',\n [PaymentMethodType.BANK_TRANSFER]: 'Bank Transfer',\n [PaymentMethodType.PAYPAL]: 'PayPal',\n [PaymentMethodType.CRYPTO]: 'Cryptocurrency',\n [PaymentMethodType.WALLET]: 'Wallet',\n [PaymentMethodType.NETBANKING]: 'Netbanking',\n };\n return labels[type] || type;\n}\n\nexport function formatCardBrand(brand?: string): string {\n if (!brand) return 'Card';\n return brand.charAt(0).toUpperCase() + brand.slice(1).toLowerCase();\n}\n\nexport function formatCardNumber(last4?: string): string {\n if (!last4) return '****';\n return `•••• ${last4}`;\n}\n\nexport function formatCardExpiry(month?: number, year?: number): string {\n if (!month || !year) return '';\n return `${month.toString().padStart(2, '0')}/${year.toString().slice(-2)}`;\n}\n\n// ============================================================================\n// Transaction Formatting\n// ============================================================================\n\nexport function formatTransactionType(type: TransactionType): string {\n const labels: Record<TransactionType, string> = {\n [TransactionType.PAYMENT]: 'Payment',\n [TransactionType.REFUND]: 'Refund',\n [TransactionType.ADJUSTMENT]: 'Adjustment',\n };\n return labels[type] || type;\n}\n\nexport function formatCreditTransactionType(type: CreditTransactionType): string {\n const labels: Record<CreditTransactionType, string> = {\n [CreditTransactionType.PURCHASE]: 'Purchase',\n [CreditTransactionType.USAGE]: 'Usage',\n [CreditTransactionType.ADJUSTMENT]: 'Earned',\n [CreditTransactionType.GRANTED]: 'Granted',\n };\n return labels[type] || type;\n}\n\n// ============================================================================\n// Text Formatting\n// ============================================================================\n\nexport function truncateText(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text;\n return `${text.slice(0, maxLength - 3)}...`;\n}\n\nexport function capitalizeFirst(text: string): string {\n if (!text) return '';\n return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();\n}\n\nexport function formatInvoiceNumber(number: string): string {\n return `#${number}`;\n}\n\n// ============================================================================\n// Quota Value Formatting\n// ============================================================================\n\n/**\n * Format a quota's total value for display, unit-aware. Byte-denominated\n * quotas (storage, upload caps) render as MB/GB via formatBytes instead of a\n * raw byte count — everything else falls back to a plain localized number.\n */\nexport function formatQuotaValue(value: number, unit?: string): string {\n if (unit === 'bytes') return formatBytes(value);\n return value.toLocaleString();\n}\n"],"mappings":";;;AA2CA,SAAgBA,EAAe,GAAgB,IAAW,OAAO,IAAS,SAAiB;CAKzF,OAHII,EAAS,YAAY,MAAM,YACtBC,EAAcC,CAAM,IAEtBL,EAAmBK,GAAQF,GAAUI,CAAM;AACpD;AAMA,SAAgBH,EAAc,GAAwB;CAMpD,OAJI,OAAO,UAAUC,CAAM,IAClB,GAAGA,EAAO,eAAe,EAAE,YAG7B,GAAGA,EAAO,eAAe,KAAA,GAAW;EAAE,uBAAuB;EAAG,uBAAuB;CAAE,CAAC,EAAE;AACrG;AAaA,SAAgBG,EAAyB,GAAoC;CAO3E,OAAO;GALJC,EAAmB,SAAS;GAC5BA,EAAmB,WAAW;GAC9BA,EAAmB,UAAU;GAC7BA,EAAmB,WAAW;CAE1B,EAAOC,MAAWA;AAC3B;AAEA,SAAgBC,EAAoB,GAA+B;CAQjE,OAAO;GANJC,EAAc,QAAQ;GACtBA,EAAc,OAAO;GACrBA,EAAc,OAAO;GACrBA,EAAc,OAAO;GACrBA,EAAc,gBAAgB;CAE1B,EAAOF,MAAWA;AAC3B;AAsCA,SAAgBG,EAAmB,GAAgC;CAKjE,OAAO;GAHJC,EAAa,UAAU;GACvBA,EAAa,SAAS;CAElB,EAAOC,MAAaA;AAC7B;AAEA,SAAgBC,EAAwB,GAAgC;CAKtE,OAAO;GAHJF,EAAa,UAAU;GACvBA,EAAa,SAAS;CAElB,EAAOC,MAAaA;AAC7B;AAmDA,SAAgBE,EAA4B,GAAqC;CAO/E,OAAO;GALJC,EAAsB,WAAW;GACjCA,EAAsB,QAAQ;GAC9BA,EAAsB,aAAa;GACnCA,EAAsB,UAAU;CAE5B,EAAOC,MAASA;AACzB;AAgBA,SAAgBC,EAAoB,GAAwB;CAC1D,OAAO,IAAIC;AACb;AAWA,SAAgBC,EAAiB,GAAe,GAAuB;CAErE,OADIC,MAAS,UAAgBC,EAAYC,CAAK,IACvCA,EAAM,eAAe;AAC9B"}
|
|
@@ -4,6 +4,8 @@ export declare function toGraphqlQuery(query: GatewayGraphqlDocument): string;
|
|
|
4
4
|
interface GatewayGraphqlRequestOptions<TVariables> {
|
|
5
5
|
apiGatewayUrl?: string;
|
|
6
6
|
authToken?: string;
|
|
7
|
+
/** The acting user, when known. Mutations default to the token subject. */
|
|
8
|
+
actorId?: string;
|
|
7
9
|
orgId?: string;
|
|
8
10
|
query: GatewayGraphqlDocument;
|
|
9
11
|
variables?: TVariables;
|
|
@@ -11,4 +13,3 @@ interface GatewayGraphqlRequestOptions<TVariables> {
|
|
|
11
13
|
export declare function normalizeGlobalGatewayBaseUrl(apiGatewayUrl?: string, legacyDirectEndpoints?: string[]): string | undefined;
|
|
12
14
|
export declare function gatewayGraphqlRequest<TData, TVariables = Record<string, unknown>>(options: GatewayGraphqlRequestOptions<TVariables>): Promise<TData>;
|
|
13
15
|
export {};
|
|
14
|
-
//# sourceMappingURL=gatewayGraphql.d.ts.map
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { actorBoundGraphqlFetch as e } from "./pinnedRequest.js";
|
|
2
2
|
import { print as t } from "graphql";
|
|
3
|
-
|
|
3
|
+
// src/billing/shared/utils/gatewayGraphql.ts
|
|
4
4
|
function n(e) {
|
|
5
5
|
return typeof e == "string" ? e : t(e);
|
|
6
6
|
}
|
|
7
7
|
var r = "/global/graphql";
|
|
8
8
|
function i(e, t = []) {
|
|
9
9
|
let n = e?.trim();
|
|
10
|
-
if (
|
|
10
|
+
if (n && !n.startsWith("/") && !t.some((e) => n.includes(e))) return n.endsWith(r) ? n.slice(0, -15) || void 0 : n;
|
|
11
11
|
}
|
|
12
12
|
async function a(t) {
|
|
13
13
|
let r = await e({
|
|
14
14
|
gateway: "global",
|
|
15
15
|
baseUrl: i(t.apiGatewayUrl),
|
|
16
16
|
authToken: t.authToken,
|
|
17
|
+
actorId: t.actorId,
|
|
17
18
|
organizationId: t.orgId,
|
|
18
19
|
query: n(t.query),
|
|
19
20
|
variables: t.variables
|
|
@@ -21,7 +22,6 @@ async function a(t) {
|
|
|
21
22
|
if (r.errors?.length || !r.data) throw Error(r.errors?.[0]?.message || "Gateway GraphQL request failed");
|
|
22
23
|
return r.data;
|
|
23
24
|
}
|
|
24
|
-
//#endregion
|
|
25
25
|
export { a as gatewayGraphqlRequest, i as normalizeGlobalGatewayBaseUrl, n as toGraphqlQuery };
|
|
26
26
|
|
|
27
27
|
//# sourceMappingURL=gatewayGraphql.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gatewayGraphql.js","names":[],"sources":["../../../../src/billing/shared/utils/gatewayGraphql.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"gatewayGraphql.js","names":["toGraphqlQuery","query","print","GLOBAL_GRAPHQL_PATH","normalizeGlobalGatewayBaseUrl","trimmedUrl","apiGatewayUrl","endpoint","gatewayGraphqlRequest","response","actorBoundGraphqlFetch","options"],"sources":["../../../../src/billing/shared/utils/gatewayGraphql.ts"],"sourcesContent":["import { print, type DocumentNode } from 'graphql';\n\nimport { actorBoundGraphqlFetch } from './pinnedRequest';\n\nexport type GatewayGraphqlDocument = string | DocumentNode;\n\nexport function toGraphqlQuery(query: GatewayGraphqlDocument): string {\n return typeof query === 'string' ? query : print(query);\n}\n\ninterface GatewayGraphqlRequestOptions<TVariables> {\n apiGatewayUrl?: string;\n authToken?: string;\n /** The acting user, when known. Mutations default to the token subject. */\n actorId?: string;\n orgId?: string;\n query: GatewayGraphqlDocument;\n variables?: TVariables;\n}\n\nconst GLOBAL_GRAPHQL_PATH = '/global/graphql';\n\nexport function normalizeGlobalGatewayBaseUrl(\n apiGatewayUrl?: string,\n legacyDirectEndpoints: string[] = []\n): string | undefined {\n const trimmedUrl = apiGatewayUrl?.trim();\n\n if (!trimmedUrl || trimmedUrl.startsWith('/')) {\n return undefined;\n }\n\n if (legacyDirectEndpoints.some((endpoint) => trimmedUrl.includes(endpoint))) {\n return undefined;\n }\n\n if (trimmedUrl.endsWith(GLOBAL_GRAPHQL_PATH)) {\n return trimmedUrl.slice(0, -GLOBAL_GRAPHQL_PATH.length) || undefined;\n }\n\n return trimmedUrl;\n}\n\nexport async function gatewayGraphqlRequest<TData, TVariables = Record<string, unknown>>(\n options: GatewayGraphqlRequestOptions<TVariables>\n): Promise<TData> {\n const response = await actorBoundGraphqlFetch<TData>({\n gateway: 'global',\n baseUrl: normalizeGlobalGatewayBaseUrl(options.apiGatewayUrl),\n authToken: options.authToken,\n actorId: options.actorId,\n organizationId: options.orgId,\n query: toGraphqlQuery(options.query),\n variables: options.variables as Record<string, unknown> | undefined,\n });\n\n if (response.errors?.length || !response.data) {\n throw new Error(response.errors?.[0]?.message || 'Gateway GraphQL request failed');\n }\n\n return response.data;\n}\n"],"mappings":";;;AAMA,SAAgBA,EAAe,GAAuC;CACpE,OAAO,OAAOC,KAAU,WAAWA,IAAQC,EAAMD,CAAK;AACxD;AAYA,IAAME,IAAsB;AAE5B,SAAgBC,EACd,GACA,IAAkC,CAAC,GACf;CACpB,IAAMC,IAAaC,GAAe,KAAK;CAEvC,IAAKD,KAAc,GAAW,WAAW,GAAG,KAIxC,GAAsB,MAAM,MAAaA,EAAW,SAASE,CAAQ,CAAC,GAQ1E,OAJIF,EAAW,SAASF,CAAmB,IAClCE,EAAW,MAAM,GAAG,GAA2B,KAAK,KAAA,IAGtDA;AACT;AAEA,eAAsBG,EACpB,GACgB;CAChB,IAAMC,IAAW,MAAMC,EAA8B;EACnD,SAAS;EACT,SAASN,EAA8BO,EAAQ,aAAa;EAC5D,WAAWA,EAAQ;EACnB,SAASA,EAAQ;EACjB,gBAAgBA,EAAQ;EACxB,OAAOX,EAAeW,EAAQ,KAAK;EACnC,WAAWA,EAAQ;CACrB,CAAC;CAED,IAAIF,EAAS,QAAQ,UAAU,CAACA,EAAS,MACvC,MAAU,MAAMA,EAAS,SAAS,EAAE,EAAE,WAAW,gCAAgC;CAGnF,OAAOA,EAAS;AAClB"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./tokens.js";
|
|
2
|
-
import "./format.js";
|
|
3
|
-
import "./status.js";
|
|
4
|
-
import "./error.js";
|
|
5
|
-
import "./paymentTheme.js";
|
|
6
|
-
import "./
|
|
7
|
-
import "./directBillingGraphql.js";
|
|
1
|
+
import { alertTokens as e, categoryTokens as t, getProgressTokens as n, getStatusBadgeTokens as r, getStatusTokens as i, progressTokens as a, statusTokens as o } from "./tokens.js";
|
|
2
|
+
import { formatBytes as s, formatCreditTransactionType as c, formatCredits as l, formatCurrency as u, formatDate as d, formatDateTime as f, formatInvoiceNumber as p, formatInvoiceStatus as m, formatNumber as h, formatPercentage as g, formatPlanDuration as _, formatPlanDurationLabel as v, formatQuotaValue as y, formatRelativeTime as b, formatSubscriptionStatus as x } from "./format.js";
|
|
3
|
+
import { getCreditTransactionStatusColor as S, getInvoiceStatusColor as C, getQuotaProgressColor as w, getStatusBadgeClasses as T, getSubscriptionStatusColor as E, getTransactionStatusColor as D } from "./status.js";
|
|
4
|
+
import { isServerError as O } from "./error.js";
|
|
5
|
+
import { getPaymentProviderThemeColor as k, getPaymentThemePalette as A, getStripeCardElementStyle as j } from "./paymentTheme.js";
|
|
6
|
+
import { directBillingGraphqlRequest as M, resolveDirectBillingGraphqlUrl as N } from "./directBillingGraphql.js";
|
|
8
7
|
import "./directActivityGraphql.js";
|
|
9
|
-
import "./
|
|
8
|
+
import { gatewayGraphqlRequest as P, normalizeGlobalGatewayBaseUrl as F, toGraphqlQuery as I } from "./gatewayGraphql.js";
|
|
9
|
+
import { getPlanFeatureQuantity as L, getPlanFeatureUnit as R, getQuotaDisplayName as z, humanizeQuotaName as B } from "./planFeatureQuantity.js";
|
|
10
|
+
export { e as alertTokens, t as categoryTokens, M as directBillingGraphqlRequest, s as formatBytes, c as formatCreditTransactionType, l as formatCredits, u as formatCurrency, d as formatDate, f as formatDateTime, p as formatInvoiceNumber, m as formatInvoiceStatus, h as formatNumber, g as formatPercentage, _ as formatPlanDuration, v as formatPlanDurationLabel, y as formatQuotaValue, b as formatRelativeTime, x as formatSubscriptionStatus, P as gatewayGraphqlRequest, S as getCreditTransactionStatusColor, C as getInvoiceStatusColor, k as getPaymentProviderThemeColor, A as getPaymentThemePalette, L as getPlanFeatureQuantity, R as getPlanFeatureUnit, n as getProgressTokens, z as getQuotaDisplayName, w as getQuotaProgressColor, T as getStatusBadgeClasses, r as getStatusBadgeTokens, i as getStatusTokens, j as getStripeCardElementStyle, E as getSubscriptionStatusColor, D as getTransactionStatusColor, B as humanizeQuotaName, O as isServerError, F as normalizeGlobalGatewayBaseUrl, a as progressTokens, N as resolveDirectBillingGraphqlUrl, o as statusTokens, I as toGraphqlQuery };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// src/billing/shared/utils/navigation.ts
|
|
2
2
|
function e(e, t) {
|
|
3
3
|
return t ? `${e}${e.includes("?") ? "&" : "?"}billingAccountId=${encodeURIComponent(t)}` : e;
|
|
4
4
|
}
|
|
5
|
-
//#endregion
|
|
6
5
|
export { e as withBillingAccountId };
|
|
7
6
|
|
|
8
7
|
//# sourceMappingURL=navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","names":[],"sources":["../../../../src/billing/shared/utils/navigation.ts"],"sourcesContent":["export function withBillingAccountId(path: string, billingAccountId?: string | null): string {\n if (!billingAccountId) return path;\n\n const separator = path.includes('?') ? '&' : '?';\n return `${path}${separator}billingAccountId=${encodeURIComponent(billingAccountId)}`;\n}\n"],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"navigation.js","names":["withBillingAccountId","billingAccountId","path"],"sources":["../../../../src/billing/shared/utils/navigation.ts"],"sourcesContent":["export function withBillingAccountId(path: string, billingAccountId?: string | null): string {\n if (!billingAccountId) return path;\n\n const separator = path.includes('?') ? '&' : '?';\n return `${path}${separator}billingAccountId=${encodeURIComponent(billingAccountId)}`;\n}\n"],"mappings":";AAAA,SAAgBA,EAAqB,GAAc,GAA0C;CAI3F,OAHKC,IAGE,GAAGC,IADQA,EAAK,SAAS,GAAG,IAAI,MAAM,IAClB,mBAAmB,mBAAmBD,CAAgB,MAHnDC;AAIhC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// src/billing/shared/utils/paymentTheme.ts
|
|
2
2
|
function e(e) {
|
|
3
|
-
if (
|
|
3
|
+
if (typeof window < "u") return window.getComputedStyle(document.documentElement).getPropertyValue(e).trim() || void 0;
|
|
4
4
|
}
|
|
5
5
|
function t() {
|
|
6
6
|
return {
|
|
@@ -26,7 +26,6 @@ function n(e = "Inter, system-ui, sans-serif") {
|
|
|
26
26
|
function r() {
|
|
27
27
|
return t().primaryColor;
|
|
28
28
|
}
|
|
29
|
-
//#endregion
|
|
30
29
|
export { r as getPaymentProviderThemeColor, t as getPaymentThemePalette, n as getStripeCardElementStyle };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=paymentTheme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymentTheme.js","names":[],"sources":["../../../../src/billing/shared/utils/paymentTheme.ts"],"sourcesContent":["/**\n * Utilities for adapting third-party payment widgets to the current semantic theme.\n */\n\ninterface PaymentThemePalette {\n textColor?: string;\n placeholderColor?: string;\n mutedColor?: string;\n errorColor?: string;\n primaryColor?: string;\n}\n\nfunction readCssVar(name: string): string | undefined {\n if (typeof window === 'undefined') {\n return undefined;\n }\n\n const value = window.getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || undefined;\n}\n\nexport function getPaymentThemePalette(): PaymentThemePalette {\n return {\n textColor: readCssVar('--color-text-primary'),\n placeholderColor: readCssVar('--color-text-placeholder'),\n mutedColor: readCssVar('--color-text-secondary'),\n errorColor: readCssVar('--color-status-error-bg'),\n primaryColor: readCssVar('--color-action-primary-bg'),\n };\n}\n\nexport function getStripeCardElementStyle(fontFamily = 'Inter, system-ui, sans-serif') {\n const palette = getPaymentThemePalette();\n\n const base: Record<string, unknown> = {\n fontSize: '16px',\n fontFamily,\n };\n\n if (palette.textColor) {\n base.color = palette.textColor;\n }\n\n if (palette.placeholderColor) {\n base['::placeholder'] = { color: palette.placeholderColor };\n }\n\n if (palette.mutedColor) {\n base.iconColor = palette.mutedColor;\n }\n\n const invalid: Record<string, unknown> = {};\n\n if (palette.errorColor) {\n invalid.color = palette.errorColor;\n invalid.iconColor = palette.errorColor;\n }\n\n return {\n base,\n invalid,\n };\n}\n\nexport function getPaymentProviderThemeColor(): string | undefined {\n return getPaymentThemePalette().primaryColor;\n}\n"],"mappings":";AAYA,
|
|
1
|
+
{"version":3,"file":"paymentTheme.js","names":["readCssVar","name","getPaymentThemePalette","getStripeCardElementStyle","palette","base","invalid","getPaymentProviderThemeColor"],"sources":["../../../../src/billing/shared/utils/paymentTheme.ts"],"sourcesContent":["/**\n * Utilities for adapting third-party payment widgets to the current semantic theme.\n */\n\ninterface PaymentThemePalette {\n textColor?: string;\n placeholderColor?: string;\n mutedColor?: string;\n errorColor?: string;\n primaryColor?: string;\n}\n\nfunction readCssVar(name: string): string | undefined {\n if (typeof window === 'undefined') {\n return undefined;\n }\n\n const value = window.getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || undefined;\n}\n\nexport function getPaymentThemePalette(): PaymentThemePalette {\n return {\n textColor: readCssVar('--color-text-primary'),\n placeholderColor: readCssVar('--color-text-placeholder'),\n mutedColor: readCssVar('--color-text-secondary'),\n errorColor: readCssVar('--color-status-error-bg'),\n primaryColor: readCssVar('--color-action-primary-bg'),\n };\n}\n\nexport function getStripeCardElementStyle(fontFamily = 'Inter, system-ui, sans-serif') {\n const palette = getPaymentThemePalette();\n\n const base: Record<string, unknown> = {\n fontSize: '16px',\n fontFamily,\n };\n\n if (palette.textColor) {\n base.color = palette.textColor;\n }\n\n if (palette.placeholderColor) {\n base['::placeholder'] = { color: palette.placeholderColor };\n }\n\n if (palette.mutedColor) {\n base.iconColor = palette.mutedColor;\n }\n\n const invalid: Record<string, unknown> = {};\n\n if (palette.errorColor) {\n invalid.color = palette.errorColor;\n invalid.iconColor = palette.errorColor;\n }\n\n return {\n base,\n invalid,\n };\n}\n\nexport function getPaymentProviderThemeColor(): string | undefined {\n return getPaymentThemePalette().primaryColor;\n}\n"],"mappings":";AAYA,SAASA,EAAW,GAAkC;CACpD,IAAI,OAAO,SAAW,KAKtB,OADc,OAAO,iBAAiB,SAAS,eAAe,CAAC,CAAC,iBAAiBC,CAAI,CAAC,CAAC,KAChF,KAAS,KAAA;AAClB;AAEA,SAAgBC,IAA8C;CAC5D,OAAO;EACL,WAAWF,EAAW,sBAAsB;EAC5C,kBAAkBA,EAAW,0BAA0B;EACvD,YAAYA,EAAW,wBAAwB;EAC/C,YAAYA,EAAW,yBAAyB;EAChD,cAAcA,EAAW,2BAA2B;CACtD;AACF;AAEA,SAAgBG,EAA0B,IAAa,gCAAgC;CACrF,IAAMC,IAAUF,EAAuB,GAEjCG,IAAgC;EACpC,UAAU;EACV;CACF;CAUA,AARID,EAAQ,cACV,EAAK,QAAQA,EAAQ,YAGnBA,EAAQ,qBACV,EAAK,mBAAmB,EAAE,OAAOA,EAAQ,iBAAiB,IAGxDA,EAAQ,eACV,EAAK,YAAYA,EAAQ;CAG3B,IAAME,IAAmC,CAAC;CAO1C,OALIF,EAAQ,eACV,EAAQ,QAAQA,EAAQ,YACxB,EAAQ,YAAYA,EAAQ,aAGvB;EACL;EACA;CACF;AACF;AAEA,SAAgBG,IAAmD;CACjE,OAAOL,EAAuB,CAAC,CAAC;AAClC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { GraphQLFetchOptions, GraphQLResponse } from '@burdenoff/fe-libs/shared/graphql';
|
|
2
|
+
export declare const SIGN_IN_REQUIRED_MESSAGE = "Your session has ended. Sign in again, then retry this action.";
|
|
3
|
+
export declare const ACTOR_CHANGED_MESSAGE = "The active account changed before this action was sent. Review it and try again.";
|
|
4
|
+
/** What identifies the acting user when an action starts. */
|
|
5
|
+
export interface RequestActorSource {
|
|
6
|
+
/** The bearer the caller was given (usually the MFE's `authToken` prop). */
|
|
7
|
+
authToken?: string | null;
|
|
8
|
+
/** The acting user, when the caller knows it. Defaults to the token subject. */
|
|
9
|
+
actorId?: string | null;
|
|
10
|
+
}
|
|
11
|
+
/** The account and bearer an action was started with. */
|
|
12
|
+
export interface CapturedRequestActor {
|
|
13
|
+
readonly actorId: string;
|
|
14
|
+
readonly authToken: string;
|
|
15
|
+
}
|
|
16
|
+
/** The `sub` claim of an access token, or null when it cannot be read. */
|
|
17
|
+
export declare function getTokenSubject(token: string | null | undefined): string | null;
|
|
18
|
+
/** True when the document contains a mutation operation. */
|
|
19
|
+
export declare function isMutationDocument(query: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Record the acting user when an action starts. Call it synchronously when the
|
|
22
|
+
* write begins so the capture reflects the account the user acted as.
|
|
23
|
+
*/
|
|
24
|
+
export declare function captureRequestActor(source: RequestActorSource): CapturedRequestActor;
|
|
25
|
+
/**
|
|
26
|
+
* Options for one operation sent on behalf of a captured actor. Billing talks
|
|
27
|
+
* to the global gateway only, which carries no workspace authority, so there
|
|
28
|
+
* is no workspace token to prepare for the captured actor.
|
|
29
|
+
*/
|
|
30
|
+
export type PinnedFetchOptions = Omit<GraphQLFetchOptions, 'authToken' | 'authTokenMode' | 'skipAuthRetry' | 'workspaceToken' | 'gateway'> & {
|
|
31
|
+
gateway: 'global';
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Send one operation bound to the captured actor. Returns the raw GraphQL
|
|
35
|
+
* response so callers keep their own error and empty-data handling.
|
|
36
|
+
*/
|
|
37
|
+
export declare function pinnedFetch<T>(actor: CapturedRequestActor, options: PinnedFetchOptions): Promise<GraphQLResponse<T>>;
|
|
38
|
+
/** Request options of the billing wrappers: an explicit bearer plus context. */
|
|
39
|
+
export type ActorBoundFetchOptions = PinnedFetchOptions & {
|
|
40
|
+
authToken?: string;
|
|
41
|
+
/** The acting user, when the caller knows it. Defaults to the token subject. */
|
|
42
|
+
actorId?: string | null;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Send a billing operation. Mutations are bound to the actor that started
|
|
46
|
+
* them; queries keep the refreshable transport.
|
|
47
|
+
*/
|
|
48
|
+
export declare function actorBoundGraphqlFetch<T>(options: ActorBoundFetchOptions): Promise<GraphQLResponse<T>>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getActiveUser as e } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
2
|
+
import { Kind as t, parse as n } from "graphql";
|
|
3
|
+
import { clearGraphqlFetchResponseCache as r, getStoredAuthToken as i, graphqlFetch as a, graphqlFetchPinned as o } from "@burdenoff/fe-libs/shared/graphql";
|
|
4
|
+
// src/billing/shared/utils/pinnedRequest.ts
|
|
5
|
+
var s = "Your session has ended. Sign in again, then retry this action.", c = "The active account changed before this action was sent. Review it and try again.";
|
|
6
|
+
function l(e) {
|
|
7
|
+
let t = e.split(".")[1];
|
|
8
|
+
if (!t) return null;
|
|
9
|
+
try {
|
|
10
|
+
let e = atob(t.replace(/-/g, "+").replace(/_/g, "/")), n = JSON.parse(e);
|
|
11
|
+
return n && typeof n == "object" ? n : null;
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function u(e) {
|
|
17
|
+
if (!e) return null;
|
|
18
|
+
let t = l(e)?.sub;
|
|
19
|
+
return typeof t == "string" && t.length > 0 ? t : null;
|
|
20
|
+
}
|
|
21
|
+
function d(e) {
|
|
22
|
+
let t = l(e)?.exp;
|
|
23
|
+
return typeof t == "number" && t * 1e3 <= Date.now();
|
|
24
|
+
}
|
|
25
|
+
function f(e) {
|
|
26
|
+
try {
|
|
27
|
+
return n(e).definitions.some((e) => e.kind === t.OPERATION_DEFINITION && e.operation === "mutation");
|
|
28
|
+
} catch {
|
|
29
|
+
return /^\s*mutation\b/.test(e.replace(/^\s*#[^\n]*\n/gm, ""));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function p(t) {
|
|
33
|
+
let n = e()?.id || null, r = t.actorId || u(t.authToken) || n;
|
|
34
|
+
if (!r || !n) throw Error(s);
|
|
35
|
+
if (n !== r) throw Error(c);
|
|
36
|
+
let a = i() || t.authToken || "";
|
|
37
|
+
if (!a || d(a)) throw Error(s);
|
|
38
|
+
return {
|
|
39
|
+
actorId: r,
|
|
40
|
+
authToken: a
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async function m(t, n) {
|
|
44
|
+
if (e()?.id !== t.actorId) throw Error(c);
|
|
45
|
+
let i = await o({
|
|
46
|
+
...n,
|
|
47
|
+
authToken: t.authToken
|
|
48
|
+
});
|
|
49
|
+
return i.errors?.length || r(), i;
|
|
50
|
+
}
|
|
51
|
+
async function h(e) {
|
|
52
|
+
let { actorId: t, authToken: n, ...r } = e;
|
|
53
|
+
return f(r.query) ? m(p({
|
|
54
|
+
authToken: n,
|
|
55
|
+
actorId: t
|
|
56
|
+
}), r) : a({
|
|
57
|
+
...r,
|
|
58
|
+
...n ? { authToken: n } : {}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export { c as ACTOR_CHANGED_MESSAGE, s as SIGN_IN_REQUIRED_MESSAGE, h as actorBoundGraphqlFetch, p as captureRequestActor, u as getTokenSubject, f as isMutationDocument, m as pinnedFetch };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=pinnedRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pinnedRequest.js","names":["SIGN_IN_REQUIRED_MESSAGE","ACTOR_CHANGED_MESSAGE","decodeJwtClaims","payload","token","json","claims","getTokenSubject","sub","isTokenExpired","exp","isMutationDocument","parse","query","definition","Kind","captureRequestActor","activeActorId","getActiveUser","actorId","source","authToken","getStoredAuthToken","pinnedFetch","actor","response","graphqlFetchPinned","options","clearGraphqlFetchResponseCache","actorBoundGraphqlFetch","request","graphqlFetch"],"sources":["../../../../src/billing/shared/utils/pinnedRequest.ts"],"sourcesContent":["/**\n * Actor-bound transport for billing writes (BOFF-11028, following BOFF-10939).\n *\n * The default `graphqlFetch` is refreshable: when an explicit `authToken` has\n * expired it falls back to the token of whichever profile is active in the\n * browser, and its UNAUTHENTICATED retry re-reads storage. A billing write\n * started by one account (a payout account change, a withdrawal, a team\n * permission grant...) could therefore be sent with another account's bearer\n * if the user switched profile while it was in flight.\n *\n * The shared request wrappers (`gatewayGraphqlRequest`,\n * `directBillingGraphqlRequest`, `directActivityGraphqlRequest`) send every\n * operation through `actorBoundGraphqlFetch`, which splits by operation type:\n *\n * - Mutations are bound to the account that started them.\n * `captureRequestActor` identifies that account from the explicit token\n * (its `sub` claim) and refuses if the profile active in the browser is a\n * different account. `graphqlFetchPinned` then sends the captured bearer,\n * refuses an expired one before dispatch and never refreshes or replays the\n * operation under the profile token stored in the browser.\n * - Queries keep the refreshable `graphqlFetch`. They are same-actor reads on\n * long-lived pages where a silent token refresh is the expected behaviour,\n * and a refreshed read cannot change data.\n */\nimport {\n clearGraphqlFetchResponseCache,\n getStoredAuthToken,\n graphqlFetch,\n graphqlFetchPinned,\n type GraphQLFetchOptions,\n type GraphQLResponse,\n} from '@burdenoff/fe-libs/shared/graphql';\nimport { getActiveUser } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Kind, parse } from 'graphql';\n\nexport const SIGN_IN_REQUIRED_MESSAGE =\n 'Your session has ended. Sign in again, then retry this action.';\nexport const ACTOR_CHANGED_MESSAGE =\n 'The active account changed before this action was sent. Review it and try again.';\n\n/** What identifies the acting user when an action starts. */\nexport interface RequestActorSource {\n /** The bearer the caller was given (usually the MFE's `authToken` prop). */\n authToken?: string | null;\n /** The acting user, when the caller knows it. Defaults to the token subject. */\n actorId?: string | null;\n}\n\n/** The account and bearer an action was started with. */\nexport interface CapturedRequestActor {\n readonly actorId: string;\n readonly authToken: string;\n}\n\ninterface JwtClaims {\n sub?: unknown;\n exp?: unknown;\n}\n\nfunction decodeJwtClaims(token: string): JwtClaims | null {\n const payload = token.split('.')[1];\n if (!payload) return null;\n try {\n // Base64URL to Base64 before decoding; the JWT alphabet is not the atob one.\n const json = atob(payload.replace(/-/g, '+').replace(/_/g, '/'));\n const claims: unknown = JSON.parse(json);\n return claims && typeof claims === 'object' ? (claims as JwtClaims) : null;\n } catch {\n return null;\n }\n}\n\n/** The `sub` claim of an access token, or null when it cannot be read. */\nexport function getTokenSubject(token: string | null | undefined): string | null {\n if (!token) return null;\n const sub = decodeJwtClaims(token)?.sub;\n return typeof sub === 'string' && sub.length > 0 ? sub : null;\n}\n\nfunction isTokenExpired(token: string): boolean {\n const exp = decodeJwtClaims(token)?.exp;\n return typeof exp === 'number' && exp * 1000 <= Date.now();\n}\n\n/** True when the document contains a mutation operation. */\nexport function isMutationDocument(query: string): boolean {\n try {\n return parse(query).definitions.some(\n (definition) =>\n definition.kind === Kind.OPERATION_DEFINITION && definition.operation === 'mutation'\n );\n } catch {\n // An unparsable document is refused by the gateway either way; classify it\n // conservatively from its leading keyword so a write is never sent through\n // the refreshable transport.\n return /^\\s*mutation\\b/.test(query.replace(/^\\s*#[^\\n]*\\n/gm, ''));\n }\n}\n\n/**\n * Record the acting user when an action starts. Call it synchronously when the\n * write begins so the capture reflects the account the user acted as.\n */\nexport function captureRequestActor(source: RequestActorSource): CapturedRequestActor {\n const activeActorId = getActiveUser()?.id || null;\n const actorId = source.actorId || getTokenSubject(source.authToken) || activeActorId;\n if (!actorId || !activeActorId) {\n throw new Error(SIGN_IN_REQUIRED_MESSAGE);\n }\n if (activeActorId !== actorId) {\n throw new Error(ACTOR_CHANGED_MESSAGE);\n }\n // The active profile belongs to the acting user, so its stored token is that\n // user's current bearer (it may be fresher than the explicit one after a\n // refresh). `getStoredAuthToken` returns null for an expired token; the\n // explicit token is then the only candidate.\n const authToken = getStoredAuthToken() || source.authToken || '';\n if (!authToken || isTokenExpired(authToken)) {\n throw new Error(SIGN_IN_REQUIRED_MESSAGE);\n }\n return { actorId, authToken };\n}\n\n/**\n * Options for one operation sent on behalf of a captured actor. Billing talks\n * to the global gateway only, which carries no workspace authority, so there\n * is no workspace token to prepare for the captured actor.\n */\nexport type PinnedFetchOptions = Omit<\n GraphQLFetchOptions,\n 'authToken' | 'authTokenMode' | 'skipAuthRetry' | 'workspaceToken' | 'gateway'\n> & { gateway: 'global' };\n\n/**\n * Send one operation bound to the captured actor. Returns the raw GraphQL\n * response so callers keep their own error and empty-data handling.\n */\nexport async function pinnedFetch<T>(\n actor: CapturedRequestActor,\n options: PinnedFetchOptions\n): Promise<GraphQLResponse<T>> {\n // Synchronous with the dispatch below: nothing can switch the profile between\n // this check and the pinned transport reading the request options.\n if (getActiveUser()?.id !== actor.actorId) {\n throw new Error(ACTOR_CHANGED_MESSAGE);\n }\n const response = await graphqlFetchPinned<T>({ ...options, authToken: actor.authToken });\n\n // A completed write must not be followed by a refetch served from the\n // 15-second response cache with pre-write data.\n if (!response.errors?.length) {\n clearGraphqlFetchResponseCache();\n }\n return response;\n}\n\n/** Request options of the billing wrappers: an explicit bearer plus context. */\nexport type ActorBoundFetchOptions = PinnedFetchOptions & {\n authToken?: string;\n /** The acting user, when the caller knows it. Defaults to the token subject. */\n actorId?: string | null;\n};\n\n/**\n * Send a billing operation. Mutations are bound to the actor that started\n * them; queries keep the refreshable transport.\n */\nexport async function actorBoundGraphqlFetch<T>(\n options: ActorBoundFetchOptions\n): Promise<GraphQLResponse<T>> {\n const { actorId, authToken, ...request } = options;\n if (!isMutationDocument(request.query)) {\n return graphqlFetch<T>({ ...request, ...(authToken ? { authToken } : {}) });\n }\n return pinnedFetch<T>(captureRequestActor({ authToken, actorId }), request);\n}\n"],"mappings":";;;;AAmCA,IAAaA,IACX,kEACWC,IACX;AAqBF,SAASC,EAAgB,GAAiC;CACxD,IAAMC,IAAUC,EAAM,MAAM,GAAG,CAAC,CAAC;CACjC,IAAI,CAACD,GAAS,OAAO;CACrB,IAAI;EAEF,IAAME,IAAO,KAAKF,EAAQ,QAAQ,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAM,GAAG,CAAC,GACzDG,IAAkB,KAAK,MAAMD,CAAI;EACvC,OAAOC,KAAU,OAAOA,KAAW,WAAYA,IAAuB;CACxE,QAAQ;EACN,OAAO;CACT;AACF;AAGA,SAAgBC,EAAgB,GAAiD;CAC/E,IAAI,CAACH,GAAO,OAAO;CACnB,IAAMI,IAAMN,EAAgBE,CAAK,CAAC,EAAE;CACpC,OAAO,OAAOI,KAAQ,YAAYA,EAAI,SAAS,IAAIA,IAAM;AAC3D;AAEA,SAASC,EAAe,GAAwB;CAC9C,IAAMC,IAAMR,EAAgBE,CAAK,CAAC,EAAE;CACpC,OAAO,OAAOM,KAAQ,YAAYA,IAAM,OAAQ,KAAK,IAAI;AAC3D;AAGA,SAAgBC,EAAmB,GAAwB;CACzD,IAAI;EACF,OAAOC,EAAMC,CAAK,CAAC,CAAC,YAAY,MAC7B,MACCC,EAAW,SAASC,EAAK,wBAAwBD,EAAW,cAAc,UAC9E;CACF,QAAQ;EAIN,OAAO,iBAAiB,KAAKD,EAAM,QAAQ,mBAAmB,EAAE,CAAC;CACnE;AACF;AAMA,SAAgBG,EAAoB,GAAkD;CACpF,IAAMC,IAAgBC,EAAc,CAAC,EAAE,MAAM,MACvCC,IAAUC,EAAO,WAAWb,EAAgBa,EAAO,SAAS,KAAKH;CACvE,IAAI,CAACE,KAAW,CAACF,GACf,MAAU,MAAMjB,CAAwB;CAE1C,IAAIiB,MAAkBE,GACpB,MAAU,MAAMlB,CAAqB;CAMvC,IAAMoB,IAAYC,EAAmB,KAAKF,EAAO,aAAa;CAC9D,IAAI,CAACC,KAAaZ,EAAeY,CAAS,GACxC,MAAU,MAAMrB,CAAwB;CAE1C,OAAO;EAAE;EAAS;CAAU;AAC9B;AAgBA,eAAsBuB,EACpB,GACA,GAC6B;CAG7B,IAAIL,EAAc,CAAC,EAAE,OAAOM,EAAM,SAChC,MAAU,MAAMvB,CAAqB;CAEvC,IAAMwB,IAAW,MAAMC,EAAsB;EAAE,GAAGC;EAAS,WAAWH,EAAM;CAAU,CAAC;CAOvF,OAHKC,EAAS,QAAQ,UACpBG,EAA+B,GAE1BH;AACT;AAaA,eAAsBI,EACpB,GAC6B;CAC7B,IAAM,EAAE,YAAS,cAAW,GAAGC,MAAYH;CAI3C,OAHKhB,EAAmBmB,EAAQ,KAAK,IAG9BP,EAAeP,EAAoB;EAAE;EAAW;CAAQ,CAAC,GAAGc,CAAO,IAFjEC,EAAgB;EAAE,GAAGD;EAAS,GAAIT,IAAY,EAAE,aAAU,IAAI,CAAC;CAAG,CAAC;AAG9E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/billing/shared/utils/planFeatureQuantity.ts
|
|
2
2
|
function e(e) {
|
|
3
3
|
let t = e.context;
|
|
4
4
|
if (t && typeof t.quantity == "number") return t.quantity;
|
|
@@ -9,7 +9,7 @@ function t(e) {
|
|
|
9
9
|
let t = e.context;
|
|
10
10
|
return typeof t?.unit == "string" ? t.unit : void 0;
|
|
11
11
|
}
|
|
12
|
-
var n = new Set([
|
|
12
|
+
var n = /* @__PURE__ */ new Set([
|
|
13
13
|
"count",
|
|
14
14
|
"bytes",
|
|
15
15
|
"days",
|
|
@@ -29,7 +29,6 @@ function i(e) {
|
|
|
29
29
|
let n = e.quota?.name;
|
|
30
30
|
return n ? r(n) : "Unknown Quota";
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { e as getPlanFeatureQuantity, t as getPlanFeatureUnit, i as getQuotaDisplayName, r as humanizeQuotaName };
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=planFeatureQuantity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planFeatureQuantity.js","names":[],"sources":["../../../../src/billing/shared/utils/planFeatureQuantity.ts"],"sourcesContent":["/**\n * Source of truth for \"how big is this quota on this plan\":\n * 1. Per-plan override stored on the SubscriptionFeature row's\n * `context.quantity` (autoseed + post-OSS-release createPlan path).\n * 2. Fall back to the catalog default `quota.limits.value` for plans that\n * pre-date per-plan overrides (only the autoseeded Free plan today).\n */\ntype FeatureLike = {\n context?: unknown;\n quota?: { name?: string | null; limits?: unknown; context?: unknown } | null;\n};\n\nexport function getPlanFeatureQuantity(feature: FeatureLike): number {\n const ctx = feature.context as { quantity?: number } | null | undefined;\n if (ctx && typeof ctx.quantity === 'number') return ctx.quantity;\n\n const limits = feature.quota?.limits as { value?: number } | null | undefined;\n return typeof limits?.value === 'number' ? limits.value : 0;\n}\n\n/**\n * The unit a quota's quantity is denominated in (e.g. \"bytes\", \"days\",\n * \"workflows\"), as seeded on the SubscriptionFeature row's `context.unit`.\n * Used to render byte-denominated quotas (storage, uploads) as MB/GB instead\n * of a raw byte count — see formatQuotaValue in format.ts.\n */\nexport function getPlanFeatureUnit(feature: FeatureLike): string | undefined {\n const ctx = feature.context as { unit?: string } | null | undefined;\n return typeof ctx?.unit === 'string' ? ctx.unit : undefined;\n}\n\n// Trailing name segments that describe the unit/cadence, not the quota\n// itself (e.g. \"fluidgrids.storage.bytes\" → the \"bytes\" segment). Stripped\n// by humanizeQuotaName so the fallback label doesn't end in a redundant\n// technical word.\nconst NAME_SUFFIX_STOPWORDS = new Set([\n 'count',\n 'bytes',\n 'days',\n 'seconds',\n 'hours',\n 'monthly',\n 'daily',\n 'concurrent',\n]);\n\n/**\n * Best-effort human label for a quota that has no seeded `displayName`\n * (older rows only — every quota seeded since BOFF-3058 carries one). Turns\n * \"fluidgrids.scheduled_triggers.count\" into \"Scheduled Triggers\": drops the\n * leading product/boundary segment and a trailing unit/cadence stopword,\n * then title-cases the rest.\n */\nexport function humanizeQuotaName(name: string): string {\n const segments = name.split('.').filter(Boolean);\n const withoutBoundary = segments.length > 1 ? segments.slice(1) : segments;\n const last = withoutBoundary[withoutBoundary.length - 1];\n const meaningful =\n withoutBoundary.length > 1 && last && NAME_SUFFIX_STOPWORDS.has(last)\n ? withoutBoundary.slice(0, -1)\n : withoutBoundary;\n\n const words = meaningful.join(' ').replace(/_/g, ' ').trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return name;\n return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(' ');\n}\n\n/**\n * The name to show a user for a quota: prefers the curated `displayName`\n * seeded on Quota.context (e.g. \"Storage\", \"Team Members\"); falls back to a\n * humanized version of the raw dotted identifier for any quota seeded before\n * displayName was added to the catalog.\n */\nexport function getQuotaDisplayName(feature: FeatureLike): string {\n const quotaContext = feature.quota?.context as { displayName?: string } | null | undefined;\n if (quotaContext && typeof quotaContext.displayName === 'string' && quotaContext.displayName) {\n return quotaContext.displayName;\n }\n\n const rawName = feature.quota?.name;\n return rawName ? humanizeQuotaName(rawName) : 'Unknown Quota';\n}\n"],"mappings":";AAYA,
|
|
1
|
+
{"version":3,"file":"planFeatureQuantity.js","names":["getPlanFeatureQuantity","ctx","feature","limits","getPlanFeatureUnit","NAME_SUFFIX_STOPWORDS","humanizeQuotaName","segments","name","withoutBoundary","last","words","w","getQuotaDisplayName","quotaContext","rawName"],"sources":["../../../../src/billing/shared/utils/planFeatureQuantity.ts"],"sourcesContent":["/**\n * Source of truth for \"how big is this quota on this plan\":\n * 1. Per-plan override stored on the SubscriptionFeature row's\n * `context.quantity` (autoseed + post-OSS-release createPlan path).\n * 2. Fall back to the catalog default `quota.limits.value` for plans that\n * pre-date per-plan overrides (only the autoseeded Free plan today).\n */\ntype FeatureLike = {\n context?: unknown;\n quota?: { name?: string | null; limits?: unknown; context?: unknown } | null;\n};\n\nexport function getPlanFeatureQuantity(feature: FeatureLike): number {\n const ctx = feature.context as { quantity?: number } | null | undefined;\n if (ctx && typeof ctx.quantity === 'number') return ctx.quantity;\n\n const limits = feature.quota?.limits as { value?: number } | null | undefined;\n return typeof limits?.value === 'number' ? limits.value : 0;\n}\n\n/**\n * The unit a quota's quantity is denominated in (e.g. \"bytes\", \"days\",\n * \"workflows\"), as seeded on the SubscriptionFeature row's `context.unit`.\n * Used to render byte-denominated quotas (storage, uploads) as MB/GB instead\n * of a raw byte count — see formatQuotaValue in format.ts.\n */\nexport function getPlanFeatureUnit(feature: FeatureLike): string | undefined {\n const ctx = feature.context as { unit?: string } | null | undefined;\n return typeof ctx?.unit === 'string' ? ctx.unit : undefined;\n}\n\n// Trailing name segments that describe the unit/cadence, not the quota\n// itself (e.g. \"fluidgrids.storage.bytes\" → the \"bytes\" segment). Stripped\n// by humanizeQuotaName so the fallback label doesn't end in a redundant\n// technical word.\nconst NAME_SUFFIX_STOPWORDS = new Set([\n 'count',\n 'bytes',\n 'days',\n 'seconds',\n 'hours',\n 'monthly',\n 'daily',\n 'concurrent',\n]);\n\n/**\n * Best-effort human label for a quota that has no seeded `displayName`\n * (older rows only — every quota seeded since BOFF-3058 carries one). Turns\n * \"fluidgrids.scheduled_triggers.count\" into \"Scheduled Triggers\": drops the\n * leading product/boundary segment and a trailing unit/cadence stopword,\n * then title-cases the rest.\n */\nexport function humanizeQuotaName(name: string): string {\n const segments = name.split('.').filter(Boolean);\n const withoutBoundary = segments.length > 1 ? segments.slice(1) : segments;\n const last = withoutBoundary[withoutBoundary.length - 1];\n const meaningful =\n withoutBoundary.length > 1 && last && NAME_SUFFIX_STOPWORDS.has(last)\n ? withoutBoundary.slice(0, -1)\n : withoutBoundary;\n\n const words = meaningful.join(' ').replace(/_/g, ' ').trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return name;\n return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(' ');\n}\n\n/**\n * The name to show a user for a quota: prefers the curated `displayName`\n * seeded on Quota.context (e.g. \"Storage\", \"Team Members\"); falls back to a\n * humanized version of the raw dotted identifier for any quota seeded before\n * displayName was added to the catalog.\n */\nexport function getQuotaDisplayName(feature: FeatureLike): string {\n const quotaContext = feature.quota?.context as { displayName?: string } | null | undefined;\n if (quotaContext && typeof quotaContext.displayName === 'string' && quotaContext.displayName) {\n return quotaContext.displayName;\n }\n\n const rawName = feature.quota?.name;\n return rawName ? humanizeQuotaName(rawName) : 'Unknown Quota';\n}\n"],"mappings":";AAYA,SAAgBA,EAAuB,GAA8B;CACnE,IAAMC,IAAMC,EAAQ;CACpB,IAAID,KAAO,OAAOA,EAAI,YAAa,UAAU,OAAOA,EAAI;CAExD,IAAME,IAASD,EAAQ,OAAO;CAC9B,OAAO,OAAOC,GAAQ,SAAU,WAAWA,EAAO,QAAQ;AAC5D;AAQA,SAAgBC,EAAmB,GAA0C;CAC3E,IAAMH,IAAMC,EAAQ;CACpB,OAAO,OAAOD,GAAK,QAAS,WAAWA,EAAI,OAAO,KAAA;AACpD;AAMA,IAAMI,oBAAwB,IAAI,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AASD,SAAgBC,EAAkB,GAAsB;CACtD,IAAMC,IAAWC,EAAK,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,GACzCC,IAAkBF,EAAS,SAAS,IAAIA,EAAS,MAAM,CAAC,IAAIA,GAC5DG,IAAOD,EAAgBA,EAAgB,SAAS,IAMhDE,KAJJF,EAAgB,SAAS,KAAKC,KAAQL,EAAsB,IAAIK,CAAI,IAChED,EAAgB,MAAM,GAAG,EAAE,IAC3BA,EAAA,CAEmB,KAAK,GAAG,CAAC,CAAC,QAAQ,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;CAExF,OADIE,EAAM,WAAW,IAAUH,IACxBG,EAAM,KAAK,MAAMC,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG;AAC1E;AAQA,SAAgBC,EAAoB,GAA8B;CAChE,IAAMC,IAAeZ,EAAQ,OAAO;CACpC,IAAIY,KAAgB,OAAOA,EAAa,eAAgB,YAAYA,EAAa,aAC/E,OAAOA,EAAa;CAGtB,IAAMC,IAAUb,EAAQ,OAAO;CAC/B,OAAOa,IAAUT,EAAkBS,CAAO,IAAI;AAChD"}
|
|
@@ -24,4 +24,3 @@ export declare function isPendingPayment(status: PaymentStatus): boolean;
|
|
|
24
24
|
export declare function isHealthyQuota(status: QuotaStatus): boolean;
|
|
25
25
|
export declare function isQuotaAtRisk(status: QuotaStatus): boolean;
|
|
26
26
|
export declare function isQuotaExhausted(status: QuotaStatus): boolean;
|
|
27
|
-
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1,45 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { CreditTransactionStatus as e, InvoiceStatus as t, SubscriptionStatus as n, TransactionStatus as r } from "../types/graphql.js";
|
|
2
|
+
import { getProgressTokens as i, getStatusBadgeTokens as a } from "./tokens.js";
|
|
3
|
+
// src/billing/shared/utils/status.ts
|
|
4
4
|
function o(e) {
|
|
5
5
|
return {
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
6
|
+
[n.ACTIVE]: "success",
|
|
7
|
+
[n.CANCELED]: "error",
|
|
8
|
+
[n.EXPIRED]: "neutral",
|
|
9
|
+
[n.UPGRADED]: "info"
|
|
10
10
|
}[e] || "neutral";
|
|
11
11
|
}
|
|
12
12
|
function s(e) {
|
|
13
13
|
return {
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
14
|
+
[t.DRAFT]: "neutral",
|
|
15
|
+
[t.OPEN]: "info",
|
|
16
|
+
[t.PAID]: "success",
|
|
17
|
+
[t.VOID]: "neutral",
|
|
18
|
+
[t.UNCOLLECTIBLE]: "error"
|
|
19
19
|
}[e] || "neutral";
|
|
20
20
|
}
|
|
21
21
|
function c(e) {
|
|
22
22
|
return {
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
23
|
+
[r.PENDING]: "warning",
|
|
24
|
+
[r.SUCCESS]: "success",
|
|
25
|
+
[r.FAILED]: "error"
|
|
26
26
|
}[e] || "neutral";
|
|
27
27
|
}
|
|
28
|
-
function l(
|
|
28
|
+
function l(t) {
|
|
29
29
|
return {
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
}[
|
|
30
|
+
[e.PENDING]: "warning",
|
|
31
|
+
[e.SUCCESS]: "success",
|
|
32
|
+
[e.FAILED]: "error",
|
|
33
|
+
[e.REFUND]: "info"
|
|
34
|
+
}[t] || "neutral";
|
|
35
35
|
}
|
|
36
36
|
function u(e) {
|
|
37
|
-
return
|
|
37
|
+
return a(e);
|
|
38
38
|
}
|
|
39
|
-
function d(
|
|
40
|
-
return e
|
|
39
|
+
function d(e) {
|
|
40
|
+
return i(e).bar;
|
|
41
41
|
}
|
|
42
|
-
//#endregion
|
|
43
42
|
export { l as getCreditTransactionStatusColor, s as getInvoiceStatusColor, d as getQuotaProgressColor, u as getStatusBadgeClasses, o as getSubscriptionStatusColor, c as getTransactionStatusColor };
|
|
44
43
|
|
|
45
44
|
//# sourceMappingURL=status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","names":[],"sources":["../../../../src/billing/shared/utils/status.ts"],"sourcesContent":["/**\n * Status utilities for the billing module\n * Provides status colors, icons, and helper functions\n *\n * Uses semantic design tokens from tokens.ts for consistent theming\n */\n\nimport {\n SubscriptionStatus,\n InvoiceStatus,\n PaymentStatus,\n ChargeStatus,\n RefundStatus,\n QuotaStatus,\n TransactionStatus,\n CreditTransactionStatus,\n} from '../types';\nimport { type SemanticStatus, getStatusBadgeTokens, getProgressTokens } from './tokens';\n\n// ============================================================================\n// Status Color Types\n// ============================================================================\n\nexport type StatusColor = SemanticStatus;\n\n// ============================================================================\n// Status Color Mappings\n// ============================================================================\n\nexport function getSubscriptionStatusColor(status: SubscriptionStatus): StatusColor {\n const colors: Record<SubscriptionStatus, StatusColor> = {\n [SubscriptionStatus.ACTIVE]: 'success',\n [SubscriptionStatus.CANCELED]: 'error',\n [SubscriptionStatus.EXPIRED]: 'neutral',\n [SubscriptionStatus.UPGRADED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getInvoiceStatusColor(status: InvoiceStatus): StatusColor {\n const colors: Record<InvoiceStatus, StatusColor> = {\n [InvoiceStatus.DRAFT]: 'neutral',\n [InvoiceStatus.OPEN]: 'info',\n [InvoiceStatus.PAID]: 'success',\n [InvoiceStatus.VOID]: 'neutral',\n [InvoiceStatus.UNCOLLECTIBLE]: 'error',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getPaymentStatusColor(status: PaymentStatus): StatusColor {\n const colors: Record<PaymentStatus, StatusColor> = {\n [PaymentStatus.PENDING]: 'warning',\n [PaymentStatus.SUCCEEDED]: 'success',\n [PaymentStatus.FAILED]: 'error',\n [PaymentStatus.CANCELED]: 'neutral',\n [PaymentStatus.REFUNDED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getChargeStatusColor(status: ChargeStatus): StatusColor {\n const colors: Record<ChargeStatus, StatusColor> = {\n [ChargeStatus.PENDING]: 'warning',\n [ChargeStatus.SUCCEEDED]: 'success',\n [ChargeStatus.FAILED]: 'error',\n [ChargeStatus.REFUNDED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getRefundStatusColor(status: RefundStatus): StatusColor {\n const colors: Record<RefundStatus, StatusColor> = {\n [RefundStatus.PENDING]: 'warning',\n [RefundStatus.SUCCEEDED]: 'success',\n [RefundStatus.FAILED]: 'error',\n [RefundStatus.CANCELED]: 'neutral',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getQuotaStatusColor(status: QuotaStatus): StatusColor {\n const colors: Record<QuotaStatus, StatusColor> = {\n [QuotaStatus.HEALTHY]: 'success',\n [QuotaStatus.WARNING]: 'warning',\n [QuotaStatus.CRITICAL]: 'error',\n [QuotaStatus.EXHAUSTED]: 'error',\n [QuotaStatus.INACTIVE]: 'neutral',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getTransactionStatusColor(status: TransactionStatus): StatusColor {\n const colors: Record<TransactionStatus, StatusColor> = {\n [TransactionStatus.PENDING]: 'warning',\n [TransactionStatus.SUCCESS]: 'success',\n [TransactionStatus.FAILED]: 'error',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getCreditTransactionStatusColor(status: CreditTransactionStatus): StatusColor {\n const colors: Record<CreditTransactionStatus, StatusColor> = {\n [CreditTransactionStatus.PENDING]: 'warning',\n [CreditTransactionStatus.SUCCESS]: 'success',\n [CreditTransactionStatus.FAILED]: 'error',\n [CreditTransactionStatus.REFUND]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\n// ============================================================================\n// CSS Class Mappings (using semantic tokens)\n// ============================================================================\n\n/**\n * Get combined badge classes for a status.\n */\nexport function getStatusBadgeClasses(color: StatusColor): string {\n return getStatusBadgeTokens(color);\n}\n\n// ============================================================================\n// Quota Status Helpers\n// ============================================================================\n\nexport function getQuotaStatusFromPercentage(percentage: number): QuotaStatus {\n if (percentage >= 100) return QuotaStatus.EXHAUSTED;\n if (percentage >= 90) return QuotaStatus.CRITICAL;\n if (percentage >= 75) return QuotaStatus.WARNING;\n return QuotaStatus.HEALTHY;\n}\n\nexport function getQuotaProgressColor(percentage: number): string {\n const tokens = getProgressTokens(percentage);\n return tokens.bar;\n}\n\nexport function getQuotaProgressBgColor(percentage: number): string {\n const tokens = getProgressTokens(percentage);\n return tokens.track;\n}\n\n// ============================================================================\n// Status Checks\n// ============================================================================\n\nexport function isActiveSubscription(status: SubscriptionStatus): boolean {\n return status === SubscriptionStatus.ACTIVE;\n}\n\nexport function isPaidInvoice(status: InvoiceStatus): boolean {\n return status === InvoiceStatus.PAID;\n}\n\nexport function isOpenInvoice(status: InvoiceStatus): boolean {\n return status === InvoiceStatus.OPEN;\n}\n\nexport function isSuccessfulPayment(status: PaymentStatus): boolean {\n return status === PaymentStatus.SUCCEEDED;\n}\n\nexport function isPendingPayment(status: PaymentStatus): boolean {\n return status === PaymentStatus.PENDING;\n}\n\nexport function isHealthyQuota(status: QuotaStatus): boolean {\n return status === QuotaStatus.HEALTHY;\n}\n\nexport function isQuotaAtRisk(status: QuotaStatus): boolean {\n return status === QuotaStatus.WARNING || status === QuotaStatus.CRITICAL;\n}\n\nexport function isQuotaExhausted(status: QuotaStatus): boolean {\n return status === QuotaStatus.EXHAUSTED;\n}\n"],"mappings":";;;AA6BA,
|
|
1
|
+
{"version":3,"file":"status.js","names":["getSubscriptionStatusColor","SubscriptionStatus","status","getInvoiceStatusColor","InvoiceStatus","getTransactionStatusColor","TransactionStatus","getCreditTransactionStatusColor","CreditTransactionStatus","getStatusBadgeClasses","getStatusBadgeTokens","color","getQuotaProgressColor","getProgressTokens","percentage"],"sources":["../../../../src/billing/shared/utils/status.ts"],"sourcesContent":["/**\n * Status utilities for the billing module\n * Provides status colors, icons, and helper functions\n *\n * Uses semantic design tokens from tokens.ts for consistent theming\n */\n\nimport {\n SubscriptionStatus,\n InvoiceStatus,\n PaymentStatus,\n ChargeStatus,\n RefundStatus,\n QuotaStatus,\n TransactionStatus,\n CreditTransactionStatus,\n} from '../types';\nimport { type SemanticStatus, getStatusBadgeTokens, getProgressTokens } from './tokens';\n\n// ============================================================================\n// Status Color Types\n// ============================================================================\n\nexport type StatusColor = SemanticStatus;\n\n// ============================================================================\n// Status Color Mappings\n// ============================================================================\n\nexport function getSubscriptionStatusColor(status: SubscriptionStatus): StatusColor {\n const colors: Record<SubscriptionStatus, StatusColor> = {\n [SubscriptionStatus.ACTIVE]: 'success',\n [SubscriptionStatus.CANCELED]: 'error',\n [SubscriptionStatus.EXPIRED]: 'neutral',\n [SubscriptionStatus.UPGRADED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getInvoiceStatusColor(status: InvoiceStatus): StatusColor {\n const colors: Record<InvoiceStatus, StatusColor> = {\n [InvoiceStatus.DRAFT]: 'neutral',\n [InvoiceStatus.OPEN]: 'info',\n [InvoiceStatus.PAID]: 'success',\n [InvoiceStatus.VOID]: 'neutral',\n [InvoiceStatus.UNCOLLECTIBLE]: 'error',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getPaymentStatusColor(status: PaymentStatus): StatusColor {\n const colors: Record<PaymentStatus, StatusColor> = {\n [PaymentStatus.PENDING]: 'warning',\n [PaymentStatus.SUCCEEDED]: 'success',\n [PaymentStatus.FAILED]: 'error',\n [PaymentStatus.CANCELED]: 'neutral',\n [PaymentStatus.REFUNDED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getChargeStatusColor(status: ChargeStatus): StatusColor {\n const colors: Record<ChargeStatus, StatusColor> = {\n [ChargeStatus.PENDING]: 'warning',\n [ChargeStatus.SUCCEEDED]: 'success',\n [ChargeStatus.FAILED]: 'error',\n [ChargeStatus.REFUNDED]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getRefundStatusColor(status: RefundStatus): StatusColor {\n const colors: Record<RefundStatus, StatusColor> = {\n [RefundStatus.PENDING]: 'warning',\n [RefundStatus.SUCCEEDED]: 'success',\n [RefundStatus.FAILED]: 'error',\n [RefundStatus.CANCELED]: 'neutral',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getQuotaStatusColor(status: QuotaStatus): StatusColor {\n const colors: Record<QuotaStatus, StatusColor> = {\n [QuotaStatus.HEALTHY]: 'success',\n [QuotaStatus.WARNING]: 'warning',\n [QuotaStatus.CRITICAL]: 'error',\n [QuotaStatus.EXHAUSTED]: 'error',\n [QuotaStatus.INACTIVE]: 'neutral',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getTransactionStatusColor(status: TransactionStatus): StatusColor {\n const colors: Record<TransactionStatus, StatusColor> = {\n [TransactionStatus.PENDING]: 'warning',\n [TransactionStatus.SUCCESS]: 'success',\n [TransactionStatus.FAILED]: 'error',\n };\n return colors[status] || 'neutral';\n}\n\nexport function getCreditTransactionStatusColor(status: CreditTransactionStatus): StatusColor {\n const colors: Record<CreditTransactionStatus, StatusColor> = {\n [CreditTransactionStatus.PENDING]: 'warning',\n [CreditTransactionStatus.SUCCESS]: 'success',\n [CreditTransactionStatus.FAILED]: 'error',\n [CreditTransactionStatus.REFUND]: 'info',\n };\n return colors[status] || 'neutral';\n}\n\n// ============================================================================\n// CSS Class Mappings (using semantic tokens)\n// ============================================================================\n\n/**\n * Get combined badge classes for a status.\n */\nexport function getStatusBadgeClasses(color: StatusColor): string {\n return getStatusBadgeTokens(color);\n}\n\n// ============================================================================\n// Quota Status Helpers\n// ============================================================================\n\nexport function getQuotaStatusFromPercentage(percentage: number): QuotaStatus {\n if (percentage >= 100) return QuotaStatus.EXHAUSTED;\n if (percentage >= 90) return QuotaStatus.CRITICAL;\n if (percentage >= 75) return QuotaStatus.WARNING;\n return QuotaStatus.HEALTHY;\n}\n\nexport function getQuotaProgressColor(percentage: number): string {\n const tokens = getProgressTokens(percentage);\n return tokens.bar;\n}\n\nexport function getQuotaProgressBgColor(percentage: number): string {\n const tokens = getProgressTokens(percentage);\n return tokens.track;\n}\n\n// ============================================================================\n// Status Checks\n// ============================================================================\n\nexport function isActiveSubscription(status: SubscriptionStatus): boolean {\n return status === SubscriptionStatus.ACTIVE;\n}\n\nexport function isPaidInvoice(status: InvoiceStatus): boolean {\n return status === InvoiceStatus.PAID;\n}\n\nexport function isOpenInvoice(status: InvoiceStatus): boolean {\n return status === InvoiceStatus.OPEN;\n}\n\nexport function isSuccessfulPayment(status: PaymentStatus): boolean {\n return status === PaymentStatus.SUCCEEDED;\n}\n\nexport function isPendingPayment(status: PaymentStatus): boolean {\n return status === PaymentStatus.PENDING;\n}\n\nexport function isHealthyQuota(status: QuotaStatus): boolean {\n return status === QuotaStatus.HEALTHY;\n}\n\nexport function isQuotaAtRisk(status: QuotaStatus): boolean {\n return status === QuotaStatus.WARNING || status === QuotaStatus.CRITICAL;\n}\n\nexport function isQuotaExhausted(status: QuotaStatus): boolean {\n return status === QuotaStatus.EXHAUSTED;\n}\n"],"mappings":";;;AA6BA,SAAgBA,EAA2B,GAAyC;CAOlF,OAAO;GALJC,EAAmB,SAAS;GAC5BA,EAAmB,WAAW;GAC9BA,EAAmB,UAAU;GAC7BA,EAAmB,WAAW;CAE1B,EAAOC,MAAW;AAC3B;AAEA,SAAgBC,EAAsB,GAAoC;CAQxE,OAAO;GANJC,EAAc,QAAQ;GACtBA,EAAc,OAAO;GACrBA,EAAc,OAAO;GACrBA,EAAc,OAAO;GACrBA,EAAc,gBAAgB;CAE1B,EAAOF,MAAW;AAC3B;AA4CA,SAAgBG,EAA0B,GAAwC;CAMhF,OAAO;GAJJC,EAAkB,UAAU;GAC5BA,EAAkB,UAAU;GAC5BA,EAAkB,SAAS;CAEvB,EAAOJ,MAAW;AAC3B;AAEA,SAAgBK,EAAgC,GAA8C;CAO5F,OAAO;GALJC,EAAwB,UAAU;GAClCA,EAAwB,UAAU;GAClCA,EAAwB,SAAS;GACjCA,EAAwB,SAAS;CAE7B,EAAON,MAAW;AAC3B;AASA,SAAgBO,EAAsB,GAA4B;CAChE,OAAOC,EAAqBC,CAAK;AACnC;AAaA,SAAgBC,EAAsB,GAA4B;CAEhE,OADeC,EAAkBC,CAC1B,CAAA,CAAO;AAChB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/billing/shared/utils/tokens.ts
|
|
2
2
|
var e = {
|
|
3
3
|
success: {
|
|
4
4
|
bg: "bg-status-success-bg-subtle",
|
|
@@ -105,7 +105,6 @@ var a = {
|
|
|
105
105
|
icon: "text-status-info-bg"
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
//#endregion
|
|
109
108
|
export { o as alertTokens, a as categoryTokens, i as getProgressTokens, n as getStatusBadgeTokens, t as getStatusTokens, r as progressTokens, e as statusTokens };
|
|
110
109
|
|
|
111
110
|
//# sourceMappingURL=tokens.js.map
|