@burdenoff/microfe-billing 2026.1113.3 → 2026.1114.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/modules/addons/pages/AddonsBrowsePage.js +293 -291
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +25 -24
- package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js +25 -24
- package/dist/billing/modules/analytics/pages/AnalyticsPage.js.map +1 -1
- package/dist/billing/modules/billing/hooks/index.js +5 -5
- package/dist/billing/modules/billing/hooks/useInvoices.js +20 -39
- package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
- package/dist/billing/modules/billing/index.js +14 -14
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +92 -89
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +2 -2
- package/dist/billing/modules/billing/pages/UserRefundsPage.js +140 -140
- package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js +16 -15
- package/dist/billing/modules/coupons/pages/CouponDetailPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +305 -282
- package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js.map +1 -1
- package/dist/billing/modules/credits/pages/CreditsPage.js +164 -137
- package/dist/billing/modules/credits/pages/CreditsPage.js.map +1 -1
- package/dist/billing/modules/dashboard/pages/OverviewPage.js +444 -594
- package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
- package/dist/billing/modules/earnings/components/PayoutDestinationList.d.ts +15 -0
- package/dist/billing/modules/earnings/components/PayoutDestinationList.js +66 -0
- package/dist/billing/modules/earnings/components/PayoutDestinationList.js.map +1 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.d.ts +7 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.js +19 -0
- package/dist/billing/modules/earnings/components/PayoutErrorNotice.js.map +1 -0
- package/dist/billing/modules/earnings/pages/EarningsPage.js +138 -125
- package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
- package/dist/billing/modules/earnings/pages/PayoutsPage.js +260 -202
- package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
- package/dist/billing/modules/earnings/utils/payoutDestination.d.ts +20 -0
- package/dist/billing/modules/earnings/utils/payoutDestination.js +27 -0
- package/dist/billing/modules/earnings/utils/payoutDestination.js.map +1 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.d.ts +10 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.js +50 -0
- package/dist/billing/modules/earnings/utils/plainPayoutError.js.map +1 -0
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +32 -32
- package/dist/billing/modules/settings/pages/SettingsPage.js +4 -4
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +577 -640
- package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
- package/dist/billing/shared/components/HeaderActions.d.ts +10 -0
- package/dist/billing/shared/components/HeaderActions.js +33 -0
- package/dist/billing/shared/components/HeaderActions.js.map +1 -0
- package/dist/billing/shared/components/index.d.ts +1 -0
- package/dist/billing/shared/components/index.js +2 -1
- package/dist/billing/shared/utils/format.js +4 -16
- package/dist/billing/shared/utils/format.js.map +1 -1
- package/dist/billing/shared/utils/index.js +8 -8
- package/dist/generated/global-operations.js +286 -294
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +1 -1
- package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +0 -46
- package/dist/billing/modules/dashboard/utils/overviewSummary.js +0 -37
- package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +0 -1
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +0 -30
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +0 -20
- package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure decision logic for the FluidGrids "My plan" home (BOFF-11860).
|
|
3
|
-
* Kept free of React and formatting so it can be unit tested.
|
|
4
|
-
*/
|
|
5
|
-
interface SummarySubscription {
|
|
6
|
-
id: string;
|
|
7
|
-
billingAccountId?: string;
|
|
8
|
-
nextBillingDate?: string;
|
|
9
|
-
endDate?: string;
|
|
10
|
-
plan?: {
|
|
11
|
-
name?: string;
|
|
12
|
-
price?: number;
|
|
13
|
-
currency?: string;
|
|
14
|
-
duration?: string;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
interface SummaryCard {
|
|
18
|
-
id: string;
|
|
19
|
-
isDefault: boolean;
|
|
20
|
-
createdAt?: string;
|
|
21
|
-
}
|
|
22
|
-
interface SummaryInvoice {
|
|
23
|
-
id: string;
|
|
24
|
-
createdAt: string;
|
|
25
|
-
}
|
|
26
|
-
export interface PlanSummary {
|
|
27
|
-
subscriptionId: string;
|
|
28
|
-
planName: string | null;
|
|
29
|
-
price: number | null;
|
|
30
|
-
currency: string | null;
|
|
31
|
-
duration: string | null;
|
|
32
|
-
/** ISO date of the next bill; falls back to the period end when no bill date is set. */
|
|
33
|
-
nextBillDate: string | null;
|
|
34
|
-
}
|
|
35
|
-
export declare function summarizePlan(subscription: SummarySubscription | null): PlanSummary | null;
|
|
36
|
-
/** The card billed by default, else the most recently added one. */
|
|
37
|
-
export declare function pickSavedCard<T extends SummaryCard>(methods: readonly T[]): T | null;
|
|
38
|
-
export declare function pickLatestInvoice<T extends SummaryInvoice>(invoices: readonly T[]): T | null;
|
|
39
|
-
/** Where "Change plan" goes: the upgrade route of the active subscription, else Plans. */
|
|
40
|
-
export declare function resolveChangePlanPath(subscription: SummarySubscription | null): string;
|
|
41
|
-
/** "New Account" only shows once no billing account exists (FluidGrids). */
|
|
42
|
-
export declare function shouldShowNewAccountButton(isFluidgrids: boolean, canManage: boolean, accountCount: number): boolean;
|
|
43
|
-
export type NoAccountMode = 'create' | 'request-access' | 'denied';
|
|
44
|
-
/** What the no-account state offers. FluidGrids never leaves a user without a way forward. */
|
|
45
|
-
export declare function resolveNoAccountMode(isFluidgrids: boolean, canManage: boolean): NoAccountMode;
|
|
46
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// src/billing/modules/dashboard/utils/overviewSummary.ts
|
|
2
|
-
function e(e) {
|
|
3
|
-
if (!e) return null;
|
|
4
|
-
let t = e.plan;
|
|
5
|
-
return {
|
|
6
|
-
subscriptionId: e.id,
|
|
7
|
-
planName: t?.name ?? null,
|
|
8
|
-
price: typeof t?.price == "number" ? t.price : null,
|
|
9
|
-
currency: t?.currency ?? null,
|
|
10
|
-
duration: t?.duration ?? null,
|
|
11
|
-
nextBillDate: e.nextBillingDate || e.endDate || null
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function t(e) {
|
|
15
|
-
return e.length === 0 ? null : e.find((e) => e.isDefault) || ([...e].sort((e, t) => r(t.createdAt) - r(e.createdAt))[0] ?? null);
|
|
16
|
-
}
|
|
17
|
-
function n(e) {
|
|
18
|
-
return e.length === 0 ? null : [...e].sort((e, t) => r(t.createdAt) - r(e.createdAt))[0] ?? null;
|
|
19
|
-
}
|
|
20
|
-
function r(e) {
|
|
21
|
-
let t = e ? new Date(e).getTime() : 0;
|
|
22
|
-
return Number.isNaN(t) ? 0 : t;
|
|
23
|
-
}
|
|
24
|
-
function i(e) {
|
|
25
|
-
if (!e) return "/plans";
|
|
26
|
-
let t = `/subscriptions/${e.id}/upgrade`;
|
|
27
|
-
return e.billingAccountId ? `${t}?billingAccountId=${encodeURIComponent(e.billingAccountId)}` : t;
|
|
28
|
-
}
|
|
29
|
-
function a(e, t, n) {
|
|
30
|
-
return !t || n === 0 ? !1 : !e;
|
|
31
|
-
}
|
|
32
|
-
function o(e, t) {
|
|
33
|
-
return t ? "create" : e ? "request-access" : "denied";
|
|
34
|
-
}
|
|
35
|
-
export { n as pickLatestInvoice, t as pickSavedCard, i as resolveChangePlanPath, o as resolveNoAccountMode, a as shouldShowNewAccountButton, e as summarizePlan };
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=overviewSummary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overviewSummary.js","names":["summarizePlan","subscription","plan","pickSavedCard","methods","method","timeOf","b","a","pickLatestInvoice","invoices","time","value","resolveChangePlanPath","base","shouldShowNewAccountButton","canManage","accountCount","isFluidgrids","resolveNoAccountMode"],"sources":["../../../../../src/billing/modules/dashboard/utils/overviewSummary.ts"],"sourcesContent":["/**\n * Pure decision logic for the FluidGrids \"My plan\" home (BOFF-11860).\n * Kept free of React and formatting so it can be unit tested.\n */\n\ninterface SummarySubscription {\n id: string;\n billingAccountId?: string;\n nextBillingDate?: string;\n endDate?: string;\n plan?: { name?: string; price?: number; currency?: string; duration?: string };\n}\n\ninterface SummaryCard {\n id: string;\n isDefault: boolean;\n createdAt?: string;\n}\n\ninterface SummaryInvoice {\n id: string;\n createdAt: string;\n}\n\nexport interface PlanSummary {\n subscriptionId: string;\n planName: string | null;\n price: number | null;\n currency: string | null;\n duration: string | null;\n /** ISO date of the next bill; falls back to the period end when no bill date is set. */\n nextBillDate: string | null;\n}\n\nexport function summarizePlan(subscription: SummarySubscription | null): PlanSummary | null {\n if (!subscription) return null;\n const plan = subscription.plan;\n return {\n subscriptionId: subscription.id,\n planName: plan?.name ?? null,\n price: typeof plan?.price === 'number' ? plan.price : null,\n currency: plan?.currency ?? null,\n duration: plan?.duration ?? null,\n nextBillDate: subscription.nextBillingDate || subscription.endDate || null,\n };\n}\n\n/** The card billed by default, else the most recently added one. */\nexport function pickSavedCard<T extends SummaryCard>(methods: readonly T[]): T | null {\n if (methods.length === 0) return null;\n const defaultMethod = methods.find((method) => method.isDefault);\n if (defaultMethod) return defaultMethod;\n return [...methods].sort((a, b) => timeOf(b.createdAt) - timeOf(a.createdAt))[0] ?? null;\n}\n\nexport function pickLatestInvoice<T extends SummaryInvoice>(invoices: readonly T[]): T | null {\n if (invoices.length === 0) return null;\n return [...invoices].sort((a, b) => timeOf(b.createdAt) - timeOf(a.createdAt))[0] ?? null;\n}\n\nfunction timeOf(value: string | undefined): number {\n const time = value ? new Date(value).getTime() : 0;\n return Number.isNaN(time) ? 0 : time;\n}\n\n/** Where \"Change plan\" goes: the upgrade route of the active subscription, else Plans. */\nexport function resolveChangePlanPath(subscription: SummarySubscription | null): string {\n if (!subscription) return '/plans';\n const base = `/subscriptions/${subscription.id}/upgrade`;\n return subscription.billingAccountId\n ? `${base}?billingAccountId=${encodeURIComponent(subscription.billingAccountId)}`\n : base;\n}\n\n/** \"New Account\" only shows once no billing account exists (FluidGrids). */\nexport function shouldShowNewAccountButton(\n isFluidgrids: boolean,\n canManage: boolean,\n accountCount: number\n): boolean {\n if (!canManage || accountCount === 0) return false;\n return !isFluidgrids;\n}\n\nexport type NoAccountMode = 'create' | 'request-access' | 'denied';\n\n/** What the no-account state offers. FluidGrids never leaves a user without a way forward. */\nexport function resolveNoAccountMode(isFluidgrids: boolean, canManage: boolean): NoAccountMode {\n if (canManage) return 'create';\n return isFluidgrids ? 'request-access' : 'denied';\n}\n"],"mappings":";AAkCA,SAAgBA,EAAc,GAA8D;CAC1F,IAAI,CAACC,GAAc,OAAO;CAC1B,IAAMC,IAAOD,EAAa;CAC1B,OAAO;EACL,gBAAgBA,EAAa;EAC7B,UAAUC,GAAM,QAAQ;EACxB,OAAO,OAAOA,GAAM,SAAU,WAAWA,EAAK,QAAQ;EACtD,UAAUA,GAAM,YAAY;EAC5B,UAAUA,GAAM,YAAY;EAC5B,cAAcD,EAAa,mBAAmBA,EAAa,WAAW;CACxE;AACF;AAGA,SAAgBE,EAAqC,GAAiC;CAIpF,OAHIC,EAAQ,WAAW,IAAU,OACXA,EAAQ,MAAM,MAAWC,EAAO,SAClD,MACG,CAAC,GAAGD,CAAO,CAAC,CAAC,MAAM,GAAG,MAAME,EAAOC,EAAE,SAAS,IAAID,EAAOE,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM;AACtF;AAEA,SAAgBC,EAA4C,GAAkC;CAE5F,OADIC,EAAS,WAAW,IAAU,OAC3B,CAAC,GAAGA,CAAQ,CAAC,CAAC,MAAM,GAAG,MAAMJ,EAAOC,EAAE,SAAS,IAAID,EAAOE,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM;AACvF;AAEA,SAASF,EAAO,GAAmC;CACjD,IAAMK,IAAOC,IAAQ,IAAI,KAAKA,CAAK,CAAC,CAAC,QAAQ,IAAI;CACjD,OAAO,OAAO,MAAMD,CAAI,IAAI,IAAIA;AAClC;AAGA,SAAgBE,EAAsB,GAAkD;CACtF,IAAI,CAACZ,GAAc,OAAO;CAC1B,IAAMa,IAAO,kBAAkBb,EAAa,GAAG;CAC/C,OAAOA,EAAa,mBAChB,GAAGa,EAAK,oBAAoB,mBAAmBb,EAAa,gBAAgB,MAC5Ea;AACN;AAGA,SAAgBC,EACd,GACA,GACA,GACS;CAET,OADI,CAACC,KAAaC,MAAiB,IAAU,KACtC,CAACC;AACV;AAKA,SAAgBC,EAAqB,GAAuB,GAAmC;CAE7F,OADIH,IAAkB,WACfE,IAAe,mBAAmB;AAC3C"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure decision logic for the Subscription detail page (BOFF-11860).
|
|
3
|
-
* Kept free of React so the level-1 versus "More options" split can be unit tested.
|
|
4
|
-
*/
|
|
5
|
-
export interface DetailActionInput {
|
|
6
|
-
/** FluidGrids Navigation v2 variant; every other app keeps today's layout. */
|
|
7
|
-
isFluidgrids: boolean;
|
|
8
|
-
isActive: boolean;
|
|
9
|
-
canUpdate: boolean;
|
|
10
|
-
canCancel: boolean;
|
|
11
|
-
/** A cancellation is already scheduled for the end of the period. */
|
|
12
|
-
cancellationScheduled: boolean;
|
|
13
|
-
perSeatPlan: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface DetailActions {
|
|
16
|
-
showChangePlan: boolean;
|
|
17
|
-
/** "Manage seats" inside the page's overflow menu (other apps). */
|
|
18
|
-
menuManageSeats: boolean;
|
|
19
|
-
/** "Cancel subscription" inside the page's overflow menu (other apps). */
|
|
20
|
-
menuCancel: boolean;
|
|
21
|
-
/** A visible "Cancel subscription" button at level 1 (FluidGrids). */
|
|
22
|
-
visibleCancel: boolean;
|
|
23
|
-
/** "Manage seats" inside the "More options" fold (FluidGrids). */
|
|
24
|
-
foldManageSeats: boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare function resolveDetailActions(input: DetailActionInput): DetailActions;
|
|
27
|
-
/** Name used in the cancel confirm so the user sees which subscription it affects. */
|
|
28
|
-
export declare function cancelSubjectName(planName: string | null | undefined): string | null;
|
|
29
|
-
/** Label for the date row at level 1: the next bill when known, otherwise the period end. */
|
|
30
|
-
export declare function summaryDateKind(nextBillingDate: string | null | undefined): 'nextBilling' | 'periodEnd';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// src/billing/modules/subscriptions/utils/subscriptionDetailView.ts
|
|
2
|
-
function e(e) {
|
|
3
|
-
let t = e.isActive && e.canUpdate, n = t && e.perSeatPlan, r = e.isActive && e.canCancel && !e.cancellationScheduled;
|
|
4
|
-
return {
|
|
5
|
-
showChangePlan: t,
|
|
6
|
-
menuManageSeats: !e.isFluidgrids && n,
|
|
7
|
-
menuCancel: !e.isFluidgrids && r,
|
|
8
|
-
visibleCancel: e.isFluidgrids && r,
|
|
9
|
-
foldManageSeats: e.isFluidgrids && n
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function t(e) {
|
|
13
|
-
return e?.trim() || null;
|
|
14
|
-
}
|
|
15
|
-
function n(e) {
|
|
16
|
-
return e ? "nextBilling" : "periodEnd";
|
|
17
|
-
}
|
|
18
|
-
export { t as cancelSubjectName, e as resolveDetailActions, n as summaryDateKind };
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=subscriptionDetailView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptionDetailView.js","names":["resolveDetailActions","showChangePlan","input","manageSeats","cancel","cancelSubjectName","planName","summaryDateKind","nextBillingDate"],"sources":["../../../../../src/billing/modules/subscriptions/utils/subscriptionDetailView.ts"],"sourcesContent":["/**\n * Pure decision logic for the Subscription detail page (BOFF-11860).\n * Kept free of React so the level-1 versus \"More options\" split can be unit tested.\n */\n\nexport interface DetailActionInput {\n /** FluidGrids Navigation v2 variant; every other app keeps today's layout. */\n isFluidgrids: boolean;\n isActive: boolean;\n canUpdate: boolean;\n canCancel: boolean;\n /** A cancellation is already scheduled for the end of the period. */\n cancellationScheduled: boolean;\n perSeatPlan: boolean;\n}\n\nexport interface DetailActions {\n showChangePlan: boolean;\n /** \"Manage seats\" inside the page's overflow menu (other apps). */\n menuManageSeats: boolean;\n /** \"Cancel subscription\" inside the page's overflow menu (other apps). */\n menuCancel: boolean;\n /** A visible \"Cancel subscription\" button at level 1 (FluidGrids). */\n visibleCancel: boolean;\n /** \"Manage seats\" inside the \"More options\" fold (FluidGrids). */\n foldManageSeats: boolean;\n}\n\nexport function resolveDetailActions(input: DetailActionInput): DetailActions {\n const showChangePlan = input.isActive && input.canUpdate;\n const manageSeats = showChangePlan && input.perSeatPlan;\n const cancel = input.isActive && input.canCancel && !input.cancellationScheduled;\n return {\n showChangePlan,\n menuManageSeats: !input.isFluidgrids && manageSeats,\n menuCancel: !input.isFluidgrids && cancel,\n visibleCancel: input.isFluidgrids && cancel,\n foldManageSeats: input.isFluidgrids && manageSeats,\n };\n}\n\n/** Name used in the cancel confirm so the user sees which subscription it affects. */\nexport function cancelSubjectName(planName: string | null | undefined): string | null {\n const trimmed = planName?.trim();\n return trimmed ? trimmed : null;\n}\n\n/** Label for the date row at level 1: the next bill when known, otherwise the period end. */\nexport function summaryDateKind(\n nextBillingDate: string | null | undefined\n): 'nextBilling' | 'periodEnd' {\n return nextBillingDate ? 'nextBilling' : 'periodEnd';\n}\n"],"mappings":";AA4BA,SAAgBA,EAAqB,GAAyC;CAC5E,IAAMC,IAAiBC,EAAM,YAAYA,EAAM,WACzCC,IAAcF,KAAkBC,EAAM,aACtCE,IAASF,EAAM,YAAYA,EAAM,aAAa,CAACA,EAAM;CAC3D,OAAO;EACL;EACA,iBAAiB,CAACA,EAAM,gBAAgBC;EACxC,YAAY,CAACD,EAAM,gBAAgBE;EACnC,eAAeF,EAAM,gBAAgBE;EACrC,iBAAiBF,EAAM,gBAAgBC;CACzC;AACF;AAGA,SAAgBE,EAAkB,GAAoD;CAEpF,OADgBC,GAAU,KAAK,KACJ;AAC7B;AAGA,SAAgBC,EACd,GAC6B;CAC7B,OAAOC,IAAkB,gBAAgB;AAC3C"}
|