@openrails/billing-ui 0.256.4 → 0.256.6
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 -0
- package/README.md +1 -1
- package/dist/account/resume-dialog.d.ts +13 -0
- package/dist/{admin-attempts-DxRHTODq.js → admin-attempts-C761C4Ys.js} +8 -8
- package/dist/{admin-attempts-DxRHTODq.js.map → admin-attempts-C761C4Ys.js.map} +1 -1
- package/dist/{admin-auth-CiuZ-Hlm.js → admin-auth-CMtFwKlJ.js} +2 -2
- package/dist/{admin-auth-CiuZ-Hlm.js.map → admin-auth-CMtFwKlJ.js.map} +1 -1
- package/dist/{admin-badge-VCGbnfiN.js → admin-badge-CKME6YUp.js} +2 -2
- package/dist/{admin-badge-VCGbnfiN.js.map → admin-badge-CKME6YUp.js.map} +1 -1
- package/dist/{admin-button-Oip73Plq.js → admin-button-BpaYeqIA.js} +2 -2
- package/dist/{admin-button-Oip73Plq.js.map → admin-button-BpaYeqIA.js.map} +1 -1
- package/dist/{admin-capabilities-BGv7oG8v.js → admin-capabilities-KRi36PEI.js} +2 -2
- package/dist/{admin-capabilities-BGv7oG8v.js.map → admin-capabilities-KRi36PEI.js.map} +1 -1
- package/dist/{admin-card-DGbi6ZHZ.js → admin-card-DAAMT-zo.js} +2 -2
- package/dist/{admin-card-DGbi6ZHZ.js.map → admin-card-DAAMT-zo.js.map} +1 -1
- package/dist/{admin-catalog-C0QRANp7.js → admin-catalog-DX0fQ_Li.js} +18 -18
- package/dist/{admin-catalog-C0QRANp7.js.map → admin-catalog-DX0fQ_Li.js.map} +1 -1
- package/dist/{admin-customers-cnKMEV4q.js → admin-customers-DHnEvj4J.js} +6 -6
- package/dist/{admin-customers-cnKMEV4q.js.map → admin-customers-DHnEvj4J.js.map} +1 -1
- package/dist/{admin-dashboard-DfSsUyo-.js → admin-dashboard-DahEHElc.js} +14 -14
- package/dist/{admin-dashboard-DfSsUyo-.js.map → admin-dashboard-DahEHElc.js.map} +1 -1
- package/dist/{admin-data-table-CgeWv__T.js → admin-data-table-JFcCM4nz.js} +6 -6
- package/dist/{admin-data-table-CgeWv__T.js.map → admin-data-table-JFcCM4nz.js.map} +1 -1
- package/dist/{admin-detail-Dc7rU4mM.js → admin-detail-BBhbe-TN.js} +15 -15
- package/dist/{admin-detail-Dc7rU4mM.js.map → admin-detail-BBhbe-TN.js.map} +1 -1
- package/dist/{admin-detail-DAOjLNL9.js → admin-detail-CrZd_jsD.js} +11 -11
- package/dist/{admin-detail-DAOjLNL9.js.map → admin-detail-CrZd_jsD.js.map} +1 -1
- package/dist/{admin-detail-qetSqVDt.js → admin-detail-Dum-UENt.js} +15 -15
- package/dist/{admin-detail-qetSqVDt.js.map → admin-detail-Dum-UENt.js.map} +1 -1
- package/dist/{admin-detail-BATuJjVs.js → admin-detail-EFditqtQ.js} +12 -12
- package/dist/{admin-detail-BATuJjVs.js.map → admin-detail-EFditqtQ.js.map} +1 -1
- package/dist/{admin-dialog-Ffx95AIT.js → admin-dialog-C6q9m4AO.js} +3 -3
- package/dist/{admin-dialog-Ffx95AIT.js.map → admin-dialog-C6q9m4AO.js.map} +1 -1
- package/dist/{admin-dom-lnNSQ7ke.js → admin-dom-CFOQMhV5.js} +4 -4
- package/dist/{admin-dom-lnNSQ7ke.js.map → admin-dom-CFOQMhV5.js.map} +1 -1
- package/dist/{admin-dropdown-menu-CCiW4-oz.js → admin-dropdown-menu-B0BamhwM.js} +2 -2
- package/dist/{admin-dropdown-menu-CCiW4-oz.js.map → admin-dropdown-menu-B0BamhwM.js.map} +1 -1
- package/dist/{admin-fact-card-D6mZgxpN.js → admin-fact-card-CayqfxhD.js} +2 -2
- package/dist/{admin-fact-card-D6mZgxpN.js.map → admin-fact-card-CayqfxhD.js.map} +1 -1
- package/dist/{admin-health-CvJX9prw.js → admin-health-DrYyfrQG.js} +9 -9
- package/dist/{admin-health-CvJX9prw.js.map → admin-health-DrYyfrQG.js.map} +1 -1
- package/dist/{admin-input-DO5lvCLL.js → admin-input-D5JvWtz6.js} +2 -2
- package/dist/{admin-input-DO5lvCLL.js.map → admin-input-D5JvWtz6.js.map} +1 -1
- package/dist/{admin-label-BzJpr3lg.js → admin-label-DiDLN80J.js} +2 -2
- package/dist/{admin-label-BzJpr3lg.js.map → admin-label-DiDLN80J.js.map} +1 -1
- package/dist/{admin-linked-table-row-5vFb6rXY.js → admin-linked-table-row-BLui28tf.js} +4 -4
- package/dist/{admin-linked-table-row-5vFb6rXY.js.map → admin-linked-table-row-BLui28tf.js.map} +1 -1
- package/dist/{admin-metering-BksTFRRP.js → admin-metering-DlUZXwed.js} +14 -14
- package/dist/{admin-metering-BksTFRRP.js.map → admin-metering-DlUZXwed.js.map} +1 -1
- package/dist/{admin-ops-Ch2-BmUp.js → admin-ops-CotDCsxb.js} +11 -11
- package/dist/{admin-ops-Ch2-BmUp.js.map → admin-ops-CotDCsxb.js.map} +1 -1
- package/dist/{admin-orders-DMSOum9t.js → admin-orders-DfJWLFAI.js} +8 -8
- package/dist/{admin-orders-DMSOum9t.js.map → admin-orders-DfJWLFAI.js.map} +1 -1
- package/dist/{admin-payments-pNLNIU0X.js → admin-payments-yaUgdqSl.js} +9 -9
- package/dist/{admin-payments-pNLNIU0X.js.map → admin-payments-yaUgdqSl.js.map} +1 -1
- package/dist/{admin-price-detail-C9CJwLeM.js → admin-price-detail-ncX-vQVz.js} +9 -9
- package/dist/{admin-price-detail-C9CJwLeM.js.map → admin-price-detail-ncX-vQVz.js.map} +1 -1
- package/dist/{admin-price-wizard-DAkDGWkH.js → admin-price-wizard-BKrUH8iN.js} +7 -7
- package/dist/{admin-price-wizard-DAkDGWkH.js.map → admin-price-wizard-BKrUH8iN.js.map} +1 -1
- package/dist/{admin-range-picker-DaIvC1oC.js → admin-range-picker-CgCtBuH8.js} +5 -5
- package/dist/{admin-range-picker-DaIvC1oC.js.map → admin-range-picker-CgCtBuH8.js.map} +1 -1
- package/dist/{admin-reports-CA-cnNur.js → admin-reports-Crpx48rH.js} +8 -8
- package/dist/{admin-reports-CA-cnNur.js.map → admin-reports-Crpx48rH.js.map} +1 -1
- package/dist/{admin-select-CUXvh6j1.js → admin-select-C-vgRjrt.js} +2 -2
- package/dist/{admin-select-CUXvh6j1.js.map → admin-select-C-vgRjrt.js.map} +1 -1
- package/dist/{admin-settings-_0T6mLFx.js → admin-settings-Ms2ghC00.js} +13 -13
- package/dist/{admin-settings-_0T6mLFx.js.map → admin-settings-Ms2ghC00.js.map} +1 -1
- package/dist/{admin-skeleton-DEY3Q8Dg.js → admin-skeleton-DwCr2rr_.js} +2 -2
- package/dist/{admin-skeleton-DEY3Q8Dg.js.map → admin-skeleton-DwCr2rr_.js.map} +1 -1
- package/dist/{admin-status-badge-CwqIU8tK.js → admin-status-badge-BPYozxZA.js} +2 -2
- package/dist/{admin-status-badge-CwqIU8tK.js.map → admin-status-badge-BPYozxZA.js.map} +1 -1
- package/dist/{admin-subscriptions-lJG_EzMe.js → admin-subscriptions-CiAsfgw4.js} +9 -9
- package/dist/{admin-subscriptions-lJG_EzMe.js.map → admin-subscriptions-CiAsfgw4.js.map} +1 -1
- package/dist/{admin-switch-S4g_ppaU.js → admin-switch-DCQyukkF.js} +2 -2
- package/dist/{admin-switch-S4g_ppaU.js.map → admin-switch-DCQyukkF.js.map} +1 -1
- package/dist/{admin-table-CWhiCb9d.js → admin-table-Cvdx51W3.js} +2 -2
- package/dist/{admin-table-CWhiCb9d.js.map → admin-table-Cvdx51W3.js.map} +1 -1
- package/dist/{admin-tabs-Cjm5a6UJ.js → admin-tabs-opLnz2dz.js} +2 -2
- package/dist/{admin-tabs-Cjm5a6UJ.js.map → admin-tabs-opLnz2dz.js.map} +1 -1
- package/dist/{admin-textarea-DK1Fq31x.js → admin-textarea-YT0_5ldp.js} +2 -2
- package/dist/{admin-textarea-DK1Fq31x.js.map → admin-textarea-YT0_5ldp.js.map} +1 -1
- package/dist/{admin-typed-confirm-dialog-BloZvFPA.js → admin-typed-confirm-dialog-Dk0tz8C0.js} +6 -6
- package/dist/{admin-typed-confirm-dialog-BloZvFPA.js.map → admin-typed-confirm-dialog-Dk0tz8C0.js.map} +1 -1
- package/dist/{admin-utils-DnVY5fYd.js → admin-utils-CwzkGo6Y.js} +490 -230
- package/dist/admin-utils-CwzkGo6Y.js.map +1 -0
- package/dist/{admin-widget-viz-RCkxUspL.js → admin-widget-viz-D0ZYS8wJ.js} +3 -3
- package/dist/{admin-widget-viz-RCkxUspL.js.map → admin-widget-viz-D0ZYS8wJ.js.map} +1 -1
- package/dist/admin.css +1 -1
- package/dist/admin.js +29 -29
- package/dist/admin.js.map +1 -1
- package/dist/client/client.d.ts +1 -1
- package/dist/client/errors.d.ts +2 -0
- package/dist/client/generated/wire.d.ts +5 -5
- package/dist/client/index.d.ts +1 -1
- package/dist/{client-CBVXfNfh.js → client-CDA6v1Jd.js} +272 -252
- package/dist/client-CDA6v1Jd.js.map +1 -0
- package/dist/client.js +2 -2
- package/dist/{hooks-Ccn3_Xqp.js → hooks-UswS31Eu.js} +157 -158
- package/dist/hooks-UswS31Eu.js.map +1 -0
- package/dist/index.js +471 -404
- package/dist/index.js.map +1 -1
- package/dist/locales/de.js +8 -1
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.d.ts +8 -1
- package/dist/locales/en.js +9 -2
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +8 -1
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +8 -1
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +8 -1
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/zh.js +8 -1
- 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-utils-DnVY5fYd.js.map +0 -1
- package/dist/client-CBVXfNfh.js.map +0 -1
- package/dist/hooks-Ccn3_Xqp.js.map +0 -1
|
@@ -20,8 +20,259 @@ function g({ id: e }) {
|
|
|
20
20
|
return h().text(e);
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
|
-
//#region src/
|
|
24
|
-
var _ =
|
|
23
|
+
//#region src/client/errors.ts
|
|
24
|
+
var _ = /* @__PURE__ */ new Set([
|
|
25
|
+
502,
|
|
26
|
+
503,
|
|
27
|
+
504,
|
|
28
|
+
520,
|
|
29
|
+
521,
|
|
30
|
+
522,
|
|
31
|
+
523,
|
|
32
|
+
524
|
|
33
|
+
]), v = /fetch|network|load failed|connection/i;
|
|
34
|
+
function y(e) {
|
|
35
|
+
if (e instanceof TypeError) return globalThis.navigator?.onLine === !1 || v.test(e.message) ? "network_error" : void 0;
|
|
36
|
+
if (!e || typeof e != "object") return;
|
|
37
|
+
let { name: t, code: n, status: r } = e;
|
|
38
|
+
if (t === "TimeoutError") return "server_unavailable";
|
|
39
|
+
if (n === "network_error" || n === "server_unavailable") return n;
|
|
40
|
+
if (n === void 0 || n === "unknown_error" || n === "server_error") return typeof r == "number" && _.has(r) ? "server_unavailable" : void 0;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/locales/en.ts
|
|
44
|
+
var b = {
|
|
45
|
+
common: {
|
|
46
|
+
cancel: "Cancel",
|
|
47
|
+
close: "Close",
|
|
48
|
+
retry: "Try again",
|
|
49
|
+
loading: "Loading...",
|
|
50
|
+
previous: "Previous",
|
|
51
|
+
next: "Next",
|
|
52
|
+
notAvailable: "—"
|
|
53
|
+
},
|
|
54
|
+
status: {
|
|
55
|
+
active: "Active",
|
|
56
|
+
pending: "Pending",
|
|
57
|
+
past_due: "Past due",
|
|
58
|
+
canceled: "Canceled",
|
|
59
|
+
cancel_scheduled: "Ending",
|
|
60
|
+
unknown: "Unknown",
|
|
61
|
+
awaiting_method: "Update card",
|
|
62
|
+
unverified: "Verifying",
|
|
63
|
+
succeeded: "Paid",
|
|
64
|
+
failed: "Failed",
|
|
65
|
+
refunded: "Refunded",
|
|
66
|
+
partially_refunded: "Partly refunded",
|
|
67
|
+
expired: "Expired",
|
|
68
|
+
expiring_soon: "Expires soon",
|
|
69
|
+
needs_attention: "Needs attention",
|
|
70
|
+
default: "Default"
|
|
71
|
+
},
|
|
72
|
+
interval: {
|
|
73
|
+
every: {
|
|
74
|
+
hour: {
|
|
75
|
+
one: "every hour",
|
|
76
|
+
other: "every {count} hours"
|
|
77
|
+
},
|
|
78
|
+
day: {
|
|
79
|
+
one: "every day",
|
|
80
|
+
other: "every {count} days"
|
|
81
|
+
},
|
|
82
|
+
week: {
|
|
83
|
+
one: "every week",
|
|
84
|
+
other: "every {count} weeks"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
per: {
|
|
88
|
+
hour: {
|
|
89
|
+
one: "/ hour",
|
|
90
|
+
other: "/ {count} hours"
|
|
91
|
+
},
|
|
92
|
+
day: {
|
|
93
|
+
one: "/ day",
|
|
94
|
+
other: "/ {count} days"
|
|
95
|
+
},
|
|
96
|
+
week: {
|
|
97
|
+
one: "/ week",
|
|
98
|
+
other: "/ {count} weeks"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
access: {
|
|
102
|
+
hour: {
|
|
103
|
+
one: "1 hour of access",
|
|
104
|
+
other: "{count} hours of access"
|
|
105
|
+
},
|
|
106
|
+
day: {
|
|
107
|
+
one: "1 day of access",
|
|
108
|
+
other: "{count} days of access"
|
|
109
|
+
},
|
|
110
|
+
week: {
|
|
111
|
+
one: "1 week of access",
|
|
112
|
+
other: "{count} weeks of access"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
duration: {
|
|
116
|
+
hour: {
|
|
117
|
+
one: "1 hour",
|
|
118
|
+
other: "{count} hours"
|
|
119
|
+
},
|
|
120
|
+
day: {
|
|
121
|
+
one: "1 day",
|
|
122
|
+
other: "{count} days"
|
|
123
|
+
},
|
|
124
|
+
week: {
|
|
125
|
+
one: "1 week",
|
|
126
|
+
other: "{count} weeks"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
once: "one-time",
|
|
130
|
+
permanent: "Access with no scheduled expiry"
|
|
131
|
+
},
|
|
132
|
+
products: {
|
|
133
|
+
empty: "Nothing on sale unlocks this",
|
|
134
|
+
once: "{amount}",
|
|
135
|
+
rent: "Rent for {period}, {amount}",
|
|
136
|
+
recurring: "{amount} {every}"
|
|
137
|
+
},
|
|
138
|
+
subscriptions: {
|
|
139
|
+
title: "Subscriptions",
|
|
140
|
+
description: "Your plans and when they renew.",
|
|
141
|
+
empty: "No subscriptions yet",
|
|
142
|
+
emptyDescription: "Plans you subscribe to will appear here.",
|
|
143
|
+
browsePlans: "Browse plans",
|
|
144
|
+
fallbackName: "Subscription",
|
|
145
|
+
renews: "Renews {date}",
|
|
146
|
+
endsOn: "Access until {date}",
|
|
147
|
+
noMorePayments: "No further payments",
|
|
148
|
+
endedOn: "Ended {date}",
|
|
149
|
+
pastDue: "Payment failed. Update your card to keep access.",
|
|
150
|
+
cancel: "Cancel",
|
|
151
|
+
cancelLabel: "Cancel {name}",
|
|
152
|
+
resume: "Resume",
|
|
153
|
+
resumed: "Your subscription will continue.",
|
|
154
|
+
manageAtProvider: "Manage",
|
|
155
|
+
updating: "Updating...",
|
|
156
|
+
paidWith: "{brand} •••• {last4}",
|
|
157
|
+
wallet: "Solana wallet",
|
|
158
|
+
changeCard: "Change card",
|
|
159
|
+
changeCardLabel: "Change card for {name}"
|
|
160
|
+
},
|
|
161
|
+
resume: {
|
|
162
|
+
title: "Resume {name}?",
|
|
163
|
+
description: "Your subscription renews on {date}, and {price} will be charged to your card then and every billing period until you cancel.",
|
|
164
|
+
descriptionNoDate: "Your subscription will renew, and your card will be charged each billing period until you cancel.",
|
|
165
|
+
keepCanceled: "Keep canceled",
|
|
166
|
+
confirm: "Resume subscription"
|
|
167
|
+
},
|
|
168
|
+
changeCard: {
|
|
169
|
+
title: "Pay {name} with",
|
|
170
|
+
description: "Future renewals charge the selected card.",
|
|
171
|
+
none: "Add another card under Payment methods to switch.",
|
|
172
|
+
confirm: "Use this card",
|
|
173
|
+
current: "Current",
|
|
174
|
+
useDefault: "Your default card ({card})",
|
|
175
|
+
done: "Payment card updated."
|
|
176
|
+
},
|
|
177
|
+
cancel: {
|
|
178
|
+
title: "Cancel {name}?",
|
|
179
|
+
description: "Future payments stop. You keep access already purchased.",
|
|
180
|
+
revokeOnChain: "Also cancel on chain (requires a wallet signature and network fee).",
|
|
181
|
+
solanaDescription: "Your wallet signs an on-chain cancellation. You keep access already purchased.",
|
|
182
|
+
reasonLabel: "Why are you cancelling?",
|
|
183
|
+
reasonPlaceholder: "Your feedback helps us improve.",
|
|
184
|
+
reasonHint: "{count}/{max}",
|
|
185
|
+
reasonTooShort: "Enter at least {min} characters.",
|
|
186
|
+
keep: "Keep subscription",
|
|
187
|
+
confirm: "Cancel subscription",
|
|
188
|
+
confirmWallet: "Sign with wallet",
|
|
189
|
+
working: "Cancelling...",
|
|
190
|
+
preparing: "Preparing transaction...",
|
|
191
|
+
signing: "Confirm in your wallet...",
|
|
192
|
+
confirming: "Recording cancellation...",
|
|
193
|
+
done: "Cancellation requested."
|
|
194
|
+
},
|
|
195
|
+
paymentMethods: {
|
|
196
|
+
title: "Payment methods",
|
|
197
|
+
description: "Cards saved for your subscriptions.",
|
|
198
|
+
empty: "No saved cards",
|
|
199
|
+
emptyDescription: "Cards you save appear here.",
|
|
200
|
+
add: "Add card",
|
|
201
|
+
addTitle: "Add a card",
|
|
202
|
+
addDescription: "Card details go straight to the payment processor; this site never sees them.",
|
|
203
|
+
save: "Save card",
|
|
204
|
+
added: "Card saved.",
|
|
205
|
+
provider: "Payment provider",
|
|
206
|
+
saveNotice: "Cards you enter are saved to your account for future payments.",
|
|
207
|
+
unavailable: "Secure card entry is unavailable for this provider.",
|
|
208
|
+
addUnavailable: "Adding a card is temporarily unavailable.",
|
|
209
|
+
verificationPending: "Card verification is pending. Check your saved cards before trying again.",
|
|
210
|
+
cardLabel: "{brand} •••• {last4}",
|
|
211
|
+
fallbackBrand: "Card",
|
|
212
|
+
expires: "Expires {date}",
|
|
213
|
+
usedBy: "Used by {names}",
|
|
214
|
+
defaultFor: "Default for {currencies}",
|
|
215
|
+
makeDefault: "Make default",
|
|
216
|
+
defaultUpdated: "Default card updated.",
|
|
217
|
+
remove: "Remove",
|
|
218
|
+
removeLabel: "Remove {label}",
|
|
219
|
+
removeTitle: "Remove {label}?",
|
|
220
|
+
removeDescription: "A card used by an active subscription must be replaced before it can be removed.",
|
|
221
|
+
removeConfirm: "Remove card",
|
|
222
|
+
removed: "Card removed.",
|
|
223
|
+
removePending: "Removal is processing.",
|
|
224
|
+
inUse: "This card pays for an active subscription. Switch that subscription to another card first."
|
|
225
|
+
},
|
|
226
|
+
purchase: { renews: "Renews {period}" },
|
|
227
|
+
history: {
|
|
228
|
+
title: "Payment history",
|
|
229
|
+
description: "Charges and refunds on your account.",
|
|
230
|
+
empty: "No payments yet",
|
|
231
|
+
emptyDescription: "Completed payments will appear here.",
|
|
232
|
+
date: "Date",
|
|
233
|
+
item: "Item",
|
|
234
|
+
subscription: "Subscription",
|
|
235
|
+
purchase: "Purchase",
|
|
236
|
+
method: "Method",
|
|
237
|
+
status: "Status",
|
|
238
|
+
amount: "Amount",
|
|
239
|
+
refund: "Refund",
|
|
240
|
+
refundedAmount: "{amount} refunded",
|
|
241
|
+
page: "Page {page}",
|
|
242
|
+
rail: {
|
|
243
|
+
card: "Card",
|
|
244
|
+
solana: "Solana",
|
|
245
|
+
ccbill: "Card",
|
|
246
|
+
nmi: "Card",
|
|
247
|
+
stripe: "Card"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
errors: {
|
|
251
|
+
generic: "Something went wrong. Please try again.",
|
|
252
|
+
network_error: "Couldn't reach the server. Check your connection and try again.",
|
|
253
|
+
server_unavailable: "The server isn't responding right now. Please try again in a moment.",
|
|
254
|
+
invalid_response: "The server sent an unexpected response.",
|
|
255
|
+
authentication_required: "Your session expired. Sign in again.",
|
|
256
|
+
resource_access_denied: "You don't have access to this.",
|
|
257
|
+
resource_not_found: "This item no longer exists.",
|
|
258
|
+
resource_conflict: "This changed in the meantime. Refresh and try again.",
|
|
259
|
+
rate_limit_exceeded: "Too many requests. Wait a moment and try again.",
|
|
260
|
+
provider_writes_disabled: "Payments are switched off on this site right now.",
|
|
261
|
+
service_unavailable: "Billing is temporarily unavailable. Try again soon.",
|
|
262
|
+
internal_error: "Something went wrong on our side. Please try again.",
|
|
263
|
+
card_declined: "The card was declined.",
|
|
264
|
+
payment_provider_rejected: "The payment provider rejected the request.",
|
|
265
|
+
provider_outcome_unknown: "We couldn't confirm the result with the provider. Check again shortly.",
|
|
266
|
+
payment_in_progress: "A payment is already in progress.",
|
|
267
|
+
payment_method_delete_unsupported: "This card can't be removed here. Contact support.",
|
|
268
|
+
payment_method_delete_failed: "The provider couldn't remove this card. Try again later.",
|
|
269
|
+
customer_session_required: "Sign in again to do this.",
|
|
270
|
+
invoker_scoped_principal: "This account can't manage billing.",
|
|
271
|
+
csrf_origin_denied: "The request was blocked. Reload the page.",
|
|
272
|
+
wallet_rejected: "The wallet request was declined.",
|
|
273
|
+
wallet_no_signature: "The wallet did not sign the transaction."
|
|
274
|
+
}
|
|
275
|
+
}, x = class extends Error {
|
|
25
276
|
status;
|
|
26
277
|
type;
|
|
27
278
|
code;
|
|
@@ -40,14 +291,19 @@ var _ = class extends Error {
|
|
|
40
291
|
return this.status === 409 && this.code === "merchant_config_read_only";
|
|
41
292
|
}
|
|
42
293
|
};
|
|
43
|
-
async function
|
|
294
|
+
async function S(e) {
|
|
44
295
|
let t = null;
|
|
45
296
|
try {
|
|
46
297
|
t = await e.json();
|
|
47
298
|
} catch {}
|
|
48
|
-
|
|
299
|
+
let n = t?.error?.code ? void 0 : y({ status: e.status });
|
|
300
|
+
return new x(e.status, t, n ? b.errors[n] : `request failed (${e.status})`);
|
|
301
|
+
}
|
|
302
|
+
function C(e) {
|
|
303
|
+
let t = y(e);
|
|
304
|
+
return t && new x(0, null, b.errors[t]);
|
|
49
305
|
}
|
|
50
|
-
function
|
|
306
|
+
function w(e, t, n) {
|
|
51
307
|
let r = e + t;
|
|
52
308
|
if (n) {
|
|
53
309
|
let e = new URLSearchParams();
|
|
@@ -57,7 +313,7 @@ function y(e, t, n) {
|
|
|
57
313
|
}
|
|
58
314
|
return r;
|
|
59
315
|
}
|
|
60
|
-
async function
|
|
316
|
+
async function T(e, t) {
|
|
61
317
|
let n = [], r;
|
|
62
318
|
for (;;) {
|
|
63
319
|
t?.throwIfAborted();
|
|
@@ -67,7 +323,7 @@ async function b(e, t) {
|
|
|
67
323
|
r = i.next_cursor;
|
|
68
324
|
}
|
|
69
325
|
}
|
|
70
|
-
function
|
|
326
|
+
function E(e) {
|
|
71
327
|
let t = e.baseUrl.replace(/\/$/, ""), n = () => e.isCurrent && !e.isCurrent() ? void 0 : e.merchant?.slug;
|
|
72
328
|
async function r(n, r) {
|
|
73
329
|
let i = { ...r.headers };
|
|
@@ -77,7 +333,7 @@ function x(e) {
|
|
|
77
333
|
headers: i,
|
|
78
334
|
signal: r.signal,
|
|
79
335
|
body: r.rawBody ?? (r.body === void 0 ? void 0 : JSON.stringify(r.body))
|
|
80
|
-
}, o =
|
|
336
|
+
}, o = w(t, n, r.query), s;
|
|
81
337
|
if (e.exchange) {
|
|
82
338
|
if (!e.merchant?.id || !e.auth.resourceFetch) throw Error("Merchant token exchange needs a merchant id and resourceFetch transport");
|
|
83
339
|
try {
|
|
@@ -87,13 +343,17 @@ function x(e) {
|
|
|
87
343
|
group: e.merchant.id
|
|
88
344
|
});
|
|
89
345
|
} catch (e) {
|
|
90
|
-
throw e && typeof e == "object" && "error" in e && e.error === "invalid_target" ? new
|
|
346
|
+
throw e && typeof e == "object" && "error" in e && e.error === "invalid_target" ? new x(403, { error: {
|
|
91
347
|
code: "merchant_unresolved",
|
|
92
348
|
message: "You hold no role at this merchant."
|
|
93
|
-
} }, "Merchant refused") : e;
|
|
349
|
+
} }, "Merchant refused") : !r.signal?.aborted && C(e) || e;
|
|
94
350
|
}
|
|
95
|
-
} else
|
|
96
|
-
|
|
351
|
+
} else try {
|
|
352
|
+
s = await e.auth.authFetch(o, a);
|
|
353
|
+
} catch (e) {
|
|
354
|
+
throw !r.signal?.aborted && C(e) || e;
|
|
355
|
+
}
|
|
356
|
+
if (!s.ok) throw await S(s);
|
|
97
357
|
return {
|
|
98
358
|
status: s.status,
|
|
99
359
|
body: s.status === 204 ? void 0 : await s.json()
|
|
@@ -119,7 +379,7 @@ function x(e) {
|
|
|
119
379
|
}
|
|
120
380
|
//#endregion
|
|
121
381
|
//#region src/admin/lib/api/endpoints.ts
|
|
122
|
-
var
|
|
382
|
+
var D = [
|
|
123
383
|
"kind",
|
|
124
384
|
"owner",
|
|
125
385
|
"category",
|
|
@@ -138,7 +398,7 @@ var S = [
|
|
|
138
398
|
"cycle_id",
|
|
139
399
|
"since",
|
|
140
400
|
"until"
|
|
141
|
-
],
|
|
401
|
+
], O = [
|
|
142
402
|
"owner",
|
|
143
403
|
"first_outcome",
|
|
144
404
|
"miss_reason",
|
|
@@ -148,7 +408,7 @@ var S = [
|
|
|
148
408
|
"due_since",
|
|
149
409
|
"due_until"
|
|
150
410
|
];
|
|
151
|
-
function
|
|
411
|
+
function k(e, t) {
|
|
152
412
|
let n = {};
|
|
153
413
|
for (let r of t) {
|
|
154
414
|
let t = e.get(r)?.trim();
|
|
@@ -156,8 +416,8 @@ function w(e, t) {
|
|
|
156
416
|
}
|
|
157
417
|
return n;
|
|
158
418
|
}
|
|
159
|
-
var
|
|
160
|
-
function
|
|
419
|
+
var A = ["nmi", "stripe"];
|
|
420
|
+
function j(e) {
|
|
161
421
|
let { api: t } = e, n = (e, n, r, i) => t("/admin/customers", {
|
|
162
422
|
query: {
|
|
163
423
|
search: e,
|
|
@@ -336,20 +596,20 @@ function E(e) {
|
|
|
336
596
|
outcome: n,
|
|
337
597
|
notes: r
|
|
338
598
|
}
|
|
339
|
-
}),
|
|
599
|
+
}), ee = (e) => t("/merchant/configuration", { signal: e }), te = (e) => t("/merchant/configuration", {
|
|
340
600
|
method: "PATCH",
|
|
341
601
|
body: e
|
|
342
|
-
}),
|
|
602
|
+
}), K = (e) => t("/merchant/psps?limit=500", { signal: e }), q = async (e) => (await Z(e)).rails, J = (e) => t("/merchant/psps", {
|
|
343
603
|
method: "POST",
|
|
344
604
|
body: e
|
|
345
|
-
}),
|
|
605
|
+
}), Y = (e, n) => t(`/merchant/psps/${encodeURIComponent(e)}`, {
|
|
346
606
|
method: "PATCH",
|
|
347
607
|
body: n
|
|
348
|
-
}),
|
|
608
|
+
}), X = (e, n) => t("/merchant/psps/routing-preview", {
|
|
349
609
|
method: "POST",
|
|
350
610
|
body: e,
|
|
351
611
|
signal: n
|
|
352
|
-
}),
|
|
612
|
+
}), Z = (e) => t("/config", { signal: e });
|
|
353
613
|
return {
|
|
354
614
|
listCustomers: n,
|
|
355
615
|
getCustomer: r,
|
|
@@ -395,14 +655,14 @@ function E(e) {
|
|
|
395
655
|
listFindings: U,
|
|
396
656
|
getFinding: W,
|
|
397
657
|
resolveFinding: G,
|
|
398
|
-
getMerchantConfiguration:
|
|
399
|
-
updateMerchantConfiguration:
|
|
400
|
-
listPSPs:
|
|
401
|
-
listRails:
|
|
402
|
-
createPSP:
|
|
403
|
-
updatePSP:
|
|
404
|
-
previewPSPRouting:
|
|
405
|
-
getConfig:
|
|
658
|
+
getMerchantConfiguration: ee,
|
|
659
|
+
updateMerchantConfiguration: te,
|
|
660
|
+
listPSPs: K,
|
|
661
|
+
listRails: q,
|
|
662
|
+
createPSP: J,
|
|
663
|
+
updatePSP: Y,
|
|
664
|
+
previewPSPRouting: X,
|
|
665
|
+
getConfig: Z,
|
|
406
666
|
getAdminAccess: (e) => t("/admin/access", { signal: e }),
|
|
407
667
|
updateCustomer: (e, n) => t(`/admin/customers/${e}`, {
|
|
408
668
|
method: "PATCH",
|
|
@@ -422,7 +682,7 @@ function E(e) {
|
|
|
422
682
|
}
|
|
423
683
|
//#endregion
|
|
424
684
|
//#region src/admin/lib/api/metrics.ts
|
|
425
|
-
var
|
|
685
|
+
var M = [
|
|
426
686
|
"stat",
|
|
427
687
|
"line",
|
|
428
688
|
"area",
|
|
@@ -430,7 +690,7 @@ var D = [
|
|
|
430
690
|
"donut",
|
|
431
691
|
"table"
|
|
432
692
|
];
|
|
433
|
-
function
|
|
693
|
+
function N(e) {
|
|
434
694
|
let { api: t } = e;
|
|
435
695
|
return {
|
|
436
696
|
metricsQuery: (e, n) => t("/metrics/query", {
|
|
@@ -447,7 +707,7 @@ function O(e) {
|
|
|
447
707
|
}
|
|
448
708
|
//#endregion
|
|
449
709
|
//#region src/admin/lib/api/copilot.ts
|
|
450
|
-
function
|
|
710
|
+
function P(e) {
|
|
451
711
|
let { api: t } = e;
|
|
452
712
|
return { askCatalog: (e) => t("/console/catalog/ask", {
|
|
453
713
|
method: "POST",
|
|
@@ -456,8 +716,8 @@ function k(e) {
|
|
|
456
716
|
}
|
|
457
717
|
//#endregion
|
|
458
718
|
//#region src/admin/lib/api/credit-endpoints.ts
|
|
459
|
-
var
|
|
460
|
-
function
|
|
719
|
+
var F = (e) => `/admin/customers/${encodeURIComponent(e)}`;
|
|
720
|
+
function I(e) {
|
|
461
721
|
let { api: t } = e;
|
|
462
722
|
return {
|
|
463
723
|
listCreditGrants: (e, n, r, i, a) => t("/admin/credit-grants", {
|
|
@@ -480,7 +740,7 @@ function j(e) {
|
|
|
480
740
|
method: "POST",
|
|
481
741
|
body: { reason: n }
|
|
482
742
|
}),
|
|
483
|
-
listBalanceTransactions: (e, n, r, i, a) => t(`${
|
|
743
|
+
listBalanceTransactions: (e, n, r, i, a) => t(`${F(e)}/balance/transactions`, {
|
|
484
744
|
query: {
|
|
485
745
|
currency: n,
|
|
486
746
|
limit: r,
|
|
@@ -492,7 +752,7 @@ function j(e) {
|
|
|
492
752
|
}
|
|
493
753
|
//#endregion
|
|
494
754
|
//#region src/admin/lib/api/order-endpoints.ts
|
|
495
|
-
function
|
|
755
|
+
function L(e) {
|
|
496
756
|
let { api: t } = e, n = (e, n, r) => t("/admin/orders", {
|
|
497
757
|
query: {
|
|
498
758
|
...e,
|
|
@@ -533,7 +793,7 @@ function M(e) {
|
|
|
533
793
|
}
|
|
534
794
|
//#endregion
|
|
535
795
|
//#region src/admin/lib/api/invoice-profile-endpoints.ts
|
|
536
|
-
function
|
|
796
|
+
function R(e) {
|
|
537
797
|
let { getCustomer: t } = e, { updateCustomer: n } = e;
|
|
538
798
|
return {
|
|
539
799
|
getInvoiceProfile: async (e, n) => (await t(e, n)).settings.invoice_profile ?? null,
|
|
@@ -545,20 +805,20 @@ function N(e) {
|
|
|
545
805
|
}
|
|
546
806
|
//#endregion
|
|
547
807
|
//#region src/admin/lib/api/index.ts
|
|
548
|
-
function
|
|
549
|
-
let t =
|
|
808
|
+
function z(e) {
|
|
809
|
+
let t = j(e);
|
|
550
810
|
return {
|
|
551
811
|
...t,
|
|
552
|
-
...
|
|
553
|
-
...
|
|
554
|
-
...
|
|
555
|
-
...
|
|
556
|
-
...
|
|
812
|
+
...N(e),
|
|
813
|
+
...P(e),
|
|
814
|
+
...I(e),
|
|
815
|
+
...L(e),
|
|
816
|
+
...R(t)
|
|
557
817
|
};
|
|
558
818
|
}
|
|
559
819
|
//#endregion
|
|
560
820
|
//#region src/admin/lib/toast.ts
|
|
561
|
-
function
|
|
821
|
+
function B(e) {
|
|
562
822
|
let t = (t) => (n, r) => t(n, {
|
|
563
823
|
...r,
|
|
564
824
|
toasterId: e
|
|
@@ -570,9 +830,9 @@ function F(e) {
|
|
|
570
830
|
warning: t(u.warning)
|
|
571
831
|
});
|
|
572
832
|
}
|
|
573
|
-
function
|
|
833
|
+
function V(e) {
|
|
574
834
|
function t(t, n) {
|
|
575
|
-
if (t instanceof
|
|
835
|
+
if (t instanceof x) {
|
|
576
836
|
if (t.code === "revision_mismatch") {
|
|
577
837
|
e.error(`${n}: changed since you opened it`, { description: "The latest version is loaded; review it and try again." });
|
|
578
838
|
return;
|
|
@@ -597,17 +857,17 @@ function I(e) {
|
|
|
597
857
|
}
|
|
598
858
|
//#endregion
|
|
599
859
|
//#region src/admin/lib/queries.ts
|
|
600
|
-
function
|
|
860
|
+
function H(e) {
|
|
601
861
|
let t = e.rows[0] ?? [];
|
|
602
862
|
return Object.fromEntries(e.columns.map((e, n) => [e.name, t[n] ?? null]));
|
|
603
863
|
}
|
|
604
|
-
async function
|
|
864
|
+
async function U(e, t) {
|
|
605
865
|
return {
|
|
606
|
-
data: await
|
|
866
|
+
data: await T((n) => e(n, t), t),
|
|
607
867
|
next_cursor: null
|
|
608
868
|
};
|
|
609
869
|
}
|
|
610
|
-
var
|
|
870
|
+
var W = (e) => ({
|
|
611
871
|
merchant: () => e(),
|
|
612
872
|
customers: () => [...e(), "customers"],
|
|
613
873
|
customer: (t) => [
|
|
@@ -651,18 +911,18 @@ var z = (e) => ({
|
|
|
651
911
|
ops: () => [...e(), "ops"],
|
|
652
912
|
dashboard: () => [...e(), "dashboard"],
|
|
653
913
|
notifications: () => [...e(), "notifications"]
|
|
654
|
-
}),
|
|
655
|
-
function
|
|
656
|
-
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, listPaymentAttempts:
|
|
914
|
+
}), G = (e) => e ? { errorAction: e } : void 0;
|
|
915
|
+
function ee(e, t) {
|
|
916
|
+
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, listPaymentAttempts: b, listPSPs: x, listRails: S, previewPSPRouting: C, listPayments: w, listPrices: E, listProducts: D, listRenewals: O, listPriceMigrations: k, listSubscriptions: A, listUsageMeters: j, getAdminAccess: M, getConfig: N, listWebhooks: P, getDashboard: F, metricsQuery: I } = t, L = n, R = W(L);
|
|
657
917
|
return {
|
|
658
|
-
queryKeys:
|
|
918
|
+
queryKeys: R,
|
|
659
919
|
merchantQueryKeys: () => {
|
|
660
|
-
let e =
|
|
661
|
-
return
|
|
920
|
+
let e = L();
|
|
921
|
+
return W(() => e);
|
|
662
922
|
},
|
|
663
923
|
adminQueries: {
|
|
664
924
|
customers: (e, t, n) => l({
|
|
665
|
-
queryKey: [...
|
|
925
|
+
queryKey: [...R.customers(), {
|
|
666
926
|
search: e,
|
|
667
927
|
limit: t,
|
|
668
928
|
cursor: n
|
|
@@ -672,14 +932,14 @@ function V(e, t) {
|
|
|
672
932
|
meta: { errorAction: "Load customers" }
|
|
673
933
|
}),
|
|
674
934
|
customer: (e) => l({
|
|
675
|
-
queryKey:
|
|
935
|
+
queryKey: R.customer(e),
|
|
676
936
|
queryFn: ({ signal: t }) => r(e, t),
|
|
677
937
|
enabled: !!e,
|
|
678
938
|
meta: { errorAction: "Load customer" }
|
|
679
939
|
}),
|
|
680
940
|
customerSubscriptions: (e, t, n) => l({
|
|
681
941
|
queryKey: [
|
|
682
|
-
...
|
|
942
|
+
...R.customer(e),
|
|
683
943
|
"subscriptions",
|
|
684
944
|
{
|
|
685
945
|
limit: t,
|
|
@@ -693,14 +953,14 @@ function V(e, t) {
|
|
|
693
953
|
}),
|
|
694
954
|
customerPayments: (e, t, n) => l({
|
|
695
955
|
queryKey: [
|
|
696
|
-
...
|
|
956
|
+
...R.customer(e),
|
|
697
957
|
"payments",
|
|
698
958
|
{
|
|
699
959
|
limit: t,
|
|
700
960
|
cursor: n
|
|
701
961
|
}
|
|
702
962
|
],
|
|
703
|
-
queryFn: ({ signal: r }) =>
|
|
963
|
+
queryFn: ({ signal: r }) => w({ customer_id: e }, {
|
|
704
964
|
limit: t,
|
|
705
965
|
cursor: n || void 0
|
|
706
966
|
}, r),
|
|
@@ -710,7 +970,7 @@ function V(e, t) {
|
|
|
710
970
|
}),
|
|
711
971
|
customerPaymentMethodsPage: (e, t, n) => l({
|
|
712
972
|
queryKey: [
|
|
713
|
-
...
|
|
973
|
+
...R.customer(e),
|
|
714
974
|
"payment-methods",
|
|
715
975
|
{
|
|
716
976
|
limit: t,
|
|
@@ -727,7 +987,7 @@ function V(e, t) {
|
|
|
727
987
|
}),
|
|
728
988
|
customerEntitlements: (e, t, n) => l({
|
|
729
989
|
queryKey: [
|
|
730
|
-
...
|
|
990
|
+
...R.customer(e),
|
|
731
991
|
"entitlements",
|
|
732
992
|
{
|
|
733
993
|
limit: t,
|
|
@@ -744,7 +1004,7 @@ function V(e, t) {
|
|
|
744
1004
|
}),
|
|
745
1005
|
customerProductAccess: (e, t, n) => l({
|
|
746
1006
|
queryKey: [
|
|
747
|
-
...
|
|
1007
|
+
...R.customer(e),
|
|
748
1008
|
"product-access",
|
|
749
1009
|
{
|
|
750
1010
|
limit: t,
|
|
@@ -760,7 +1020,7 @@ function V(e, t) {
|
|
|
760
1020
|
meta: { errorAction: "Load product access" }
|
|
761
1021
|
}),
|
|
762
1022
|
subscriptions: (e, t, n) => l({
|
|
763
|
-
queryKey: [...
|
|
1023
|
+
queryKey: [...R.subscriptions(), {
|
|
764
1024
|
filters: e,
|
|
765
1025
|
limit: t,
|
|
766
1026
|
cursor: n
|
|
@@ -770,26 +1030,26 @@ function V(e, t) {
|
|
|
770
1030
|
meta: { errorAction: "Load subscriptions" }
|
|
771
1031
|
}),
|
|
772
1032
|
subscription: (e) => l({
|
|
773
|
-
queryKey:
|
|
1033
|
+
queryKey: R.subscription(e),
|
|
774
1034
|
queryFn: ({ signal: t }) => p(e, t),
|
|
775
1035
|
enabled: !!e,
|
|
776
1036
|
meta: { errorAction: "Load subscription" }
|
|
777
1037
|
}),
|
|
778
1038
|
customerPaymentMethods: (e) => l({
|
|
779
|
-
queryKey: [...
|
|
780
|
-
queryFn: ({ signal: t }) =>
|
|
1039
|
+
queryKey: [...R.customer(e ?? "unselected"), "payment-methods"],
|
|
1040
|
+
queryFn: ({ signal: t }) => T((n) => g(e, {
|
|
781
1041
|
limit: 100,
|
|
782
1042
|
cursor: n
|
|
783
1043
|
}, t), t),
|
|
784
1044
|
enabled: !!e
|
|
785
1045
|
}),
|
|
786
1046
|
payments: (e, t, n) => l({
|
|
787
|
-
queryKey: [...
|
|
1047
|
+
queryKey: [...R.payments(), {
|
|
788
1048
|
filters: e,
|
|
789
1049
|
limit: t,
|
|
790
1050
|
cursor: n
|
|
791
1051
|
}],
|
|
792
|
-
queryFn: ({ signal: r }) =>
|
|
1052
|
+
queryFn: ({ signal: r }) => w(e, {
|
|
793
1053
|
limit: t,
|
|
794
1054
|
cursor: n
|
|
795
1055
|
}, r),
|
|
@@ -797,18 +1057,18 @@ function V(e, t) {
|
|
|
797
1057
|
meta: { errorAction: "Load payments" }
|
|
798
1058
|
}),
|
|
799
1059
|
payment: (e) => l({
|
|
800
|
-
queryKey:
|
|
1060
|
+
queryKey: R.payment(e),
|
|
801
1061
|
queryFn: ({ signal: t }) => a(e, t),
|
|
802
1062
|
enabled: !!e,
|
|
803
1063
|
meta: { errorAction: "Load payment" }
|
|
804
1064
|
}),
|
|
805
1065
|
attempts: (e, t, n) => l({
|
|
806
|
-
queryKey: [...
|
|
1066
|
+
queryKey: [...R.attempts(), {
|
|
807
1067
|
filters: e,
|
|
808
1068
|
limit: t,
|
|
809
1069
|
cursor: n
|
|
810
1070
|
}],
|
|
811
|
-
queryFn: ({ signal: r }) =>
|
|
1071
|
+
queryFn: ({ signal: r }) => b(e, {
|
|
812
1072
|
limit: t,
|
|
813
1073
|
cursor: n
|
|
814
1074
|
}, r),
|
|
@@ -816,13 +1076,13 @@ function V(e, t) {
|
|
|
816
1076
|
meta: { errorAction: "Load payment attempts" }
|
|
817
1077
|
}),
|
|
818
1078
|
attempt: (e) => l({
|
|
819
|
-
queryKey: [...
|
|
1079
|
+
queryKey: [...R.attempts(), e],
|
|
820
1080
|
queryFn: ({ signal: t }) => o(e, t),
|
|
821
1081
|
enabled: !!e,
|
|
822
1082
|
meta: { errorAction: "Load payment attempt" }
|
|
823
1083
|
}),
|
|
824
1084
|
cycles: (e, t, n) => l({
|
|
825
|
-
queryKey: [...
|
|
1085
|
+
queryKey: [...R.cycles(), {
|
|
826
1086
|
filters: e,
|
|
827
1087
|
limit: t,
|
|
828
1088
|
cursor: n
|
|
@@ -835,7 +1095,7 @@ function V(e, t) {
|
|
|
835
1095
|
meta: { errorAction: "Load renewals" }
|
|
836
1096
|
}),
|
|
837
1097
|
cycle: (e) => l({
|
|
838
|
-
queryKey: [...
|
|
1098
|
+
queryKey: [...R.cycles(), e],
|
|
839
1099
|
queryFn: ({ signal: t }) => f(e, t),
|
|
840
1100
|
enabled: !!e,
|
|
841
1101
|
meta: { errorAction: "Load renewal" }
|
|
@@ -844,7 +1104,7 @@ function V(e, t) {
|
|
|
844
1104
|
let { limit: t = 100, cursor: n, errorAction: r } = e;
|
|
845
1105
|
return l({
|
|
846
1106
|
queryKey: [
|
|
847
|
-
...
|
|
1107
|
+
...R.catalog(),
|
|
848
1108
|
"products",
|
|
849
1109
|
{
|
|
850
1110
|
limit: t,
|
|
@@ -853,23 +1113,23 @@ function V(e, t) {
|
|
|
853
1113
|
],
|
|
854
1114
|
queryFn: ({ signal: e }) => D(t, n, void 0, e),
|
|
855
1115
|
placeholderData: s,
|
|
856
|
-
meta:
|
|
1116
|
+
meta: G(r)
|
|
857
1117
|
});
|
|
858
1118
|
},
|
|
859
1119
|
allProducts: (e = {}) => l({
|
|
860
1120
|
queryKey: [
|
|
861
|
-
...
|
|
1121
|
+
...R.catalog(),
|
|
862
1122
|
"products",
|
|
863
1123
|
"all"
|
|
864
1124
|
],
|
|
865
|
-
queryFn: ({ signal: e }) =>
|
|
866
|
-
meta:
|
|
1125
|
+
queryFn: ({ signal: e }) => U((e, t) => D(500, e, void 0, t), e),
|
|
1126
|
+
meta: G(e.errorAction)
|
|
867
1127
|
}),
|
|
868
1128
|
prices: (e = {}) => {
|
|
869
1129
|
let { productId: t, limit: n = 100, cursor: r, errorAction: i } = e;
|
|
870
1130
|
return l({
|
|
871
1131
|
queryKey: [
|
|
872
|
-
...
|
|
1132
|
+
...R.catalog(),
|
|
873
1133
|
"prices",
|
|
874
1134
|
{
|
|
875
1135
|
productId: t,
|
|
@@ -879,24 +1139,24 @@ function V(e, t) {
|
|
|
879
1139
|
],
|
|
880
1140
|
queryFn: ({ signal: e }) => E(n, r, t, e),
|
|
881
1141
|
placeholderData: s,
|
|
882
|
-
meta:
|
|
1142
|
+
meta: G(i)
|
|
883
1143
|
});
|
|
884
1144
|
},
|
|
885
1145
|
allPrices: (e = {}) => l({
|
|
886
1146
|
queryKey: [
|
|
887
|
-
...
|
|
1147
|
+
...R.catalog(),
|
|
888
1148
|
"prices",
|
|
889
1149
|
"all",
|
|
890
1150
|
{ productId: e.productId }
|
|
891
1151
|
],
|
|
892
|
-
queryFn: ({ signal: t }) =>
|
|
893
|
-
meta:
|
|
1152
|
+
queryFn: ({ signal: t }) => U((t, n) => E(500, t, e.productId, n), t),
|
|
1153
|
+
meta: G(e.errorAction)
|
|
894
1154
|
}),
|
|
895
1155
|
price: (e, t = {}) => {
|
|
896
1156
|
let { verify: n = !1, errorAction: r } = t;
|
|
897
1157
|
return l({
|
|
898
1158
|
queryKey: [
|
|
899
|
-
...
|
|
1159
|
+
...R.catalog(),
|
|
900
1160
|
"prices",
|
|
901
1161
|
e,
|
|
902
1162
|
{ verify: n }
|
|
@@ -904,12 +1164,12 @@ function V(e, t) {
|
|
|
904
1164
|
queryFn: ({ signal: t }) => c(e, n, t),
|
|
905
1165
|
enabled: !!e,
|
|
906
1166
|
placeholderData: s,
|
|
907
|
-
meta:
|
|
1167
|
+
meta: G(r)
|
|
908
1168
|
});
|
|
909
1169
|
},
|
|
910
1170
|
product: (e) => l({
|
|
911
1171
|
queryKey: [
|
|
912
|
-
...
|
|
1172
|
+
...R.catalog(),
|
|
913
1173
|
"products",
|
|
914
1174
|
e ?? "unselected"
|
|
915
1175
|
],
|
|
@@ -918,7 +1178,7 @@ function V(e, t) {
|
|
|
918
1178
|
}),
|
|
919
1179
|
priceHistory: (e) => l({
|
|
920
1180
|
queryKey: [
|
|
921
|
-
...
|
|
1181
|
+
...R.catalog(),
|
|
922
1182
|
"prices",
|
|
923
1183
|
"history",
|
|
924
1184
|
e ?? "unselected"
|
|
@@ -928,7 +1188,7 @@ function V(e, t) {
|
|
|
928
1188
|
}),
|
|
929
1189
|
priceMigrations: (e, t, n = 5) => l({
|
|
930
1190
|
queryKey: [
|
|
931
|
-
...
|
|
1191
|
+
...R.catalog(),
|
|
932
1192
|
"price-migrations",
|
|
933
1193
|
{
|
|
934
1194
|
productKey: e,
|
|
@@ -940,7 +1200,7 @@ function V(e, t) {
|
|
|
940
1200
|
enabled: !!(e && t)
|
|
941
1201
|
}),
|
|
942
1202
|
catalogDrift: (e = !0, t = 200, n) => l({
|
|
943
|
-
queryKey: [...
|
|
1203
|
+
queryKey: [...R.catalogDrift(), {
|
|
944
1204
|
limit: t,
|
|
945
1205
|
cursor: n
|
|
946
1206
|
}],
|
|
@@ -950,17 +1210,17 @@ function V(e, t) {
|
|
|
950
1210
|
}),
|
|
951
1211
|
pspRouting: (e) => l({
|
|
952
1212
|
queryKey: [
|
|
953
|
-
...
|
|
1213
|
+
...R.catalog(),
|
|
954
1214
|
"prices",
|
|
955
1215
|
e,
|
|
956
1216
|
"routing"
|
|
957
1217
|
],
|
|
958
|
-
queryFn: ({ signal: t }) =>
|
|
1218
|
+
queryFn: ({ signal: t }) => C({ price_id: e }, t),
|
|
959
1219
|
enabled: !!e,
|
|
960
1220
|
meta: { errorAction: "Check purchase readiness" }
|
|
961
1221
|
}),
|
|
962
1222
|
usageMeters: (e = 200, t) => l({
|
|
963
|
-
queryKey: [...
|
|
1223
|
+
queryKey: [...R.usageMeters(), {
|
|
964
1224
|
limit: e,
|
|
965
1225
|
cursor: t
|
|
966
1226
|
}],
|
|
@@ -969,19 +1229,19 @@ function V(e, t) {
|
|
|
969
1229
|
meta: { errorAction: "Load usage meters" }
|
|
970
1230
|
}),
|
|
971
1231
|
allUsageMeters: () => l({
|
|
972
|
-
queryKey: [...
|
|
973
|
-
queryFn: ({ signal: e }) =>
|
|
1232
|
+
queryKey: [...R.usageMeters(), "all"],
|
|
1233
|
+
queryFn: ({ signal: e }) => U((e, t) => j(500, e, t), e),
|
|
974
1234
|
meta: { errorAction: "Load usage meters" }
|
|
975
1235
|
}),
|
|
976
1236
|
usageMeter: (e) => l({
|
|
977
|
-
queryKey:
|
|
1237
|
+
queryKey: R.usageMeter(e),
|
|
978
1238
|
queryFn: ({ signal: t }) => m(e, t),
|
|
979
1239
|
enabled: !!e,
|
|
980
1240
|
meta: { errorAction: "Load usage meter" }
|
|
981
1241
|
}),
|
|
982
1242
|
findings: (e = !0) => l({
|
|
983
1243
|
queryKey: [
|
|
984
|
-
...
|
|
1244
|
+
...R.ops(),
|
|
985
1245
|
"findings",
|
|
986
1246
|
{ limit: 100 }
|
|
987
1247
|
],
|
|
@@ -991,12 +1251,12 @@ function V(e, t) {
|
|
|
991
1251
|
}),
|
|
992
1252
|
findingSummary: () => l({
|
|
993
1253
|
queryKey: [
|
|
994
|
-
...
|
|
1254
|
+
...R.ops(),
|
|
995
1255
|
"findings",
|
|
996
1256
|
"summary"
|
|
997
1257
|
],
|
|
998
1258
|
queryFn: async ({ signal: e }) => {
|
|
999
|
-
let t =
|
|
1259
|
+
let t = H(await I({
|
|
1000
1260
|
measures: [
|
|
1001
1261
|
"open_findings",
|
|
1002
1262
|
"orphaned_members",
|
|
@@ -1015,18 +1275,18 @@ function V(e, t) {
|
|
|
1015
1275
|
meta: { errorAction: "Load the findings summary" }
|
|
1016
1276
|
}),
|
|
1017
1277
|
merchantConfiguration: (e) => l({
|
|
1018
|
-
queryKey:
|
|
1278
|
+
queryKey: R.settings(),
|
|
1019
1279
|
queryFn: ({ signal: e }) => i(e),
|
|
1020
|
-
meta:
|
|
1280
|
+
meta: G(e)
|
|
1021
1281
|
}),
|
|
1022
1282
|
psps: () => l({
|
|
1023
|
-
queryKey: [...
|
|
1024
|
-
queryFn: ({ signal: e }) =>
|
|
1283
|
+
queryKey: [...R.settings(), "psps"],
|
|
1284
|
+
queryFn: ({ signal: e }) => x(e),
|
|
1025
1285
|
meta: { errorAction: "Load PSPs" }
|
|
1026
1286
|
}),
|
|
1027
1287
|
rails: () => l({
|
|
1028
|
-
queryKey: [...
|
|
1029
|
-
queryFn: ({ signal: e }) =>
|
|
1288
|
+
queryKey: [...R.settings(), "rails"],
|
|
1289
|
+
queryFn: ({ signal: e }) => S(e),
|
|
1030
1290
|
staleTime: Infinity,
|
|
1031
1291
|
meta: { errorAction: "Load rails" }
|
|
1032
1292
|
}),
|
|
@@ -1037,24 +1297,24 @@ function V(e, t) {
|
|
|
1037
1297
|
meta: { errorAction: "Load configuration" }
|
|
1038
1298
|
}),
|
|
1039
1299
|
access: () => l({
|
|
1040
|
-
queryKey: [...
|
|
1300
|
+
queryKey: [...R.merchant(), "access"],
|
|
1041
1301
|
queryFn: ({ signal: e }) => M(e),
|
|
1042
1302
|
staleTime: 3e5,
|
|
1043
1303
|
meta: { errorAction: "Load your access" }
|
|
1044
1304
|
}),
|
|
1045
1305
|
webhooks: () => l({
|
|
1046
|
-
queryKey: [...
|
|
1306
|
+
queryKey: [...R.alerts(), "webhooks"],
|
|
1047
1307
|
queryFn: ({ signal: e }) => P(e),
|
|
1048
1308
|
meta: { errorAction: "Load webhooks" }
|
|
1049
1309
|
}),
|
|
1050
1310
|
dashboard: () => l({
|
|
1051
|
-
queryKey:
|
|
1311
|
+
queryKey: R.dashboard(),
|
|
1052
1312
|
queryFn: ({ signal: e }) => F(e),
|
|
1053
1313
|
meta: { errorAction: "Load dashboard" }
|
|
1054
1314
|
}),
|
|
1055
1315
|
widgetMetrics: (e) => l({
|
|
1056
1316
|
queryKey: [
|
|
1057
|
-
...
|
|
1317
|
+
...R.dashboard(),
|
|
1058
1318
|
"metrics",
|
|
1059
1319
|
e ?? "unselected"
|
|
1060
1320
|
],
|
|
@@ -1062,13 +1322,13 @@ function V(e, t) {
|
|
|
1062
1322
|
enabled: !!e
|
|
1063
1323
|
}),
|
|
1064
1324
|
notifications: (e) => l({
|
|
1065
|
-
queryKey:
|
|
1325
|
+
queryKey: R.notifications(),
|
|
1066
1326
|
queryFn: ({ signal: e }) => y({ status: "requires_review" }, 10, e),
|
|
1067
1327
|
enabled: e
|
|
1068
1328
|
}),
|
|
1069
1329
|
unreadNotifications: () => l({
|
|
1070
|
-
queryKey: [...
|
|
1071
|
-
queryFn: async ({ signal: e }) => Number(
|
|
1330
|
+
queryKey: [...R.notifications(), "count"],
|
|
1331
|
+
queryFn: async ({ signal: e }) => Number(H(await I({
|
|
1072
1332
|
measures: ["open_findings"],
|
|
1073
1333
|
range: { last: "1d" },
|
|
1074
1334
|
filters: { finding_status: ["requires_review"] }
|
|
@@ -1081,26 +1341,26 @@ function V(e, t) {
|
|
|
1081
1341
|
}
|
|
1082
1342
|
//#endregion
|
|
1083
1343
|
//#region src/admin/lib/mutations.ts
|
|
1084
|
-
var
|
|
1344
|
+
var te = 200, K = async (e) => {
|
|
1085
1345
|
let t = [], n;
|
|
1086
1346
|
for (;;) {
|
|
1087
|
-
let r = await e(
|
|
1347
|
+
let r = await e(te, n);
|
|
1088
1348
|
if (t.push(...r.data), !r.next_cursor || r.data.length === 0) return t;
|
|
1089
1349
|
n = r.next_cursor;
|
|
1090
1350
|
}
|
|
1091
|
-
},
|
|
1351
|
+
}, q = (e, t) => e.invalidateQueries({
|
|
1092
1352
|
queryKey: t,
|
|
1093
1353
|
exact: !0
|
|
1094
|
-
}),
|
|
1095
|
-
n instanceof
|
|
1354
|
+
}), J = (e, t) => () => q(e, t), Y = (e, t) => () => e.invalidateQueries({ queryKey: t }), X = (e, ...t) => (n) => {
|
|
1355
|
+
n instanceof x && n.code === "revision_mismatch" && Promise.all(t.map((t) => e.invalidateQueries({ queryKey: t })));
|
|
1096
1356
|
};
|
|
1097
|
-
function
|
|
1098
|
-
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:
|
|
1099
|
-
t instanceof
|
|
1100
|
-
},
|
|
1357
|
+
function Z(e, t, n) {
|
|
1358
|
+
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, refreshPSPs: k, refundPayment: A, createPriceMigration: j, resolveFinding: 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) => {
|
|
1359
|
+
t instanceof x && t.merchantConfigReadOnly && e.invalidateQueries({ queryKey: V.config().queryKey });
|
|
1360
|
+
}, W = (e, t) => () => Promise.all([q(e, [...t.alerts(), "webhooks"]), q(e, t.settings())]);
|
|
1101
1361
|
return { adminMutations: {
|
|
1102
1362
|
saveDashboard: (e) => {
|
|
1103
|
-
let t =
|
|
1363
|
+
let t = H().dashboard();
|
|
1104
1364
|
return c({
|
|
1105
1365
|
mutationKey: [...t, "save"],
|
|
1106
1366
|
mutationFn: (e) => B(e),
|
|
@@ -1108,38 +1368,38 @@ function J(e, t, n) {
|
|
|
1108
1368
|
});
|
|
1109
1369
|
},
|
|
1110
1370
|
findCustomer: () => {
|
|
1111
|
-
let e =
|
|
1371
|
+
let e = H().customers();
|
|
1112
1372
|
return c({
|
|
1113
1373
|
mutationKey: [...e, "find"],
|
|
1114
|
-
mutationFn: async (e) => (await
|
|
1374
|
+
mutationFn: async (e) => (await v(e, 1, "")).data[0]
|
|
1115
1375
|
});
|
|
1116
1376
|
},
|
|
1117
1377
|
exportCustomers: () => {
|
|
1118
|
-
let e =
|
|
1378
|
+
let e = H().customers();
|
|
1119
1379
|
return c({
|
|
1120
1380
|
mutationKey: [...e, "export"],
|
|
1121
|
-
mutationFn: (e) =>
|
|
1381
|
+
mutationFn: (e) => K((t, n) => v(e, t, n ?? ""))
|
|
1122
1382
|
});
|
|
1123
1383
|
},
|
|
1124
1384
|
exportSubscriptions: () => {
|
|
1125
|
-
let e =
|
|
1385
|
+
let e = H().subscriptions();
|
|
1126
1386
|
return c({
|
|
1127
1387
|
mutationKey: [...e, "export"],
|
|
1128
|
-
mutationFn: (e) =>
|
|
1388
|
+
mutationFn: (e) => K((t, n) => b(e, t, n))
|
|
1129
1389
|
});
|
|
1130
1390
|
},
|
|
1131
1391
|
exportPayments: () => {
|
|
1132
|
-
let e =
|
|
1392
|
+
let e = H().payments();
|
|
1133
1393
|
return c({
|
|
1134
1394
|
mutationKey: [...e, "export"],
|
|
1135
|
-
mutationFn: (e) =>
|
|
1136
|
-
limit:
|
|
1395
|
+
mutationFn: (e) => T((t) => y(e, {
|
|
1396
|
+
limit: te,
|
|
1137
1397
|
cursor: t
|
|
1138
1398
|
}))
|
|
1139
1399
|
});
|
|
1140
1400
|
},
|
|
1141
1401
|
resolveFinding: (e) => {
|
|
1142
|
-
let t =
|
|
1402
|
+
let t = H().ops();
|
|
1143
1403
|
return c({
|
|
1144
1404
|
mutationKey: [
|
|
1145
1405
|
...t,
|
|
@@ -1147,11 +1407,11 @@ function J(e, t, n) {
|
|
|
1147
1407
|
"resolve"
|
|
1148
1408
|
],
|
|
1149
1409
|
mutationFn: ({ id: e, outcome: t, notes: n }) => M(e, t, n),
|
|
1150
|
-
onSuccess:
|
|
1410
|
+
onSuccess: Y(e, t)
|
|
1151
1411
|
});
|
|
1152
1412
|
},
|
|
1153
1413
|
refundPayment: (e, t, n, r) => {
|
|
1154
|
-
let i =
|
|
1414
|
+
let i = H(), a = i.payments(), o = n ? i.customer(n) : void 0, s = r ? i.subscription(r) : void 0;
|
|
1155
1415
|
return c({
|
|
1156
1416
|
mutationKey: [
|
|
1157
1417
|
...a,
|
|
@@ -1167,7 +1427,7 @@ function J(e, t, n) {
|
|
|
1167
1427
|
});
|
|
1168
1428
|
},
|
|
1169
1429
|
cancelSubscription: (e, t, n) => {
|
|
1170
|
-
let r =
|
|
1430
|
+
let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
|
|
1171
1431
|
return c({
|
|
1172
1432
|
mutationKey: [
|
|
1173
1433
|
...i,
|
|
@@ -1179,7 +1439,7 @@ function J(e, t, n) {
|
|
|
1179
1439
|
});
|
|
1180
1440
|
},
|
|
1181
1441
|
resumeSubscription: (e, t, n) => {
|
|
1182
|
-
let r =
|
|
1442
|
+
let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
|
|
1183
1443
|
return c({
|
|
1184
1444
|
mutationKey: [
|
|
1185
1445
|
...i,
|
|
@@ -1191,7 +1451,7 @@ function J(e, t, n) {
|
|
|
1191
1451
|
});
|
|
1192
1452
|
},
|
|
1193
1453
|
changeSubscriptionPaymentMethod: (e, t, n) => {
|
|
1194
|
-
let r =
|
|
1454
|
+
let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0;
|
|
1195
1455
|
return c({
|
|
1196
1456
|
mutationKey: [
|
|
1197
1457
|
...i,
|
|
@@ -1203,7 +1463,7 @@ function J(e, t, n) {
|
|
|
1203
1463
|
});
|
|
1204
1464
|
},
|
|
1205
1465
|
previewSubscriptionChange: (e) => {
|
|
1206
|
-
let t =
|
|
1466
|
+
let t = H().subscriptions();
|
|
1207
1467
|
return c({
|
|
1208
1468
|
mutationKey: [
|
|
1209
1469
|
...t,
|
|
@@ -1215,7 +1475,7 @@ function J(e, t, n) {
|
|
|
1215
1475
|
});
|
|
1216
1476
|
},
|
|
1217
1477
|
changeSubscription: (e, t, n) => {
|
|
1218
|
-
let r =
|
|
1478
|
+
let r = H(), i = r.subscriptions(), a = n ? r.customer(n) : void 0, o = r.payments();
|
|
1219
1479
|
return c({
|
|
1220
1480
|
mutationKey: [
|
|
1221
1481
|
...i,
|
|
@@ -1231,19 +1491,19 @@ function J(e, t, n) {
|
|
|
1231
1491
|
});
|
|
1232
1492
|
},
|
|
1233
1493
|
grantCustomerProductAccess: (e, t) => {
|
|
1234
|
-
let n =
|
|
1494
|
+
let n = H().customer(t);
|
|
1235
1495
|
return c({
|
|
1236
1496
|
mutationKey: [
|
|
1237
1497
|
...n,
|
|
1238
1498
|
"product-access",
|
|
1239
1499
|
"grant"
|
|
1240
1500
|
],
|
|
1241
|
-
mutationFn: (e) =>
|
|
1242
|
-
onSuccess:
|
|
1501
|
+
mutationFn: (e) => _(t, e),
|
|
1502
|
+
onSuccess: Y(e, n)
|
|
1243
1503
|
});
|
|
1244
1504
|
},
|
|
1245
1505
|
revokeCustomerProductAccess: (e, t) => {
|
|
1246
|
-
let n =
|
|
1506
|
+
let n = H().customer(t);
|
|
1247
1507
|
return c({
|
|
1248
1508
|
mutationKey: [
|
|
1249
1509
|
...n,
|
|
@@ -1251,11 +1511,11 @@ function J(e, t, n) {
|
|
|
1251
1511
|
"revoke"
|
|
1252
1512
|
],
|
|
1253
1513
|
mutationFn: ({ grantId: e, reason: t }) => P(e, t),
|
|
1254
|
-
onSuccess:
|
|
1514
|
+
onSuccess: Y(e, n)
|
|
1255
1515
|
});
|
|
1256
1516
|
},
|
|
1257
1517
|
askCatalogCopilot: () => {
|
|
1258
|
-
let e =
|
|
1518
|
+
let e = H();
|
|
1259
1519
|
return c({
|
|
1260
1520
|
mutationKey: [
|
|
1261
1521
|
...e.catalog(),
|
|
@@ -1266,7 +1526,7 @@ function J(e, t, n) {
|
|
|
1266
1526
|
});
|
|
1267
1527
|
},
|
|
1268
1528
|
loadCatalogPriceDraft: () => {
|
|
1269
|
-
let e =
|
|
1529
|
+
let e = H();
|
|
1270
1530
|
return c({
|
|
1271
1531
|
mutationKey: [
|
|
1272
1532
|
...e.catalog(),
|
|
@@ -1285,7 +1545,7 @@ function J(e, t, n) {
|
|
|
1285
1545
|
});
|
|
1286
1546
|
},
|
|
1287
1547
|
createCatalogDraftPrice: (e) => {
|
|
1288
|
-
let t =
|
|
1548
|
+
let t = H();
|
|
1289
1549
|
return c({
|
|
1290
1550
|
mutationKey: [
|
|
1291
1551
|
...t.catalog(),
|
|
@@ -1293,27 +1553,27 @@ function J(e, t, n) {
|
|
|
1293
1553
|
"create-price"
|
|
1294
1554
|
],
|
|
1295
1555
|
mutationFn: (e) => u(e),
|
|
1296
|
-
onSuccess:
|
|
1556
|
+
onSuccess: Y(e, t.catalog())
|
|
1297
1557
|
});
|
|
1298
1558
|
},
|
|
1299
1559
|
applyCatalog: (e) => {
|
|
1300
|
-
let t =
|
|
1560
|
+
let t = H();
|
|
1301
1561
|
return c({
|
|
1302
1562
|
mutationKey: [...t.catalog(), "apply"],
|
|
1303
1563
|
mutationFn: ({ document: e, force: t }) => O(e, t),
|
|
1304
|
-
onSuccess:
|
|
1564
|
+
onSuccess: Y(e, t.catalog())
|
|
1305
1565
|
});
|
|
1306
1566
|
},
|
|
1307
1567
|
refreshPSPs: (e) => {
|
|
1308
|
-
let t =
|
|
1568
|
+
let t = H();
|
|
1309
1569
|
return c({
|
|
1310
1570
|
mutationKey: [...t.catalogDrift(), "refresh"],
|
|
1311
1571
|
mutationFn: () => k(),
|
|
1312
|
-
onSuccess:
|
|
1572
|
+
onSuccess: Y(e, t.catalogDrift())
|
|
1313
1573
|
});
|
|
1314
1574
|
},
|
|
1315
1575
|
createProduct: (e) => {
|
|
1316
|
-
let t =
|
|
1576
|
+
let t = H();
|
|
1317
1577
|
return c({
|
|
1318
1578
|
mutationKey: [
|
|
1319
1579
|
...t.catalog(),
|
|
@@ -1321,11 +1581,11 @@ function J(e, t, n) {
|
|
|
1321
1581
|
"create"
|
|
1322
1582
|
],
|
|
1323
1583
|
mutationFn: (e) => d(e),
|
|
1324
|
-
onSuccess:
|
|
1584
|
+
onSuccess: Y(e, t.catalog())
|
|
1325
1585
|
});
|
|
1326
1586
|
},
|
|
1327
1587
|
updateProduct: (e) => {
|
|
1328
|
-
let t =
|
|
1588
|
+
let t = H();
|
|
1329
1589
|
return c({
|
|
1330
1590
|
mutationKey: [
|
|
1331
1591
|
...t.catalog(),
|
|
@@ -1333,12 +1593,12 @@ function J(e, t, n) {
|
|
|
1333
1593
|
"update"
|
|
1334
1594
|
],
|
|
1335
1595
|
mutationFn: ({ id: e, product: t }) => R(e, t),
|
|
1336
|
-
onSuccess:
|
|
1337
|
-
onError:
|
|
1596
|
+
onSuccess: Y(e, t.catalog()),
|
|
1597
|
+
onError: X(e, t.catalog())
|
|
1338
1598
|
});
|
|
1339
1599
|
},
|
|
1340
1600
|
setProductActive: (e) => {
|
|
1341
|
-
let t =
|
|
1601
|
+
let t = H();
|
|
1342
1602
|
return c({
|
|
1343
1603
|
mutationKey: [
|
|
1344
1604
|
...t.catalog(),
|
|
@@ -1349,12 +1609,12 @@ function J(e, t, n) {
|
|
|
1349
1609
|
archived: !t,
|
|
1350
1610
|
expected_revision: n
|
|
1351
1611
|
}),
|
|
1352
|
-
onSuccess:
|
|
1353
|
-
onError:
|
|
1612
|
+
onSuccess: Y(e, t.catalog()),
|
|
1613
|
+
onError: X(e, t.catalog())
|
|
1354
1614
|
});
|
|
1355
1615
|
},
|
|
1356
1616
|
createPrice: (e) => {
|
|
1357
|
-
let t =
|
|
1617
|
+
let t = H();
|
|
1358
1618
|
return c({
|
|
1359
1619
|
mutationKey: [
|
|
1360
1620
|
...t.catalog(),
|
|
@@ -1362,11 +1622,11 @@ function J(e, t, n) {
|
|
|
1362
1622
|
"create"
|
|
1363
1623
|
],
|
|
1364
1624
|
mutationFn: (e) => u(e),
|
|
1365
|
-
onSuccess:
|
|
1625
|
+
onSuccess: Y(e, t.catalog())
|
|
1366
1626
|
});
|
|
1367
1627
|
},
|
|
1368
1628
|
setPriceActive: (e) => {
|
|
1369
|
-
let t =
|
|
1629
|
+
let t = H();
|
|
1370
1630
|
return c({
|
|
1371
1631
|
mutationKey: [
|
|
1372
1632
|
...t.catalog(),
|
|
@@ -1377,46 +1637,46 @@ function J(e, t, n) {
|
|
|
1377
1637
|
archived: !t,
|
|
1378
1638
|
expected_revision: n
|
|
1379
1639
|
}),
|
|
1380
|
-
onSuccess:
|
|
1381
|
-
onError:
|
|
1640
|
+
onSuccess: Y(e, t.catalog()),
|
|
1641
|
+
onError: X(e, t.catalog())
|
|
1382
1642
|
});
|
|
1383
1643
|
},
|
|
1384
1644
|
putUsageMeter: (e) => {
|
|
1385
|
-
let t =
|
|
1645
|
+
let t = H(), n = t.usageMeters();
|
|
1386
1646
|
return c({
|
|
1387
1647
|
mutationKey: [...n, "put"],
|
|
1388
|
-
mutationFn: ({ key: e, meter: t }) =>
|
|
1648
|
+
mutationFn: ({ key: e, meter: t }) => w(e, t),
|
|
1389
1649
|
onSuccess: (r, { key: i }) => Promise.all([e.invalidateQueries({ queryKey: n }), e.invalidateQueries({ queryKey: t.usageMeter(i) })]),
|
|
1390
|
-
onError:
|
|
1650
|
+
onError: X(e, n)
|
|
1391
1651
|
});
|
|
1392
1652
|
},
|
|
1393
1653
|
putDefaultUsageRateCard: (e) => {
|
|
1394
|
-
let t =
|
|
1654
|
+
let t = H(), n = t.usageMeters();
|
|
1395
1655
|
return c({
|
|
1396
1656
|
mutationKey: [
|
|
1397
1657
|
...n,
|
|
1398
1658
|
"rate-card",
|
|
1399
1659
|
"put"
|
|
1400
1660
|
],
|
|
1401
|
-
mutationFn: ({ meter: e, rateCard: t }) =>
|
|
1661
|
+
mutationFn: ({ meter: e, rateCard: t }) => S(e, t),
|
|
1402
1662
|
onSuccess: (r, { meter: i }) => Promise.all([e.invalidateQueries({ queryKey: n }), e.invalidateQueries({ queryKey: t.usageMeter(i.key) })]),
|
|
1403
|
-
onError:
|
|
1663
|
+
onError: X(e, n)
|
|
1404
1664
|
});
|
|
1405
1665
|
},
|
|
1406
1666
|
deleteDefaultUsageRateCard: (e) => {
|
|
1407
|
-
let t =
|
|
1667
|
+
let t = H(), n = t.usageMeters();
|
|
1408
1668
|
return c({
|
|
1409
1669
|
mutationKey: [
|
|
1410
1670
|
...n,
|
|
1411
1671
|
"rate-card",
|
|
1412
1672
|
"delete"
|
|
1413
1673
|
],
|
|
1414
|
-
mutationFn: (e) =>
|
|
1674
|
+
mutationFn: (e) => S(e, null),
|
|
1415
1675
|
onSuccess: (r, i) => Promise.all([e.invalidateQueries({ queryKey: n }), e.invalidateQueries({ queryKey: t.usageMeter(i.key) })])
|
|
1416
1676
|
});
|
|
1417
1677
|
},
|
|
1418
1678
|
previewPriceChange: () => {
|
|
1419
|
-
let e =
|
|
1679
|
+
let e = H();
|
|
1420
1680
|
return c({
|
|
1421
1681
|
mutationKey: [
|
|
1422
1682
|
...e.catalog(),
|
|
@@ -1427,7 +1687,7 @@ function J(e, t, n) {
|
|
|
1427
1687
|
});
|
|
1428
1688
|
},
|
|
1429
1689
|
changePrice: (e) => {
|
|
1430
|
-
let t =
|
|
1690
|
+
let t = H();
|
|
1431
1691
|
return c({
|
|
1432
1692
|
mutationKey: [
|
|
1433
1693
|
...t.catalog(),
|
|
@@ -1438,11 +1698,11 @@ function J(e, t, n) {
|
|
|
1438
1698
|
let n = await u(e);
|
|
1439
1699
|
return t && await j(t.productKey, t.priceKey, n.id, t.effectiveAt), n;
|
|
1440
1700
|
},
|
|
1441
|
-
onSettled:
|
|
1701
|
+
onSettled: Y(e, t.catalog())
|
|
1442
1702
|
});
|
|
1443
1703
|
},
|
|
1444
1704
|
cancelPriceMigration: (e) => {
|
|
1445
|
-
let t =
|
|
1705
|
+
let t = H();
|
|
1446
1706
|
return c({
|
|
1447
1707
|
mutationKey: [
|
|
1448
1708
|
...t.catalog(),
|
|
@@ -1450,20 +1710,20 @@ function J(e, t, n) {
|
|
|
1450
1710
|
"cancel"
|
|
1451
1711
|
],
|
|
1452
1712
|
mutationFn: (e) => a(e),
|
|
1453
|
-
onSuccess:
|
|
1713
|
+
onSuccess: Y(e, t.catalog())
|
|
1454
1714
|
});
|
|
1455
1715
|
},
|
|
1456
1716
|
updateMerchantConfiguration: (e) => {
|
|
1457
|
-
let t =
|
|
1717
|
+
let t = H();
|
|
1458
1718
|
return c({
|
|
1459
1719
|
mutationKey: [...t.settings(), "update"],
|
|
1460
1720
|
mutationFn: (e) => I(e),
|
|
1461
|
-
onSettled:
|
|
1462
|
-
onError:
|
|
1721
|
+
onSettled: J(e, t.settings()),
|
|
1722
|
+
onError: U(e)
|
|
1463
1723
|
});
|
|
1464
1724
|
},
|
|
1465
1725
|
createPSP: (e) => {
|
|
1466
|
-
let t = r(), n =
|
|
1726
|
+
let t = r(), n = H();
|
|
1467
1727
|
return c({
|
|
1468
1728
|
mutationKey: [
|
|
1469
1729
|
...n.settings(),
|
|
@@ -1476,12 +1736,12 @@ function J(e, t, n) {
|
|
|
1476
1736
|
if (r() !== t) throw Error("Merchant changed; reopen this form before saving");
|
|
1477
1737
|
return p(e);
|
|
1478
1738
|
},
|
|
1479
|
-
onSettled:
|
|
1480
|
-
onError:
|
|
1739
|
+
onSettled: J(e, [...n.settings(), "psps"]),
|
|
1740
|
+
onError: U(e)
|
|
1481
1741
|
});
|
|
1482
1742
|
},
|
|
1483
1743
|
updatePSP: (e) => {
|
|
1484
|
-
let t = r(), n =
|
|
1744
|
+
let t = r(), n = H();
|
|
1485
1745
|
return c({
|
|
1486
1746
|
mutationKey: [
|
|
1487
1747
|
...n.settings(),
|
|
@@ -1492,14 +1752,14 @@ function J(e, t, n) {
|
|
|
1492
1752
|
gcTime: 0,
|
|
1493
1753
|
mutationFn: ({ id: e, psp: n }) => {
|
|
1494
1754
|
if (r() !== t) throw Error("Merchant changed; reopen this form before saving");
|
|
1495
|
-
return
|
|
1755
|
+
return C(e, n);
|
|
1496
1756
|
},
|
|
1497
|
-
onSettled:
|
|
1498
|
-
onError:
|
|
1757
|
+
onSettled: J(e, [...n.settings(), "psps"]),
|
|
1758
|
+
onError: U(e)
|
|
1499
1759
|
});
|
|
1500
1760
|
},
|
|
1501
1761
|
setCreditLimit: () => {
|
|
1502
|
-
let e =
|
|
1762
|
+
let e = H();
|
|
1503
1763
|
return c({
|
|
1504
1764
|
mutationKey: [
|
|
1505
1765
|
...e.settings(),
|
|
@@ -1513,7 +1773,7 @@ function J(e, t, n) {
|
|
|
1513
1773
|
});
|
|
1514
1774
|
},
|
|
1515
1775
|
lookupCustomerControls: () => {
|
|
1516
|
-
let e =
|
|
1776
|
+
let e = H();
|
|
1517
1777
|
return c({
|
|
1518
1778
|
mutationKey: [
|
|
1519
1779
|
...e.settings(),
|
|
@@ -1522,7 +1782,7 @@ function J(e, t, n) {
|
|
|
1522
1782
|
],
|
|
1523
1783
|
mutationFn: async ({ customerId: e, currency: t }) => {
|
|
1524
1784
|
let { settings: n } = await h(e).catch((e) => {
|
|
1525
|
-
throw e instanceof
|
|
1785
|
+
throw e instanceof x && e.status === 404 ? Error("No customer has this ID") : e;
|
|
1526
1786
|
}), r = t.toUpperCase();
|
|
1527
1787
|
return {
|
|
1528
1788
|
currency: r,
|
|
@@ -1533,7 +1793,7 @@ function J(e, t, n) {
|
|
|
1533
1793
|
});
|
|
1534
1794
|
},
|
|
1535
1795
|
createWebhook: (e) => {
|
|
1536
|
-
let t =
|
|
1796
|
+
let t = H();
|
|
1537
1797
|
return c({
|
|
1538
1798
|
mutationKey: [
|
|
1539
1799
|
...t.alerts(),
|
|
@@ -1541,12 +1801,12 @@ function J(e, t, n) {
|
|
|
1541
1801
|
"create"
|
|
1542
1802
|
],
|
|
1543
1803
|
mutationFn: (e) => f(e),
|
|
1544
|
-
onSuccess:
|
|
1545
|
-
onError:
|
|
1804
|
+
onSuccess: W(e, t),
|
|
1805
|
+
onError: U(e)
|
|
1546
1806
|
});
|
|
1547
1807
|
},
|
|
1548
1808
|
updateWebhook: (e) => {
|
|
1549
|
-
let t =
|
|
1809
|
+
let t = H();
|
|
1550
1810
|
return c({
|
|
1551
1811
|
mutationKey: [
|
|
1552
1812
|
...t.alerts(),
|
|
@@ -1554,12 +1814,12 @@ function J(e, t, n) {
|
|
|
1554
1814
|
"update"
|
|
1555
1815
|
],
|
|
1556
1816
|
mutationFn: ({ id: e, webhook: t }) => z(e, t),
|
|
1557
|
-
onSuccess:
|
|
1558
|
-
onError:
|
|
1817
|
+
onSuccess: W(e, t),
|
|
1818
|
+
onError: U(e)
|
|
1559
1819
|
});
|
|
1560
1820
|
},
|
|
1561
1821
|
deleteWebhook: (e) => {
|
|
1562
|
-
let t =
|
|
1822
|
+
let t = H();
|
|
1563
1823
|
return c({
|
|
1564
1824
|
mutationKey: [
|
|
1565
1825
|
...t.alerts(),
|
|
@@ -1567,15 +1827,15 @@ function J(e, t, n) {
|
|
|
1567
1827
|
"delete"
|
|
1568
1828
|
],
|
|
1569
1829
|
mutationFn: (e) => m(e),
|
|
1570
|
-
onSuccess:
|
|
1571
|
-
onError:
|
|
1830
|
+
onSuccess: W(e, t),
|
|
1831
|
+
onError: U(e)
|
|
1572
1832
|
});
|
|
1573
1833
|
}
|
|
1574
1834
|
} };
|
|
1575
1835
|
}
|
|
1576
1836
|
//#endregion
|
|
1577
1837
|
//#region src/admin/lib/credit-queries.ts
|
|
1578
|
-
function
|
|
1838
|
+
function ne(e, t) {
|
|
1579
1839
|
let { selectedMerchant: n } = e, r = (t, n) => [
|
|
1580
1840
|
...e.queryRoot(t),
|
|
1581
1841
|
"customers",
|
|
@@ -1624,7 +1884,7 @@ function Y(e, t) {
|
|
|
1624
1884
|
}
|
|
1625
1885
|
//#endregion
|
|
1626
1886
|
//#region src/admin/lib/order-queries.ts
|
|
1627
|
-
function
|
|
1887
|
+
function re(e, t, n) {
|
|
1628
1888
|
let { queryRoot: r } = e, { queryKeys: i } = n, a = t, o = t, u = {
|
|
1629
1889
|
root: () => [...r(), "orders"],
|
|
1630
1890
|
detail: (e) => [...u.root(), e],
|
|
@@ -1694,28 +1954,28 @@ function X(e, t, n) {
|
|
|
1694
1954
|
}
|
|
1695
1955
|
//#endregion
|
|
1696
1956
|
//#region src/admin/context.tsx
|
|
1697
|
-
function
|
|
1698
|
-
let t =
|
|
1957
|
+
function ie(e) {
|
|
1958
|
+
let t = E(e), n = z(t), r = ee(t, n), i = B(e.namespace);
|
|
1699
1959
|
return {
|
|
1700
1960
|
toast: i,
|
|
1701
|
-
...
|
|
1961
|
+
...V(i),
|
|
1702
1962
|
...t,
|
|
1703
1963
|
...n,
|
|
1704
1964
|
...r,
|
|
1705
|
-
...
|
|
1706
|
-
...
|
|
1707
|
-
...
|
|
1965
|
+
...Z(t, n, r),
|
|
1966
|
+
...ne(t, n),
|
|
1967
|
+
...re(t, n, r)
|
|
1708
1968
|
};
|
|
1709
1969
|
}
|
|
1710
|
-
var
|
|
1711
|
-
function
|
|
1712
|
-
let e = n(
|
|
1970
|
+
var ae = e(null);
|
|
1971
|
+
function oe() {
|
|
1972
|
+
let e = n(ae);
|
|
1713
1973
|
if (!e) throw Error("BillingAdmin context is missing");
|
|
1714
1974
|
return e;
|
|
1715
1975
|
}
|
|
1716
|
-
var
|
|
1717
|
-
function
|
|
1718
|
-
let s = o(
|
|
1976
|
+
var se = () => oe().services, Q = e(null), ce = (e) => (window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e)), le = () => window.location.pathname + window.location.search;
|
|
1977
|
+
function ue({ basePath: e = "/", navigation: n, children: r }) {
|
|
1978
|
+
let s = o(ce, le, () => 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) => {
|
|
1719
1979
|
if (/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(e)) return e;
|
|
1720
1980
|
let t = new URL(e, "http://billing.local" + p + f);
|
|
1721
1981
|
return c + t.pathname + t.search + t.hash;
|
|
@@ -1752,25 +2012,25 @@ function ae({ basePath: e = "/", navigation: n, children: r }) {
|
|
|
1752
2012
|
n,
|
|
1753
2013
|
m
|
|
1754
2014
|
]);
|
|
1755
|
-
return /* @__PURE__ */ d(
|
|
2015
|
+
return /* @__PURE__ */ d(Q.Provider, {
|
|
1756
2016
|
value: v,
|
|
1757
2017
|
children: r
|
|
1758
2018
|
});
|
|
1759
2019
|
}
|
|
1760
2020
|
function $() {
|
|
1761
|
-
let e = n(
|
|
2021
|
+
let e = n(Q);
|
|
1762
2022
|
if (!e) throw Error("BillingAdmin router is missing");
|
|
1763
2023
|
return e;
|
|
1764
2024
|
}
|
|
1765
|
-
var
|
|
1766
|
-
function
|
|
2025
|
+
var de = () => $().location, fe = () => $().navigate, pe = () => $().params;
|
|
2026
|
+
function me() {
|
|
1767
2027
|
let { location: e, navigate: t } = $();
|
|
1768
2028
|
return [i(() => new URLSearchParams(e.search), [e.search]), (n, r) => {
|
|
1769
2029
|
let i = new URLSearchParams(n).toString();
|
|
1770
2030
|
t(e.pathname + (i ? "?" + i : ""), r);
|
|
1771
2031
|
}];
|
|
1772
2032
|
}
|
|
1773
|
-
function
|
|
2033
|
+
function he({ to: e, onClick: t, ...n }) {
|
|
1774
2034
|
let { href: r, navigate: i } = $();
|
|
1775
2035
|
return /* @__PURE__ */ d("a", {
|
|
1776
2036
|
...n,
|
|
@@ -1780,17 +2040,17 @@ function ue({ to: e, onClick: t, ...n }) {
|
|
|
1780
2040
|
}
|
|
1781
2041
|
});
|
|
1782
2042
|
}
|
|
1783
|
-
function
|
|
1784
|
-
let n =
|
|
2043
|
+
function ge({ to: e, replace: t }) {
|
|
2044
|
+
let n = fe();
|
|
1785
2045
|
return r(() => n(e, { replace: t }), [
|
|
1786
2046
|
n,
|
|
1787
2047
|
e,
|
|
1788
2048
|
t
|
|
1789
2049
|
]), null;
|
|
1790
2050
|
}
|
|
1791
|
-
function
|
|
2051
|
+
function _e({ params: e, children: t }) {
|
|
1792
2052
|
let n = $();
|
|
1793
|
-
return /* @__PURE__ */ d(
|
|
2053
|
+
return /* @__PURE__ */ d(Q.Provider, {
|
|
1794
2054
|
value: {
|
|
1795
2055
|
...n,
|
|
1796
2056
|
params: e
|
|
@@ -1800,10 +2060,10 @@ function fe({ params: e, children: t }) {
|
|
|
1800
2060
|
}
|
|
1801
2061
|
//#endregion
|
|
1802
2062
|
//#region src/admin/lib/utils.ts
|
|
1803
|
-
function
|
|
2063
|
+
function ve(...e) {
|
|
1804
2064
|
return p(f(e));
|
|
1805
2065
|
}
|
|
1806
2066
|
//#endregion
|
|
1807
|
-
export {
|
|
2067
|
+
export { E as C, h as E, x as S, m as T, M as _, _e as a, A as b, pe as c, ie as d, oe as f, z as g, V as h, ge as i, me as l, B as m, ue as n, de as o, se as p, he as r, fe as s, ve as t, ae as u, D as v, g as w, k as x, O as y };
|
|
1808
2068
|
|
|
1809
|
-
//# sourceMappingURL=admin-utils-
|
|
2069
|
+
//# sourceMappingURL=admin-utils-CwzkGo6Y.js.map
|