@lukoweb/apitogo-plugin-dev-portal-billing 0.2.78 → 0.2.79
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/{AccountPlansPage-CRZpmhTm.mjs → AccountPlansPage-BDfagKTr.mjs} +4 -4
- package/dist/{CheckoutPage-B56e5vLI.mjs → CheckoutPage-4tCFiL7W.mjs} +2 -2
- package/dist/{ContactSalesPage-Ca-LTZbN.mjs → ContactSalesPage-BqxdJ4wl.mjs} +2 -2
- package/dist/{CredentialsPage-JtIVqKF4.mjs → CredentialsPage-DMVMiDdL.mjs} +3 -3
- package/dist/{PricingCard-CgSIIalL.mjs → PricingCard-CrN4GIZ7.mjs} +31 -6
- package/dist/{PricingPage-DD6m9wtN.mjs → PricingPage-DPIF_DOP.mjs} +31 -11
- package/dist/{SubscriptionsPage-CMcTjfb-.mjs → SubscriptionsPage-C8hRY5Sr.mjs} +6 -6
- package/dist/{UsagePage--DVUA6rr.mjs → UsagePage-Cwqnusaz.mjs} +4 -4
- package/dist/{account-links-Dri6HK0u.mjs → account-links-DGL7nKSZ.mjs} +1 -1
- package/dist/{billing-state-BKTAV0xR.mjs → billing-state-CIqyRwkD.mjs} +1 -1
- package/dist/index.mjs +15 -15
- package/dist/{useApiKeys-4pgYaVZ0.mjs → useApiKeys-BE2aLp-q.mjs} +1 -1
- package/dist/{useDevPortalApiBaseUrl-DoEmQpw0.mjs → useDevPortalApiBaseUrl-TaJ7GhG5.mjs} +9 -1
- package/dist/{useMySubscriptions-CAvkfuhc.mjs → useMySubscriptions-DnjIFrcQ.mjs} +1 -1
- package/dist/{usePlans-ARES9Hcn.mjs → usePlans-BfvrukjB.mjs} +1 -1
- package/dist/{useUsage-4fYIwe5V.mjs → useUsage-DQty3tDN.mjs} +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as PricingCard } from "./PricingCard-
|
|
2
|
+
import { b as withPlanFeatures, c as isActiveSubscription, n as useDevPortalPreviewMode, p as parseManifestPlans, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
3
|
+
import { t as PricingCard } from "./PricingCard-CrN4GIZ7.mjs";
|
|
4
4
|
import { n as readProblemDetail } from "./problem-details-n20-dy3w.mjs";
|
|
5
|
-
import { t as useMySubscriptions } from "./useMySubscriptions-
|
|
6
|
-
import { t as usePlans } from "./usePlans-
|
|
5
|
+
import { t as useMySubscriptions } from "./useMySubscriptions-DnjIFrcQ.mjs";
|
|
6
|
+
import { t as usePlans } from "./usePlans-BfvrukjB.mjs";
|
|
7
7
|
import { n as readPendingCheckout, t as clearPendingCheckout } from "./pending-checkout-DpVaNnTu.mjs";
|
|
8
8
|
import { Head } from "@lukoweb/apitogo/components";
|
|
9
9
|
import { CreditCardIcon } from "@lukoweb/apitogo/icons";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as ALREADY_SUBSCRIBED_PARAM, s as PRICING_PATH, t as ACCOUNT_PLANS_PATH } from "./paths-DBr3Dj_q.mjs";
|
|
2
|
-
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-
|
|
2
|
+
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
3
3
|
import { n as readProblemDetail, t as isAlreadySubscribedMessage } from "./problem-details-n20-dy3w.mjs";
|
|
4
4
|
import { r as rememberPendingCheckout } from "./pending-checkout-DpVaNnTu.mjs";
|
|
5
|
-
import { t as FREE_CHECKOUT_MARKER } from "./billing-state-
|
|
5
|
+
import { t as FREE_CHECKOUT_MARKER } from "./billing-state-CIqyRwkD.mjs";
|
|
6
6
|
import { ShieldIcon } from "@lukoweb/apitogo/icons";
|
|
7
7
|
import { Link, useNavigate, useSearchParams } from "@lukoweb/apitogo/router";
|
|
8
8
|
import { useEffect } from "react";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
2
|
import { s as PRICING_PATH } from "./paths-DBr3Dj_q.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl, u as isPlanCustomPriced } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
4
4
|
import { n as readProblemDetail } from "./problem-details-n20-dy3w.mjs";
|
|
5
|
-
import { t as usePlans } from "./usePlans-
|
|
5
|
+
import { t as usePlans } from "./usePlans-BfvrukjB.mjs";
|
|
6
6
|
import { Link, useSearchParams } from "@lukoweb/apitogo/router";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
2
|
import { t as ACCOUNT_PLANS_PATH } from "./paths-DBr3Dj_q.mjs";
|
|
3
|
-
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-
|
|
3
|
+
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
4
4
|
import { r as createDemoCredentials, t as DEMO_GATEWAY_KEY_HEADER } from "./demo-session-yK9qEqV-.mjs";
|
|
5
|
-
import { n as useApiKeys } from "./useApiKeys-
|
|
6
|
-
import { n as apiReferencePath, r as ApiKeysPanel } from "./account-links-
|
|
5
|
+
import { n as useApiKeys } from "./useApiKeys-BE2aLp-q.mjs";
|
|
6
|
+
import { n as apiReferencePath, r as ApiKeysPanel } from "./account-links-DGL7nKSZ.mjs";
|
|
7
7
|
import { i as ChoosePlanNotice, r as keyPlanNote, t as apiKeysPageState } from "./page-state-Cmo0FPLl.mjs";
|
|
8
8
|
import { Head } from "@lukoweb/apitogo/components";
|
|
9
9
|
import { KeyRoundIcon } from "@lukoweb/apitogo/icons";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
2
|
import { i as CONTACT_SALES_PATH, r as CHECKOUT_PATH } from "./paths-DBr3Dj_q.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { a as formatPlanDisplayPrice, c as isActiveSubscription, d as isPlanFree, f as listPlanFeatureLines, i as formatMoney, s as formatPlanPriceUnit, u as isPlanCustomPriced } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
4
4
|
import { Button } from "@lukoweb/apitogo/components";
|
|
5
5
|
import { Link as Link$1 } from "@lukoweb/apitogo/router";
|
|
6
6
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@lukoweb/apitogo/ui/AlertDialog.js";
|
|
@@ -26,7 +26,7 @@ const planCtaPath = (plan) => {
|
|
|
26
26
|
if (isPlanCustomPriced(plan) || (plan.prices?.length ?? 0) < 2) return base;
|
|
27
27
|
return `${base}&period=${encodeURIComponent(plan.billingPeriod)}¤cy=${encodeURIComponent(plan.priceCurrency)}`;
|
|
28
28
|
};
|
|
29
|
-
const PricingCard = ({ plan, mode = "public", subscriptionStatus, isSubscribed = false, onUnsubscribe, onSwitch, isSwitching = false, isCanceling = false, cancelDisabled = false, featured = false, isConfirming = false }) => {
|
|
29
|
+
const PricingCard = ({ plan, mode = "public", subscriptionStatus, isSubscribed = false, onUnsubscribe, onSwitch, isSwitching = false, isCanceling = false, cancelDisabled = false, featured = false, isConfirming = false, discount = null }) => {
|
|
30
30
|
const isActive = isSubscribed || isActiveSubscription(subscriptionStatus ?? "");
|
|
31
31
|
const { showEndpoints } = useDevPortalBillingConfig();
|
|
32
32
|
const features = listPlanFeatureLines(plan, { showEndpoints });
|
|
@@ -53,14 +53,39 @@ const PricingCard = ({ plan, mode = "public", subscriptionStatus, isSubscribed =
|
|
|
53
53
|
}) : null
|
|
54
54
|
]
|
|
55
55
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
className: "mt-3.5
|
|
58
|
-
children:
|
|
56
|
+
/* @__PURE__ */ jsxs("p", {
|
|
57
|
+
className: "mt-3.5 flex flex-wrap items-baseline gap-x-2.5",
|
|
58
|
+
children: [discount ? /* @__PURE__ */ jsxs("s", {
|
|
59
|
+
className: "text-xl font-semibold text-muted-foreground",
|
|
60
|
+
"data-testid": `original-price-${plan.sku}`,
|
|
61
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
62
|
+
className: "sr-only",
|
|
63
|
+
children: "Regular price "
|
|
64
|
+
}), formatMoney(discount.originalAmount, plan.priceCurrency)]
|
|
65
|
+
}) : null, /* @__PURE__ */ jsxs("span", {
|
|
66
|
+
className: "text-[2.1rem] font-extrabold tracking-[-0.02em]",
|
|
67
|
+
children: [discount ? /* @__PURE__ */ jsx("span", {
|
|
68
|
+
className: "sr-only",
|
|
69
|
+
children: "Now "
|
|
70
|
+
}) : null, displayPrice]
|
|
71
|
+
})]
|
|
59
72
|
}),
|
|
60
73
|
/* @__PURE__ */ jsx("p", {
|
|
61
|
-
className: "
|
|
74
|
+
className: "mt-0.5 text-[0.78125rem] text-muted-foreground",
|
|
62
75
|
children: formatPlanPriceUnit(plan)
|
|
63
76
|
}),
|
|
77
|
+
discount ? /* @__PURE__ */ jsxs("p", {
|
|
78
|
+
className: "mt-1.5 text-[0.8125rem] font-semibold text-emerald-600",
|
|
79
|
+
"data-testid": `saving-${plan.sku}`,
|
|
80
|
+
children: [
|
|
81
|
+
"You save ",
|
|
82
|
+
formatMoney(discount.savedAmount, plan.priceCurrency),
|
|
83
|
+
" (",
|
|
84
|
+
discount.percent,
|
|
85
|
+
"%)"
|
|
86
|
+
]
|
|
87
|
+
}) : null,
|
|
88
|
+
/* @__PURE__ */ jsx("div", { className: "mb-[18px]" }),
|
|
64
89
|
/* @__PURE__ */ jsx("div", {
|
|
65
90
|
className: "space-y-2",
|
|
66
91
|
children: mode === "account" ? isActive ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as PricingCard } from "./PricingCard-
|
|
4
|
-
import { t as usePlans } from "./usePlans-
|
|
2
|
+
import { b as withPlanFeatures, d as isPlanFree, g as pickFeaturedPlanSku, n as useDevPortalPreviewMode, p as parseManifestPlans, u as isPlanCustomPriced } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
3
|
+
import { t as PricingCard } from "./PricingCard-CrN4GIZ7.mjs";
|
|
4
|
+
import { t as usePlans } from "./usePlans-BfvrukjB.mjs";
|
|
5
5
|
import { t as isPreviewPricingEnabled } from "./pricing-config-Bc6eWFUO.mjs";
|
|
6
|
-
import { a as isPricingLoading, n as buildCompareRows } from "./billing-state-
|
|
6
|
+
import { a as isPricingLoading, n as buildCompareRows } from "./billing-state-CIqyRwkD.mjs";
|
|
7
7
|
import { Head, Heading } from "@lukoweb/apitogo/components";
|
|
8
8
|
import { Navigate } from "@lukoweb/apitogo/router";
|
|
9
9
|
import { useState } from "react";
|
|
@@ -86,18 +86,37 @@ function monthlyPriceFor(plan, plans) {
|
|
|
86
86
|
if (own) return own.amount;
|
|
87
87
|
return plans.map((other) => planAtPeriod(other, "monthly")).find((other) => isPaidFixed(other) && periodOf(other.billingPeriod) === "monthly" && nameKey(other) === nameKey(plan))?.priceAmount;
|
|
88
88
|
}
|
|
89
|
+
const cents = (amount) => Math.round(amount * 100) / 100;
|
|
89
90
|
/**
|
|
90
|
-
*
|
|
91
|
-
* price, or the monthly plan with the same name and currency. Null
|
|
91
|
+
* The saving of a plan as shown (already at its period's price) against paying monthly for as long: its own monthly
|
|
92
|
+
* price, or the monthly plan with the same name and currency. Null for a monthly price, nothing to compare with, or no
|
|
93
|
+
* saving.
|
|
94
|
+
*/
|
|
95
|
+
function discountFor(plan, plans) {
|
|
96
|
+
if (!isPaidFixed(plan)) return null;
|
|
97
|
+
const period = periodOf(plan.billingPeriod);
|
|
98
|
+
if (period === "monthly") return null;
|
|
99
|
+
const monthly = monthlyPriceFor(plan, plans);
|
|
100
|
+
if (!monthly) return null;
|
|
101
|
+
const originalAmount = cents(monthly * MONTHS[period]);
|
|
102
|
+
const savedAmount = cents(originalAmount - plan.priceAmount);
|
|
103
|
+
if (savedAmount <= 0) return null;
|
|
104
|
+
const percent = Math.round(savedAmount / originalAmount * 100);
|
|
105
|
+
return percent > 0 ? {
|
|
106
|
+
originalAmount,
|
|
107
|
+
savedAmount,
|
|
108
|
+
percent
|
|
109
|
+
} : null;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* What a plan saves in a longer period against paying monthly for as long, in whole percent. Null when there is
|
|
113
|
+
* nothing to compare with or no saving.
|
|
92
114
|
*/
|
|
93
115
|
function savingsPercent(plan, period, plans) {
|
|
94
116
|
if (period === "monthly" || !isPaidFixed(plan)) return null;
|
|
95
117
|
const atPeriod = planAtPeriod(plan, period);
|
|
96
118
|
if (periodOf(atPeriod.billingPeriod) !== period) return null;
|
|
97
|
-
|
|
98
|
-
if (!monthly) return null;
|
|
99
|
-
const percent = Math.round((1 - atPeriod.priceAmount / (monthly * MONTHS[period])) * 100);
|
|
100
|
-
return percent > 0 ? percent : null;
|
|
119
|
+
return discountFor(atPeriod, plans)?.percent ?? null;
|
|
101
120
|
}
|
|
102
121
|
/**
|
|
103
122
|
* A period button's badge: "Save 20%" when every plan saves the same, "Save up to 25%" when they differ, null when
|
|
@@ -293,7 +312,8 @@ const PricingPage = () => {
|
|
|
293
312
|
children: plans.map((plan) => /* @__PURE__ */ jsx(PricingCard, {
|
|
294
313
|
plan,
|
|
295
314
|
mode: "public",
|
|
296
|
-
featured: plan.sku === featuredSku
|
|
315
|
+
featured: plan.sku === featuredSku,
|
|
316
|
+
discount: periodChoice ? discountFor(plan, allPlans) : null
|
|
297
317
|
}, plan.sku))
|
|
298
318
|
}) : !isLoading && !isError ? /* @__PURE__ */ jsx("div", {
|
|
299
319
|
className: "mx-auto max-w-lg rounded-xl border border-dashed p-8 text-center text-sm text-muted-foreground",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
2
|
import { a as CREDENTIALS_PATH, n as ALREADY_SUBSCRIBED_PARAM, t as ACCOUNT_PLANS_PATH } from "./paths-DBr3Dj_q.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { t as useMySubscriptions } from "./useMySubscriptions-
|
|
5
|
-
import { t as usePlans } from "./usePlans-
|
|
3
|
+
import { c as isActiveSubscription, m as parseMonthlyQuotaCalls, o as formatPlanPrice, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
4
|
+
import { t as useMySubscriptions } from "./useMySubscriptions-DnjIFrcQ.mjs";
|
|
5
|
+
import { t as usePlans } from "./usePlans-BfvrukjB.mjs";
|
|
6
6
|
import { n as readPendingCheckout, t as clearPendingCheckout } from "./pending-checkout-DpVaNnTu.mjs";
|
|
7
|
-
import { n as useApiKeys } from "./useApiKeys-
|
|
8
|
-
import { t as useUsage } from "./useUsage-
|
|
9
|
-
import { i as hasPaymentProvider, r as checkoutConfirmingText } from "./billing-state-
|
|
7
|
+
import { n as useApiKeys } from "./useApiKeys-BE2aLp-q.mjs";
|
|
8
|
+
import { t as useUsage } from "./useUsage-DQty3tDN.mjs";
|
|
9
|
+
import { i as hasPaymentProvider, r as checkoutConfirmingText } from "./billing-state-CIqyRwkD.mjs";
|
|
10
10
|
import { i as ChoosePlanNotice, n as billingPageState, r as keyPlanNote } from "./page-state-Cmo0FPLl.mjs";
|
|
11
11
|
import { Head, Spinner } from "@lukoweb/apitogo/components";
|
|
12
12
|
import { Link as Link$1, useSearchParams } from "@lukoweb/apitogo/router";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as useMySubscriptions } from "./useMySubscriptions-
|
|
4
|
-
import { t as usePlans } from "./usePlans-
|
|
5
|
-
import { n as useUsageRecent, t as useUsage } from "./useUsage-
|
|
2
|
+
import { c as isActiveSubscription, h as parseQuotaPeriodDays, m as parseMonthlyQuotaCalls } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
3
|
+
import { t as useMySubscriptions } from "./useMySubscriptions-DnjIFrcQ.mjs";
|
|
4
|
+
import { t as usePlans } from "./usePlans-BfvrukjB.mjs";
|
|
5
|
+
import { n as useUsageRecent, t as useUsage } from "./useUsage-DQty3tDN.mjs";
|
|
6
6
|
import { Head } from "@lukoweb/apitogo/components";
|
|
7
7
|
import { Link as Link$1 } from "@lukoweb/apitogo/router";
|
|
8
8
|
import { useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as useRevokeApiKey, r as useCreateApiKey, t as API_KEY_CAP_REACHED } from "./useApiKeys-
|
|
1
|
+
import { i as useRevokeApiKey, r as useCreateApiKey, t as API_KEY_CAP_REACHED } from "./useApiKeys-BE2aLp-q.mjs";
|
|
2
2
|
import { Spinner } from "@lukoweb/apitogo/components";
|
|
3
3
|
import { KeyRoundIcon, TrashIcon } from "@lukoweb/apitogo/icons";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as quotaCell, v as rateLimitCell } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/billing-state.ts
|
|
4
4
|
/** Whether the pricing page has no plans to show yet because the answer is still on its way. */
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { t as AccountPlansPage } from "./AccountPlansPage-
|
|
1
|
+
import { t as AccountPlansPage } from "./AccountPlansPage-BDfagKTr.mjs";
|
|
2
2
|
import { n as registerDevPortalBillingOptions, r as useDevPortalBillingConfig, t as DevPortalBillingProvider } from "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
3
3
|
import { a as CREDENTIALS_PATH, c as SUBSCRIPTIONS_PATH, i as CONTACT_SALES_PATH, l as USAGE_PATH, o as LOGIN_NAV_PATH, r as CHECKOUT_PATH, s as PRICING_PATH, t as ACCOUNT_PLANS_PATH } from "./paths-DBr3Dj_q.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import "./PricingCard-
|
|
4
|
+
import { a as formatPlanDisplayPrice, c as isActiveSubscription, f as listPlanFeatureLines, g as pickFeaturedPlanSku, p as parseManifestPlans, s as formatPlanPriceUnit, y as resolveDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
5
|
+
import "./PricingCard-CrN4GIZ7.mjs";
|
|
6
6
|
import { t as DEMO_GATEWAY_KEY_HEADER } from "./demo-session-yK9qEqV-.mjs";
|
|
7
|
-
import { t as useMySubscriptions } from "./useMySubscriptions-
|
|
8
|
-
import { n as startPlansPrefetch, t as usePlans } from "./usePlans-
|
|
7
|
+
import { t as useMySubscriptions } from "./useMySubscriptions-DnjIFrcQ.mjs";
|
|
8
|
+
import { n as startPlansPrefetch, t as usePlans } from "./usePlans-BfvrukjB.mjs";
|
|
9
9
|
import "./pending-checkout-DpVaNnTu.mjs";
|
|
10
|
-
import { a as playgroundKeyIdentities, i as useRevokeApiKey, n as useApiKeys, r as useCreateApiKey, t as API_KEY_CAP_REACHED } from "./useApiKeys-
|
|
11
|
-
import { n as useUsageRecent, t as useUsage } from "./useUsage-
|
|
12
|
-
import { r as ApiKeysPanel, t as accountLayoutProps } from "./account-links-
|
|
10
|
+
import { a as playgroundKeyIdentities, i as useRevokeApiKey, n as useApiKeys, r as useCreateApiKey, t as API_KEY_CAP_REACHED } from "./useApiKeys-BE2aLp-q.mjs";
|
|
11
|
+
import { n as useUsageRecent, t as useUsage } from "./useUsage-DQty3tDN.mjs";
|
|
12
|
+
import { r as ApiKeysPanel, t as accountLayoutProps } from "./account-links-DGL7nKSZ.mjs";
|
|
13
13
|
import { t as isPreviewPricingEnabled } from "./pricing-config-Bc6eWFUO.mjs";
|
|
14
14
|
import { Head, Link } from "@lukoweb/apitogo/components";
|
|
15
15
|
import { ArrowRightIcon, KeyRoundIcon, StarsIcon } from "@lukoweb/apitogo/icons";
|
|
@@ -367,13 +367,13 @@ async function getSignedInIdentities(apiBaseUrl, fetchImpl = fetch) {
|
|
|
367
367
|
|
|
368
368
|
//#endregion
|
|
369
369
|
//#region src/DevPortalBillingPlugin.tsx
|
|
370
|
-
const AccountPlansPage$1 = lazy(() => import("./AccountPlansPage-
|
|
371
|
-
const CheckoutPage = lazy(() => import("./CheckoutPage-
|
|
372
|
-
const ContactSalesPage = lazy(() => import("./ContactSalesPage-
|
|
373
|
-
const CredentialsPage = lazy(() => import("./CredentialsPage-
|
|
374
|
-
const PricingPage = lazy(() => import("./PricingPage-
|
|
375
|
-
const SubscriptionsPage = lazy(() => import("./SubscriptionsPage-
|
|
376
|
-
const UsagePage = lazy(() => import("./UsagePage
|
|
370
|
+
const AccountPlansPage$1 = lazy(() => import("./AccountPlansPage-BDfagKTr.mjs").then((n) => n.n));
|
|
371
|
+
const CheckoutPage = lazy(() => import("./CheckoutPage-4tCFiL7W.mjs"));
|
|
372
|
+
const ContactSalesPage = lazy(() => import("./ContactSalesPage-BqxdJ4wl.mjs"));
|
|
373
|
+
const CredentialsPage = lazy(() => import("./CredentialsPage-DMVMiDdL.mjs"));
|
|
374
|
+
const PricingPage = lazy(() => import("./PricingPage-DPIF_DOP.mjs"));
|
|
375
|
+
const SubscriptionsPage = lazy(() => import("./SubscriptionsPage-C8hRY5Sr.mjs"));
|
|
376
|
+
const UsagePage = lazy(() => import("./UsagePage-Cwqnusaz.mjs"));
|
|
377
377
|
function resolvePricingEnabled(config) {
|
|
378
378
|
if (config.__meta?.pricingEnabled !== void 0) return config.__meta.pricingEnabled;
|
|
379
379
|
return isPreviewPricingEnabled();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
|
-
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-
|
|
2
|
+
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
3
3
|
import { n as readProblemDetail } from "./problem-details-n20-dy3w.mjs";
|
|
4
4
|
import { n as createDemoApiKeys, t as DEMO_GATEWAY_KEY_HEADER } from "./demo-session-yK9qEqV-.mjs";
|
|
5
5
|
import { useMutation, useQuery, useQueryClient } from "@lukoweb/apitogo/react-query";
|
|
@@ -84,6 +84,14 @@ function isPlanCustomPriced(plan) {
|
|
|
84
84
|
function formatCustomPriceLabel(plan) {
|
|
85
85
|
return plan.priceLabel?.trim() || "Custom";
|
|
86
86
|
}
|
|
87
|
+
/** An amount in a currency, with cents only when it has them (`$588`, `$470.40`). */
|
|
88
|
+
function formatMoney(amount, currency) {
|
|
89
|
+
return new Intl.NumberFormat(void 0, {
|
|
90
|
+
style: "currency",
|
|
91
|
+
currency: currency.toUpperCase(),
|
|
92
|
+
minimumFractionDigits: Math.round(amount * 100) % 100 === 0 ? 0 : 2
|
|
93
|
+
}).format(amount);
|
|
94
|
+
}
|
|
87
95
|
function formatPlanPrice(plan) {
|
|
88
96
|
if (isPlanCustomPriced(plan)) return formatCustomPriceLabel(plan);
|
|
89
97
|
if (plan.priceAmount <= 0) return "Free";
|
|
@@ -273,4 +281,4 @@ function useDevPortalPreviewMode() {
|
|
|
273
281
|
}
|
|
274
282
|
|
|
275
283
|
//#endregion
|
|
276
|
-
export {
|
|
284
|
+
export { quotaCell as _, formatPlanDisplayPrice as a, withPlanFeatures as b, isActiveSubscription as c, isPlanFree as d, listPlanFeatureLines as f, pickFeaturedPlanSku as g, parseQuotaPeriodDays as h, formatMoney as i, isPlaceholderDevPortalApiUrl as l, parseMonthlyQuotaCalls as m, useDevPortalPreviewMode as n, formatPlanPrice as o, parseManifestPlans as p, useIsDemoSession as r, formatPlanPriceUnit as s, useDevPortalApiBaseUrl as t, isPlanCustomPriced as u, rateLimitCell as v, resolveDevPortalApiBaseUrl as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
|
-
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-
|
|
2
|
+
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
3
3
|
import { i as createDemoMeResponse } from "./demo-session-yK9qEqV-.mjs";
|
|
4
4
|
import { useQuery } from "@lukoweb/apitogo/react-query";
|
|
5
5
|
import { useAuth } from "@lukoweb/apitogo/hooks";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-BUQPLoyk.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { b as withPlanFeatures, l as isPlaceholderDevPortalApiUrl, n as useDevPortalPreviewMode, p as parseManifestPlans, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
3
3
|
import { useQuery } from "@lukoweb/apitogo/react-query";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/plans-prefetch.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-
|
|
1
|
+
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-TaJ7GhG5.mjs";
|
|
2
2
|
import { useQuery } from "@lukoweb/apitogo/react-query";
|
|
3
3
|
import { useAuth } from "@lukoweb/apitogo/hooks";
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lukoweb/apitogo-plugin-dev-portal-billing",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.79",
|
|
4
4
|
"homepage": "https://docs.apitogo.com",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"react": "19.2.4",
|
|
43
43
|
"react-dom": "19.2.4",
|
|
44
44
|
"tsdown": "0.20.3",
|
|
45
|
-
"@lukoweb/apitogo": "0.2.
|
|
46
|
-
"@lukoweb/apitogo-module-user-panel": "0.2.
|
|
45
|
+
"@lukoweb/apitogo": "0.2.79",
|
|
46
|
+
"@lukoweb/apitogo-module-user-panel": "0.2.79"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": ">=19.2.0",
|