@lukoweb/apitogo-plugin-dev-portal-billing 0.2.57 → 0.2.58
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-DBBVHGuw.mjs → AccountPlansPage-DW3DhOfi.mjs} +3 -3
- package/dist/{ContactSalesPage-D4jX0rtt.mjs → ContactSalesPage-CNx7qTyo.mjs} +2 -2
- package/dist/{CredentialsPage-CVecoIuQ.mjs → CredentialsPage-CZeYg5Bd.mjs} +3 -3
- package/dist/DevPortalBillingContext-WcoincpU.mjs +23 -0
- package/dist/{PricingPage-BM7NH4VQ.mjs → PricingPage-CmeLQeEx.mjs} +2 -2
- package/dist/{SubscriptionsPage-C58HnDmQ.mjs → SubscriptionsPage-9SubcmOS.mjs} +4 -4
- package/dist/{UsagePage-C5opT1KD.mjs → UsagePage-CFZTZMvk.mjs} +3 -3
- package/dist/{account-links-CpTOzb2V.mjs → account-links-kIj72Vb2.mjs} +1 -1
- package/dist/index.mjs +13 -12
- package/dist/{useApiKeys-CnyxipLc.mjs → useApiKeys-BrYWVXE9.mjs} +1 -1
- package/dist/{useMySubscriptions-C1UMb8rJ.mjs → useMySubscriptions-C291WpgF.mjs} +1 -1
- package/dist/{usePlans-D_Khso7B.mjs → usePlans-c8s0gfOq.mjs} +1 -1
- package/package.json +3 -3
- package/dist/DevPortalBillingContext-CR83s4LO.mjs +0 -13
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { f as parseManifestPlans, n as useDevPortalPreviewMode, r as useIsDemoSession, s as isActiveSubscription, t as useDevPortalApiBaseUrl, y as withPlanFeatures } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
2
2
|
import { t as PricingCard } from "./PricingCard-CRlUGh0k.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-WcoincpU.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-C291WpgF.mjs";
|
|
6
|
+
import { t as usePlans } from "./usePlans-c8s0gfOq.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 { s as PRICING_PATH } from "./paths-DaVyTIDJ.mjs";
|
|
2
2
|
import { l as isPlanCustomPriced, n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
3
|
-
import "./DevPortalBillingContext-
|
|
3
|
+
import "./DevPortalBillingContext-WcoincpU.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-c8s0gfOq.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 { t as ACCOUNT_PLANS_PATH } from "./paths-DaVyTIDJ.mjs";
|
|
2
2
|
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-WcoincpU.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-BrYWVXE9.mjs";
|
|
6
|
+
import { n as apiReferencePath, r as ApiKeysPanel } from "./account-links-kIj72Vb2.mjs";
|
|
7
7
|
import { i as ChoosePlanNotice, r as keyPlanNote, t as apiKeysPageState } from "./page-state-BLL2JJBc.mjs";
|
|
8
8
|
import { Head } from "@lukoweb/apitogo/components";
|
|
9
9
|
import { KeyRoundIcon } from "@lukoweb/apitogo/icons";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/DevPortalBillingContext.tsx
|
|
5
|
+
const DevPortalBillingContext = createContext(null);
|
|
6
|
+
/**
|
|
7
|
+
* The options the plugin was created with. The billing pages get them from the provider; a component outside those
|
|
8
|
+
* pages (the portal's home page, which uses `useGatewayCall` and `usePlansPreview`) got an empty object, so its code
|
|
9
|
+
* sample showed `https://YOUR-GATEWAY` and its plans came from the preview catalog (API-130).
|
|
10
|
+
*/
|
|
11
|
+
let registeredOptions = {};
|
|
12
|
+
/** Called by the plugin when it is created, so the hooks work on every page of the portal. */
|
|
13
|
+
const registerDevPortalBillingOptions = (options) => {
|
|
14
|
+
registeredOptions = options;
|
|
15
|
+
};
|
|
16
|
+
const DevPortalBillingProvider = ({ options, children }) => /* @__PURE__ */ jsx(DevPortalBillingContext.Provider, {
|
|
17
|
+
value: options,
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
const useDevPortalBillingConfig = () => useContext(DevPortalBillingContext) ?? registeredOptions;
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { registerDevPortalBillingOptions as n, useDevPortalBillingConfig as r, DevPortalBillingProvider as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { f as parseManifestPlans, h as pickFeaturedPlanSku, n as useDevPortalPreviewMode, y as withPlanFeatures } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
2
2
|
import { t as PricingCard } from "./PricingCard-CRlUGh0k.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { t as usePlans } from "./usePlans-
|
|
3
|
+
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-WcoincpU.mjs";
|
|
4
|
+
import { t as usePlans } from "./usePlans-c8s0gfOq.mjs";
|
|
5
5
|
import { t as isPreviewPricingEnabled } from "./pricing-config-Bc6eWFUO.mjs";
|
|
6
6
|
import { a as isPricingLoading, n as buildCompareRows } from "./billing-state-CJmy96zI.mjs";
|
|
7
7
|
import { Head, Heading } from "@lukoweb/apitogo/components";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as CREDENTIALS_PATH, n as ALREADY_SUBSCRIBED_PARAM, t as ACCOUNT_PLANS_PATH } from "./paths-DaVyTIDJ.mjs";
|
|
2
2
|
import { a as formatPlanPrice, p as parseMonthlyQuotaCalls, s as isActiveSubscription, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { t as useMySubscriptions } from "./useMySubscriptions-
|
|
5
|
-
import { t as usePlans } from "./usePlans-
|
|
3
|
+
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-WcoincpU.mjs";
|
|
4
|
+
import { t as useMySubscriptions } from "./useMySubscriptions-C291WpgF.mjs";
|
|
5
|
+
import { t as usePlans } from "./usePlans-c8s0gfOq.mjs";
|
|
6
6
|
import { n as readPendingCheckout, t as clearPendingCheckout } from "./pending-checkout-DpVaNnTu.mjs";
|
|
7
|
-
import { n as useApiKeys } from "./useApiKeys-
|
|
7
|
+
import { n as useApiKeys } from "./useApiKeys-BrYWVXE9.mjs";
|
|
8
8
|
import { t as useUsage } from "./useUsage-DeEDgDdj.mjs";
|
|
9
9
|
import { i as hasPaymentProvider, r as checkoutConfirmingText } from "./billing-state-CJmy96zI.mjs";
|
|
10
10
|
import { i as ChoosePlanNotice, n as billingPageState, r as keyPlanNote } from "./page-state-BLL2JJBc.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as parseQuotaPeriodDays, p as parseMonthlyQuotaCalls, s as isActiveSubscription } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
2
|
-
import "./DevPortalBillingContext-
|
|
3
|
-
import { t as useMySubscriptions } from "./useMySubscriptions-
|
|
4
|
-
import { t as usePlans } from "./usePlans-
|
|
2
|
+
import "./DevPortalBillingContext-WcoincpU.mjs";
|
|
3
|
+
import { t as useMySubscriptions } from "./useMySubscriptions-C291WpgF.mjs";
|
|
4
|
+
import { t as usePlans } from "./usePlans-c8s0gfOq.mjs";
|
|
5
5
|
import { n as useUsageRecent, t as useUsage } from "./useUsage-DeEDgDdj.mjs";
|
|
6
6
|
import { Head } from "@lukoweb/apitogo/components";
|
|
7
7
|
import { Link as Link$1 } from "@lukoweb/apitogo/router";
|
|
@@ -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-BrYWVXE9.mjs";
|
|
2
2
|
import { Spinner } from "@lukoweb/apitogo/components";
|
|
3
3
|
import { KeyRoundIcon, TrashIcon } from "@lukoweb/apitogo/icons";
|
|
4
4
|
import { useState } from "react";
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { t as AccountPlansPage } from "./AccountPlansPage-
|
|
1
|
+
import { t as AccountPlansPage } from "./AccountPlansPage-DW3DhOfi.mjs";
|
|
2
2
|
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-DaVyTIDJ.mjs";
|
|
3
3
|
import { d as listPlanFeatureLines, f as parseManifestPlans, h as pickFeaturedPlanSku, i as formatPlanDisplayPrice, o as formatPlanPriceUnit, s as isActiveSubscription, v as resolveDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
4
4
|
import "./PricingCard-CRlUGh0k.mjs";
|
|
5
|
-
import { n as useDevPortalBillingConfig, t as DevPortalBillingProvider } from "./DevPortalBillingContext-
|
|
5
|
+
import { n as registerDevPortalBillingOptions, r as useDevPortalBillingConfig, t as DevPortalBillingProvider } from "./DevPortalBillingContext-WcoincpU.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-C291WpgF.mjs";
|
|
8
|
+
import { n as startPlansPrefetch, t as usePlans } from "./usePlans-c8s0gfOq.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-
|
|
10
|
+
import { a as playgroundKeyIdentities, i as useRevokeApiKey, n as useApiKeys, r as useCreateApiKey, t as API_KEY_CAP_REACHED } from "./useApiKeys-BrYWVXE9.mjs";
|
|
11
11
|
import { n as useUsageRecent, t as useUsage } from "./useUsage-DeEDgDdj.mjs";
|
|
12
|
-
import { r as ApiKeysPanel, t as accountLayoutProps } from "./account-links-
|
|
12
|
+
import { r as ApiKeysPanel, t as accountLayoutProps } from "./account-links-kIj72Vb2.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,18 +367,19 @@ async function getSignedInIdentities(apiBaseUrl, fetchImpl = fetch) {
|
|
|
367
367
|
|
|
368
368
|
//#endregion
|
|
369
369
|
//#region src/DevPortalBillingPlugin.tsx
|
|
370
|
-
const AccountPlansPage$1 = lazy(() => import("./AccountPlansPage-
|
|
370
|
+
const AccountPlansPage$1 = lazy(() => import("./AccountPlansPage-DW3DhOfi.mjs").then((n) => n.n));
|
|
371
371
|
const CheckoutPage = lazy(() => import("./CheckoutPage-CZ9NXp8z.mjs"));
|
|
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-
|
|
372
|
+
const ContactSalesPage = lazy(() => import("./ContactSalesPage-CNx7qTyo.mjs"));
|
|
373
|
+
const CredentialsPage = lazy(() => import("./CredentialsPage-CZeYg5Bd.mjs"));
|
|
374
|
+
const PricingPage = lazy(() => import("./PricingPage-CmeLQeEx.mjs"));
|
|
375
|
+
const SubscriptionsPage = lazy(() => import("./SubscriptionsPage-9SubcmOS.mjs"));
|
|
376
|
+
const UsagePage = lazy(() => import("./UsagePage-CFZTZMvk.mjs"));
|
|
377
377
|
function resolvePricingEnabled(config) {
|
|
378
378
|
if (config.__meta?.pricingEnabled !== void 0) return config.__meta.pricingEnabled;
|
|
379
379
|
return isPreviewPricingEnabled();
|
|
380
380
|
}
|
|
381
381
|
const devPortalBillingPlugin = createPlugin((options = {}) => {
|
|
382
|
+
registerDevPortalBillingOptions(options);
|
|
382
383
|
if (typeof window !== "undefined" && window.location.pathname.replace(/\/+$/, "") === PRICING_PATH) startPlansPrefetch(resolveDevPortalApiBaseUrl(options.apiBaseUrl));
|
|
383
384
|
const accountLayoutProps$1 = accountLayoutProps(options);
|
|
384
385
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-WcoincpU.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-WcoincpU.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 { c as isPlaceholderDevPortalApiUrl, f as parseManifestPlans, n as useDevPortalPreviewMode, r as useIsDemoSession, t as useDevPortalApiBaseUrl, y as withPlanFeatures } from "./useDevPortalApiBaseUrl-BfpUBayO.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { r as useDevPortalBillingConfig } from "./DevPortalBillingContext-WcoincpU.mjs";
|
|
3
3
|
import { useQuery } from "@lukoweb/apitogo/react-query";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/plans-prefetch.ts
|
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.58",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/zuplo/zudoku",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"react": "19.2.4",
|
|
47
47
|
"react-dom": "19.2.4",
|
|
48
48
|
"tsdown": "0.20.3",
|
|
49
|
-
"@lukoweb/apitogo": "0.2.
|
|
50
|
-
"@lukoweb/apitogo-module-user-panel": "0.2.
|
|
49
|
+
"@lukoweb/apitogo": "0.2.58",
|
|
50
|
+
"@lukoweb/apitogo-module-user-panel": "0.2.58"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": ">=19.2.0",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/DevPortalBillingContext.tsx
|
|
5
|
-
const DevPortalBillingContext = createContext({});
|
|
6
|
-
const DevPortalBillingProvider = ({ options, children }) => /* @__PURE__ */ jsx(DevPortalBillingContext.Provider, {
|
|
7
|
-
value: options,
|
|
8
|
-
children
|
|
9
|
-
});
|
|
10
|
-
const useDevPortalBillingConfig = () => useContext(DevPortalBillingContext);
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { useDevPortalBillingConfig as n, DevPortalBillingProvider as t };
|