@openrails/billing-ui 0.241.0 → 0.243.0
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/CHANGELOG.md +27 -11
- package/README.md +41 -8
- package/dist/admin/billing-admin.d.ts +3 -0
- package/dist/admin/components/app-sidebar.d.ts +1 -0
- package/dist/admin/components/confirm.d.ts +4 -0
- package/dist/admin/components/cursor-pager.d.ts +8 -0
- package/dist/admin/components/data-table.d.ts +14 -0
- package/dist/admin/components/fact-card.d.ts +5 -0
- package/dist/admin/components/form-field-errors.d.ts +3 -0
- package/dist/admin/components/linked-table-row.d.ts +5 -0
- package/dist/admin/components/logo.d.ts +3 -0
- package/dist/admin/components/no-access.d.ts +3 -0
- package/dist/admin/components/no-merchants.d.ts +1 -0
- package/dist/admin/components/notification-bell.d.ts +2 -0
- package/dist/admin/components/route-error.d.ts +3 -0
- package/dist/admin/components/site-header.d.ts +9 -0
- package/dist/admin/components/status-badge.d.ts +3 -0
- package/dist/admin/components/typed-confirm-dialog.d.ts +11 -0
- package/dist/admin/components/ui/alert-dialog.d.ts +18 -0
- package/dist/admin/components/ui/avatar.d.ts +11 -0
- package/dist/admin/components/ui/badge.d.ts +7 -0
- package/dist/admin/components/ui/breadcrumb.d.ts +10 -0
- package/dist/admin/components/ui/button.d.ts +8 -0
- package/dist/admin/components/ui/card.d.ts +11 -0
- package/dist/admin/components/ui/chart.d.ts +44 -0
- package/dist/admin/components/ui/dialog.d.ts +17 -0
- package/dist/admin/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/admin/components/ui/input.d.ts +3 -0
- package/dist/admin/components/ui/label.d.ts +3 -0
- package/dist/admin/components/ui/select.d.ts +15 -0
- package/dist/admin/components/ui/separator.d.ts +3 -0
- package/dist/admin/components/ui/sheet.d.ts +14 -0
- package/dist/admin/components/ui/sidebar.d.ts +63 -0
- package/dist/admin/components/ui/skeleton.d.ts +2 -0
- package/dist/admin/components/ui/sonner.d.ts +3 -0
- package/dist/admin/components/ui/switch.d.ts +5 -0
- package/dist/admin/components/ui/table.d.ts +10 -0
- package/dist/admin/components/ui/tabs.d.ts +10 -0
- package/dist/admin/components/ui/textarea.d.ts +3 -0
- package/dist/admin/components/ui/tooltip.d.ts +6 -0
- package/dist/admin/context.d.ts +1193 -0
- package/dist/admin/hooks/use-mobile.d.ts +1 -0
- package/dist/admin/index.d.ts +5 -0
- package/dist/admin/layouts/app-layout.d.ts +4 -0
- package/dist/admin/lib/api/client.d.ts +64 -0
- package/dist/admin/lib/api/copilot.d.ts +6 -0
- package/dist/admin/lib/api/credit-endpoints.d.ts +8 -0
- package/dist/admin/lib/api/credit-types.d.ts +9 -0
- package/dist/admin/lib/api/endpoints.d.ts +133 -0
- package/dist/admin/lib/api/index.d.ts +89 -0
- package/dist/admin/lib/api/invoice-profile-endpoints.d.ts +6 -0
- package/dist/admin/lib/api/metrics.d.ts +68 -0
- package/dist/admin/lib/api/order-endpoints.d.ts +21 -0
- package/dist/admin/lib/api/types.d.ts +122 -0
- package/dist/admin/lib/auth.d.ts +6 -0
- package/dist/admin/lib/capabilities.d.ts +13 -0
- package/dist/admin/lib/chunk-error.d.ts +1 -0
- package/dist/admin/lib/confirm.d.ts +11 -0
- package/dist/admin/lib/credit-queries.d.ts +23 -0
- package/dist/admin/lib/csv.d.ts +3 -0
- package/dist/admin/lib/cursor-pages.d.ts +13 -0
- package/dist/admin/lib/dialog-width.d.ts +6 -0
- package/dist/admin/lib/dom.d.ts +1 -0
- package/dist/admin/lib/duration.d.ts +3 -0
- package/dist/admin/lib/format.d.ts +23 -0
- package/dist/admin/lib/mount.d.ts +6 -0
- package/dist/admin/lib/mutations.d.ts +125 -0
- package/dist/admin/lib/order-queries.d.ts +29 -0
- package/dist/admin/lib/queries.d.ts +369 -0
- package/dist/admin/lib/query-client.d.ts +3 -0
- package/dist/admin/lib/toast.d.ts +10 -0
- package/dist/admin/lib/utils.d.ts +2 -0
- package/dist/admin/messages.d.ts +670 -0
- package/dist/admin/navigation.d.ts +14 -0
- package/dist/admin/pages/catalog/application-dialog.d.ts +2 -0
- package/dist/admin/pages/catalog/copilot-panel.d.ts +4 -0
- package/dist/admin/pages/catalog/index.d.ts +4 -0
- package/dist/admin/pages/catalog/meter-form.d.ts +6 -0
- package/dist/admin/pages/catalog/metering-model.d.ts +67 -0
- package/dist/admin/pages/catalog/metering.d.ts +3 -0
- package/dist/admin/pages/catalog/price-detail.d.ts +2 -0
- package/dist/admin/pages/catalog/price-format.d.ts +3 -0
- package/dist/admin/pages/catalog/price-wizard-logic.d.ts +20 -0
- package/dist/admin/pages/catalog/price-wizard.d.ts +10 -0
- package/dist/admin/pages/catalog/psp-links.d.ts +10 -0
- package/dist/admin/pages/catalog/rate-card-editor.d.ts +10 -0
- package/dist/admin/pages/customers/credit-form.d.ts +14 -0
- package/dist/admin/pages/customers/credits.d.ts +5 -0
- package/dist/admin/pages/customers/default-card-badges.d.ts +3 -0
- package/dist/admin/pages/customers/detail.d.ts +5 -0
- package/dist/admin/pages/customers/grant-duration.d.ts +32 -0
- package/dist/admin/pages/customers/index.d.ts +2 -0
- package/dist/admin/pages/customers/invoice-profile-model.d.ts +18 -0
- package/dist/admin/pages/customers/invoice-profile.d.ts +9 -0
- package/dist/admin/pages/dashboard/index.d.ts +2 -0
- package/dist/admin/pages/dashboard/lib.d.ts +48 -0
- package/dist/admin/pages/dashboard/range-picker.d.ts +1 -0
- package/dist/admin/pages/dashboard/range.d.ts +34 -0
- package/dist/admin/pages/dashboard/reports-model.d.ts +29 -0
- package/dist/admin/pages/dashboard/reports.d.ts +2 -0
- package/dist/admin/pages/dashboard/use-range.d.ts +5 -0
- package/dist/admin/pages/dashboard/widget-editor.d.ts +8 -0
- package/dist/admin/pages/dashboard/widget-tile.d.ts +9 -0
- package/dist/admin/pages/dashboard/widget-viz.d.ts +12 -0
- package/dist/admin/pages/ops/index.d.ts +2 -0
- package/dist/admin/pages/orders/detail.d.ts +5 -0
- package/dist/admin/pages/orders/index.d.ts +1 -0
- package/dist/admin/pages/orders/model.d.ts +7 -0
- package/dist/admin/pages/payments/attempts.d.ts +7 -0
- package/dist/admin/pages/payments/detail.d.ts +2 -0
- package/dist/admin/pages/payments/health-model.d.ts +149 -0
- package/dist/admin/pages/payments/health.d.ts +2 -0
- package/dist/admin/pages/payments/index.d.ts +2 -0
- package/dist/admin/pages/settings/configuration-edit.d.ts +9 -0
- package/dist/admin/pages/settings/index.d.ts +9 -0
- package/dist/admin/pages/settings/notifications.d.ts +2 -0
- package/dist/admin/pages/settings/setting-fields.d.ts +20 -0
- package/dist/admin/pages/subscriptions/change-subscription-dialog.d.ts +16 -0
- package/dist/admin/pages/subscriptions/detail.d.ts +2 -0
- package/dist/admin/pages/subscriptions/dunning.d.ts +2 -0
- package/dist/admin/pages/subscriptions/index.d.ts +2 -0
- package/dist/admin/pages/subscriptions/subscription-change-options.d.ts +23 -0
- package/dist/admin/pages/subscriptions/views.d.ts +15 -0
- package/dist/admin/router.d.ts +32 -0
- package/dist/admin/routes.d.ts +5 -0
- package/dist/admin/summary.d.ts +27 -0
- package/dist/admin/theme.d.ts +2 -0
- package/dist/admin/types.d.ts +56 -0
- package/dist/admin/ui-context.d.ts +14 -0
- package/dist/admin-attempts-lAoW-Urd.js +419 -0
- package/dist/admin-attempts-lAoW-Urd.js.map +1 -0
- package/dist/admin-auth-DQGHtt0j.js +14 -0
- package/dist/admin-auth-DQGHtt0j.js.map +1 -0
- package/dist/admin-badge-DR5-1qd8.js +31 -0
- package/dist/admin-badge-DR5-1qd8.js.map +1 -0
- package/dist/admin-button-CTL3DgOt.js +46 -0
- package/dist/admin-button-CTL3DgOt.js.map +1 -0
- package/dist/admin-capabilities-BuigAgtm.js +59 -0
- package/dist/admin-capabilities-BuigAgtm.js.map +1 -0
- package/dist/admin-card-bzAks3-3.js +51 -0
- package/dist/admin-card-bzAks3-3.js.map +1 -0
- package/dist/admin-catalog-CC7I4n0_.js +1189 -0
- package/dist/admin-catalog-CC7I4n0_.js.map +1 -0
- package/dist/admin-confirm-katGq0Qo.js +12 -0
- package/dist/admin-confirm-katGq0Qo.js.map +1 -0
- package/dist/admin-csv-CPoNZj2D.js +16 -0
- package/dist/admin-csv-CPoNZj2D.js.map +1 -0
- package/dist/admin-customers-D8u5gq3M.js +160 -0
- package/dist/admin-customers-D8u5gq3M.js.map +1 -0
- package/dist/admin-dashboard-DqqFjOzq.js +420 -0
- package/dist/admin-dashboard-DqqFjOzq.js.map +1 -0
- package/dist/admin-data-table-qfXLOFmN.js +96 -0
- package/dist/admin-data-table-qfXLOFmN.js.map +1 -0
- package/dist/admin-detail-5aNNvrc0.js +324 -0
- package/dist/admin-detail-5aNNvrc0.js.map +1 -0
- package/dist/admin-detail-7p684Uyc.js +342 -0
- package/dist/admin-detail-7p684Uyc.js.map +1 -0
- package/dist/admin-detail-CGOyqs7s.js +1312 -0
- package/dist/admin-detail-CGOyqs7s.js.map +1 -0
- package/dist/admin-detail-DUAJQg8G.js +710 -0
- package/dist/admin-detail-DUAJQg8G.js.map +1 -0
- package/dist/admin-dialog-BjuKI5Hp.js +88 -0
- package/dist/admin-dialog-BjuKI5Hp.js.map +1 -0
- package/dist/admin-dialog-width-BPrgdYlj.js +6 -0
- package/dist/admin-dialog-width-BPrgdYlj.js.map +1 -0
- package/dist/admin-dom-uMmZzRvU.js +149 -0
- package/dist/admin-dom-uMmZzRvU.js.map +1 -0
- package/dist/admin-dropdown-menu-BW1D_h6s.js +69 -0
- package/dist/admin-dropdown-menu-BW1D_h6s.js.map +1 -0
- package/dist/admin-dunning-B2zgtrOo.js +10 -0
- package/dist/admin-dunning-B2zgtrOo.js.map +1 -0
- package/dist/admin-fact-card-DO_fHosg.js +20 -0
- package/dist/admin-fact-card-DO_fHosg.js.map +1 -0
- package/dist/admin-form-field-errors-hbUMIriS.js +14 -0
- package/dist/admin-form-field-errors-hbUMIriS.js.map +1 -0
- package/dist/admin-format-DoohJ7Fg.js +136 -0
- package/dist/admin-format-DoohJ7Fg.js.map +1 -0
- package/dist/admin-health-B4jN2LwR.js +983 -0
- package/dist/admin-health-B4jN2LwR.js.map +1 -0
- package/dist/admin-input-CcfQfJFN.js +17 -0
- package/dist/admin-input-CcfQfJFN.js.map +1 -0
- package/dist/admin-invoice-profile-model-Cgjy3zV8.js +53 -0
- package/dist/admin-invoice-profile-model-Cgjy3zV8.js.map +1 -0
- package/dist/admin-label-BiEN5cjb.js +15 -0
- package/dist/admin-label-BiEN5cjb.js.map +1 -0
- package/dist/admin-linked-table-row-BsaUruCN.js +26 -0
- package/dist/admin-linked-table-row-BsaUruCN.js.map +1 -0
- package/dist/admin-metering-BGAXbT23.js +1702 -0
- package/dist/admin-metering-BGAXbT23.js.map +1 -0
- package/dist/admin-ops-B3mcr76u.js +217 -0
- package/dist/admin-ops-B3mcr76u.js.map +1 -0
- package/dist/admin-orders-dxC99Idl.js +192 -0
- package/dist/admin-orders-dxC99Idl.js.map +1 -0
- package/dist/admin-payments-Bs7HSfP0.js +246 -0
- package/dist/admin-payments-Bs7HSfP0.js.map +1 -0
- package/dist/admin-price-detail-DRquxpA9.js +482 -0
- package/dist/admin-price-detail-DRquxpA9.js.map +1 -0
- package/dist/admin-price-format-DM1qORWI.js +44 -0
- package/dist/admin-price-format-DM1qORWI.js.map +1 -0
- package/dist/admin-price-wizard-CI7K-2Nz.js +357 -0
- package/dist/admin-price-wizard-CI7K-2Nz.js.map +1 -0
- package/dist/admin-range-picker-Dr2M1EZr.js +192 -0
- package/dist/admin-range-picker-Dr2M1EZr.js.map +1 -0
- package/dist/admin-reports-CywKLiSA.js +320 -0
- package/dist/admin-reports-CywKLiSA.js.map +1 -0
- package/dist/admin-select-DBgprVW6.js +81 -0
- package/dist/admin-select-DBgprVW6.js.map +1 -0
- package/dist/admin-settings-Bmoy95uO.js +1434 -0
- package/dist/admin-settings-Bmoy95uO.js.map +1 -0
- package/dist/admin-skeleton-DsM7crYi.js +14 -0
- package/dist/admin-skeleton-DsM7crYi.js.map +1 -0
- package/dist/admin-status-badge-BFPgo71d.js +38 -0
- package/dist/admin-status-badge-BFPgo71d.js.map +1 -0
- package/dist/admin-subscriptions-CLYc_HEV.js +301 -0
- package/dist/admin-subscriptions-CLYc_HEV.js.map +1 -0
- package/dist/admin-switch-BJUxLCsa.js +20 -0
- package/dist/admin-switch-BJUxLCsa.js.map +1 -0
- package/dist/admin-table-CH9TrXJf.js +61 -0
- package/dist/admin-table-CH9TrXJf.js.map +1 -0
- package/dist/admin-tabs-528FJMjt.js +46 -0
- package/dist/admin-tabs-528FJMjt.js.map +1 -0
- package/dist/admin-textarea-DEz38RaI.js +15 -0
- package/dist/admin-textarea-DEz38RaI.js.map +1 -0
- package/dist/admin-typed-confirm-dialog-DU7m9-O7.js +66 -0
- package/dist/admin-typed-confirm-dialog-DU7m9-O7.js.map +1 -0
- package/dist/admin-utils-BK4Vh1o_.js +1809 -0
- package/dist/admin-utils-BK4Vh1o_.js.map +1 -0
- package/dist/admin-widget-viz-Da48c-Zf.js +581 -0
- package/dist/admin-widget-viz-Da48c-Zf.js.map +1 -0
- package/dist/admin.css +3 -0
- package/dist/admin.js +2164 -0
- package/dist/admin.js.map +1 -0
- package/dist/appearance.d.ts +1 -1
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/routes.d.ts +2156 -189
- package/dist/client/generated/wire.d.ts +1265 -50
- package/dist/client/types.d.ts +0 -1
- package/dist/{client-Cxz_miQj.js → client-PjivPHmE.js} +2 -3
- package/dist/client-PjivPHmE.js.map +1 -0
- package/dist/client.js +1 -1
- package/dist/{hooks-aKefXeMO.js → hooks-Ckd8F2JF.js} +8 -8
- package/dist/hooks-Ckd8F2JF.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/lib/{offer-label.d.ts → price-label.d.ts} +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.d.ts +1 -1
- package/dist/locales/en.js +1 -1
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +1 -1
- package/dist/locales/zh.js.map +1 -1
- package/dist/{offers.d.ts → product-list.d.ts} +5 -5
- package/dist/react.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +28 -6
- package/dist/client-Cxz_miQj.js.map +0 -1
- package/dist/hooks-aKefXeMO.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PSP } from '../../../client/generated/wire';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare function SettingsPage(): React.JSX.Element;
|
|
4
|
+
export declare function MerchantSettingsTab(): React.JSX.Element;
|
|
5
|
+
export declare function PSPsTab(): React.JSX.Element;
|
|
6
|
+
export declare function RotateCredentialsDialog({ psp, credentialKeys, }: {
|
|
7
|
+
psp: PSP;
|
|
8
|
+
credentialKeys: string[];
|
|
9
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare function ReadOnlyNotice(): React.JSX.Element | null;
|
|
3
|
+
export declare function EditActions({ edits, editing, form, saving, canSave, onEdit, onCancel, }: {
|
|
4
|
+
edits: boolean;
|
|
5
|
+
editing: boolean;
|
|
6
|
+
form: string;
|
|
7
|
+
saving: boolean;
|
|
8
|
+
canSave?: boolean;
|
|
9
|
+
onEdit: () => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
}): React.JSX.Element | null;
|
|
12
|
+
export declare function SettingDetail({ label, value, }: {
|
|
13
|
+
label: string;
|
|
14
|
+
value?: string;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
export declare function SettingEditField({ label, id, children, }: {
|
|
17
|
+
label: string;
|
|
18
|
+
id: string;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Rail, ScheduledChange, SubscriptionStatus } from '../../lib/api/types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface ChangeSubscriptionDialogProps {
|
|
4
|
+
subscriptionId: string;
|
|
5
|
+
customerId?: string;
|
|
6
|
+
productId: string;
|
|
7
|
+
priceId: string;
|
|
8
|
+
quantity: number | null;
|
|
9
|
+
currency?: string;
|
|
10
|
+
collectionPolicy?: string;
|
|
11
|
+
scheduledChange?: ScheduledChange | null;
|
|
12
|
+
rail: Rail;
|
|
13
|
+
status: SubscriptionStatus;
|
|
14
|
+
}
|
|
15
|
+
export declare function ChangeSubscriptionDialog(props: ChangeSubscriptionDialogProps): React.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Rail, SubscriptionStatus } from '../../lib/api/types';
|
|
2
|
+
import { Price, Product, ScheduledChange } from '../../../client/generated/wire';
|
|
3
|
+
export interface SubscriptionChangeOption {
|
|
4
|
+
direction: "current" | "upgrade" | "downgrade";
|
|
5
|
+
price: Price;
|
|
6
|
+
product: Product;
|
|
7
|
+
}
|
|
8
|
+
export declare function subscriptionChangeOptionLabel(option: SubscriptionChangeOption): string;
|
|
9
|
+
export declare function initialSeats(price: Price, current: number | null): number | null;
|
|
10
|
+
export declare function adminSubscriptionChangeBlockReason({ rail, status, collectionPolicy, scheduledChange, }: {
|
|
11
|
+
rail: Rail;
|
|
12
|
+
status: SubscriptionStatus;
|
|
13
|
+
collectionPolicy?: string;
|
|
14
|
+
scheduledChange?: Pick<ScheduledChange, "source"> | null;
|
|
15
|
+
}): string | undefined;
|
|
16
|
+
export declare function subscriptionChangeOptions({ currentProduct, currentPrice, currentCurrency, products, prices, scheduledChange, }: {
|
|
17
|
+
currentProduct?: Product;
|
|
18
|
+
currentPrice?: Price;
|
|
19
|
+
currentCurrency?: string;
|
|
20
|
+
products: Product[];
|
|
21
|
+
prices: Price[];
|
|
22
|
+
scheduledChange?: Pick<ScheduledChange, "source"> | null;
|
|
23
|
+
}): SubscriptionChangeOption[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SubscriptionFilters } from '../../lib/api/endpoints';
|
|
2
|
+
export declare const subscriptionViews: {
|
|
3
|
+
readonly renewing_soon: {
|
|
4
|
+
readonly label: "Renewing soon";
|
|
5
|
+
readonly days: 7;
|
|
6
|
+
};
|
|
7
|
+
readonly recently_canceled: {
|
|
8
|
+
readonly label: "Recently canceled";
|
|
9
|
+
readonly days: -30;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type SubscriptionView = keyof typeof subscriptionViews;
|
|
13
|
+
export declare function viewFilters(view: string, now?: Date): SubscriptionFilters | null;
|
|
14
|
+
export declare const isView: (v: string) => v is SubscriptionView;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { BillingAdminNavigation } from './types';
|
|
3
|
+
type NavigateOptions = {
|
|
4
|
+
replace?: boolean;
|
|
5
|
+
state?: unknown;
|
|
6
|
+
};
|
|
7
|
+
type Location = {
|
|
8
|
+
pathname: string;
|
|
9
|
+
search: string;
|
|
10
|
+
state: unknown;
|
|
11
|
+
};
|
|
12
|
+
export declare function AdminRouter({ basePath, navigation, children, }: {
|
|
13
|
+
basePath?: string;
|
|
14
|
+
navigation?: BillingAdminNavigation;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
export declare const useLocation: () => Location;
|
|
18
|
+
export declare const useNavigate: () => (to: string | number, options?: NavigateOptions) => void;
|
|
19
|
+
export declare const useParams: <T extends string = string>() => Partial<Record<T, string>>;
|
|
20
|
+
export declare function useSearchParams(): readonly [URLSearchParams, (value: URLSearchParams | Record<string, string>, options?: NavigateOptions) => void];
|
|
21
|
+
export declare function Link({ to, onClick, ...props }: Omit<ComponentProps<"a">, "href"> & {
|
|
22
|
+
to: string;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
export declare function Navigate({ to, replace }: {
|
|
25
|
+
to: string;
|
|
26
|
+
replace?: boolean;
|
|
27
|
+
}): null;
|
|
28
|
+
export declare function RouteParams({ params, children, }: {
|
|
29
|
+
params: Record<string, string>;
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function matchAdminRoute(pathname: string): {
|
|
2
|
+
Component: import('react').LazyExoticComponent<typeof import('./pages/catalog').CatalogDriftPage>;
|
|
3
|
+
params: Record<string, string>;
|
|
4
|
+
} | undefined;
|
|
5
|
+
export declare function AdminPages(): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AdminAccess } from '../client/generated/wire';
|
|
2
|
+
import { BillingAdminProps } from './types';
|
|
3
|
+
type Connection = Pick<BillingAdminProps, "baseUrl" | "auth" | "merchant" | "exchange">;
|
|
4
|
+
/** Reads tab permissions without requiring a BillingAdmin or QueryClient provider. */
|
|
5
|
+
export declare function useBillingAdminAccess(options: Connection): {
|
|
6
|
+
data: AdminAccess | undefined;
|
|
7
|
+
error: Error | undefined;
|
|
8
|
+
isPending: boolean;
|
|
9
|
+
refetch: () => void;
|
|
10
|
+
};
|
|
11
|
+
export interface BillingCustomerSummaryProps extends Connection {
|
|
12
|
+
customer: string;
|
|
13
|
+
href?: string;
|
|
14
|
+
appearance?: BillingAdminProps["appearance"];
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/** A bounded preview for the host's customer or user page. */
|
|
18
|
+
export declare function BillingCustomerSummary(props: BillingCustomerSummaryProps): import("react").JSX.Element;
|
|
19
|
+
/** A ban or account deletion never cancels the customer's subscriptions. */
|
|
20
|
+
export declare function billingConfirmWarnings(customer: {
|
|
21
|
+
subscriptions: readonly {
|
|
22
|
+
status: string;
|
|
23
|
+
}[];
|
|
24
|
+
}): string[];
|
|
25
|
+
/** Descriptions for a host's role editor; permissions are enforced by the API. */
|
|
26
|
+
export declare const billingPermissionHelp: Readonly<Record<string, string>>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { CheckoutAppearance } from '../appearance';
|
|
4
|
+
import { Customer } from '../client/generated/wire';
|
|
5
|
+
/** The host's authenticated transport. Tokens remain with the host. */
|
|
6
|
+
export interface BillingAdminAuth {
|
|
7
|
+
authFetch(input: string, init?: RequestInit): Promise<Response>;
|
|
8
|
+
resourceFetch?(input: string, init: RequestInit & BillingAdminResource): Promise<Response>;
|
|
9
|
+
}
|
|
10
|
+
export interface BillingAdminResource {
|
|
11
|
+
resource: string;
|
|
12
|
+
scope?: string;
|
|
13
|
+
group: string;
|
|
14
|
+
}
|
|
15
|
+
/** The host router's current location and navigation operation. */
|
|
16
|
+
export interface BillingAdminNavigation {
|
|
17
|
+
pathname: string;
|
|
18
|
+
search: string;
|
|
19
|
+
navigate(to: string, options?: {
|
|
20
|
+
replace?: boolean;
|
|
21
|
+
}): void;
|
|
22
|
+
}
|
|
23
|
+
export interface BillingAdminMerchant {
|
|
24
|
+
id: string;
|
|
25
|
+
slug: string;
|
|
26
|
+
display_name?: string;
|
|
27
|
+
role?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface BillingAdminSettingsTab {
|
|
30
|
+
value: string;
|
|
31
|
+
title: string;
|
|
32
|
+
element: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export interface BillingAdminProps {
|
|
35
|
+
/** The engine's API prefix, including /v1. */
|
|
36
|
+
baseUrl: string;
|
|
37
|
+
auth: BillingAdminAuth;
|
|
38
|
+
basePath?: string;
|
|
39
|
+
navigation?: BillingAdminNavigation;
|
|
40
|
+
merchant?: string | BillingAdminMerchant;
|
|
41
|
+
merchants?: BillingAdminMerchant[];
|
|
42
|
+
onMerchantChange?: (merchant: BillingAdminMerchant) => void;
|
|
43
|
+
/** The standalone server's resource; each selected merchant supplies group. */
|
|
44
|
+
exchange?: Omit<BillingAdminResource, "group">;
|
|
45
|
+
settingsTabs?: BillingAdminSettingsTab[];
|
|
46
|
+
customerPanels?: (customer: Customer) => ReactNode;
|
|
47
|
+
userHref?: (id: string) => string;
|
|
48
|
+
newMerchantHref?: string;
|
|
49
|
+
emptyState?: ReactNode;
|
|
50
|
+
appearance?: CheckoutAppearance;
|
|
51
|
+
className?: string;
|
|
52
|
+
style?: CSSProperties;
|
|
53
|
+
queryClient?: QueryClient;
|
|
54
|
+
language?: string;
|
|
55
|
+
messages?: Record<string, string>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const AdminUIContext: import('react').Context<{
|
|
2
|
+
namespace: string;
|
|
3
|
+
messages?: Record<string, string>;
|
|
4
|
+
}>;
|
|
5
|
+
export declare function useAdminUI(): {
|
|
6
|
+
text: (message: string) => string;
|
|
7
|
+
id: {
|
|
8
|
+
(value: string): string;
|
|
9
|
+
(value: string | undefined): string | undefined;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare function AdminMessage({ id }: {
|
|
13
|
+
id: string;
|
|
14
|
+
}): string;
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { E as e, c as t, l as n, p as r, r as i, s as a, v as o, w as s, x as c, y as l } from "./admin-utils-BK4Vh1o_.js";
|
|
2
|
+
import { t as u } from "./admin-button-CTL3DgOt.js";
|
|
3
|
+
import { i as d, o as f, s as p, u as m } from "./admin-format-DoohJ7Fg.js";
|
|
4
|
+
import { i as h, n as g } from "./admin-dom-uMmZzRvU.js";
|
|
5
|
+
import { t as _ } from "./admin-status-badge-BFPgo71d.js";
|
|
6
|
+
import { a as v, o as y, r as b, t as x } from "./admin-card-bzAks3-3.js";
|
|
7
|
+
import { t as S } from "./admin-fact-card-DO_fHosg.js";
|
|
8
|
+
import { t as C } from "./admin-data-table-qfXLOFmN.js";
|
|
9
|
+
import { useQuery as w } from "@tanstack/react-query";
|
|
10
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
11
|
+
import { HugeiconsIcon as D } from "@hugeicons/react";
|
|
12
|
+
import { ArrowLeft01Icon as O, Cancel01Icon as k } from "@hugeicons/core-free-icons";
|
|
13
|
+
//#region src/admin/pages/payments/attempts.tsx
|
|
14
|
+
function A({ category: e }) {
|
|
15
|
+
return /* @__PURE__ */ T(_, { status: e === "approved" ? "approved" : "declined" });
|
|
16
|
+
}
|
|
17
|
+
var j = [
|
|
18
|
+
{
|
|
19
|
+
header: "Attempted",
|
|
20
|
+
cell: ({ row: e }) => /* @__PURE__ */ T("span", {
|
|
21
|
+
className: "text-muted-foreground tabular-nums",
|
|
22
|
+
children: f(e.original.attempted_at)
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
header: "Kind",
|
|
27
|
+
cell: ({ row: e }) => e.original.kind
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
header: "Outcome",
|
|
31
|
+
cell: ({ row: e }) => /* @__PURE__ */ T(A, { category: e.original.category })
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
header: "Reason",
|
|
35
|
+
cell: ({ row: e }) => e.original.category === "approved" ? /* @__PURE__ */ T("span", {
|
|
36
|
+
className: "text-muted-foreground",
|
|
37
|
+
children: "—"
|
|
38
|
+
}) : /* @__PURE__ */ E("span", { children: [e.original.reason || e.original.category, e.original.response_code ? /* @__PURE__ */ T("span", {
|
|
39
|
+
className: "ml-1 font-mono text-xs text-muted-foreground",
|
|
40
|
+
children: e.original.response_code
|
|
41
|
+
}) : null] })
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
header: "Owner",
|
|
45
|
+
cell: ({ row: e }) => e.original.owner
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
header: "Card",
|
|
49
|
+
cell: ({ row: e }) => d(e.original.card)
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
header: "Amount",
|
|
53
|
+
cell: ({ row: e }) => e.original.currency ? /* @__PURE__ */ T("span", {
|
|
54
|
+
className: "tabular-nums",
|
|
55
|
+
children: p(e.original.amount, e.original.currency)
|
|
56
|
+
}) : /* @__PURE__ */ T("span", {
|
|
57
|
+
className: "text-muted-foreground",
|
|
58
|
+
children: "—"
|
|
59
|
+
})
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
header: "Rail",
|
|
63
|
+
cell: ({ row: e }) => e.original.rail
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
function M({ keys: e }) {
|
|
67
|
+
let [t, r] = n(), i = e.filter((e) => t.get(e));
|
|
68
|
+
if (i.length === 0) return null;
|
|
69
|
+
let a = (e) => {
|
|
70
|
+
let n = new URLSearchParams(t);
|
|
71
|
+
for (let t of e ? [e] : i) n.delete(t);
|
|
72
|
+
n.delete("cursor"), r(n);
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ E("div", {
|
|
75
|
+
className: "flex flex-wrap items-center gap-2 text-sm",
|
|
76
|
+
children: [i.map((e) => /* @__PURE__ */ E("span", {
|
|
77
|
+
className: "inline-flex items-center gap-1 rounded-md bg-muted py-0.5 pr-1 pl-2",
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ T("span", {
|
|
80
|
+
className: "text-muted-foreground",
|
|
81
|
+
children: e
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ T("span", {
|
|
84
|
+
className: "font-medium",
|
|
85
|
+
children: t.get(e)
|
|
86
|
+
}),
|
|
87
|
+
/* @__PURE__ */ T(u, {
|
|
88
|
+
variant: "ghost",
|
|
89
|
+
size: "icon",
|
|
90
|
+
className: "size-5",
|
|
91
|
+
"aria-label": `Clear ${e}`,
|
|
92
|
+
onClick: () => a(e),
|
|
93
|
+
children: /* @__PURE__ */ T(D, {
|
|
94
|
+
icon: k,
|
|
95
|
+
className: "size-3"
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
}, e)), /* @__PURE__ */ T(u, {
|
|
100
|
+
variant: "ghost",
|
|
101
|
+
size: "sm",
|
|
102
|
+
onClick: () => a(),
|
|
103
|
+
children: /* @__PURE__ */ T(s, { id: "Clear all" })
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function N() {
|
|
108
|
+
let { adminQueries: e } = r(), [t] = n(), i = h(), l = a(), u = c(t, o), { data: d, isPending: f, isFetching: p } = w(e.attempts(u, i.size, i.cursor));
|
|
109
|
+
return /* @__PURE__ */ E("div", {
|
|
110
|
+
className: "flex flex-col gap-4",
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ T("h1", {
|
|
113
|
+
className: "text-2xl font-semibold tracking-tight",
|
|
114
|
+
children: /* @__PURE__ */ T(s, { id: "Payment attempts" })
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ T(M, { keys: o }),
|
|
117
|
+
/* @__PURE__ */ T(C, {
|
|
118
|
+
columns: j,
|
|
119
|
+
data: d?.data ?? [],
|
|
120
|
+
loading: f,
|
|
121
|
+
onRowClick: (e) => l(`/payments/attempts/${e.id}`),
|
|
122
|
+
emptyMessage: "No attempts match."
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ T(g, {
|
|
125
|
+
pages: i,
|
|
126
|
+
rows: d?.data?.length ?? 0,
|
|
127
|
+
nextCursor: d?.next_cursor,
|
|
128
|
+
busy: p
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function P() {
|
|
134
|
+
let { text: t } = e(), n = a();
|
|
135
|
+
return /* @__PURE__ */ T(u, {
|
|
136
|
+
variant: "ghost",
|
|
137
|
+
size: "icon",
|
|
138
|
+
onClick: () => n(-1),
|
|
139
|
+
"aria-label": t("Back"),
|
|
140
|
+
children: /* @__PURE__ */ T(D, {
|
|
141
|
+
icon: O,
|
|
142
|
+
className: "size-4"
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function F({ to: e, children: t }) {
|
|
147
|
+
return /* @__PURE__ */ T(i, {
|
|
148
|
+
className: "text-xs underline-offset-2 hover:underline",
|
|
149
|
+
to: e,
|
|
150
|
+
children: t
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function I() {
|
|
154
|
+
let { text: n } = e(), { adminQueries: i } = r(), { id: a = "" } = t(), { data: o, isPending: c } = w(i.attempt(a));
|
|
155
|
+
if (c) return /* @__PURE__ */ T("p", {
|
|
156
|
+
className: "text-sm text-muted-foreground",
|
|
157
|
+
children: /* @__PURE__ */ T(s, { id: "Loading…" })
|
|
158
|
+
});
|
|
159
|
+
if (!o) return /* @__PURE__ */ T("p", {
|
|
160
|
+
className: "text-sm text-muted-foreground",
|
|
161
|
+
children: /* @__PURE__ */ T(s, { id: "Attempt not found." })
|
|
162
|
+
});
|
|
163
|
+
let l = [
|
|
164
|
+
["Response", [o.response_code, o.response_text].filter(Boolean).join(" ")],
|
|
165
|
+
["Issuer", [o.issuer_code, o.issuer_text].filter(Boolean).join(" ")],
|
|
166
|
+
["AVS", o.avs_result],
|
|
167
|
+
["CVV", o.cvv_result],
|
|
168
|
+
["Action", o.action],
|
|
169
|
+
["Token", o.token_type],
|
|
170
|
+
["BIN", o.card_bin],
|
|
171
|
+
["Transaction", o.transaction_id],
|
|
172
|
+
["Observed via", `${o.source} · ${o.observed_via}`],
|
|
173
|
+
["Enriched", o.enriched_at ? f(o.enriched_at) : ""]
|
|
174
|
+
];
|
|
175
|
+
return /* @__PURE__ */ E("div", {
|
|
176
|
+
className: "flex flex-col gap-4",
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ E("div", {
|
|
179
|
+
className: "flex items-center gap-3",
|
|
180
|
+
children: [/* @__PURE__ */ T(P, {}), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ E("h2", {
|
|
181
|
+
className: "flex items-center gap-2 text-sm",
|
|
182
|
+
children: [
|
|
183
|
+
o.id,
|
|
184
|
+
" ",
|
|
185
|
+
/* @__PURE__ */ T(A, { category: o.category })
|
|
186
|
+
]
|
|
187
|
+
}), /* @__PURE__ */ E("p", {
|
|
188
|
+
className: "text-xs text-muted-foreground",
|
|
189
|
+
children: [
|
|
190
|
+
o.kind,
|
|
191
|
+
" · ",
|
|
192
|
+
o.owner,
|
|
193
|
+
" · ",
|
|
194
|
+
o.rail,
|
|
195
|
+
" · ",
|
|
196
|
+
f(o.attempted_at)
|
|
197
|
+
]
|
|
198
|
+
})] })]
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ E("div", {
|
|
201
|
+
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
202
|
+
children: [
|
|
203
|
+
/* @__PURE__ */ T(S, {
|
|
204
|
+
label: n("Outcome"),
|
|
205
|
+
children: o.category === "approved" ? "approved" : `${o.category}${o.reason ? ` · ${o.reason}` : ""}`
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ T(S, {
|
|
208
|
+
label: n("Amount"),
|
|
209
|
+
children: o.currency ? p(o.amount, o.currency) : "—"
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ E(S, {
|
|
212
|
+
label: n("Card"),
|
|
213
|
+
children: [
|
|
214
|
+
d(o.card),
|
|
215
|
+
" (",
|
|
216
|
+
o.card_entry,
|
|
217
|
+
")"
|
|
218
|
+
]
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ T(S, {
|
|
221
|
+
label: n("Customer"),
|
|
222
|
+
children: /* @__PURE__ */ T(F, {
|
|
223
|
+
to: `/customers/${o.customer_id}`,
|
|
224
|
+
children: m(o.customer_id, 16)
|
|
225
|
+
})
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ T(S, {
|
|
228
|
+
label: n("Subscription"),
|
|
229
|
+
children: o.subscription_id ? /* @__PURE__ */ T(F, {
|
|
230
|
+
to: `/subscriptions/${o.subscription_id}`,
|
|
231
|
+
children: m(o.subscription_id, 16)
|
|
232
|
+
}) : "—"
|
|
233
|
+
}),
|
|
234
|
+
/* @__PURE__ */ T(S, {
|
|
235
|
+
label: n("Renewal"),
|
|
236
|
+
children: o.cycle_id ? /* @__PURE__ */ T(F, {
|
|
237
|
+
to: `/payments/cycles/${o.cycle_id}`,
|
|
238
|
+
children: m(o.cycle_id, 16)
|
|
239
|
+
}) : "—"
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ T(S, {
|
|
242
|
+
label: n("Payment"),
|
|
243
|
+
children: o.payment_id ? /* @__PURE__ */ T(F, {
|
|
244
|
+
to: `/payments/${o.payment_id}`,
|
|
245
|
+
children: m(o.payment_id, 16)
|
|
246
|
+
}) : "—"
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ T(S, {
|
|
249
|
+
label: n("Paying"),
|
|
250
|
+
children: o.order_id ? /* @__PURE__ */ T(F, {
|
|
251
|
+
to: `/orders/${o.order_id}`,
|
|
252
|
+
children: m(o.order_id, 16)
|
|
253
|
+
}) : "—"
|
|
254
|
+
})
|
|
255
|
+
]
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ E(x, { children: [/* @__PURE__ */ T(v, { children: /* @__PURE__ */ T(y, {
|
|
258
|
+
className: "text-sm",
|
|
259
|
+
children: /* @__PURE__ */ T(s, { id: "PSP answer" })
|
|
260
|
+
}) }), /* @__PURE__ */ T(b, { children: /* @__PURE__ */ T("dl", {
|
|
261
|
+
className: "grid gap-x-6 gap-y-2 text-sm sm:grid-cols-2",
|
|
262
|
+
children: l.map(([e, t]) => /* @__PURE__ */ E("div", {
|
|
263
|
+
className: "flex gap-2",
|
|
264
|
+
children: [/* @__PURE__ */ T("dt", {
|
|
265
|
+
className: "w-28 shrink-0 text-muted-foreground",
|
|
266
|
+
children: e
|
|
267
|
+
}), /* @__PURE__ */ T("dd", {
|
|
268
|
+
className: "font-mono text-xs break-all",
|
|
269
|
+
children: t || "—"
|
|
270
|
+
})]
|
|
271
|
+
}, e))
|
|
272
|
+
}) })] })
|
|
273
|
+
]
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
var L = [
|
|
277
|
+
{
|
|
278
|
+
header: "Due",
|
|
279
|
+
cell: ({ row: e }) => /* @__PURE__ */ T("span", {
|
|
280
|
+
className: "text-muted-foreground tabular-nums",
|
|
281
|
+
children: f(e.original.due_at)
|
|
282
|
+
})
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
header: "Owner",
|
|
286
|
+
cell: ({ row: e }) => e.original.owner
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
header: "First outcome",
|
|
290
|
+
cell: ({ row: e }) => e.original.miss_reason ? `missed · ${e.original.miss_reason}` : e.original.first_outcome
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
header: "Outcome",
|
|
294
|
+
cell: ({ row: e }) => /* @__PURE__ */ T(_, { status: e.original.outcome })
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
header: "Recovered by",
|
|
298
|
+
cell: ({ row: e }) => e.original.recovered_by || "—"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
header: "Amount",
|
|
302
|
+
cell: ({ row: e }) => /* @__PURE__ */ T("span", {
|
|
303
|
+
className: "tabular-nums",
|
|
304
|
+
children: p(e.original.amount, e.original.currency)
|
|
305
|
+
})
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
header: "Rail",
|
|
309
|
+
cell: ({ row: e }) => e.original.rail
|
|
310
|
+
}
|
|
311
|
+
];
|
|
312
|
+
function R() {
|
|
313
|
+
let { adminQueries: e } = r(), [t] = n(), i = h(), o = a(), u = c(t, l), { data: d, isPending: f, isFetching: p } = w(e.cycles(u, i.size, i.cursor));
|
|
314
|
+
return /* @__PURE__ */ E("div", {
|
|
315
|
+
className: "flex flex-col gap-4",
|
|
316
|
+
children: [
|
|
317
|
+
/* @__PURE__ */ T("h1", {
|
|
318
|
+
className: "text-2xl font-semibold tracking-tight",
|
|
319
|
+
children: /* @__PURE__ */ T(s, { id: "Renewals" })
|
|
320
|
+
}),
|
|
321
|
+
/* @__PURE__ */ T(M, { keys: l }),
|
|
322
|
+
/* @__PURE__ */ T(C, {
|
|
323
|
+
columns: L,
|
|
324
|
+
data: d?.data ?? [],
|
|
325
|
+
loading: f,
|
|
326
|
+
onRowClick: (e) => o(`/payments/cycles/${e.id}`),
|
|
327
|
+
emptyMessage: "No renewals match."
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ T(g, {
|
|
330
|
+
pages: i,
|
|
331
|
+
rows: d?.data?.length ?? 0,
|
|
332
|
+
nextCursor: d?.next_cursor,
|
|
333
|
+
busy: p
|
|
334
|
+
})
|
|
335
|
+
]
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
function z() {
|
|
339
|
+
let { text: n } = e(), { adminQueries: i } = r(), { id: o = "" } = t(), c = a(), { data: l, isPending: u } = w(i.cycle(o));
|
|
340
|
+
return u ? /* @__PURE__ */ T("p", {
|
|
341
|
+
className: "text-sm text-muted-foreground",
|
|
342
|
+
children: /* @__PURE__ */ T(s, { id: "Loading…" })
|
|
343
|
+
}) : l ? /* @__PURE__ */ E("div", {
|
|
344
|
+
className: "flex flex-col gap-4",
|
|
345
|
+
children: [
|
|
346
|
+
/* @__PURE__ */ E("div", {
|
|
347
|
+
className: "flex items-center gap-3",
|
|
348
|
+
children: [/* @__PURE__ */ T(P, {}), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ E("h2", {
|
|
349
|
+
className: "flex items-center gap-2 text-sm",
|
|
350
|
+
children: [
|
|
351
|
+
l.id,
|
|
352
|
+
" ",
|
|
353
|
+
/* @__PURE__ */ T(_, { status: l.outcome })
|
|
354
|
+
]
|
|
355
|
+
}), /* @__PURE__ */ E("p", {
|
|
356
|
+
className: "text-xs text-muted-foreground",
|
|
357
|
+
children: [
|
|
358
|
+
l.owner,
|
|
359
|
+
" · ",
|
|
360
|
+
l.rail,
|
|
361
|
+
/* @__PURE__ */ T(s, { id: " · due " }),
|
|
362
|
+
f(l.due_at)
|
|
363
|
+
]
|
|
364
|
+
})] })]
|
|
365
|
+
}),
|
|
366
|
+
/* @__PURE__ */ E("div", {
|
|
367
|
+
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
368
|
+
children: [
|
|
369
|
+
/* @__PURE__ */ T(S, {
|
|
370
|
+
label: n("Amount"),
|
|
371
|
+
children: p(l.amount, l.currency)
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ T(S, {
|
|
374
|
+
label: n("First outcome"),
|
|
375
|
+
children: l.miss_reason ? `missed · ${l.miss_reason}` : l.first_outcome
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ T(S, {
|
|
378
|
+
label: n("Collected"),
|
|
379
|
+
children: l.collected_at ? `${f(l.collected_at)}${l.recovered_by ? ` · ${l.recovered_by}` : ""}` : "—"
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ T(S, {
|
|
382
|
+
label: l.outcome === "open" ? "Closes" : "Closed",
|
|
383
|
+
children: f(l.closes_at)
|
|
384
|
+
}),
|
|
385
|
+
/* @__PURE__ */ T(S, {
|
|
386
|
+
label: n("Subscription"),
|
|
387
|
+
children: /* @__PURE__ */ T(F, {
|
|
388
|
+
to: `/subscriptions/${l.subscription_id}`,
|
|
389
|
+
children: m(l.subscription_id, 16)
|
|
390
|
+
})
|
|
391
|
+
}),
|
|
392
|
+
/* @__PURE__ */ T(S, {
|
|
393
|
+
label: n("Customer"),
|
|
394
|
+
children: /* @__PURE__ */ T(F, {
|
|
395
|
+
to: `/customers/${l.customer_id}`,
|
|
396
|
+
children: m(l.customer_id, 16)
|
|
397
|
+
})
|
|
398
|
+
})
|
|
399
|
+
]
|
|
400
|
+
}),
|
|
401
|
+
/* @__PURE__ */ E(x, { children: [/* @__PURE__ */ T(v, { children: /* @__PURE__ */ T(y, {
|
|
402
|
+
className: "text-sm",
|
|
403
|
+
children: /* @__PURE__ */ T(s, { id: "Attempts" })
|
|
404
|
+
}) }), /* @__PURE__ */ T(b, { children: /* @__PURE__ */ T(C, {
|
|
405
|
+
columns: j,
|
|
406
|
+
data: l.attempts ?? [],
|
|
407
|
+
onRowClick: (e) => c(`/payments/attempts/${e.id}`),
|
|
408
|
+
emptyMessage: l.miss_reason ? "Never attempted." : "No attempts yet."
|
|
409
|
+
}) })] })
|
|
410
|
+
]
|
|
411
|
+
}) : /* @__PURE__ */ T("p", {
|
|
412
|
+
className: "text-sm text-muted-foreground",
|
|
413
|
+
children: /* @__PURE__ */ T(s, { id: "Renewal not found." })
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
//#endregion
|
|
417
|
+
export { I as AttemptDetailPage, N as AttemptsPage, z as CycleDetailPage, R as CyclesPage };
|
|
418
|
+
|
|
419
|
+
//# sourceMappingURL=admin-attempts-lAoW-Urd.js.map
|