@openrails/billing-ui 0.273.0 → 0.275.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/dist/admin/components/customer-search.d.ts +5 -0
- package/dist/admin/components/missing-record.d.ts +6 -0
- package/dist/admin/components/status-badge.d.ts +1 -0
- package/dist/admin/context.d.ts +34 -2
- package/dist/admin/lib/api/endpoints.d.ts +4 -1
- package/dist/admin/lib/api/index.d.ts +3 -0
- package/dist/admin/lib/api/order-endpoints.d.ts +1 -0
- package/dist/admin/lib/api/types.d.ts +4 -12
- package/dist/admin/lib/capabilities.d.ts +4 -0
- package/dist/admin/lib/dialog-width.d.ts +4 -3
- package/dist/admin/lib/error-text.d.ts +4 -0
- package/dist/admin/lib/format.d.ts +5 -1
- package/dist/admin/lib/mutations.d.ts +6 -1
- package/dist/admin/lib/order-queries.d.ts +3 -0
- package/dist/admin/lib/queries.d.ts +6 -0
- package/dist/admin/lib/tile-grids.d.ts +6 -0
- package/dist/admin/messages.d.ts +102 -8
- package/dist/admin/pages/dashboard/lib.d.ts +1 -0
- package/dist/admin/pages/imports/shared.d.ts +1 -0
- package/dist/admin/pages/payments/index.d.ts +1 -2
- package/dist/admin/pages/subscriptions/change-subscription-dialog.d.ts +4 -7
- package/dist/admin/pages/subscriptions/index.d.ts +1 -2
- package/dist/admin/pages/subscriptions/subscription-change-options.d.ts +6 -15
- package/dist/admin-attempts-CP5CWyNR.js +419 -0
- package/dist/admin-attempts-CP5CWyNR.js.map +1 -0
- package/dist/{admin-auth-1aZIgXiS.js → admin-auth-DlIOmwPo.js} +2 -2
- package/dist/{admin-auth-1aZIgXiS.js.map → admin-auth-DlIOmwPo.js.map} +1 -1
- package/dist/{admin-badge-pgG6D9-a.js → admin-badge-DR_8AhdC.js} +2 -2
- package/dist/{admin-badge-pgG6D9-a.js.map → admin-badge-DR_8AhdC.js.map} +1 -1
- package/dist/{admin-button-CrcYk5r0.js → admin-button-DBzTD6By.js} +2 -2
- package/dist/{admin-button-CrcYk5r0.js.map → admin-button-DBzTD6By.js.map} +1 -1
- package/dist/{admin-capabilities-BDcZeHL_.js → admin-capabilities-CZdT1Pxe.js} +35 -14
- package/dist/admin-capabilities-CZdT1Pxe.js.map +1 -0
- package/dist/{admin-card-DvTMc5Se.js → admin-card-mZl4-s5d.js} +2 -2
- package/dist/{admin-card-DvTMc5Se.js.map → admin-card-mZl4-s5d.js.map} +1 -1
- package/dist/{admin-catalog-BlF5mnu4.js → admin-catalog-DpTjS0Yo.js} +298 -298
- package/dist/{admin-catalog-BlF5mnu4.js.map → admin-catalog-DpTjS0Yo.js.map} +1 -1
- package/dist/{admin-cursor-pager-CIb3Jw2F.js → admin-cursor-pager-C-KjCIy9.js} +6 -6
- package/dist/{admin-cursor-pager-CIb3Jw2F.js.map → admin-cursor-pager-C-KjCIy9.js.map} +1 -1
- package/dist/{admin-customers-EpfoWDh-.js → admin-customers-BE3N839X.js} +22 -21
- package/dist/{admin-customers-EpfoWDh-.js.map → admin-customers-BE3N839X.js.map} +1 -1
- package/dist/admin-dashboard-BxjkV15J.js +464 -0
- package/dist/admin-dashboard-BxjkV15J.js.map +1 -0
- package/dist/admin-data-table-D89AwWz_.js +107 -0
- package/dist/admin-data-table-D89AwWz_.js.map +1 -0
- package/dist/admin-detail-BKe9xqPd.js +338 -0
- package/dist/admin-detail-BKe9xqPd.js.map +1 -0
- package/dist/admin-detail-C8lD7U2t.js +699 -0
- package/dist/admin-detail-C8lD7U2t.js.map +1 -0
- package/dist/admin-detail-D6zD085K.js +354 -0
- package/dist/admin-detail-D6zD085K.js.map +1 -0
- package/dist/{admin-detail-3wFIDPNB.js → admin-detail-Ln56otK0.js} +83 -83
- package/dist/{admin-detail-3wFIDPNB.js.map → admin-detail-Ln56otK0.js.map} +1 -1
- package/dist/admin-detail-P-UnNvXJ.js +1357 -0
- package/dist/admin-detail-P-UnNvXJ.js.map +1 -0
- package/dist/{admin-dialog-BSRf9Zre.js → admin-dialog-Dn2FRJu4.js} +3 -3
- package/dist/{admin-dialog-BSRf9Zre.js.map → admin-dialog-Dn2FRJu4.js.map} +1 -1
- package/dist/admin-dialog-width-CC7QHT1p.js +6 -0
- package/dist/admin-dialog-width-CC7QHT1p.js.map +1 -0
- package/dist/{admin-dropdown-menu-D0E5rwmn.js → admin-dropdown-menu-DLUn6Uj3.js} +2 -2
- package/dist/{admin-dropdown-menu-D0E5rwmn.js.map → admin-dropdown-menu-DLUn6Uj3.js.map} +1 -1
- package/dist/{admin-dunning-B2zgtrOo.js → admin-dunning-COaHzrmN.js} +2 -2
- package/dist/{admin-dunning-B2zgtrOo.js.map → admin-dunning-COaHzrmN.js.map} +1 -1
- package/dist/{admin-fact-card-BPSVhS15.js → admin-fact-card-DKvBnUXB.js} +2 -2
- package/dist/{admin-fact-card-BPSVhS15.js.map → admin-fact-card-DKvBnUXB.js.map} +1 -1
- package/dist/admin-format-BbiTCqUG.js +171 -0
- package/dist/admin-format-BbiTCqUG.js.map +1 -0
- package/dist/{admin-health-D0L5Kig7.js → admin-health-DmnI4e8K.js} +249 -248
- package/dist/admin-health-DmnI4e8K.js.map +1 -0
- package/dist/{admin-imports-CgZB5JAV.js → admin-imports-C0aMP6sj.js} +65 -65
- package/dist/{admin-imports-CgZB5JAV.js.map → admin-imports-C0aMP6sj.js.map} +1 -1
- package/dist/{admin-input-DJAK9nmk.js → admin-input-JKrQIGfD.js} +2 -2
- package/dist/{admin-input-DJAK9nmk.js.map → admin-input-JKrQIGfD.js.map} +1 -1
- package/dist/{admin-label-aviN9Gng.js → admin-label-CHWsVIZC.js} +2 -2
- package/dist/{admin-label-aviN9Gng.js.map → admin-label-CHWsVIZC.js.map} +1 -1
- package/dist/{admin-linked-table-row-BGr7JXeM.js → admin-linked-table-row-BMZYYsuk.js} +4 -4
- package/dist/{admin-linked-table-row-BGr7JXeM.js.map → admin-linked-table-row-BMZYYsuk.js.map} +1 -1
- package/dist/{admin-map-dialog-DS2Wz6G3.js → admin-map-dialog-BHUGdCcv.js} +24 -24
- package/dist/{admin-map-dialog-DS2Wz6G3.js.map → admin-map-dialog-BHUGdCcv.js.map} +1 -1
- package/dist/{admin-metering-D-e-37Jn.js → admin-metering-CDqueHUh.js} +307 -307
- package/dist/{admin-metering-D-e-37Jn.js.map → admin-metering-CDqueHUh.js.map} +1 -1
- package/dist/admin-missing-record-BPFs3MmO.js +42 -0
- package/dist/admin-missing-record-BPFs3MmO.js.map +1 -0
- package/dist/admin-ops-CL2kjDwi.js +359 -0
- package/dist/admin-ops-CL2kjDwi.js.map +1 -0
- package/dist/admin-orders-C1Sf2qhc.js +192 -0
- package/dist/admin-orders-C1Sf2qhc.js.map +1 -0
- package/dist/admin-parked-a0tB5bhG.js +193 -0
- package/dist/admin-parked-a0tB5bhG.js.map +1 -0
- package/dist/admin-payments-DJcjwRA4.js +221 -0
- package/dist/admin-payments-DJcjwRA4.js.map +1 -0
- package/dist/{admin-price-detail-CSI5oKdb.js → admin-price-detail-BOmeWw15.js} +103 -103
- package/dist/{admin-price-detail-CSI5oKdb.js.map → admin-price-detail-BOmeWw15.js.map} +1 -1
- package/dist/{admin-price-format-BVUpDoSC.js → admin-price-format-CqOmHrIn.js} +2 -2
- package/dist/{admin-price-format-BVUpDoSC.js.map → admin-price-format-CqOmHrIn.js.map} +1 -1
- package/dist/{admin-price-wizard-CBEcNGvP.js → admin-price-wizard-B6s5OJeO.js} +63 -63
- package/dist/{admin-price-wizard-CBEcNGvP.js.map → admin-price-wizard-B6s5OJeO.js.map} +1 -1
- package/dist/{admin-proposals-Cuj7tvaM.js → admin-proposals-DVrl-ym4.js} +70 -70
- package/dist/{admin-proposals-Cuj7tvaM.js.map → admin-proposals-DVrl-ym4.js.map} +1 -1
- package/dist/admin-provider-prices-BVVogH7Q.js +241 -0
- package/dist/admin-provider-prices-BVVogH7Q.js.map +1 -0
- package/dist/{admin-range-picker-De36L-AP.js → admin-range-picker-C6BtSm2B.js} +9 -9
- package/dist/{admin-range-picker-De36L-AP.js.map → admin-range-picker-C6BtSm2B.js.map} +1 -1
- package/dist/{admin-records-H0MlhEVY.js → admin-records-DKtcgN11.js} +50 -50
- package/dist/{admin-records-H0MlhEVY.js.map → admin-records-DKtcgN11.js.map} +1 -1
- package/dist/{admin-reports-BFGS_PWf.js → admin-reports-CtPoiceH.js} +50 -50
- package/dist/{admin-reports-BFGS_PWf.js.map → admin-reports-CtPoiceH.js.map} +1 -1
- package/dist/{admin-select-BUcEU5Rg.js → admin-select-6Yuh5M1Q.js} +2 -2
- package/dist/{admin-select-BUcEU5Rg.js.map → admin-select-6Yuh5M1Q.js.map} +1 -1
- package/dist/admin-settings-DscHu4ww.js +1823 -0
- package/dist/admin-settings-DscHu4ww.js.map +1 -0
- package/dist/{admin-shared-lfIUEbPY.js → admin-shared-BywM-MMp.js} +28 -24
- package/dist/{admin-shared-lfIUEbPY.js.map → admin-shared-BywM-MMp.js.map} +1 -1
- package/dist/{admin-skeleton-B0yzYY_X.js → admin-skeleton-lndmw89u.js} +2 -2
- package/dist/{admin-skeleton-B0yzYY_X.js.map → admin-skeleton-lndmw89u.js.map} +1 -1
- package/dist/admin-status-badge-IL8ofZ_6.js +51 -0
- package/dist/admin-status-badge-IL8ofZ_6.js.map +1 -0
- package/dist/admin-subscriptions-Cd5CGrue.js +271 -0
- package/dist/admin-subscriptions-Cd5CGrue.js.map +1 -0
- package/dist/{admin-switch-DDorugaw.js → admin-switch-DpwQSzEm.js} +2 -2
- package/dist/{admin-switch-DDorugaw.js.map → admin-switch-DpwQSzEm.js.map} +1 -1
- package/dist/{admin-table-BU6Tie69.js → admin-table-D-GdGM1m.js} +2 -2
- package/dist/{admin-table-BU6Tie69.js.map → admin-table-D-GdGM1m.js.map} +1 -1
- package/dist/admin-tabs-B--1flzO.js +158 -0
- package/dist/admin-tabs-B--1flzO.js.map +1 -0
- package/dist/{admin-textarea-Dc6lnEub.js → admin-textarea-xsp5V9xM.js} +2 -2
- package/dist/{admin-textarea-Dc6lnEub.js.map → admin-textarea-xsp5V9xM.js.map} +1 -1
- package/dist/admin-tile-grids-CzGpidd9.js +6 -0
- package/dist/admin-tile-grids-CzGpidd9.js.map +1 -0
- package/dist/{admin-typed-confirm-dialog-Bk6XxmPb.js → admin-typed-confirm-dialog-NiEDwX_0.js} +11 -11
- package/dist/{admin-typed-confirm-dialog-Bk6XxmPb.js.map → admin-typed-confirm-dialog-NiEDwX_0.js.map} +1 -1
- package/dist/{admin-utils-B9eEBNsR.js → admin-utils-wuPUD0uh.js} +341 -283
- package/dist/admin-utils-wuPUD0uh.js.map +1 -0
- package/dist/admin-widget-viz-kHHVmDEx.js +646 -0
- package/dist/admin-widget-viz-kHHVmDEx.js.map +1 -0
- package/dist/admin.css +1 -1
- package/dist/admin.js +544 -413
- package/dist/admin.js.map +1 -1
- package/dist/client/generated/routes.d.ts +17 -0
- package/dist/client/generated/wire.d.ts +4 -0
- package/dist/client/types.d.ts +6 -0
- package/dist/{client-BYgnI6_h.js → client-ctrbivyN.js} +3 -2
- package/dist/client-ctrbivyN.js.map +1 -0
- package/dist/client.js +1 -1
- package/dist/{hooks-t2tSrCpa.js → hooks-KpTetx6F.js} +2 -2
- package/dist/{hooks-t2tSrCpa.js.map → hooks-KpTetx6F.js.map} +1 -1
- package/dist/index.js +750 -711
- package/dist/index.js.map +1 -1
- package/dist/lib/card-brands.d.ts +1 -0
- package/dist/locales/de.js +3 -0
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.d.ts +3 -0
- package/dist/locales/en.js +3 -0
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +3 -0
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +3 -0
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +3 -0
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +3 -0
- package/dist/locales/zh.js.map +1 -1
- package/dist/react.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/admin-attempts-DyDDt-qw.js +0 -418
- package/dist/admin-attempts-DyDDt-qw.js.map +0 -1
- package/dist/admin-capabilities-BDcZeHL_.js.map +0 -1
- package/dist/admin-dashboard-CJE63yz4.js +0 -420
- package/dist/admin-dashboard-CJE63yz4.js.map +0 -1
- package/dist/admin-data-table-hvFcJepL.js +0 -96
- package/dist/admin-data-table-hvFcJepL.js.map +0 -1
- package/dist/admin-detail-BRP6pL7t.js +0 -328
- package/dist/admin-detail-BRP6pL7t.js.map +0 -1
- package/dist/admin-detail-CRzFb_pa.js +0 -1331
- package/dist/admin-detail-CRzFb_pa.js.map +0 -1
- package/dist/admin-detail-QLxU8r-5.js +0 -344
- package/dist/admin-detail-QLxU8r-5.js.map +0 -1
- package/dist/admin-detail-pPC8Q9l-.js +0 -710
- package/dist/admin-detail-pPC8Q9l-.js.map +0 -1
- package/dist/admin-dialog-width-BPrgdYlj.js +0 -6
- package/dist/admin-dialog-width-BPrgdYlj.js.map +0 -1
- package/dist/admin-format-DoohJ7Fg.js +0 -136
- package/dist/admin-format-DoohJ7Fg.js.map +0 -1
- package/dist/admin-health-D0L5Kig7.js.map +0 -1
- package/dist/admin-ops-CQP4TzWM.js +0 -235
- package/dist/admin-ops-CQP4TzWM.js.map +0 -1
- package/dist/admin-orders-BJ7W5S8P.js +0 -192
- package/dist/admin-orders-BJ7W5S8P.js.map +0 -1
- package/dist/admin-parked-B8xHkV2e.js +0 -193
- package/dist/admin-parked-B8xHkV2e.js.map +0 -1
- package/dist/admin-payments-CzkzqYA1.js +0 -246
- package/dist/admin-payments-CzkzqYA1.js.map +0 -1
- package/dist/admin-provider-prices-B6vwnVPi.js +0 -246
- package/dist/admin-provider-prices-B6vwnVPi.js.map +0 -1
- package/dist/admin-settings-DYC-c7mJ.js +0 -1813
- package/dist/admin-settings-DYC-c7mJ.js.map +0 -1
- package/dist/admin-status-badge-0-K37EfN.js +0 -43
- package/dist/admin-status-badge-0-K37EfN.js.map +0 -1
- package/dist/admin-subscriptions-CvW-YFs0.js +0 -301
- package/dist/admin-subscriptions-CvW-YFs0.js.map +0 -1
- package/dist/admin-tabs-D5lqdVcC.js +0 -46
- package/dist/admin-tabs-D5lqdVcC.js.map +0 -1
- package/dist/admin-utils-B9eEBNsR.js.map +0 -1
- package/dist/admin-widget-viz-8aukE3v_.js +0 -581
- package/dist/admin-widget-viz-8aukE3v_.js.map +0 -1
- package/dist/client-BYgnI6_h.js.map +0 -1
|
@@ -315,6 +315,9 @@ var b = {
|
|
|
315
315
|
service_unavailable: "Billing is temporarily unavailable. Try again soon.",
|
|
316
316
|
internal_error: "Something went wrong on our side. Please try again.",
|
|
317
317
|
card_declined: "The card was declined.",
|
|
318
|
+
ccbill_email_required: "Verify your email to pay with CCBill.",
|
|
319
|
+
ccbill_username_required: "Set a username to pay with CCBill.",
|
|
320
|
+
customer_email_required: "Verify your email and set a username to pay with CCBill.",
|
|
318
321
|
payment_provider_rejected: "The payment provider rejected the request.",
|
|
319
322
|
provider_outcome_unknown: "We couldn't confirm the result with the provider. Check again shortly.",
|
|
320
323
|
payment_in_progress: "A payment is already in progress.",
|
|
@@ -528,20 +531,20 @@ function j(e) {
|
|
|
528
531
|
}), f = (e) => t(`/admin/subscriptions/${e}/resume`, { method: "POST" }), p = (e, n) => t(`/admin/subscriptions/${e}/payment-method`, {
|
|
529
532
|
method: "PUT",
|
|
530
533
|
body: { payment_method_id: n }
|
|
531
|
-
}), m = (e, n) => t(`/admin/subscriptions/${e}/change/preview`, {
|
|
534
|
+
}), m = (e, n) => t(`/admin/subscriptions/${e}/change/options`, { signal: n }), h = (e, n) => t(`/admin/subscriptions/${e}/change/preview`, {
|
|
532
535
|
method: "POST",
|
|
533
536
|
body: n
|
|
534
|
-
}),
|
|
537
|
+
}), g = (e, n, r) => t(`/admin/subscriptions/${e}/change`, {
|
|
535
538
|
method: "POST",
|
|
536
539
|
headers: { "Idempotency-Key": r },
|
|
537
540
|
body: n
|
|
538
|
-
}),
|
|
541
|
+
}), _ = (e, n, r) => t("/admin/payments", {
|
|
539
542
|
query: {
|
|
540
543
|
...e,
|
|
541
544
|
...n
|
|
542
545
|
},
|
|
543
546
|
signal: r
|
|
544
|
-
}),
|
|
547
|
+
}), v = (e, n) => t(`/admin/payments/${e}`, { signal: n }), y = (e, n, r, i) => {
|
|
545
548
|
let a = {
|
|
546
549
|
amount: n,
|
|
547
550
|
reason: r || void 0,
|
|
@@ -552,41 +555,41 @@ function j(e) {
|
|
|
552
555
|
headers: { "Idempotency-Key": crypto.randomUUID() },
|
|
553
556
|
body: a
|
|
554
557
|
});
|
|
555
|
-
},
|
|
558
|
+
}, b = (e, n, r) => t("/admin/payment-attempts", {
|
|
556
559
|
query: {
|
|
557
560
|
...e,
|
|
558
561
|
...n
|
|
559
562
|
},
|
|
560
563
|
signal: r
|
|
561
|
-
}),
|
|
564
|
+
}), x = (e, n) => t(`/admin/payment-attempts/${e}`, { signal: n }), S = (e, n, r) => t("/admin/renewals", {
|
|
562
565
|
query: {
|
|
563
566
|
...e,
|
|
564
567
|
...n
|
|
565
568
|
},
|
|
566
569
|
signal: r
|
|
567
|
-
}),
|
|
570
|
+
}), C = (e, n) => t(`/admin/renewals/${e}`, { signal: n }), w = (e, n, r, i) => t("/catalog/products", {
|
|
568
571
|
query: {
|
|
569
572
|
limit: e,
|
|
570
573
|
cursor: n,
|
|
571
574
|
archived: r
|
|
572
575
|
},
|
|
573
576
|
signal: i
|
|
574
|
-
}),
|
|
577
|
+
}), T = (e, n) => t(`/catalog/products/${e}`, { signal: n }), E = (e) => t("/catalog/products", {
|
|
575
578
|
method: "POST",
|
|
576
579
|
body: e
|
|
577
|
-
}),
|
|
580
|
+
}), D = (e, n) => t(`/catalog/products/${e}`, {
|
|
578
581
|
method: "PATCH",
|
|
579
582
|
body: n
|
|
580
|
-
}),
|
|
583
|
+
}), O = (e = 500, n, r) => t("/catalog/meters", {
|
|
581
584
|
query: {
|
|
582
585
|
limit: e,
|
|
583
586
|
cursor: n
|
|
584
587
|
},
|
|
585
588
|
signal: r
|
|
586
|
-
}),
|
|
589
|
+
}), k = (e, n) => t(`/catalog/meters/${encodeURIComponent(e)}`, { signal: n }), A = (e, n) => t(`/catalog/meters/${encodeURIComponent(e)}`, {
|
|
587
590
|
method: "PUT",
|
|
588
591
|
body: n
|
|
589
|
-
}),
|
|
592
|
+
}), j = (e, t) => A(e.key, {
|
|
590
593
|
event_type: e.event_type,
|
|
591
594
|
value_property: e.value_property,
|
|
592
595
|
aggregation: e.aggregation,
|
|
@@ -594,36 +597,36 @@ function j(e) {
|
|
|
594
597
|
group_by: e.group_by ?? {},
|
|
595
598
|
rate_card: t,
|
|
596
599
|
expected_revision: e.revision
|
|
597
|
-
}),
|
|
600
|
+
}), M = (e, n, r, i) => t("/catalog/prices", {
|
|
598
601
|
query: {
|
|
599
602
|
limit: e,
|
|
600
603
|
cursor: n,
|
|
601
604
|
product_id: r
|
|
602
605
|
},
|
|
603
606
|
signal: i
|
|
604
|
-
}),
|
|
607
|
+
}), N = (e) => t("/catalog/prices", {
|
|
605
608
|
method: "POST",
|
|
606
609
|
body: e
|
|
607
|
-
}),
|
|
610
|
+
}), P = (e, n = !1, r) => t(`/catalog/prices/${encodeURIComponent(e)}`, {
|
|
608
611
|
query: n ? { verify: !0 } : void 0,
|
|
609
612
|
signal: r
|
|
610
|
-
}),
|
|
613
|
+
}), F = async (e) => {
|
|
611
614
|
let n = (await t("/catalog/products", { query: { keys: e } })).data[0];
|
|
612
615
|
if (!n) throw Error(`No product ${e}`);
|
|
613
616
|
return n;
|
|
614
|
-
},
|
|
617
|
+
}, I = (e, n) => t(`/catalog/prices/${encodeURIComponent(e)}`, {
|
|
615
618
|
method: "PATCH",
|
|
616
619
|
body: n
|
|
617
|
-
}),
|
|
620
|
+
}), L = (e, n) => t(`/catalog/prices/${encodeURIComponent(e)}/history`, {
|
|
618
621
|
query: { limit: 500 },
|
|
619
622
|
signal: n
|
|
620
|
-
}),
|
|
623
|
+
}), R = (e, n) => t("/catalog/price-migrations/preview", {
|
|
621
624
|
method: "POST",
|
|
622
625
|
body: {
|
|
623
626
|
product_key: e,
|
|
624
627
|
price_key: n
|
|
625
628
|
}
|
|
626
|
-
}),
|
|
629
|
+
}), z = (e, n, r, i) => t("/catalog/price-migrations", {
|
|
627
630
|
method: "POST",
|
|
628
631
|
body: {
|
|
629
632
|
product_key: e,
|
|
@@ -631,47 +634,56 @@ function j(e) {
|
|
|
631
634
|
to_price_id: r,
|
|
632
635
|
effective_at: i
|
|
633
636
|
}
|
|
634
|
-
}),
|
|
637
|
+
}), B = (e, n, r = 20, i) => t("/catalog/price-migrations", {
|
|
635
638
|
query: {
|
|
636
639
|
product_key: e,
|
|
637
640
|
price_key: n,
|
|
638
641
|
limit: r
|
|
639
642
|
},
|
|
640
643
|
signal: i
|
|
641
|
-
}),
|
|
644
|
+
}), V = (e) => t(`/catalog/price-migrations/${e}/cancel`, { method: "POST" }), H = (e, n = !1) => t("/catalog/apply", {
|
|
642
645
|
method: "POST",
|
|
643
646
|
rawBody: e,
|
|
644
647
|
headers: { "Content-Type": "application/yaml" },
|
|
645
648
|
...n ? { query: { force: "true" } } : {}
|
|
646
|
-
}),
|
|
649
|
+
}), U = (e, n, r) => t("/merchant/findings", {
|
|
647
650
|
query: {
|
|
648
651
|
...e,
|
|
649
652
|
limit: n
|
|
650
653
|
},
|
|
651
654
|
signal: r
|
|
652
|
-
}),
|
|
655
|
+
}), W = (e) => t(`/merchant/findings/${e}`), G = (e, n, r) => t(`/merchant/findings/${e}/resolve`, {
|
|
653
656
|
method: "POST",
|
|
654
657
|
body: {
|
|
655
658
|
outcome: n,
|
|
656
659
|
notes: r
|
|
657
660
|
}
|
|
658
|
-
}),
|
|
661
|
+
}), K = (e, n) => t("/merchant/destructive-holds", {
|
|
662
|
+
query: {
|
|
663
|
+
limit: 100,
|
|
664
|
+
cursor: e
|
|
665
|
+
},
|
|
666
|
+
signal: n
|
|
667
|
+
}), q = (e, n) => t(`/merchant/destructive-holds/${encodeURIComponent(e)}/clear`, {
|
|
668
|
+
method: "POST",
|
|
669
|
+
body: { reason: n }
|
|
670
|
+
}), ee = (e) => t("/merchant/configuration", { signal: e }), J = (e) => t("/merchant/configuration", {
|
|
659
671
|
method: "PATCH",
|
|
660
672
|
body: e
|
|
661
|
-
}), te = (e) => t("/merchant/psps?limit=500", { signal: e }),
|
|
673
|
+
}), te = (e) => t("/merchant/psps?limit=500", { signal: e }), ne = (e) => t("/merchant/custodians", { signal: e }), re = (e, n) => t(`/admin/customers/${encodeURIComponent(e)}/payment-methods/${encodeURIComponent(n)}`, { method: "DELETE" }), Y = (e, n) => t(`/merchant/custodians/${encodeURIComponent(e)}`, {
|
|
662
674
|
method: "PUT",
|
|
663
675
|
body: n
|
|
664
|
-
}),
|
|
676
|
+
}), X = async (e) => (await ae(e)).rails, Z = (e) => t("/merchant/psps", {
|
|
665
677
|
method: "POST",
|
|
666
678
|
body: e
|
|
667
|
-
}),
|
|
679
|
+
}), Q = (e, n) => t(`/merchant/psps/${encodeURIComponent(e)}`, {
|
|
668
680
|
method: "PATCH",
|
|
669
681
|
body: n
|
|
670
|
-
}),
|
|
682
|
+
}), ie = (e, n) => t("/merchant/psps/routing-preview", {
|
|
671
683
|
method: "POST",
|
|
672
684
|
body: e,
|
|
673
685
|
signal: n
|
|
674
|
-
}),
|
|
686
|
+
}), ae = (e) => t("/config", { signal: e });
|
|
675
687
|
return {
|
|
676
688
|
listCustomers: n,
|
|
677
689
|
getCustomer: r,
|
|
@@ -685,48 +697,51 @@ function j(e) {
|
|
|
685
697
|
cancelSubscription: d,
|
|
686
698
|
resumeSubscription: f,
|
|
687
699
|
changeSubscriptionPaymentMethod: p,
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
700
|
+
listSubscriptionChangeOptions: m,
|
|
701
|
+
previewSubscriptionChange: h,
|
|
702
|
+
changeSubscription: g,
|
|
703
|
+
listPayments: _,
|
|
704
|
+
getPayment: v,
|
|
705
|
+
refundPayment: y,
|
|
706
|
+
listPaymentAttempts: b,
|
|
707
|
+
getPaymentAttempt: x,
|
|
708
|
+
listRenewals: S,
|
|
709
|
+
getRenewal: C,
|
|
710
|
+
listProducts: w,
|
|
711
|
+
getProduct: T,
|
|
712
|
+
createProduct: E,
|
|
713
|
+
updateProduct: D,
|
|
714
|
+
listUsageMeters: O,
|
|
715
|
+
getUsageMeter: k,
|
|
716
|
+
putUsageMeter: A,
|
|
717
|
+
putUsageMeterRateCard: j,
|
|
718
|
+
listPrices: M,
|
|
719
|
+
createPrice: N,
|
|
720
|
+
getPrice: P,
|
|
721
|
+
getProductByKey: F,
|
|
722
|
+
updatePrice: I,
|
|
723
|
+
getPriceHistory: L,
|
|
724
|
+
previewPriceMigration: R,
|
|
725
|
+
createPriceMigration: z,
|
|
726
|
+
listPriceMigrations: B,
|
|
727
|
+
cancelPriceMigration: V,
|
|
728
|
+
applyCatalog: H,
|
|
729
|
+
listFindings: U,
|
|
730
|
+
getFinding: W,
|
|
731
|
+
resolveFinding: G,
|
|
732
|
+
listDestructiveHolds: K,
|
|
733
|
+
clearDestructiveHold: q,
|
|
719
734
|
getMerchantConfiguration: ee,
|
|
720
|
-
updateMerchantConfiguration:
|
|
735
|
+
updateMerchantConfiguration: J,
|
|
721
736
|
listPSPs: te,
|
|
722
|
-
listRails:
|
|
723
|
-
createPSP:
|
|
724
|
-
listCustodians:
|
|
725
|
-
putCustodian:
|
|
726
|
-
deleteCustomerPaymentMethod:
|
|
727
|
-
updatePSP:
|
|
728
|
-
previewPSPRouting:
|
|
729
|
-
getConfig:
|
|
737
|
+
listRails: X,
|
|
738
|
+
createPSP: Z,
|
|
739
|
+
listCustodians: ne,
|
|
740
|
+
putCustodian: Y,
|
|
741
|
+
deleteCustomerPaymentMethod: re,
|
|
742
|
+
updatePSP: Q,
|
|
743
|
+
previewPSPRouting: ie,
|
|
744
|
+
getConfig: ae,
|
|
730
745
|
getAdminAccess: (e) => t("/admin/access", { signal: e }),
|
|
731
746
|
updateCustomer: (e, n) => t(`/admin/customers/${e}`, {
|
|
732
747
|
method: "PATCH",
|
|
@@ -961,8 +976,28 @@ function B(e) {
|
|
|
961
976
|
};
|
|
962
977
|
}
|
|
963
978
|
//#endregion
|
|
979
|
+
//#region src/admin/lib/error-text.ts
|
|
980
|
+
var V = {
|
|
981
|
+
destructive_actions_held: "Refunds, revokes and cancels are paused for you after several in a short time. Someone else can clear the hold on the Ops page.",
|
|
982
|
+
authorization_unavailable: "Billing couldn't check your permissions just now. Try again in a moment.",
|
|
983
|
+
permission_required: "Your role doesn't allow this."
|
|
984
|
+
}, H = (e) => {
|
|
985
|
+
let t = e.trim();
|
|
986
|
+
if (!t) return t;
|
|
987
|
+
let n = t.charAt(0).toUpperCase() + t.slice(1);
|
|
988
|
+
return /[.!?]$/.test(n) ? n : `${n}.`;
|
|
989
|
+
};
|
|
990
|
+
function U(e) {
|
|
991
|
+
if (!(e instanceof x)) return { text: H(e instanceof Error && e.message ? e.message : b.errors.generic) };
|
|
992
|
+
let t = e.code;
|
|
993
|
+
return {
|
|
994
|
+
text: (t && V[t] || (e.message ? void 0 : t && b.errors[t] || (e.status === 404 ? b.errors.resource_not_found : void 0) || (e.status === 403 ? V.permission_required : void 0))) ?? H(e.message || b.errors.generic),
|
|
995
|
+
code: t
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
//#endregion
|
|
964
999
|
//#region src/admin/lib/toast.ts
|
|
965
|
-
function
|
|
1000
|
+
function W(e) {
|
|
966
1001
|
let t = (t) => (n, r) => t(n, {
|
|
967
1002
|
...r,
|
|
968
1003
|
toasterId: e
|
|
@@ -974,7 +1009,7 @@ function V(e) {
|
|
|
974
1009
|
warning: t(u.warning)
|
|
975
1010
|
});
|
|
976
1011
|
}
|
|
977
|
-
function
|
|
1012
|
+
function G(e) {
|
|
978
1013
|
function t(t, n) {
|
|
979
1014
|
if (t instanceof x) {
|
|
980
1015
|
if (t.code === "revision_mismatch") {
|
|
@@ -985,15 +1020,9 @@ function H(e) {
|
|
|
985
1020
|
e.error(`${n}: only a signed-in person can do this`, { description: t.message });
|
|
986
1021
|
return;
|
|
987
1022
|
}
|
|
988
|
-
if (t.isPermissionDenied) {
|
|
989
|
-
e.error(`${n}: your role lacks permission`, { description: t.message });
|
|
990
|
-
return;
|
|
991
|
-
}
|
|
992
|
-
let r = t.code ? `${n} (${t.code})` : n;
|
|
993
|
-
e.error(r, { description: t.message });
|
|
994
|
-
return;
|
|
995
1023
|
}
|
|
996
|
-
|
|
1024
|
+
let { text: r, code: i } = U(t);
|
|
1025
|
+
e.error(`Couldn't ${n.charAt(0).toLowerCase()}${n.slice(1)}`, { description: i ? `${r} Code: ${i}.` : r });
|
|
997
1026
|
}
|
|
998
1027
|
function n(t) {
|
|
999
1028
|
e.error(`${t} changed since you opened it`, { description: "Reloaded. Review the current version and edit again." });
|
|
@@ -1005,11 +1034,11 @@ function H(e) {
|
|
|
1005
1034
|
}
|
|
1006
1035
|
//#endregion
|
|
1007
1036
|
//#region src/admin/lib/queries.ts
|
|
1008
|
-
function
|
|
1037
|
+
function K(e) {
|
|
1009
1038
|
let t = e.rows[0] ?? [];
|
|
1010
1039
|
return Object.fromEntries(e.columns.map((e, n) => [e.name, t[n] ?? null]));
|
|
1011
1040
|
}
|
|
1012
|
-
async function
|
|
1041
|
+
async function q(e, t) {
|
|
1013
1042
|
return {
|
|
1014
1043
|
data: await T((n) => e(n, t), t),
|
|
1015
1044
|
next_cursor: null
|
|
@@ -1054,18 +1083,18 @@ var ee = (e) => ({
|
|
|
1054
1083
|
ops: () => [...e(), "ops"],
|
|
1055
1084
|
dashboard: () => [...e(), "dashboard"],
|
|
1056
1085
|
notifications: () => [...e(), "notifications"]
|
|
1057
|
-
}),
|
|
1086
|
+
}), J = (e) => e ? { errorAction: e } : void 0;
|
|
1058
1087
|
function te(e, t) {
|
|
1059
|
-
let { queryRoot: n } = e, { getCustomer: r, getMerchantConfiguration: i, getPayment: a, getPaymentAttempt: o, getPrice: c, getPriceHistory: u, getProduct: d, getRenewal: f, getSubscription: p, getUsageMeter: m, listCustomerEntitlements: h, listCustomerPaymentMethods: g, listCustomerProductAccess: _, listCustomers: v, listFindings: y,
|
|
1088
|
+
let { queryRoot: n } = e, { getCustomer: r, getMerchantConfiguration: i, getPayment: a, getPaymentAttempt: o, getPrice: c, getPriceHistory: u, getProduct: d, getRenewal: f, getSubscription: p, getUsageMeter: m, listCustomerEntitlements: h, listCustomerPaymentMethods: g, listCustomerProductAccess: _, listCustomers: v, listFindings: y, listDestructiveHolds: b, listPaymentAttempts: x, listPSPs: S, listRails: C, previewPSPRouting: w, listPayments: E, listPrices: D, listProducts: O, listRenewals: k, listPriceMigrations: A, listSubscriptionChangeOptions: j, listSubscriptions: M, listUsageMeters: N, getAdminAccess: P, getConfig: F, listWebhooks: I, getDashboard: L, metricsQuery: R } = t, z = n, B = ee(z);
|
|
1060
1089
|
return {
|
|
1061
|
-
queryKeys:
|
|
1090
|
+
queryKeys: B,
|
|
1062
1091
|
merchantQueryKeys: () => {
|
|
1063
|
-
let e =
|
|
1092
|
+
let e = z();
|
|
1064
1093
|
return ee(() => e);
|
|
1065
1094
|
},
|
|
1066
1095
|
adminQueries: {
|
|
1067
1096
|
customers: (e, t, n) => l({
|
|
1068
|
-
queryKey: [...
|
|
1097
|
+
queryKey: [...B.customers(), {
|
|
1069
1098
|
search: e,
|
|
1070
1099
|
limit: t,
|
|
1071
1100
|
cursor: n
|
|
@@ -1075,35 +1104,34 @@ function te(e, t) {
|
|
|
1075
1104
|
meta: { errorAction: "Load customers" }
|
|
1076
1105
|
}),
|
|
1077
1106
|
customer: (e) => l({
|
|
1078
|
-
queryKey:
|
|
1107
|
+
queryKey: B.customer(e),
|
|
1079
1108
|
queryFn: ({ signal: t }) => r(e, t),
|
|
1080
|
-
enabled: !!e
|
|
1081
|
-
meta: { errorAction: "Load customer" }
|
|
1109
|
+
enabled: !!e
|
|
1082
1110
|
}),
|
|
1083
1111
|
customerSubscriptions: (e, t, n) => l({
|
|
1084
1112
|
queryKey: [
|
|
1085
|
-
...
|
|
1113
|
+
...B.customer(e),
|
|
1086
1114
|
"subscriptions",
|
|
1087
1115
|
{
|
|
1088
1116
|
limit: t,
|
|
1089
1117
|
cursor: n
|
|
1090
1118
|
}
|
|
1091
1119
|
],
|
|
1092
|
-
queryFn: ({ signal: r }) =>
|
|
1120
|
+
queryFn: ({ signal: r }) => M({ customer_id: e }, t, n || void 0, r),
|
|
1093
1121
|
enabled: !!e,
|
|
1094
1122
|
placeholderData: s,
|
|
1095
1123
|
meta: { errorAction: "Load subscriptions" }
|
|
1096
1124
|
}),
|
|
1097
1125
|
customerPayments: (e, t, n) => l({
|
|
1098
1126
|
queryKey: [
|
|
1099
|
-
...
|
|
1127
|
+
...B.customer(e),
|
|
1100
1128
|
"payments",
|
|
1101
1129
|
{
|
|
1102
1130
|
limit: t,
|
|
1103
1131
|
cursor: n
|
|
1104
1132
|
}
|
|
1105
1133
|
],
|
|
1106
|
-
queryFn: ({ signal: r }) =>
|
|
1134
|
+
queryFn: ({ signal: r }) => E({ customer_id: e }, {
|
|
1107
1135
|
limit: t,
|
|
1108
1136
|
cursor: n || void 0
|
|
1109
1137
|
}, r),
|
|
@@ -1113,7 +1141,7 @@ function te(e, t) {
|
|
|
1113
1141
|
}),
|
|
1114
1142
|
customerPaymentMethodsPage: (e, t, n) => l({
|
|
1115
1143
|
queryKey: [
|
|
1116
|
-
...
|
|
1144
|
+
...B.customer(e),
|
|
1117
1145
|
"payment-methods",
|
|
1118
1146
|
{
|
|
1119
1147
|
limit: t,
|
|
@@ -1130,7 +1158,7 @@ function te(e, t) {
|
|
|
1130
1158
|
}),
|
|
1131
1159
|
customerEntitlements: (e, t, n) => l({
|
|
1132
1160
|
queryKey: [
|
|
1133
|
-
...
|
|
1161
|
+
...B.customer(e),
|
|
1134
1162
|
"entitlements",
|
|
1135
1163
|
{
|
|
1136
1164
|
limit: t,
|
|
@@ -1147,7 +1175,7 @@ function te(e, t) {
|
|
|
1147
1175
|
}),
|
|
1148
1176
|
customerProductAccess: (e, t, n) => l({
|
|
1149
1177
|
queryKey: [
|
|
1150
|
-
...
|
|
1178
|
+
...B.customer(e),
|
|
1151
1179
|
"product-access",
|
|
1152
1180
|
{
|
|
1153
1181
|
limit: t,
|
|
@@ -1163,23 +1191,27 @@ function te(e, t) {
|
|
|
1163
1191
|
meta: { errorAction: "Load product access" }
|
|
1164
1192
|
}),
|
|
1165
1193
|
subscriptions: (e, t, n) => l({
|
|
1166
|
-
queryKey: [...
|
|
1194
|
+
queryKey: [...B.subscriptions(), {
|
|
1167
1195
|
filters: e,
|
|
1168
1196
|
limit: t,
|
|
1169
1197
|
cursor: n
|
|
1170
1198
|
}],
|
|
1171
|
-
queryFn: ({ signal: r }) =>
|
|
1199
|
+
queryFn: ({ signal: r }) => M(e, t, n || void 0, r),
|
|
1172
1200
|
placeholderData: s,
|
|
1173
1201
|
meta: { errorAction: "Load subscriptions" }
|
|
1174
1202
|
}),
|
|
1175
1203
|
subscription: (e) => l({
|
|
1176
|
-
queryKey:
|
|
1204
|
+
queryKey: B.subscription(e),
|
|
1177
1205
|
queryFn: ({ signal: t }) => p(e, t),
|
|
1178
|
-
enabled: !!e
|
|
1179
|
-
|
|
1206
|
+
enabled: !!e
|
|
1207
|
+
}),
|
|
1208
|
+
subscriptionChangeOptions: (e) => l({
|
|
1209
|
+
queryKey: [...B.subscription(e), "change-options"],
|
|
1210
|
+
queryFn: ({ signal: t }) => j(e, t),
|
|
1211
|
+
staleTime: 6e4
|
|
1180
1212
|
}),
|
|
1181
1213
|
customerPaymentMethods: (e) => l({
|
|
1182
|
-
queryKey: [...
|
|
1214
|
+
queryKey: [...B.customer(e ?? "unselected"), "payment-methods"],
|
|
1183
1215
|
queryFn: ({ signal: t }) => T((n) => g(e, {
|
|
1184
1216
|
limit: 100,
|
|
1185
1217
|
cursor: n
|
|
@@ -1187,12 +1219,12 @@ function te(e, t) {
|
|
|
1187
1219
|
enabled: !!e
|
|
1188
1220
|
}),
|
|
1189
1221
|
payments: (e, t, n) => l({
|
|
1190
|
-
queryKey: [...
|
|
1222
|
+
queryKey: [...B.payments(), {
|
|
1191
1223
|
filters: e,
|
|
1192
1224
|
limit: t,
|
|
1193
1225
|
cursor: n
|
|
1194
1226
|
}],
|
|
1195
|
-
queryFn: ({ signal: r }) =>
|
|
1227
|
+
queryFn: ({ signal: r }) => E(e, {
|
|
1196
1228
|
limit: t,
|
|
1197
1229
|
cursor: n
|
|
1198
1230
|
}, r),
|
|
@@ -1200,18 +1232,17 @@ function te(e, t) {
|
|
|
1200
1232
|
meta: { errorAction: "Load payments" }
|
|
1201
1233
|
}),
|
|
1202
1234
|
payment: (e) => l({
|
|
1203
|
-
queryKey:
|
|
1235
|
+
queryKey: B.payment(e),
|
|
1204
1236
|
queryFn: ({ signal: t }) => a(e, t),
|
|
1205
|
-
enabled: !!e
|
|
1206
|
-
meta: { errorAction: "Load payment" }
|
|
1237
|
+
enabled: !!e
|
|
1207
1238
|
}),
|
|
1208
1239
|
attempts: (e, t, n) => l({
|
|
1209
|
-
queryKey: [...
|
|
1240
|
+
queryKey: [...B.attempts(), {
|
|
1210
1241
|
filters: e,
|
|
1211
1242
|
limit: t,
|
|
1212
1243
|
cursor: n
|
|
1213
1244
|
}],
|
|
1214
|
-
queryFn: ({ signal: r }) =>
|
|
1245
|
+
queryFn: ({ signal: r }) => x(e, {
|
|
1215
1246
|
limit: t,
|
|
1216
1247
|
cursor: n
|
|
1217
1248
|
}, r),
|
|
@@ -1219,18 +1250,18 @@ function te(e, t) {
|
|
|
1219
1250
|
meta: { errorAction: "Load payment attempts" }
|
|
1220
1251
|
}),
|
|
1221
1252
|
attempt: (e) => l({
|
|
1222
|
-
queryKey: [...
|
|
1253
|
+
queryKey: [...B.attempts(), e],
|
|
1223
1254
|
queryFn: ({ signal: t }) => o(e, t),
|
|
1224
1255
|
enabled: !!e,
|
|
1225
1256
|
meta: { errorAction: "Load payment attempt" }
|
|
1226
1257
|
}),
|
|
1227
1258
|
cycles: (e, t, n) => l({
|
|
1228
|
-
queryKey: [...
|
|
1259
|
+
queryKey: [...B.cycles(), {
|
|
1229
1260
|
filters: e,
|
|
1230
1261
|
limit: t,
|
|
1231
1262
|
cursor: n
|
|
1232
1263
|
}],
|
|
1233
|
-
queryFn: ({ signal: r }) =>
|
|
1264
|
+
queryFn: ({ signal: r }) => k(e, {
|
|
1234
1265
|
limit: t,
|
|
1235
1266
|
cursor: n
|
|
1236
1267
|
}, r),
|
|
@@ -1238,7 +1269,7 @@ function te(e, t) {
|
|
|
1238
1269
|
meta: { errorAction: "Load renewals" }
|
|
1239
1270
|
}),
|
|
1240
1271
|
cycle: (e) => l({
|
|
1241
|
-
queryKey: [...
|
|
1272
|
+
queryKey: [...B.cycles(), e],
|
|
1242
1273
|
queryFn: ({ signal: t }) => f(e, t),
|
|
1243
1274
|
enabled: !!e,
|
|
1244
1275
|
meta: { errorAction: "Load renewal" }
|
|
@@ -1247,32 +1278,32 @@ function te(e, t) {
|
|
|
1247
1278
|
let { limit: t = 100, cursor: n, errorAction: r } = e;
|
|
1248
1279
|
return l({
|
|
1249
1280
|
queryKey: [
|
|
1250
|
-
...
|
|
1281
|
+
...B.catalog(),
|
|
1251
1282
|
"products",
|
|
1252
1283
|
{
|
|
1253
1284
|
limit: t,
|
|
1254
1285
|
cursor: n
|
|
1255
1286
|
}
|
|
1256
1287
|
],
|
|
1257
|
-
queryFn: ({ signal: e }) =>
|
|
1288
|
+
queryFn: ({ signal: e }) => O(t, n, void 0, e),
|
|
1258
1289
|
placeholderData: s,
|
|
1259
|
-
meta:
|
|
1290
|
+
meta: J(r)
|
|
1260
1291
|
});
|
|
1261
1292
|
},
|
|
1262
1293
|
allProducts: (e = {}) => l({
|
|
1263
1294
|
queryKey: [
|
|
1264
|
-
...
|
|
1295
|
+
...B.catalog(),
|
|
1265
1296
|
"products",
|
|
1266
1297
|
"all"
|
|
1267
1298
|
],
|
|
1268
|
-
queryFn: ({ signal: e }) =>
|
|
1269
|
-
meta:
|
|
1299
|
+
queryFn: ({ signal: e }) => q((e, t) => O(500, e, void 0, t), e),
|
|
1300
|
+
meta: J(e.errorAction)
|
|
1270
1301
|
}),
|
|
1271
1302
|
prices: (e = {}) => {
|
|
1272
1303
|
let { productId: t, limit: n = 100, cursor: r, errorAction: i } = e;
|
|
1273
1304
|
return l({
|
|
1274
1305
|
queryKey: [
|
|
1275
|
-
...
|
|
1306
|
+
...B.catalog(),
|
|
1276
1307
|
"prices",
|
|
1277
1308
|
{
|
|
1278
1309
|
productId: t,
|
|
@@ -1280,26 +1311,26 @@ function te(e, t) {
|
|
|
1280
1311
|
cursor: r
|
|
1281
1312
|
}
|
|
1282
1313
|
],
|
|
1283
|
-
queryFn: ({ signal: e }) =>
|
|
1314
|
+
queryFn: ({ signal: e }) => D(n, r, t, e),
|
|
1284
1315
|
placeholderData: s,
|
|
1285
|
-
meta:
|
|
1316
|
+
meta: J(i)
|
|
1286
1317
|
});
|
|
1287
1318
|
},
|
|
1288
1319
|
allPrices: (e = {}) => l({
|
|
1289
1320
|
queryKey: [
|
|
1290
|
-
...
|
|
1321
|
+
...B.catalog(),
|
|
1291
1322
|
"prices",
|
|
1292
1323
|
"all",
|
|
1293
1324
|
{ productId: e.productId }
|
|
1294
1325
|
],
|
|
1295
|
-
queryFn: ({ signal: t }) =>
|
|
1296
|
-
meta:
|
|
1326
|
+
queryFn: ({ signal: t }) => q((t, n) => D(500, t, e.productId, n), t),
|
|
1327
|
+
meta: J(e.errorAction)
|
|
1297
1328
|
}),
|
|
1298
1329
|
price: (e, t = {}) => {
|
|
1299
1330
|
let { verify: n = !1, errorAction: r } = t;
|
|
1300
1331
|
return l({
|
|
1301
1332
|
queryKey: [
|
|
1302
|
-
...
|
|
1333
|
+
...B.catalog(),
|
|
1303
1334
|
"prices",
|
|
1304
1335
|
e,
|
|
1305
1336
|
{ verify: n }
|
|
@@ -1307,12 +1338,12 @@ function te(e, t) {
|
|
|
1307
1338
|
queryFn: ({ signal: t }) => c(e, n, t),
|
|
1308
1339
|
enabled: !!e,
|
|
1309
1340
|
placeholderData: s,
|
|
1310
|
-
meta:
|
|
1341
|
+
meta: J(r)
|
|
1311
1342
|
});
|
|
1312
1343
|
},
|
|
1313
1344
|
product: (e) => l({
|
|
1314
1345
|
queryKey: [
|
|
1315
|
-
...
|
|
1346
|
+
...B.catalog(),
|
|
1316
1347
|
"products",
|
|
1317
1348
|
e ?? "unselected"
|
|
1318
1349
|
],
|
|
@@ -1321,7 +1352,7 @@ function te(e, t) {
|
|
|
1321
1352
|
}),
|
|
1322
1353
|
priceHistory: (e) => l({
|
|
1323
1354
|
queryKey: [
|
|
1324
|
-
...
|
|
1355
|
+
...B.catalog(),
|
|
1325
1356
|
"prices",
|
|
1326
1357
|
"history",
|
|
1327
1358
|
e ?? "unselected"
|
|
@@ -1331,7 +1362,7 @@ function te(e, t) {
|
|
|
1331
1362
|
}),
|
|
1332
1363
|
priceMigrations: (e, t, n = 5) => l({
|
|
1333
1364
|
queryKey: [
|
|
1334
|
-
...
|
|
1365
|
+
...B.catalog(),
|
|
1335
1366
|
"price-migrations",
|
|
1336
1367
|
{
|
|
1337
1368
|
productKey: e,
|
|
@@ -1339,43 +1370,43 @@ function te(e, t) {
|
|
|
1339
1370
|
limit: n
|
|
1340
1371
|
}
|
|
1341
1372
|
],
|
|
1342
|
-
queryFn: ({ signal: r }) =>
|
|
1373
|
+
queryFn: ({ signal: r }) => A(e, t, n, r),
|
|
1343
1374
|
enabled: !!(e && t)
|
|
1344
1375
|
}),
|
|
1345
1376
|
pspRouting: (e) => l({
|
|
1346
1377
|
queryKey: [
|
|
1347
|
-
...
|
|
1378
|
+
...B.catalog(),
|
|
1348
1379
|
"prices",
|
|
1349
1380
|
e,
|
|
1350
1381
|
"routing"
|
|
1351
1382
|
],
|
|
1352
|
-
queryFn: ({ signal: t }) =>
|
|
1383
|
+
queryFn: ({ signal: t }) => w({ price_id: e }, t),
|
|
1353
1384
|
enabled: !!e,
|
|
1354
1385
|
meta: { errorAction: "Check purchase readiness" }
|
|
1355
1386
|
}),
|
|
1356
1387
|
usageMeters: (e = 200, t) => l({
|
|
1357
|
-
queryKey: [...
|
|
1388
|
+
queryKey: [...B.usageMeters(), {
|
|
1358
1389
|
limit: e,
|
|
1359
1390
|
cursor: t
|
|
1360
1391
|
}],
|
|
1361
|
-
queryFn: ({ signal: n }) =>
|
|
1392
|
+
queryFn: ({ signal: n }) => N(e, t, n),
|
|
1362
1393
|
placeholderData: s,
|
|
1363
1394
|
meta: { errorAction: "Load usage meters" }
|
|
1364
1395
|
}),
|
|
1365
1396
|
allUsageMeters: () => l({
|
|
1366
|
-
queryKey: [...
|
|
1367
|
-
queryFn: ({ signal: e }) =>
|
|
1397
|
+
queryKey: [...B.usageMeters(), "all"],
|
|
1398
|
+
queryFn: ({ signal: e }) => q((e, t) => N(500, e, t), e),
|
|
1368
1399
|
meta: { errorAction: "Load usage meters" }
|
|
1369
1400
|
}),
|
|
1370
1401
|
usageMeter: (e) => l({
|
|
1371
|
-
queryKey:
|
|
1402
|
+
queryKey: B.usageMeter(e),
|
|
1372
1403
|
queryFn: ({ signal: t }) => m(e, t),
|
|
1373
1404
|
enabled: !!e,
|
|
1374
1405
|
meta: { errorAction: "Load usage meter" }
|
|
1375
1406
|
}),
|
|
1376
1407
|
findings: (e = !0) => l({
|
|
1377
1408
|
queryKey: [
|
|
1378
|
-
...
|
|
1409
|
+
...B.ops(),
|
|
1379
1410
|
"findings",
|
|
1380
1411
|
{ limit: 100 }
|
|
1381
1412
|
],
|
|
@@ -1383,14 +1414,20 @@ function te(e, t) {
|
|
|
1383
1414
|
enabled: e,
|
|
1384
1415
|
meta: { errorAction: "Load findings" }
|
|
1385
1416
|
}),
|
|
1417
|
+
destructiveHolds: (e = !0) => l({
|
|
1418
|
+
queryKey: [...B.ops(), "destructive-holds"],
|
|
1419
|
+
queryFn: ({ signal: e }) => q((e, t) => b(e, t), e),
|
|
1420
|
+
enabled: e,
|
|
1421
|
+
meta: { errorAction: "Load holds" }
|
|
1422
|
+
}),
|
|
1386
1423
|
findingSummary: () => l({
|
|
1387
1424
|
queryKey: [
|
|
1388
|
-
...
|
|
1425
|
+
...B.ops(),
|
|
1389
1426
|
"findings",
|
|
1390
1427
|
"summary"
|
|
1391
1428
|
],
|
|
1392
1429
|
queryFn: async ({ signal: e }) => {
|
|
1393
|
-
let t =
|
|
1430
|
+
let t = K(await R({
|
|
1394
1431
|
measures: [
|
|
1395
1432
|
"open_findings",
|
|
1396
1433
|
"orphaned_members",
|
|
@@ -1409,60 +1446,60 @@ function te(e, t) {
|
|
|
1409
1446
|
meta: { errorAction: "Load the findings summary" }
|
|
1410
1447
|
}),
|
|
1411
1448
|
merchantConfiguration: (e) => l({
|
|
1412
|
-
queryKey:
|
|
1449
|
+
queryKey: B.settings(),
|
|
1413
1450
|
queryFn: ({ signal: e }) => i(e),
|
|
1414
|
-
meta:
|
|
1451
|
+
meta: J(e)
|
|
1415
1452
|
}),
|
|
1416
1453
|
psps: () => l({
|
|
1417
|
-
queryKey: [...
|
|
1418
|
-
queryFn: ({ signal: e }) =>
|
|
1454
|
+
queryKey: [...B.settings(), "psps"],
|
|
1455
|
+
queryFn: ({ signal: e }) => S(e),
|
|
1419
1456
|
meta: { errorAction: "Load PSPs" }
|
|
1420
1457
|
}),
|
|
1421
1458
|
rails: () => l({
|
|
1422
|
-
queryKey: [...
|
|
1423
|
-
queryFn: ({ signal: e }) =>
|
|
1459
|
+
queryKey: [...B.settings(), "rails"],
|
|
1460
|
+
queryFn: ({ signal: e }) => C(e),
|
|
1424
1461
|
staleTime: Infinity,
|
|
1425
1462
|
meta: { errorAction: "Load rails" }
|
|
1426
1463
|
}),
|
|
1427
1464
|
config: () => l({
|
|
1428
1465
|
queryKey: ["config"],
|
|
1429
|
-
queryFn: ({ signal: e }) =>
|
|
1466
|
+
queryFn: ({ signal: e }) => F(e),
|
|
1430
1467
|
staleTime: 3e5,
|
|
1431
1468
|
meta: { errorAction: "Load configuration" }
|
|
1432
1469
|
}),
|
|
1433
1470
|
access: () => l({
|
|
1434
|
-
queryKey: [...
|
|
1435
|
-
queryFn: ({ signal: e }) =>
|
|
1471
|
+
queryKey: [...B.merchant(), "access"],
|
|
1472
|
+
queryFn: ({ signal: e }) => P(e),
|
|
1436
1473
|
staleTime: 3e5,
|
|
1437
1474
|
meta: { errorAction: "Load your access" }
|
|
1438
1475
|
}),
|
|
1439
1476
|
webhooks: () => l({
|
|
1440
|
-
queryKey: [...
|
|
1441
|
-
queryFn: ({ signal: e }) =>
|
|
1477
|
+
queryKey: [...B.alerts(), "webhooks"],
|
|
1478
|
+
queryFn: ({ signal: e }) => I(e),
|
|
1442
1479
|
meta: { errorAction: "Load webhooks" }
|
|
1443
1480
|
}),
|
|
1444
1481
|
dashboard: () => l({
|
|
1445
|
-
queryKey:
|
|
1446
|
-
queryFn: ({ signal: e }) =>
|
|
1482
|
+
queryKey: B.dashboard(),
|
|
1483
|
+
queryFn: ({ signal: e }) => L(e),
|
|
1447
1484
|
meta: { errorAction: "Load dashboard" }
|
|
1448
1485
|
}),
|
|
1449
1486
|
widgetMetrics: (e) => l({
|
|
1450
1487
|
queryKey: [
|
|
1451
|
-
...
|
|
1488
|
+
...B.dashboard(),
|
|
1452
1489
|
"metrics",
|
|
1453
1490
|
e ?? "unselected"
|
|
1454
1491
|
],
|
|
1455
|
-
queryFn: ({ signal: t }) =>
|
|
1492
|
+
queryFn: ({ signal: t }) => R(e, t),
|
|
1456
1493
|
enabled: !!e
|
|
1457
1494
|
}),
|
|
1458
1495
|
notifications: (e) => l({
|
|
1459
|
-
queryKey:
|
|
1496
|
+
queryKey: B.notifications(),
|
|
1460
1497
|
queryFn: ({ signal: e }) => y({ status: "requires_review" }, 10, e),
|
|
1461
1498
|
enabled: e
|
|
1462
1499
|
}),
|
|
1463
1500
|
unreadNotifications: () => l({
|
|
1464
|
-
queryKey: [...
|
|
1465
|
-
queryFn: async ({ signal: e }) => Number(
|
|
1501
|
+
queryKey: [...B.notifications(), "count"],
|
|
1502
|
+
queryFn: async ({ signal: e }) => Number(K(await R({
|
|
1466
1503
|
measures: ["open_findings"],
|
|
1467
1504
|
range: { last: "1d" },
|
|
1468
1505
|
filters: { finding_status: ["requires_review"] }
|
|
@@ -1475,65 +1512,65 @@ function te(e, t) {
|
|
|
1475
1512
|
}
|
|
1476
1513
|
//#endregion
|
|
1477
1514
|
//#region src/admin/lib/mutations.ts
|
|
1478
|
-
var
|
|
1515
|
+
var ne = 200, re = async (e) => {
|
|
1479
1516
|
let t = [], n;
|
|
1480
1517
|
for (;;) {
|
|
1481
|
-
let r = await e(
|
|
1518
|
+
let r = await e(ne, n);
|
|
1482
1519
|
if (t.push(...r.data), !r.next_cursor || r.data.length === 0) return t;
|
|
1483
1520
|
n = r.next_cursor;
|
|
1484
1521
|
}
|
|
1485
|
-
},
|
|
1522
|
+
}, Y = (e, t) => e.invalidateQueries({
|
|
1486
1523
|
queryKey: t,
|
|
1487
1524
|
exact: !0
|
|
1488
|
-
}),
|
|
1525
|
+
}), X = (e, t) => () => Y(e, t), Z = (e, t) => () => e.invalidateQueries({ queryKey: t }), Q = (e, ...t) => (n) => {
|
|
1489
1526
|
n instanceof x && n.code === "revision_mismatch" && Promise.all(t.map((t) => e.invalidateQueries({ queryKey: t })));
|
|
1490
1527
|
};
|
|
1491
|
-
function
|
|
1492
|
-
let { selectedMerchant: r } = e, { askCatalog: i, cancelPriceMigration: a, cancelSubscription: o, changeSubscriptionPaymentMethod: s, changeSubscription: l, createPrice: u, createProduct: d, createWebhook: f, createPSP: p, deleteWebhook: m, getCustomer: h, getProductByKey: g, grantProductAccess: _, listCustomers: v, listPayments: y, listSubscriptions: b, putUsageMeterRateCard: S, updatePSP: C, putUsageMeter: w, previewPriceMigration: E, previewSubscriptionChange: D, applyCatalog: O, refundPayment: k, createPriceMigration: A, resolveFinding: j,
|
|
1493
|
-
t instanceof x && t.merchantConfigReadOnly && e.invalidateQueries({ queryKey:
|
|
1494
|
-
},
|
|
1528
|
+
function ie(e, t, n) {
|
|
1529
|
+
let { selectedMerchant: r } = e, { askCatalog: i, cancelPriceMigration: a, cancelSubscription: o, changeSubscriptionPaymentMethod: s, changeSubscription: l, createPrice: u, createProduct: d, createWebhook: f, createPSP: p, deleteWebhook: m, getCustomer: h, getProductByKey: g, grantProductAccess: _, listCustomers: v, listPayments: y, listSubscriptions: b, putUsageMeterRateCard: S, updatePSP: C, putUsageMeter: w, previewPriceMigration: E, previewSubscriptionChange: D, applyCatalog: O, refundPayment: k, createPriceMigration: A, resolveFinding: j, clearDestructiveHold: M, resumeSubscription: N, revokeProductAccess: P, updateCustomer: F, updateMerchantConfiguration: I, updatePrice: L, updateProduct: R, updateWebhook: z, putDashboard: B } = t, { adminQueries: V, merchantQueryKeys: H } = n, U = (e) => (t) => {
|
|
1530
|
+
t instanceof x && t.merchantConfigReadOnly && e.invalidateQueries({ queryKey: V.config().queryKey });
|
|
1531
|
+
}, W = (e, t) => () => Promise.all([Y(e, [...t.alerts(), "webhooks"]), Y(e, t.settings())]);
|
|
1495
1532
|
return { adminMutations: {
|
|
1496
1533
|
saveDashboard: (e) => {
|
|
1497
|
-
let t =
|
|
1534
|
+
let t = H().dashboard();
|
|
1498
1535
|
return c({
|
|
1499
1536
|
mutationKey: [...t, "save"],
|
|
1500
|
-
mutationFn: (e) =>
|
|
1537
|
+
mutationFn: (e) => B(e),
|
|
1501
1538
|
onSuccess: (n) => e.setQueryData(t, n)
|
|
1502
1539
|
});
|
|
1503
1540
|
},
|
|
1504
|
-
|
|
1505
|
-
let e =
|
|
1541
|
+
findCustomers: () => {
|
|
1542
|
+
let e = H().customers();
|
|
1506
1543
|
return c({
|
|
1507
1544
|
mutationKey: [...e, "find"],
|
|
1508
|
-
mutationFn: async (e) => (await v(e,
|
|
1545
|
+
mutationFn: async (e) => (await v(e, 9, "")).data
|
|
1509
1546
|
});
|
|
1510
1547
|
},
|
|
1511
1548
|
exportCustomers: () => {
|
|
1512
|
-
let e =
|
|
1549
|
+
let e = H().customers();
|
|
1513
1550
|
return c({
|
|
1514
1551
|
mutationKey: [...e, "export"],
|
|
1515
|
-
mutationFn: (e) =>
|
|
1552
|
+
mutationFn: (e) => re((t, n) => v(e, t, n ?? ""))
|
|
1516
1553
|
});
|
|
1517
1554
|
},
|
|
1518
1555
|
exportSubscriptions: () => {
|
|
1519
|
-
let e =
|
|
1556
|
+
let e = H().subscriptions();
|
|
1520
1557
|
return c({
|
|
1521
1558
|
mutationKey: [...e, "export"],
|
|
1522
|
-
mutationFn: (e) =>
|
|
1559
|
+
mutationFn: (e) => re((t, n) => b(e, t, n))
|
|
1523
1560
|
});
|
|
1524
1561
|
},
|
|
1525
1562
|
exportPayments: () => {
|
|
1526
|
-
let e =
|
|
1563
|
+
let e = H().payments();
|
|
1527
1564
|
return c({
|
|
1528
1565
|
mutationKey: [...e, "export"],
|
|
1529
1566
|
mutationFn: (e) => T((t) => y(e, {
|
|
1530
|
-
limit:
|
|
1567
|
+
limit: ne,
|
|
1531
1568
|
cursor: t
|
|
1532
1569
|
}))
|
|
1533
1570
|
});
|
|
1534
1571
|
},
|
|
1535
1572
|
resolveFinding: (e) => {
|
|
1536
|
-
let t =
|
|
1573
|
+
let t = H().ops();
|
|
1537
1574
|
return c({
|
|
1538
1575
|
mutationKey: [
|
|
1539
1576
|
...t,
|
|
@@ -1541,11 +1578,23 @@ function re(e, t, n) {
|
|
|
1541
1578
|
"resolve"
|
|
1542
1579
|
],
|
|
1543
1580
|
mutationFn: ({ id: e, outcome: t, notes: n }) => j(e, t, n),
|
|
1544
|
-
onSuccess:
|
|
1581
|
+
onSuccess: Z(e, t)
|
|
1582
|
+
});
|
|
1583
|
+
},
|
|
1584
|
+
clearDestructiveHold: (e) => {
|
|
1585
|
+
let t = H().ops();
|
|
1586
|
+
return c({
|
|
1587
|
+
mutationKey: [
|
|
1588
|
+
...t,
|
|
1589
|
+
"destructive-holds",
|
|
1590
|
+
"clear"
|
|
1591
|
+
],
|
|
1592
|
+
mutationFn: ({ id: e, reason: t }) => M(e, t),
|
|
1593
|
+
onSuccess: Z(e, t)
|
|
1545
1594
|
});
|
|
1546
1595
|
},
|
|
1547
1596
|
refundPayment: (e, t, n, r) => {
|
|
1548
|
-
let i =
|
|
1597
|
+
let i = H(), a = i.payments(), o = n ? i.customer(n) : void 0, s = r ? i.subscription(r) : void 0;
|
|
1549
1598
|
return c({
|
|
1550
1599
|
mutationKey: [
|
|
1551
1600
|
...a,
|
|
@@ -1561,7 +1610,7 @@ function re(e, t, n) {
|
|
|
1561
1610
|
});
|
|
1562
1611
|
},
|
|
1563
1612
|
cancelSubscription: (e, t, n) => {
|
|
1564
|
-
let r =
|
|
1613
|
+
let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
|
|
1565
1614
|
return c({
|
|
1566
1615
|
mutationKey: [
|
|
1567
1616
|
...i,
|
|
@@ -1573,19 +1622,19 @@ function re(e, t, n) {
|
|
|
1573
1622
|
});
|
|
1574
1623
|
},
|
|
1575
1624
|
resumeSubscription: (e, t, n) => {
|
|
1576
|
-
let r =
|
|
1625
|
+
let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
|
|
1577
1626
|
return c({
|
|
1578
1627
|
mutationKey: [
|
|
1579
1628
|
...i,
|
|
1580
1629
|
t,
|
|
1581
1630
|
"resume"
|
|
1582
1631
|
],
|
|
1583
|
-
mutationFn: () =>
|
|
1632
|
+
mutationFn: () => N(t),
|
|
1584
1633
|
onSuccess: () => Promise.all([e.invalidateQueries({ queryKey: i }), ...a ? [e.invalidateQueries({ queryKey: a })] : []])
|
|
1585
1634
|
});
|
|
1586
1635
|
},
|
|
1587
1636
|
changeSubscriptionPaymentMethod: (e, t, n) => {
|
|
1588
|
-
let r =
|
|
1637
|
+
let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
|
|
1589
1638
|
return c({
|
|
1590
1639
|
mutationKey: [
|
|
1591
1640
|
...i,
|
|
@@ -1597,7 +1646,7 @@ function re(e, t, n) {
|
|
|
1597
1646
|
});
|
|
1598
1647
|
},
|
|
1599
1648
|
previewSubscriptionChange: (e) => {
|
|
1600
|
-
let t =
|
|
1649
|
+
let t = H().subscriptions();
|
|
1601
1650
|
return c({
|
|
1602
1651
|
mutationKey: [
|
|
1603
1652
|
...t,
|
|
@@ -1609,7 +1658,7 @@ function re(e, t, n) {
|
|
|
1609
1658
|
});
|
|
1610
1659
|
},
|
|
1611
1660
|
changeSubscription: (e, t, n) => {
|
|
1612
|
-
let r =
|
|
1661
|
+
let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0, o = r.payments();
|
|
1613
1662
|
return c({
|
|
1614
1663
|
mutationKey: [
|
|
1615
1664
|
...i,
|
|
@@ -1625,7 +1674,7 @@ function re(e, t, n) {
|
|
|
1625
1674
|
});
|
|
1626
1675
|
},
|
|
1627
1676
|
grantCustomerProductAccess: (e, t) => {
|
|
1628
|
-
let n =
|
|
1677
|
+
let n = H().customer(t);
|
|
1629
1678
|
return c({
|
|
1630
1679
|
mutationKey: [
|
|
1631
1680
|
...n,
|
|
@@ -1633,23 +1682,23 @@ function re(e, t, n) {
|
|
|
1633
1682
|
"grant"
|
|
1634
1683
|
],
|
|
1635
1684
|
mutationFn: (e) => _(t, e),
|
|
1636
|
-
onSuccess:
|
|
1685
|
+
onSuccess: Z(e, n)
|
|
1637
1686
|
});
|
|
1638
1687
|
},
|
|
1639
1688
|
revokeCustomerProductAccess: (e, t) => {
|
|
1640
|
-
let n =
|
|
1689
|
+
let n = H().customer(t);
|
|
1641
1690
|
return c({
|
|
1642
1691
|
mutationKey: [
|
|
1643
1692
|
...n,
|
|
1644
1693
|
"product-access",
|
|
1645
1694
|
"revoke"
|
|
1646
1695
|
],
|
|
1647
|
-
mutationFn: ({ grantId: e, reason: t }) =>
|
|
1648
|
-
onSuccess:
|
|
1696
|
+
mutationFn: ({ grantId: e, reason: t }) => P(e, t),
|
|
1697
|
+
onSuccess: Z(e, n)
|
|
1649
1698
|
});
|
|
1650
1699
|
},
|
|
1651
1700
|
askCatalogCopilot: () => {
|
|
1652
|
-
let e =
|
|
1701
|
+
let e = H();
|
|
1653
1702
|
return c({
|
|
1654
1703
|
mutationKey: [
|
|
1655
1704
|
...e.catalog(),
|
|
@@ -1660,7 +1709,7 @@ function re(e, t, n) {
|
|
|
1660
1709
|
});
|
|
1661
1710
|
},
|
|
1662
1711
|
loadCatalogPriceDraft: () => {
|
|
1663
|
-
let e =
|
|
1712
|
+
let e = H();
|
|
1664
1713
|
return c({
|
|
1665
1714
|
mutationKey: [
|
|
1666
1715
|
...e.catalog(),
|
|
@@ -1679,7 +1728,7 @@ function re(e, t, n) {
|
|
|
1679
1728
|
});
|
|
1680
1729
|
},
|
|
1681
1730
|
createCatalogDraftPrice: (e) => {
|
|
1682
|
-
let t =
|
|
1731
|
+
let t = H();
|
|
1683
1732
|
return c({
|
|
1684
1733
|
mutationKey: [
|
|
1685
1734
|
...t.catalog(),
|
|
@@ -1687,19 +1736,19 @@ function re(e, t, n) {
|
|
|
1687
1736
|
"create-price"
|
|
1688
1737
|
],
|
|
1689
1738
|
mutationFn: (e) => u(e),
|
|
1690
|
-
onSuccess:
|
|
1739
|
+
onSuccess: Z(e, t.catalog())
|
|
1691
1740
|
});
|
|
1692
1741
|
},
|
|
1693
1742
|
applyCatalog: (e) => {
|
|
1694
|
-
let t =
|
|
1743
|
+
let t = H();
|
|
1695
1744
|
return c({
|
|
1696
1745
|
mutationKey: [...t.catalog(), "apply"],
|
|
1697
1746
|
mutationFn: ({ document: e, force: t }) => O(e, t),
|
|
1698
|
-
onSuccess:
|
|
1747
|
+
onSuccess: Z(e, t.catalog())
|
|
1699
1748
|
});
|
|
1700
1749
|
},
|
|
1701
1750
|
createProduct: (e) => {
|
|
1702
|
-
let t =
|
|
1751
|
+
let t = H();
|
|
1703
1752
|
return c({
|
|
1704
1753
|
mutationKey: [
|
|
1705
1754
|
...t.catalog(),
|
|
@@ -1707,40 +1756,40 @@ function re(e, t, n) {
|
|
|
1707
1756
|
"create"
|
|
1708
1757
|
],
|
|
1709
1758
|
mutationFn: (e) => d(e),
|
|
1710
|
-
onSuccess:
|
|
1759
|
+
onSuccess: Z(e, t.catalog())
|
|
1711
1760
|
});
|
|
1712
1761
|
},
|
|
1713
1762
|
updateProduct: (e) => {
|
|
1714
|
-
let t =
|
|
1763
|
+
let t = H();
|
|
1715
1764
|
return c({
|
|
1716
1765
|
mutationKey: [
|
|
1717
1766
|
...t.catalog(),
|
|
1718
1767
|
"products",
|
|
1719
1768
|
"update"
|
|
1720
1769
|
],
|
|
1721
|
-
mutationFn: ({ id: e, product: t }) =>
|
|
1722
|
-
onSuccess:
|
|
1723
|
-
onError:
|
|
1770
|
+
mutationFn: ({ id: e, product: t }) => R(e, t),
|
|
1771
|
+
onSuccess: Z(e, t.catalog()),
|
|
1772
|
+
onError: Q(e, t.catalog())
|
|
1724
1773
|
});
|
|
1725
1774
|
},
|
|
1726
1775
|
setProductActive: (e) => {
|
|
1727
|
-
let t =
|
|
1776
|
+
let t = H();
|
|
1728
1777
|
return c({
|
|
1729
1778
|
mutationKey: [
|
|
1730
1779
|
...t.catalog(),
|
|
1731
1780
|
"products",
|
|
1732
1781
|
"set-active"
|
|
1733
1782
|
],
|
|
1734
|
-
mutationFn: ({ id: e, active: t, revision: n }) =>
|
|
1783
|
+
mutationFn: ({ id: e, active: t, revision: n }) => R(e, {
|
|
1735
1784
|
archived: !t,
|
|
1736
1785
|
expected_revision: n
|
|
1737
1786
|
}),
|
|
1738
|
-
onSuccess:
|
|
1739
|
-
onError:
|
|
1787
|
+
onSuccess: Z(e, t.catalog()),
|
|
1788
|
+
onError: Q(e, t.catalog())
|
|
1740
1789
|
});
|
|
1741
1790
|
},
|
|
1742
1791
|
createPrice: (e) => {
|
|
1743
|
-
let t =
|
|
1792
|
+
let t = H();
|
|
1744
1793
|
return c({
|
|
1745
1794
|
mutationKey: [
|
|
1746
1795
|
...t.catalog(),
|
|
@@ -1748,36 +1797,36 @@ function re(e, t, n) {
|
|
|
1748
1797
|
"create"
|
|
1749
1798
|
],
|
|
1750
1799
|
mutationFn: (e) => u(e),
|
|
1751
|
-
onSuccess:
|
|
1800
|
+
onSuccess: Z(e, t.catalog())
|
|
1752
1801
|
});
|
|
1753
1802
|
},
|
|
1754
1803
|
setPriceActive: (e) => {
|
|
1755
|
-
let t =
|
|
1804
|
+
let t = H();
|
|
1756
1805
|
return c({
|
|
1757
1806
|
mutationKey: [
|
|
1758
1807
|
...t.catalog(),
|
|
1759
1808
|
"prices",
|
|
1760
1809
|
"set-active"
|
|
1761
1810
|
],
|
|
1762
|
-
mutationFn: ({ id: e, active: t, revision: n }) =>
|
|
1811
|
+
mutationFn: ({ id: e, active: t, revision: n }) => L(e, {
|
|
1763
1812
|
archived: !t,
|
|
1764
1813
|
expected_revision: n
|
|
1765
1814
|
}),
|
|
1766
|
-
onSuccess:
|
|
1767
|
-
onError:
|
|
1815
|
+
onSuccess: Z(e, t.catalog()),
|
|
1816
|
+
onError: Q(e, t.catalog())
|
|
1768
1817
|
});
|
|
1769
1818
|
},
|
|
1770
1819
|
putUsageMeter: (e) => {
|
|
1771
|
-
let t =
|
|
1820
|
+
let t = H(), n = t.usageMeters();
|
|
1772
1821
|
return c({
|
|
1773
1822
|
mutationKey: [...n, "put"],
|
|
1774
1823
|
mutationFn: ({ key: e, meter: t }) => w(e, t),
|
|
1775
1824
|
onSuccess: (r, { key: i }) => Promise.all([e.invalidateQueries({ queryKey: n }), e.invalidateQueries({ queryKey: t.usageMeter(i) })]),
|
|
1776
|
-
onError:
|
|
1825
|
+
onError: Q(e, n)
|
|
1777
1826
|
});
|
|
1778
1827
|
},
|
|
1779
1828
|
putDefaultUsageRateCard: (e) => {
|
|
1780
|
-
let t =
|
|
1829
|
+
let t = H(), n = t.usageMeters();
|
|
1781
1830
|
return c({
|
|
1782
1831
|
mutationKey: [
|
|
1783
1832
|
...n,
|
|
@@ -1786,11 +1835,11 @@ function re(e, t, n) {
|
|
|
1786
1835
|
],
|
|
1787
1836
|
mutationFn: ({ meter: e, rateCard: t }) => S(e, t),
|
|
1788
1837
|
onSuccess: (r, { meter: i }) => Promise.all([e.invalidateQueries({ queryKey: n }), e.invalidateQueries({ queryKey: t.usageMeter(i.key) })]),
|
|
1789
|
-
onError:
|
|
1838
|
+
onError: Q(e, n)
|
|
1790
1839
|
});
|
|
1791
1840
|
},
|
|
1792
1841
|
deleteDefaultUsageRateCard: (e) => {
|
|
1793
|
-
let t =
|
|
1842
|
+
let t = H(), n = t.usageMeters();
|
|
1794
1843
|
return c({
|
|
1795
1844
|
mutationKey: [
|
|
1796
1845
|
...n,
|
|
@@ -1802,7 +1851,7 @@ function re(e, t, n) {
|
|
|
1802
1851
|
});
|
|
1803
1852
|
},
|
|
1804
1853
|
previewPriceChange: () => {
|
|
1805
|
-
let e =
|
|
1854
|
+
let e = H();
|
|
1806
1855
|
return c({
|
|
1807
1856
|
mutationKey: [
|
|
1808
1857
|
...e.catalog(),
|
|
@@ -1813,7 +1862,7 @@ function re(e, t, n) {
|
|
|
1813
1862
|
});
|
|
1814
1863
|
},
|
|
1815
1864
|
changePrice: (e) => {
|
|
1816
|
-
let t =
|
|
1865
|
+
let t = H();
|
|
1817
1866
|
return c({
|
|
1818
1867
|
mutationKey: [
|
|
1819
1868
|
...t.catalog(),
|
|
@@ -1824,11 +1873,11 @@ function re(e, t, n) {
|
|
|
1824
1873
|
let n = await u(e);
|
|
1825
1874
|
return t && await A(t.productKey, t.priceKey, n.id, t.effectiveAt), n;
|
|
1826
1875
|
},
|
|
1827
|
-
onSettled:
|
|
1876
|
+
onSettled: Z(e, t.catalog())
|
|
1828
1877
|
});
|
|
1829
1878
|
},
|
|
1830
1879
|
cancelPriceMigration: (e) => {
|
|
1831
|
-
let t =
|
|
1880
|
+
let t = H();
|
|
1832
1881
|
return c({
|
|
1833
1882
|
mutationKey: [
|
|
1834
1883
|
...t.catalog(),
|
|
@@ -1836,20 +1885,20 @@ function re(e, t, n) {
|
|
|
1836
1885
|
"cancel"
|
|
1837
1886
|
],
|
|
1838
1887
|
mutationFn: (e) => a(e),
|
|
1839
|
-
onSuccess:
|
|
1888
|
+
onSuccess: Z(e, t.catalog())
|
|
1840
1889
|
});
|
|
1841
1890
|
},
|
|
1842
1891
|
updateMerchantConfiguration: (e) => {
|
|
1843
|
-
let t =
|
|
1892
|
+
let t = H();
|
|
1844
1893
|
return c({
|
|
1845
1894
|
mutationKey: [...t.settings(), "update"],
|
|
1846
|
-
mutationFn: (e) =>
|
|
1847
|
-
onSettled:
|
|
1848
|
-
onError:
|
|
1895
|
+
mutationFn: (e) => I(e),
|
|
1896
|
+
onSettled: X(e, t.settings()),
|
|
1897
|
+
onError: U(e)
|
|
1849
1898
|
});
|
|
1850
1899
|
},
|
|
1851
1900
|
createPSP: (e) => {
|
|
1852
|
-
let t = r(), n =
|
|
1901
|
+
let t = r(), n = H();
|
|
1853
1902
|
return c({
|
|
1854
1903
|
mutationKey: [
|
|
1855
1904
|
...n.settings(),
|
|
@@ -1862,12 +1911,12 @@ function re(e, t, n) {
|
|
|
1862
1911
|
if (r() !== t) throw Error("Merchant changed; reopen this form before saving");
|
|
1863
1912
|
return p(e);
|
|
1864
1913
|
},
|
|
1865
|
-
onSettled:
|
|
1866
|
-
onError:
|
|
1914
|
+
onSettled: X(e, [...n.settings(), "psps"]),
|
|
1915
|
+
onError: U(e)
|
|
1867
1916
|
});
|
|
1868
1917
|
},
|
|
1869
1918
|
updatePSP: (e) => {
|
|
1870
|
-
let t = r(), n =
|
|
1919
|
+
let t = r(), n = H();
|
|
1871
1920
|
return c({
|
|
1872
1921
|
mutationKey: [
|
|
1873
1922
|
...n.settings(),
|
|
@@ -1880,26 +1929,26 @@ function re(e, t, n) {
|
|
|
1880
1929
|
if (r() !== t) throw Error("Merchant changed; reopen this form before saving");
|
|
1881
1930
|
return C(e, n);
|
|
1882
1931
|
},
|
|
1883
|
-
onSettled:
|
|
1884
|
-
onError:
|
|
1932
|
+
onSettled: X(e, [...n.settings(), "psps"]),
|
|
1933
|
+
onError: U(e)
|
|
1885
1934
|
});
|
|
1886
1935
|
},
|
|
1887
1936
|
setCreditLimit: () => {
|
|
1888
|
-
let e =
|
|
1937
|
+
let e = H();
|
|
1889
1938
|
return c({
|
|
1890
1939
|
mutationKey: [
|
|
1891
1940
|
...e.settings(),
|
|
1892
1941
|
"customer-controls",
|
|
1893
1942
|
"credit-limit"
|
|
1894
1943
|
],
|
|
1895
|
-
mutationFn: ({ customerId: e, currency: t, amount: n }) =>
|
|
1944
|
+
mutationFn: ({ customerId: e, currency: t, amount: n }) => F(e, { credit_limits: [{
|
|
1896
1945
|
currency: t,
|
|
1897
1946
|
amount: n
|
|
1898
1947
|
}] })
|
|
1899
1948
|
});
|
|
1900
1949
|
},
|
|
1901
1950
|
lookupCustomerControls: () => {
|
|
1902
|
-
let e =
|
|
1951
|
+
let e = H();
|
|
1903
1952
|
return c({
|
|
1904
1953
|
mutationKey: [
|
|
1905
1954
|
...e.settings(),
|
|
@@ -1919,7 +1968,7 @@ function re(e, t, n) {
|
|
|
1919
1968
|
});
|
|
1920
1969
|
},
|
|
1921
1970
|
createWebhook: (e) => {
|
|
1922
|
-
let t =
|
|
1971
|
+
let t = H();
|
|
1923
1972
|
return c({
|
|
1924
1973
|
mutationKey: [
|
|
1925
1974
|
...t.alerts(),
|
|
@@ -1927,25 +1976,25 @@ function re(e, t, n) {
|
|
|
1927
1976
|
"create"
|
|
1928
1977
|
],
|
|
1929
1978
|
mutationFn: (e) => f(e),
|
|
1930
|
-
onSuccess:
|
|
1931
|
-
onError:
|
|
1979
|
+
onSuccess: W(e, t),
|
|
1980
|
+
onError: U(e)
|
|
1932
1981
|
});
|
|
1933
1982
|
},
|
|
1934
1983
|
updateWebhook: (e) => {
|
|
1935
|
-
let t =
|
|
1984
|
+
let t = H();
|
|
1936
1985
|
return c({
|
|
1937
1986
|
mutationKey: [
|
|
1938
1987
|
...t.alerts(),
|
|
1939
1988
|
"webhooks",
|
|
1940
1989
|
"update"
|
|
1941
1990
|
],
|
|
1942
|
-
mutationFn: ({ id: e, webhook: t }) =>
|
|
1943
|
-
onSuccess:
|
|
1944
|
-
onError:
|
|
1991
|
+
mutationFn: ({ id: e, webhook: t }) => z(e, t),
|
|
1992
|
+
onSuccess: W(e, t),
|
|
1993
|
+
onError: U(e)
|
|
1945
1994
|
});
|
|
1946
1995
|
},
|
|
1947
1996
|
deleteWebhook: (e) => {
|
|
1948
|
-
let t =
|
|
1997
|
+
let t = H();
|
|
1949
1998
|
return c({
|
|
1950
1999
|
mutationKey: [
|
|
1951
2000
|
...t.alerts(),
|
|
@@ -1953,22 +2002,22 @@ function re(e, t, n) {
|
|
|
1953
2002
|
"delete"
|
|
1954
2003
|
],
|
|
1955
2004
|
mutationFn: (e) => m(e),
|
|
1956
|
-
onSuccess:
|
|
1957
|
-
onError:
|
|
2005
|
+
onSuccess: W(e, t),
|
|
2006
|
+
onError: U(e)
|
|
1958
2007
|
});
|
|
1959
2008
|
}
|
|
1960
2009
|
} };
|
|
1961
2010
|
}
|
|
1962
2011
|
//#endregion
|
|
1963
2012
|
//#region src/admin/lib/credit-queries.ts
|
|
1964
|
-
function
|
|
2013
|
+
function ae(e, t) {
|
|
1965
2014
|
let { selectedMerchant: n } = e, r = (t, n) => [
|
|
1966
2015
|
...e.queryRoot(t),
|
|
1967
2016
|
"customers",
|
|
1968
2017
|
n
|
|
1969
2018
|
], { createCreditGrant: i, listCreditGrants: a, listBalanceTransactions: o, revokeCreditGrant: s } = t;
|
|
1970
2019
|
function u(e) {
|
|
1971
|
-
if (
|
|
2020
|
+
if (n() !== e) throw Error("The selected merchant changed. Reload this customer's credits.");
|
|
1972
2021
|
}
|
|
1973
2022
|
return {
|
|
1974
2023
|
assertMerchant: u,
|
|
@@ -1981,7 +2030,7 @@ function Z(e, t) {
|
|
|
1981
2030
|
i,
|
|
1982
2031
|
o
|
|
1983
2032
|
],
|
|
1984
|
-
enabled: !!(
|
|
2033
|
+
enabled: !!(t && n),
|
|
1985
2034
|
queryFn: ({ signal: r }) => (u(e), a(t, n, i, o, r))
|
|
1986
2035
|
}),
|
|
1987
2036
|
transactions: (e, t, n, i, a) => l({
|
|
@@ -1992,7 +2041,7 @@ function Z(e, t) {
|
|
|
1992
2041
|
i,
|
|
1993
2042
|
a
|
|
1994
2043
|
],
|
|
1995
|
-
enabled: !!(
|
|
2044
|
+
enabled: !!(t && n),
|
|
1996
2045
|
queryFn: ({ signal: r }) => (u(e), o(t, n, i, a, r))
|
|
1997
2046
|
})
|
|
1998
2047
|
},
|
|
@@ -2010,7 +2059,7 @@ function Z(e, t) {
|
|
|
2010
2059
|
}
|
|
2011
2060
|
//#endregion
|
|
2012
2061
|
//#region src/admin/lib/order-queries.ts
|
|
2013
|
-
function
|
|
2062
|
+
function oe(e, t, n) {
|
|
2014
2063
|
let { queryRoot: r } = e, { queryKeys: i } = n, a = t, o = t, u = {
|
|
2015
2064
|
root: () => [...r(), "orders"],
|
|
2016
2065
|
detail: (e) => [...u.root(), e],
|
|
@@ -2030,6 +2079,15 @@ function ie(e, t, n) {
|
|
|
2030
2079
|
}, r),
|
|
2031
2080
|
placeholderData: s
|
|
2032
2081
|
}),
|
|
2082
|
+
byIds: (e) => l({
|
|
2083
|
+
queryKey: [
|
|
2084
|
+
...u.root(),
|
|
2085
|
+
"ids",
|
|
2086
|
+
e
|
|
2087
|
+
],
|
|
2088
|
+
queryFn: ({ signal: t }) => a.listOrders({ ids: e.join(",") }, {}, t),
|
|
2089
|
+
enabled: e.length > 0
|
|
2090
|
+
}),
|
|
2033
2091
|
detail: (e) => l({
|
|
2034
2092
|
queryKey: u.detail(e),
|
|
2035
2093
|
queryFn: ({ signal: t }) => a.getOrder(e, t),
|
|
@@ -2080,7 +2138,7 @@ function ie(e, t, n) {
|
|
|
2080
2138
|
}
|
|
2081
2139
|
//#endregion
|
|
2082
2140
|
//#region src/admin/lib/import-queries.ts
|
|
2083
|
-
var
|
|
2141
|
+
var se = (e) => e === "pulling" || e === "applying", ce = 2e3, le = (e) => ({
|
|
2084
2142
|
imports: () => [...e(), "psp-imports"],
|
|
2085
2143
|
import: (t) => [
|
|
2086
2144
|
...e(),
|
|
@@ -2093,10 +2151,10 @@ var ae = (e) => e === "pulling" || e === "applying", oe = 2e3, se = (e) => ({
|
|
|
2093
2151
|
catalog: () => [...e(), "catalog"],
|
|
2094
2152
|
ops: () => [...e(), "ops"]
|
|
2095
2153
|
});
|
|
2096
|
-
function
|
|
2097
|
-
let { queryRoot: n } = e, r =
|
|
2154
|
+
function ue(e, t) {
|
|
2155
|
+
let { queryRoot: n } = e, r = le(n), i = () => {
|
|
2098
2156
|
let e = n();
|
|
2099
|
-
return
|
|
2157
|
+
return le(() => e);
|
|
2100
2158
|
};
|
|
2101
2159
|
return {
|
|
2102
2160
|
importKeys: r,
|
|
@@ -2114,7 +2172,7 @@ function ce(e, t) {
|
|
|
2114
2172
|
cursor: i
|
|
2115
2173
|
}, r),
|
|
2116
2174
|
placeholderData: s,
|
|
2117
|
-
refetchInterval: (e) => e.state.data?.data.some((e) =>
|
|
2175
|
+
refetchInterval: (e) => e.state.data?.data.some((e) => se(e.status)) ? ce : !1,
|
|
2118
2176
|
meta: { errorAction: "Load PSP imports" }
|
|
2119
2177
|
}),
|
|
2120
2178
|
latest: (e) => l({
|
|
@@ -2130,7 +2188,7 @@ function ce(e, t) {
|
|
|
2130
2188
|
queryKey: r.import(e),
|
|
2131
2189
|
queryFn: ({ signal: n }) => t.getPSPImport(e, n),
|
|
2132
2190
|
enabled: !!e,
|
|
2133
|
-
refetchInterval: (e) =>
|
|
2191
|
+
refetchInterval: (e) => se(e.state.data?.status) ? ce : !1,
|
|
2134
2192
|
meta: { errorAction: "Load PSP import" }
|
|
2135
2193
|
}),
|
|
2136
2194
|
records: (e, n, i, a, o) => l({
|
|
@@ -2270,29 +2328,29 @@ function ce(e, t) {
|
|
|
2270
2328
|
}
|
|
2271
2329
|
//#endregion
|
|
2272
2330
|
//#region src/admin/context.tsx
|
|
2273
|
-
function
|
|
2274
|
-
let t = E(e), n = B(t), r = te(t, n), i =
|
|
2331
|
+
function de(e) {
|
|
2332
|
+
let t = E(e), n = B(t), r = te(t, n), i = W(e.namespace);
|
|
2275
2333
|
return {
|
|
2276
2334
|
toast: i,
|
|
2277
|
-
...
|
|
2335
|
+
...G(i),
|
|
2278
2336
|
...t,
|
|
2279
2337
|
...n,
|
|
2280
2338
|
...r,
|
|
2281
|
-
...re(t, n, r),
|
|
2282
|
-
...Z(t, n),
|
|
2283
2339
|
...ie(t, n, r),
|
|
2284
|
-
...
|
|
2340
|
+
...ae(t, n),
|
|
2341
|
+
...oe(t, n, r),
|
|
2342
|
+
...ue(t, n)
|
|
2285
2343
|
};
|
|
2286
2344
|
}
|
|
2287
|
-
var
|
|
2288
|
-
function
|
|
2289
|
-
let e = n(
|
|
2345
|
+
var fe = e(null);
|
|
2346
|
+
function pe() {
|
|
2347
|
+
let e = n(fe);
|
|
2290
2348
|
if (!e) throw Error("BillingAdmin context is missing");
|
|
2291
2349
|
return e;
|
|
2292
2350
|
}
|
|
2293
|
-
var
|
|
2294
|
-
function
|
|
2295
|
-
let s = o(
|
|
2351
|
+
var me = () => pe().services, he = e(null), ge = (e) => (window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e)), _e = () => window.location.pathname + window.location.search;
|
|
2352
|
+
function ve({ basePath: e = "/", navigation: n, children: r }) {
|
|
2353
|
+
let s = o(ge, _e, () => e), c = e.replace(/\/$/, ""), l = new URL(s, "http://billing.local"), u = n?.pathname ?? l.pathname, f = n?.search ?? l.search, p = u === c ? "/" : u.startsWith(c + "/") ? u.slice(c.length) : "/", [m, h] = a(() => /* @__PURE__ */ new Map()), g = t((e) => {
|
|
2296
2354
|
if (/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(e)) return e;
|
|
2297
2355
|
let t = new URL(e, "http://billing.local" + p + f);
|
|
2298
2356
|
return c + t.pathname + t.search + t.hash;
|
|
@@ -2329,25 +2387,25 @@ function he({ basePath: e = "/", navigation: n, children: r }) {
|
|
|
2329
2387
|
n,
|
|
2330
2388
|
m
|
|
2331
2389
|
]);
|
|
2332
|
-
return /* @__PURE__ */ d(
|
|
2390
|
+
return /* @__PURE__ */ d(he.Provider, {
|
|
2333
2391
|
value: v,
|
|
2334
2392
|
children: r
|
|
2335
2393
|
});
|
|
2336
2394
|
}
|
|
2337
2395
|
function $() {
|
|
2338
|
-
let e = n(
|
|
2396
|
+
let e = n(he);
|
|
2339
2397
|
if (!e) throw Error("BillingAdmin router is missing");
|
|
2340
2398
|
return e;
|
|
2341
2399
|
}
|
|
2342
|
-
var
|
|
2343
|
-
function
|
|
2400
|
+
var ye = () => $().location, be = () => $().navigate, xe = () => $().params;
|
|
2401
|
+
function Se() {
|
|
2344
2402
|
let { location: e, navigate: t } = $();
|
|
2345
2403
|
return [i(() => new URLSearchParams(e.search), [e.search]), (n, r) => {
|
|
2346
2404
|
let i = new URLSearchParams(n).toString();
|
|
2347
2405
|
t(e.pathname + (i ? "?" + i : ""), r);
|
|
2348
2406
|
}];
|
|
2349
2407
|
}
|
|
2350
|
-
function
|
|
2408
|
+
function Ce({ to: e, onClick: t, ...n }) {
|
|
2351
2409
|
let { href: r, navigate: i } = $();
|
|
2352
2410
|
return /* @__PURE__ */ d("a", {
|
|
2353
2411
|
...n,
|
|
@@ -2357,17 +2415,17 @@ function be({ to: e, onClick: t, ...n }) {
|
|
|
2357
2415
|
}
|
|
2358
2416
|
});
|
|
2359
2417
|
}
|
|
2360
|
-
function
|
|
2361
|
-
let n =
|
|
2418
|
+
function we({ to: e, replace: t }) {
|
|
2419
|
+
let n = be();
|
|
2362
2420
|
return r(() => n(e, { replace: t }), [
|
|
2363
2421
|
n,
|
|
2364
2422
|
e,
|
|
2365
2423
|
t
|
|
2366
2424
|
]), null;
|
|
2367
2425
|
}
|
|
2368
|
-
function
|
|
2426
|
+
function Te({ params: e, children: t }) {
|
|
2369
2427
|
let n = $();
|
|
2370
|
-
return /* @__PURE__ */ d(
|
|
2428
|
+
return /* @__PURE__ */ d(he.Provider, {
|
|
2371
2429
|
value: {
|
|
2372
2430
|
...n,
|
|
2373
2431
|
params: e
|
|
@@ -2377,10 +2435,10 @@ function Se({ params: e, children: t }) {
|
|
|
2377
2435
|
}
|
|
2378
2436
|
//#endregion
|
|
2379
2437
|
//#region src/admin/lib/utils.ts
|
|
2380
|
-
function
|
|
2438
|
+
function Ee(...e) {
|
|
2381
2439
|
return p(f(e));
|
|
2382
2440
|
}
|
|
2383
2441
|
//#endregion
|
|
2384
|
-
export {
|
|
2442
|
+
export { k as C, m as D, g as E, h as O, A as S, E as T, U as _, Te as a, D as b, xe as c, de as d, pe as f, G as g, W as h, we as i, Se as l, se as m, ve as n, ye as o, me as p, Ce as r, be as s, Ee as t, fe as u, B as v, x as w, O as x, M as y };
|
|
2385
2443
|
|
|
2386
|
-
//# sourceMappingURL=admin-utils-
|
|
2444
|
+
//# sourceMappingURL=admin-utils-wuPUD0uh.js.map
|