@openrails/billing-ui 0.248.0 → 0.249.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +32 -27
- package/dist/buy-button.d.ts +9 -15
- package/dist/client/client.d.ts +12 -20
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/routes.d.ts +8 -22
- package/dist/client/generated/wire.d.ts +42 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/types.d.ts +7 -3
- package/dist/{client-DoRYitD3.js → client-rFrCMrkn.js} +211 -226
- package/dist/client-rFrCMrkn.js.map +1 -0
- package/dist/client.js +1 -1
- package/dist/embedded-checkout.d.ts +5 -2
- package/dist/{hooks-DCSelDIZ.js → hooks-B1TffejB.js} +7 -20
- package/dist/hooks-B1TffejB.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +247 -235
- package/dist/index.js.map +1 -1
- package/dist/modal.d.ts +10 -1
- package/dist/product-list.d.ts +7 -13
- package/dist/react/hooks.d.ts +2 -15
- package/dist/react/index.d.ts +1 -1
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/dist/client-DoRYitD3.js.map +0 -1
- package/dist/hooks-DCSelDIZ.js.map +0 -1
|
@@ -105,8 +105,8 @@ function c({ fetchToken: e, skew: t = 60 }) {
|
|
|
105
105
|
(e === void 0 || n?.token === e) && (n = void 0);
|
|
106
106
|
}, a;
|
|
107
107
|
}
|
|
108
|
-
var
|
|
109
|
-
async function
|
|
108
|
+
var l = (e) => typeof e == "function" && typeof e.invalidate == "function";
|
|
109
|
+
async function u(e) {
|
|
110
110
|
let t = await (e.fetch ?? ((e, t) => fetch(e, t)))(e.tokenEndpoint, {
|
|
111
111
|
method: "POST",
|
|
112
112
|
headers: {
|
|
@@ -130,7 +130,7 @@ async function l(e) {
|
|
|
130
130
|
}
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region src/psp.ts
|
|
133
|
-
var
|
|
133
|
+
var d = e.object({
|
|
134
134
|
psp_id: e.string().min(1),
|
|
135
135
|
key: e.string().min(1),
|
|
136
136
|
rail: e.string(),
|
|
@@ -141,77 +141,77 @@ var u = e.object({
|
|
|
141
141
|
checkout: e.boolean().nullish(),
|
|
142
142
|
status: e.string().nullish(),
|
|
143
143
|
retry_after: e.number().int().nullish()
|
|
144
|
-
}),
|
|
144
|
+
}), f = (e) => e.filter((e) => e.checkout !== !1), p = /* @__PURE__ */ new Set([
|
|
145
145
|
"tokenize",
|
|
146
146
|
"card",
|
|
147
147
|
"elements"
|
|
148
148
|
]);
|
|
149
|
-
function
|
|
150
|
-
let t = e.filter((e) => !!e.status && e.custodian === "psp" &&
|
|
149
|
+
function m(e) {
|
|
150
|
+
let t = e.filter((e) => !!e.status && e.custodian === "psp" && p.has(e.flow)).map((e) => e.retry_after ?? 30);
|
|
151
151
|
return t.length > 0 ? Math.min(...t) : null;
|
|
152
152
|
}
|
|
153
|
-
var
|
|
154
|
-
function
|
|
155
|
-
return e.custodian !== "psp" || e.status ? null : e.flow === "card" && e.rail === "nmi" ? "card" : e.flow === "tokenize" &&
|
|
153
|
+
var h = (e) => !!e && !e.startsWith("preview_"), g = (e) => e.rail === "stripe" && !!e.config?.publishable_key?.startsWith("pk_");
|
|
154
|
+
function _(e) {
|
|
155
|
+
return e.custodian !== "psp" || e.status ? null : e.flow === "card" && e.rail === "nmi" ? "card" : e.flow === "tokenize" && h(e.config?.tokenization_key) && e.config?.tokenization_url ? "collect_js" : g(e) ? "stripe_elements" : null;
|
|
156
156
|
}
|
|
157
|
-
var
|
|
158
|
-
function
|
|
157
|
+
var v = (e) => _(e) !== null, y = (e) => _(e) === "stripe_elements", b = -(1n << 63n), x = (1n << 63n) - 1n;
|
|
158
|
+
function S(e) {
|
|
159
159
|
if (typeof e != "string" || !/^-?\d{1,19}$/.test(e)) return null;
|
|
160
160
|
let t = BigInt(e);
|
|
161
|
-
return t <
|
|
162
|
-
}
|
|
163
|
-
function S(e) {
|
|
164
|
-
return x(e) !== null;
|
|
161
|
+
return t < b || t > x ? null : t;
|
|
165
162
|
}
|
|
166
163
|
function C(e) {
|
|
164
|
+
return S(e) !== null;
|
|
165
|
+
}
|
|
166
|
+
function w(e) {
|
|
167
167
|
return typeof e == "number" && Number.isInteger(e) && e >= 0 && e <= 18;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function T(...e) {
|
|
170
170
|
let t = 0n;
|
|
171
171
|
for (let n of e) {
|
|
172
|
-
let e =
|
|
172
|
+
let e = S(n);
|
|
173
173
|
if (e === null) return null;
|
|
174
174
|
t += e;
|
|
175
175
|
}
|
|
176
|
-
return t <
|
|
176
|
+
return t < b || t > x ? null : t.toString();
|
|
177
177
|
}
|
|
178
|
-
var
|
|
178
|
+
var ee = (() => {
|
|
179
179
|
try {
|
|
180
180
|
return new Intl.NumberFormat("en", { useGrouping: !1 }).format("9007199254740993") === "9007199254740993";
|
|
181
181
|
} catch {
|
|
182
182
|
return !1;
|
|
183
183
|
}
|
|
184
|
-
})(),
|
|
185
|
-
function
|
|
184
|
+
})(), E = 10n ** 15n;
|
|
185
|
+
function D(e, t) {
|
|
186
186
|
let n = e < 0n ? -e : e, r = 10n ** BigInt(t), i = (n % r).toString().padStart(t, "0").replace(/0+$/, "");
|
|
187
187
|
return `${e < 0n ? "-" : ""}${n / r}${i ? `.${i}` : ""}`;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
let n =
|
|
191
|
-
return n === null || !
|
|
189
|
+
function te(e, t) {
|
|
190
|
+
let n = S(e);
|
|
191
|
+
return n === null || !w(t) ? null : D(n, t);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
let r =
|
|
195
|
-
if (r === null || !
|
|
193
|
+
function ne(e, t, n) {
|
|
194
|
+
let r = S(e);
|
|
195
|
+
if (r === null || !w(t) || !w(n) || n > t) return null;
|
|
196
196
|
let i = 10n ** BigInt(t - n);
|
|
197
197
|
if (r % i !== 0n) return null;
|
|
198
198
|
let a = r / i;
|
|
199
199
|
return a > BigInt(2 ** 53 - 1) || a < -BigInt(2 ** 53 - 1) ? null : Number(a);
|
|
200
200
|
}
|
|
201
201
|
function re(e, t) {
|
|
202
|
-
if (!
|
|
202
|
+
if (!w(t) || e.length > 40) return null;
|
|
203
203
|
let n = /^(-?)(\d+)(?:\.(\d+))?$/.exec(e);
|
|
204
204
|
if (!n) return null;
|
|
205
205
|
let r = n[3] ?? "";
|
|
206
206
|
if (r.length > t) return null;
|
|
207
207
|
let i = BigInt(n[2]) * 10n ** BigInt(t) + BigInt(r.padEnd(t, "0") || "0"), a = n[1] ? -i : i;
|
|
208
|
-
return a <
|
|
208
|
+
return a < b || a > x ? null : a.toString();
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
let i = t.trim().toUpperCase(), a =
|
|
212
|
-
if (a === null || !
|
|
213
|
-
if (!
|
|
214
|
-
let o =
|
|
210
|
+
function O(e, t, n, r) {
|
|
211
|
+
let i = t.trim().toUpperCase(), a = S(e);
|
|
212
|
+
if (a === null || !w(n)) return `${i} amount exceeds the exact display range`;
|
|
213
|
+
if (!ee && (a >= E || a <= -E)) return `${i} amount exceeds this browser's exact display range`;
|
|
214
|
+
let o = D(a, n);
|
|
215
215
|
try {
|
|
216
216
|
return new Intl.NumberFormat(r, {
|
|
217
217
|
style: "currency",
|
|
@@ -224,17 +224,10 @@ function ie(e, t, n, r) {
|
|
|
224
224
|
}
|
|
225
225
|
//#endregion
|
|
226
226
|
//#region src/client/types.ts
|
|
227
|
-
var
|
|
228
|
-
data: e.array(t).nullish().transform((e) => e ?? []),
|
|
229
|
-
total: e.number().nullish(),
|
|
230
|
-
limit: e.number().nullish(),
|
|
231
|
-
offset: e.number().nullish(),
|
|
232
|
-
has_more: e.boolean().nullish(),
|
|
233
|
-
next_cursor: e.string().nullish()
|
|
234
|
-
}), A = (t) => e.object({
|
|
227
|
+
var k = e.string().refine(C, "amount must be an int64 string"), A = e.string(), j = (t) => e.object({
|
|
235
228
|
data: e.array(t).nullish().transform((e) => e ?? []),
|
|
236
229
|
next_cursor: e.string().nullish().transform((e) => e ?? null)
|
|
237
|
-
}),
|
|
230
|
+
}), ie = e.string(), M = e.object({
|
|
238
231
|
status: e.string(),
|
|
239
232
|
ids: e.record(e.string(), e.string()).nullish(),
|
|
240
233
|
sync_status: e.string().nullish()
|
|
@@ -245,19 +238,19 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
245
238
|
version: e.number().int().nonnegative().optional(),
|
|
246
239
|
product_id: e.string(),
|
|
247
240
|
archived: e.boolean(),
|
|
248
|
-
unit_amount:
|
|
241
|
+
unit_amount: k,
|
|
249
242
|
customer_amount: e.object({
|
|
250
|
-
min_amount:
|
|
251
|
-
max_amount:
|
|
243
|
+
min_amount: k,
|
|
244
|
+
max_amount: k
|
|
252
245
|
}).nullish(),
|
|
253
246
|
currency: e.string(),
|
|
254
247
|
access_duration_hours: e.number().nullable(),
|
|
255
248
|
billing_interval_hours: e.number().nullable(),
|
|
256
|
-
trial_unit_amount:
|
|
249
|
+
trial_unit_amount: k.nullable(),
|
|
257
250
|
trial_duration_hours: e.number().nullable(),
|
|
258
251
|
psps: e.record(e.string(), M).nullish(),
|
|
259
|
-
created_at:
|
|
260
|
-
updated_at:
|
|
252
|
+
created_at: A,
|
|
253
|
+
updated_at: A
|
|
261
254
|
}), P = e.object({
|
|
262
255
|
id: e.string(),
|
|
263
256
|
key: e.string().nullish(),
|
|
@@ -271,7 +264,7 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
271
264
|
last4: e.string().nullish(),
|
|
272
265
|
exp_month: e.number().nullish(),
|
|
273
266
|
exp_year: e.number().nullish()
|
|
274
|
-
}),
|
|
267
|
+
}), ae = e.object({
|
|
275
268
|
last_failure_reason: e.string().nullish(),
|
|
276
269
|
retryable: e.boolean(),
|
|
277
270
|
blocked_reason: e.string().nullish(),
|
|
@@ -282,16 +275,16 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
282
275
|
psp_id: e.string().nullish(),
|
|
283
276
|
transactions: e.array(e.string()).nullish(),
|
|
284
277
|
payload: e.record(e.string(), e.string()).nullish()
|
|
285
|
-
}),
|
|
278
|
+
}), oe = e.object({
|
|
286
279
|
attempts: e.number(),
|
|
287
280
|
retries_left: e.number().nullish(),
|
|
288
|
-
next_retry_at:
|
|
289
|
-
final_retry_at:
|
|
281
|
+
next_retry_at: A.nullish(),
|
|
282
|
+
final_retry_at: A.nullish(),
|
|
290
283
|
waiting_for_new_card: e.boolean(),
|
|
291
284
|
last_failure_reason: e.string().nullish()
|
|
292
285
|
}), L = e.object({
|
|
293
286
|
id: e.string(),
|
|
294
|
-
status:
|
|
287
|
+
status: ie,
|
|
295
288
|
rail: e.string().nullish(),
|
|
296
289
|
product_id: e.string().nullish(),
|
|
297
290
|
price_id: e.string().nullish(),
|
|
@@ -299,36 +292,36 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
299
292
|
psp_id: e.string().nullish(),
|
|
300
293
|
collection_policy: e.string().nullish(),
|
|
301
294
|
payment_method_id: e.string().nullish(),
|
|
302
|
-
started_at:
|
|
303
|
-
ended_at:
|
|
304
|
-
current_period_starts_at:
|
|
305
|
-
current_period_ends_at:
|
|
306
|
-
canceled_at:
|
|
295
|
+
started_at: A.nullish(),
|
|
296
|
+
ended_at: A.nullish(),
|
|
297
|
+
current_period_starts_at: A.nullish(),
|
|
298
|
+
current_period_ends_at: A.nullish(),
|
|
299
|
+
canceled_at: A.nullish(),
|
|
307
300
|
cancel_type: e.string().nullish(),
|
|
308
301
|
resumable: e.boolean().nullish(),
|
|
309
302
|
cancel_scheduled: e.boolean().nullish(),
|
|
310
303
|
cancel_mode: e.string().nullish(),
|
|
311
304
|
cancel_portal_url: e.string().nullish(),
|
|
312
305
|
access: e.object({
|
|
313
|
-
starts_at:
|
|
314
|
-
ends_at:
|
|
306
|
+
starts_at: A,
|
|
307
|
+
ends_at: A.nullish()
|
|
315
308
|
}).nullish(),
|
|
316
|
-
dunning:
|
|
309
|
+
dunning: oe.nullish(),
|
|
317
310
|
price: N.nullish(),
|
|
318
311
|
product: P.nullish(),
|
|
319
312
|
scheduled_change: e.object({
|
|
320
313
|
price_id: e.string(),
|
|
321
314
|
quantity: e.number().nullish(),
|
|
322
|
-
effective_at:
|
|
315
|
+
effective_at: A,
|
|
323
316
|
source: e.string(),
|
|
324
317
|
price: N.nullish(),
|
|
325
318
|
product: P.nullish()
|
|
326
319
|
}).nullish(),
|
|
327
320
|
card: F.nullish(),
|
|
328
|
-
recovery:
|
|
321
|
+
recovery: ae.nullish(),
|
|
329
322
|
next_action: I.nullish(),
|
|
330
|
-
created_at:
|
|
331
|
-
updated_at:
|
|
323
|
+
created_at: A.nullish(),
|
|
324
|
+
updated_at: A.nullish()
|
|
332
325
|
}), R = e.object({
|
|
333
326
|
name: e.string().nullish(),
|
|
334
327
|
email: e.string().nullish(),
|
|
@@ -356,7 +349,7 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
356
349
|
reusable: e.boolean().nullish(),
|
|
357
350
|
health: e.object({
|
|
358
351
|
expiry_status: e.string().nullish(),
|
|
359
|
-
last_charged_at:
|
|
352
|
+
last_charged_at: A.nullish(),
|
|
360
353
|
last_charge_outcome: e.string().nullish(),
|
|
361
354
|
active: e.boolean().nullish()
|
|
362
355
|
}).nullish(),
|
|
@@ -365,7 +358,7 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
365
358
|
display_name: e.string().nullish()
|
|
366
359
|
})).nullish(),
|
|
367
360
|
default_currencies: e.array(e.string()).nullish(),
|
|
368
|
-
created_at:
|
|
361
|
+
created_at: A.nullish()
|
|
369
362
|
}), B = e.object({
|
|
370
363
|
reason: e.string(),
|
|
371
364
|
message: e.string(),
|
|
@@ -377,8 +370,8 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
377
370
|
source: e.string().nullish(),
|
|
378
371
|
description: e.string(),
|
|
379
372
|
quantity: e.number().nullish(),
|
|
380
|
-
unit_amount:
|
|
381
|
-
amount:
|
|
373
|
+
unit_amount: k,
|
|
374
|
+
amount: k,
|
|
382
375
|
billing_interval_hours: e.number().nullish(),
|
|
383
376
|
access_duration_hours: e.number().nullish(),
|
|
384
377
|
subscription_id: e.string().nullish(),
|
|
@@ -394,13 +387,13 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
394
387
|
kind: e.string(),
|
|
395
388
|
reference: e.string(),
|
|
396
389
|
settlement_source: e.string().nullish(),
|
|
397
|
-
non_cash_amount:
|
|
398
|
-
settled_at:
|
|
390
|
+
non_cash_amount: k,
|
|
391
|
+
settled_at: A.nullish()
|
|
399
392
|
})).nullish().transform((e) => e ?? []),
|
|
400
393
|
status: e.string(),
|
|
401
394
|
number: e.string().nullish(),
|
|
402
395
|
currency: e.string(),
|
|
403
|
-
total:
|
|
396
|
+
total: k,
|
|
404
397
|
lines: e.array(V),
|
|
405
398
|
payment: e.object({
|
|
406
399
|
status: e.string(),
|
|
@@ -417,69 +410,72 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
417
410
|
checkout: e.object({
|
|
418
411
|
url: e.string().nullish(),
|
|
419
412
|
ui_mode: e.enum(["hosted", "embedded"]).catch("hosted"),
|
|
420
|
-
expires_at:
|
|
421
|
-
success_url: e.string(),
|
|
413
|
+
expires_at: A,
|
|
414
|
+
success_url: e.string().nullish(),
|
|
422
415
|
cancel_url: e.string().nullish(),
|
|
423
416
|
saved_payment_methods: e.boolean()
|
|
424
417
|
}).nullish(),
|
|
425
418
|
renewal: e.object({
|
|
426
419
|
subscription_id: e.string(),
|
|
427
|
-
period_starts_at:
|
|
428
|
-
period_ends_at:
|
|
429
|
-
due_at:
|
|
420
|
+
period_starts_at: A,
|
|
421
|
+
period_ends_at: A,
|
|
422
|
+
due_at: A
|
|
430
423
|
}).nullish(),
|
|
431
424
|
usage: e.object({
|
|
432
|
-
period_starts_at:
|
|
433
|
-
period_ends_at:
|
|
434
|
-
due_at:
|
|
435
|
-
amount_paid:
|
|
436
|
-
amount_due:
|
|
425
|
+
period_starts_at: A,
|
|
426
|
+
period_ends_at: A,
|
|
427
|
+
due_at: A,
|
|
428
|
+
amount_paid: k,
|
|
429
|
+
amount_due: k,
|
|
437
430
|
collection_method: e.string(),
|
|
438
|
-
next_collection_attempt_at:
|
|
431
|
+
next_collection_attempt_at: A.nullish(),
|
|
439
432
|
po_number: e.string().nullish(),
|
|
440
433
|
memo: e.string().nullish(),
|
|
441
434
|
delinquent: e.boolean()
|
|
442
435
|
}).nullish(),
|
|
443
|
-
expires_at:
|
|
444
|
-
completed_at:
|
|
445
|
-
canceled_at:
|
|
446
|
-
expired_at:
|
|
447
|
-
voided_at:
|
|
448
|
-
uncollectible_at:
|
|
449
|
-
created_at:
|
|
436
|
+
expires_at: A.nullish(),
|
|
437
|
+
completed_at: A.nullish(),
|
|
438
|
+
canceled_at: A.nullish(),
|
|
439
|
+
expired_at: A.nullish(),
|
|
440
|
+
voided_at: A.nullish(),
|
|
441
|
+
uncollectible_at: A.nullish(),
|
|
442
|
+
created_at: A
|
|
450
443
|
}), U = e.object({
|
|
451
444
|
code: e.string(),
|
|
452
445
|
message: e.string(),
|
|
453
446
|
owned_by: e.string().nullish(),
|
|
454
|
-
hint: e.string().nullish()
|
|
447
|
+
hint: e.string().nullish(),
|
|
448
|
+
missing: e.array(e.string()).optional()
|
|
455
449
|
}), W = e.object({
|
|
456
450
|
price_id: e.string(),
|
|
457
451
|
product_id: e.string(),
|
|
458
452
|
description: e.string(),
|
|
459
453
|
quantity: e.number().nullish(),
|
|
460
|
-
unit_amount:
|
|
461
|
-
amount:
|
|
454
|
+
unit_amount: k,
|
|
455
|
+
amount: k,
|
|
462
456
|
ownership: e.string(),
|
|
463
457
|
billing_interval_hours: e.number().nullish(),
|
|
464
458
|
access_duration_hours: e.number().nullish(),
|
|
465
459
|
refusal: U.nullish()
|
|
466
460
|
}), G = e.object({
|
|
467
461
|
currency: e.string(),
|
|
468
|
-
total:
|
|
462
|
+
total: k,
|
|
469
463
|
lines: e.array(W),
|
|
470
464
|
payment_options: H.shape.payment_options,
|
|
471
|
-
last_changed_at:
|
|
472
|
-
expires_at:
|
|
473
|
-
})
|
|
465
|
+
last_changed_at: A.nullish(),
|
|
466
|
+
expires_at: A.nullish()
|
|
467
|
+
});
|
|
468
|
+
e.object({
|
|
474
469
|
id: e.string(),
|
|
475
470
|
key: e.string(),
|
|
476
471
|
revision: e.number().int().nonnegative().optional(),
|
|
477
472
|
display_name: e.string(),
|
|
478
473
|
description: e.string(),
|
|
479
474
|
entitlements: e.array(e.string()),
|
|
475
|
+
required_entitlements: e.array(e.string()).optional(),
|
|
480
476
|
credit_grant: e.object({
|
|
481
477
|
currency: e.string(),
|
|
482
|
-
amount:
|
|
478
|
+
amount: k.nullish(),
|
|
483
479
|
from_payment: e.boolean().optional(),
|
|
484
480
|
expires_after_days: e.number().int().positive().nullish()
|
|
485
481
|
}).nullish(),
|
|
@@ -487,20 +483,21 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
487
483
|
tier_rank: e.number(),
|
|
488
484
|
archived: e.boolean(),
|
|
489
485
|
prices: e.array(N).nullish().transform((e) => e ?? []),
|
|
490
|
-
created_at:
|
|
491
|
-
updated_at:
|
|
492
|
-
})
|
|
486
|
+
created_at: A,
|
|
487
|
+
updated_at: A
|
|
488
|
+
});
|
|
489
|
+
var K = e.object({
|
|
493
490
|
id: e.string(),
|
|
494
491
|
kind: e.string(),
|
|
495
492
|
status: e.string(),
|
|
496
|
-
amount:
|
|
497
|
-
amount_refunded:
|
|
493
|
+
amount: k,
|
|
494
|
+
amount_refunded: k.nullish(),
|
|
498
495
|
currency: e.string(),
|
|
499
496
|
subscription_id: e.string().nullish(),
|
|
500
497
|
order_id: e.string().nullish(),
|
|
501
498
|
channel: e.string().nullish(),
|
|
502
499
|
rail: e.string().nullish(),
|
|
503
|
-
created_at:
|
|
500
|
+
created_at: A,
|
|
504
501
|
card: F.nullish(),
|
|
505
502
|
failure: e.object({
|
|
506
503
|
reason: e.string(),
|
|
@@ -511,61 +508,61 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
511
508
|
customer_id: e.string(),
|
|
512
509
|
entitlement: e.string(),
|
|
513
510
|
quantity: e.number().int().nullable()
|
|
514
|
-
}),
|
|
511
|
+
}), se = e.object({
|
|
515
512
|
currency: e.string(),
|
|
516
513
|
billing_mode: e.string(),
|
|
517
|
-
balance_amount:
|
|
518
|
-
held_amount:
|
|
519
|
-
accrued_amount:
|
|
520
|
-
available_amount:
|
|
521
|
-
owed_amount:
|
|
522
|
-
accrual_rate_per_hour:
|
|
514
|
+
balance_amount: k,
|
|
515
|
+
held_amount: k,
|
|
516
|
+
accrued_amount: k,
|
|
517
|
+
available_amount: k,
|
|
518
|
+
owed_amount: k,
|
|
519
|
+
accrual_rate_per_hour: k,
|
|
523
520
|
as_of: e.string(),
|
|
524
521
|
depletes_at: e.string().nullable()
|
|
525
522
|
}), J = e.object({
|
|
526
523
|
currency: e.string(),
|
|
527
|
-
amount:
|
|
524
|
+
amount: k,
|
|
528
525
|
runway_hours: e.number().int(),
|
|
529
526
|
source: e.enum([
|
|
530
527
|
"customer",
|
|
531
528
|
"merchant",
|
|
532
529
|
"default"
|
|
533
530
|
])
|
|
534
|
-
}),
|
|
531
|
+
}), ce = e.object({
|
|
535
532
|
id: e.string(),
|
|
536
|
-
balances: e.array(
|
|
533
|
+
balances: e.array(se),
|
|
537
534
|
default_payment_methods: e.array(e.object({
|
|
538
535
|
currency: e.string(),
|
|
539
536
|
payment_method_id: e.string()
|
|
540
537
|
})),
|
|
541
538
|
low_balance_lines: e.array(J)
|
|
542
|
-
}),
|
|
539
|
+
}), le = e.object({
|
|
543
540
|
key: e.string(),
|
|
544
541
|
cell: e.string().nullish(),
|
|
545
542
|
event_count: e.number(),
|
|
546
|
-
amount:
|
|
543
|
+
amount: k,
|
|
547
544
|
quantity: e.number().nullish(),
|
|
548
545
|
dimensions: e.record(e.string(), e.number()).nullish()
|
|
549
|
-
}),
|
|
546
|
+
}), ue = e.object({
|
|
550
547
|
customer_id: e.string(),
|
|
551
548
|
currency: e.string(),
|
|
552
|
-
from:
|
|
553
|
-
to:
|
|
549
|
+
from: A,
|
|
550
|
+
to: A,
|
|
554
551
|
group_by: e.string(),
|
|
555
|
-
rows: e.array(
|
|
552
|
+
rows: e.array(le),
|
|
556
553
|
next_cursor: e.string().nullish().transform((e) => e ?? null)
|
|
557
|
-
}),
|
|
554
|
+
}), de = e.object({
|
|
558
555
|
code: e.string(),
|
|
559
556
|
decimals: e.number(),
|
|
560
557
|
minor_decimals: e.number().nullish()
|
|
561
|
-
}),
|
|
558
|
+
}), fe = e.object({
|
|
562
559
|
price_id: e.string(),
|
|
563
560
|
quantity: e.number().nullish(),
|
|
564
561
|
rail: e.string().nullish(),
|
|
565
562
|
currency: e.string(),
|
|
566
|
-
amount_due_now:
|
|
567
|
-
next_charge_amount:
|
|
568
|
-
next_charge_date:
|
|
563
|
+
amount_due_now: k,
|
|
564
|
+
next_charge_amount: k,
|
|
565
|
+
next_charge_date: A.nullish(),
|
|
569
566
|
effective: e.string(),
|
|
570
567
|
is_estimate: e.boolean().nullish(),
|
|
571
568
|
message: e.string().nullish()
|
|
@@ -576,14 +573,14 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
576
573
|
quantity: e.number().nullish(),
|
|
577
574
|
subscription_id: e.string().nullish(),
|
|
578
575
|
next_action: I.nullish(),
|
|
579
|
-
delayed_start:
|
|
576
|
+
delayed_start: A.nullish(),
|
|
580
577
|
currency: e.string().nullish(),
|
|
581
|
-
amount_due_now:
|
|
582
|
-
next_charge_amount:
|
|
583
|
-
next_charge_date:
|
|
578
|
+
amount_due_now: k.nullish(),
|
|
579
|
+
next_charge_amount: k.nullish(),
|
|
580
|
+
next_charge_date: A.nullish(),
|
|
584
581
|
message: e.string().nullish()
|
|
585
|
-
}),
|
|
586
|
-
psps: e.array(
|
|
582
|
+
}), pe = e.object({
|
|
583
|
+
psps: e.array(d).nullish().transform((e) => e ?? []),
|
|
587
584
|
solana: e.object({
|
|
588
585
|
network: e.string(),
|
|
589
586
|
chain: e.string(),
|
|
@@ -597,51 +594,51 @@ var O = e.string().refine(S, "amount must be an int64 string"), k = e.string(),
|
|
|
597
594
|
recurring_eligible: e.boolean().nullish()
|
|
598
595
|
})).nullish().transform((e) => e ?? [])
|
|
599
596
|
}).nullish()
|
|
600
|
-
}),
|
|
597
|
+
}), me = e.object({
|
|
601
598
|
provider: e.string(),
|
|
602
599
|
site_key: e.string(),
|
|
603
600
|
script_url: e.string(),
|
|
604
601
|
action: e.string(),
|
|
605
602
|
token_header: e.string()
|
|
606
|
-
}),
|
|
603
|
+
}), he = e.object({
|
|
607
604
|
display_name: e.string(),
|
|
608
605
|
logo_url: e.string().nullish(),
|
|
609
606
|
support_url: e.string().nullish(),
|
|
610
607
|
embed_origins: e.array(e.string()).nullish().transform((e) => e ?? [])
|
|
611
|
-
}),
|
|
608
|
+
}), ge = e.object({
|
|
612
609
|
capabilities: e.object({
|
|
613
610
|
route_groups: e.record(e.string(), e.boolean()),
|
|
614
611
|
features: e.record(e.string(), e.boolean())
|
|
615
612
|
}),
|
|
616
|
-
currencies: e.array(
|
|
617
|
-
captcha:
|
|
613
|
+
currencies: e.array(de).nullish().transform((e) => e ?? []),
|
|
614
|
+
captcha: me.nullish(),
|
|
618
615
|
network: e.object({
|
|
619
616
|
issuer: e.string(),
|
|
620
617
|
client_id: e.string()
|
|
621
618
|
}).nullish()
|
|
622
|
-
}),
|
|
623
|
-
payment:
|
|
624
|
-
merchant:
|
|
625
|
-
}),
|
|
619
|
+
}), _e = e.object({
|
|
620
|
+
payment: pe,
|
|
621
|
+
merchant: he
|
|
622
|
+
}), ve = e.object({
|
|
626
623
|
id: e.string(),
|
|
627
624
|
nonce: e.string(),
|
|
628
|
-
expires_at:
|
|
629
|
-
}),
|
|
625
|
+
expires_at: A
|
|
626
|
+
}), ye = e.object({
|
|
630
627
|
id: e.string(),
|
|
631
628
|
merchant_id: e.string(),
|
|
632
629
|
customer_id: e.string(),
|
|
633
630
|
account_id: e.string(),
|
|
634
631
|
method: e.string(),
|
|
635
632
|
status: e.string(),
|
|
636
|
-
linked_at:
|
|
637
|
-
revoked_at:
|
|
633
|
+
linked_at: A,
|
|
634
|
+
revoked_at: A.nullish(),
|
|
638
635
|
revoked_by: e.string().nullish()
|
|
639
636
|
}), X = class extends Error {
|
|
640
637
|
constructor(e = "The wallet request was declined.") {
|
|
641
638
|
super(e), this.name = "WalletRejectedError";
|
|
642
639
|
}
|
|
643
|
-
},
|
|
644
|
-
async function
|
|
640
|
+
}, be = 4, xe = 500, Se = (e) => e?.type === "solana_sign_transactions" && !!e.transactions?.length;
|
|
641
|
+
async function Ce(e, t) {
|
|
645
642
|
let n = "";
|
|
646
643
|
for (let r of e.transactions ?? []) {
|
|
647
644
|
try {
|
|
@@ -654,9 +651,9 @@ async function Te(e, t) {
|
|
|
654
651
|
if (!n) throw i("wallet_no_signature", "The wallet returned no signature.");
|
|
655
652
|
return n;
|
|
656
653
|
}
|
|
657
|
-
var
|
|
658
|
-
function
|
|
659
|
-
let t =
|
|
654
|
+
var we = 2e3, Z = 300;
|
|
655
|
+
function Te(e) {
|
|
656
|
+
let t = Ee(e.headers.get("Retry-After"));
|
|
660
657
|
switch (e.status) {
|
|
661
658
|
case 429: return t;
|
|
662
659
|
case 503: return t ?? Z;
|
|
@@ -665,7 +662,7 @@ function De(e) {
|
|
|
665
662
|
default: return null;
|
|
666
663
|
}
|
|
667
664
|
}
|
|
668
|
-
function
|
|
665
|
+
function Ee(e) {
|
|
669
666
|
if (!e) return null;
|
|
670
667
|
if (/^\d+$/.test(e.trim())) return Number(e.trim()) * 1e3;
|
|
671
668
|
let t = Date.parse(e);
|
|
@@ -682,8 +679,8 @@ function Q(e, t) {
|
|
|
682
679
|
t?.addEventListener("abort", a, { once: !0 });
|
|
683
680
|
});
|
|
684
681
|
}
|
|
685
|
-
function
|
|
686
|
-
let t = (e.baseUrl ?? "/billing/v1").replace(/\/+$/, ""), r = e.fetch ?? ((e, t) => fetch(e, t)), o =
|
|
682
|
+
function De(e = {}) {
|
|
683
|
+
let t = (e.baseUrl ?? "/billing/v1").replace(/\/+$/, ""), r = e.fetch ?? ((e, t) => fetch(e, t)), o = Oe({
|
|
687
684
|
...s,
|
|
688
685
|
...e.currencies
|
|
689
686
|
});
|
|
@@ -694,7 +691,7 @@ function ke(e = {}) {
|
|
|
694
691
|
let i = r.toString();
|
|
695
692
|
return `${t}${e}${i ? `?${i}` : ""}`;
|
|
696
693
|
}
|
|
697
|
-
async function
|
|
694
|
+
async function u(t, n = {}) {
|
|
698
695
|
let i = new Headers({
|
|
699
696
|
Accept: "application/json",
|
|
700
697
|
...n.headers
|
|
@@ -704,36 +701,36 @@ function ke(e = {}) {
|
|
|
704
701
|
o && i.set("Authorization", `Bearer ${o}`);
|
|
705
702
|
let s = e.language?.();
|
|
706
703
|
s && i.set("Accept-Language", s);
|
|
707
|
-
let
|
|
708
|
-
method:
|
|
704
|
+
let u = n.method ?? "GET", d = {
|
|
705
|
+
method: u,
|
|
709
706
|
headers: i,
|
|
710
707
|
body: n.body === void 0 ? void 0 : JSON.stringify(n.body),
|
|
711
708
|
signal: n.signal
|
|
712
|
-
},
|
|
709
|
+
}, f = +(u === "GET"), p = 0, m = !1;
|
|
713
710
|
for (let s = 0;; s++) {
|
|
714
|
-
let
|
|
711
|
+
let u;
|
|
715
712
|
try {
|
|
716
|
-
|
|
713
|
+
u = await r(c(t, n.query), d);
|
|
717
714
|
} catch (e) {
|
|
718
715
|
let t = Z;
|
|
719
|
-
if (s >=
|
|
720
|
-
|
|
716
|
+
if (s >= f || n.signal?.aborted || !(e instanceof TypeError) || p + t > 2e3) throw e;
|
|
717
|
+
p += await Q(t, n.signal);
|
|
721
718
|
continue;
|
|
722
719
|
}
|
|
723
|
-
if (
|
|
724
|
-
if (
|
|
725
|
-
let t = await a(
|
|
720
|
+
if (u.ok) return u;
|
|
721
|
+
if (u.status === 401 && o && !m && l(e.getToken)) {
|
|
722
|
+
let t = await a(u);
|
|
726
723
|
if (t.code !== "credential_expired") throw t;
|
|
727
|
-
e.getToken.invalidate(o), o = await e.getToken(), i.set("Authorization", `Bearer ${o}`),
|
|
724
|
+
e.getToken.invalidate(o), o = await e.getToken(), i.set("Authorization", `Bearer ${o}`), m = !0, s--;
|
|
728
725
|
continue;
|
|
729
726
|
}
|
|
730
|
-
let
|
|
731
|
-
if (s >=
|
|
732
|
-
await
|
|
727
|
+
let h = Te(u);
|
|
728
|
+
if (s >= f || h === null || p + h > 2e3) throw await a(u);
|
|
729
|
+
await u.body?.cancel().catch(() => void 0), p += await Q(h, n.signal);
|
|
733
730
|
}
|
|
734
731
|
}
|
|
735
|
-
async function
|
|
736
|
-
let r = await
|
|
732
|
+
async function d(e, t, n) {
|
|
733
|
+
let r = await u(t, n), a;
|
|
737
734
|
try {
|
|
738
735
|
a = await r.json();
|
|
739
736
|
} catch {
|
|
@@ -743,13 +740,13 @@ function ke(e = {}) {
|
|
|
743
740
|
if (!o.success) throw i("invalid_response", `${t}: ${o.error.issues[0]?.path.join(".")} ${o.error.issues[0]?.message}`);
|
|
744
741
|
return o.data;
|
|
745
742
|
}
|
|
746
|
-
let
|
|
743
|
+
let f = (e) => encodeURIComponent(e), p = j(L), m = j(z), h = j(K), g = j(H), _ = j(q), v = (e, t) => ({
|
|
747
744
|
limit: e.limit ?? t,
|
|
748
745
|
cursor: e.cursor ?? void 0
|
|
749
|
-
})
|
|
746
|
+
});
|
|
750
747
|
async function y(e, t) {
|
|
751
748
|
try {
|
|
752
|
-
return { order: await
|
|
749
|
+
return { order: await d(H, e, t) };
|
|
753
750
|
} catch (e) {
|
|
754
751
|
if (n(e) && e.status === 402 && e.order) {
|
|
755
752
|
let t = H.safeParse(e.order);
|
|
@@ -764,19 +761,19 @@ function ke(e = {}) {
|
|
|
764
761
|
return {
|
|
765
762
|
baseUrl: t,
|
|
766
763
|
listSubscriptions(e = {}) {
|
|
767
|
-
return
|
|
764
|
+
return d(p, "/me/subscriptions", {
|
|
768
765
|
query: {
|
|
769
766
|
status: e.status ?? "all",
|
|
770
|
-
...
|
|
767
|
+
...v(e, 100)
|
|
771
768
|
},
|
|
772
769
|
signal: e.signal
|
|
773
770
|
});
|
|
774
771
|
},
|
|
775
772
|
getSubscription(e, t) {
|
|
776
|
-
return
|
|
773
|
+
return d(L, `/me/subscriptions/${f(e)}`, { signal: t });
|
|
777
774
|
},
|
|
778
775
|
cancelSubscription(e, t) {
|
|
779
|
-
return
|
|
776
|
+
return d(L, `/me/subscriptions/${f(e)}/cancel`, {
|
|
780
777
|
method: "POST",
|
|
781
778
|
body: {
|
|
782
779
|
reason: t.reason.trim(),
|
|
@@ -785,19 +782,19 @@ function ke(e = {}) {
|
|
|
785
782
|
});
|
|
786
783
|
},
|
|
787
784
|
resumeSubscription(e) {
|
|
788
|
-
return
|
|
785
|
+
return d(L, `/me/subscriptions/${f(e)}/resume`, {
|
|
789
786
|
method: "POST",
|
|
790
787
|
body: {}
|
|
791
788
|
});
|
|
792
789
|
},
|
|
793
790
|
setSubscriptionPaymentMethod(e, t) {
|
|
794
|
-
return
|
|
791
|
+
return d(L, `/me/subscriptions/${f(e)}/payment-method`, {
|
|
795
792
|
method: "PUT",
|
|
796
793
|
body: { payment_method_id: t }
|
|
797
794
|
});
|
|
798
795
|
},
|
|
799
796
|
previewSubscriptionChange(e, t, n) {
|
|
800
|
-
return
|
|
797
|
+
return d(fe, `/me/subscriptions/${f(e)}/change/preview`, {
|
|
801
798
|
method: "POST",
|
|
802
799
|
body: {
|
|
803
800
|
price_id: t.priceId,
|
|
@@ -807,13 +804,13 @@ function ke(e = {}) {
|
|
|
807
804
|
});
|
|
808
805
|
},
|
|
809
806
|
confirmSubscriptionChange(e) {
|
|
810
|
-
return
|
|
807
|
+
return d(Y, `/me/subscriptions/${f(e)}/confirm`, {
|
|
811
808
|
method: "POST",
|
|
812
809
|
body: {}
|
|
813
810
|
});
|
|
814
811
|
},
|
|
815
812
|
changeSubscription(e, t) {
|
|
816
|
-
return
|
|
813
|
+
return d(Y, `/me/subscriptions/${f(e)}/change`, {
|
|
817
814
|
method: "POST",
|
|
818
815
|
body: {
|
|
819
816
|
price_id: t.priceId,
|
|
@@ -824,29 +821,29 @@ function ke(e = {}) {
|
|
|
824
821
|
});
|
|
825
822
|
},
|
|
826
823
|
listPaymentMethods(e = {}) {
|
|
827
|
-
return
|
|
828
|
-
query:
|
|
824
|
+
return d(m, "/me/payment-methods", {
|
|
825
|
+
query: v(e, 100),
|
|
829
826
|
signal: e.signal
|
|
830
827
|
});
|
|
831
828
|
},
|
|
832
829
|
addPaymentMethod(e, t) {
|
|
833
|
-
return
|
|
830
|
+
return d(z, "/me/payment-methods", {
|
|
834
831
|
method: "POST",
|
|
835
832
|
body: e,
|
|
836
833
|
headers: t ? { "Idempotency-Key": t } : void 0
|
|
837
834
|
});
|
|
838
835
|
},
|
|
839
836
|
getCart(e) {
|
|
840
|
-
return
|
|
837
|
+
return d(G, "/me/cart", { signal: e });
|
|
841
838
|
},
|
|
842
839
|
setCartLine(e, t = {}) {
|
|
843
|
-
return
|
|
840
|
+
return d(G, `/me/cart/lines/${f(e)}`, {
|
|
844
841
|
method: "PUT",
|
|
845
842
|
body: t
|
|
846
843
|
});
|
|
847
844
|
},
|
|
848
845
|
async clearCart() {
|
|
849
|
-
await
|
|
846
|
+
await u("/me/cart", { method: "DELETE" });
|
|
850
847
|
},
|
|
851
848
|
createOrder(e) {
|
|
852
849
|
return y("/me/orders", {
|
|
@@ -855,18 +852,19 @@ function ke(e = {}) {
|
|
|
855
852
|
...e.cart ? { cart: !0 } : { lines: e.lines ?? [] },
|
|
856
853
|
...e.expectedTotal === void 0 ? {} : { expected_total: e.expectedTotal },
|
|
857
854
|
...e.payment === void 0 ? {} : { payment: e.payment },
|
|
858
|
-
...e.reusable === void 0 ? {} : { reusable: e.reusable }
|
|
855
|
+
...e.reusable === void 0 ? {} : { reusable: e.reusable },
|
|
856
|
+
...e.checkout === void 0 ? {} : { checkout: e.checkout }
|
|
859
857
|
},
|
|
860
|
-
headers: { "Idempotency-Key": e.idempotencyKey }
|
|
858
|
+
headers: e.idempotencyKey ? { "Idempotency-Key": e.idempotencyKey } : void 0
|
|
861
859
|
});
|
|
862
860
|
},
|
|
863
861
|
listOrders(e = {}) {
|
|
864
|
-
return e.ids?.length ?
|
|
862
|
+
return e.ids?.length ? d(g, "/me/orders", {
|
|
865
863
|
query: { ids: e.ids.join(",") },
|
|
866
864
|
signal: e.signal
|
|
867
|
-
}) :
|
|
865
|
+
}) : d(g, "/me/orders", {
|
|
868
866
|
query: {
|
|
869
|
-
...
|
|
867
|
+
...v(e, 20),
|
|
870
868
|
origin: e.origin,
|
|
871
869
|
status: e.status,
|
|
872
870
|
subscription_id: e.subscriptionId,
|
|
@@ -876,10 +874,10 @@ function ke(e = {}) {
|
|
|
876
874
|
});
|
|
877
875
|
},
|
|
878
876
|
getOrder(e, t) {
|
|
879
|
-
return
|
|
877
|
+
return d(H, `/me/orders/${f(e)}`, { signal: t });
|
|
880
878
|
},
|
|
881
879
|
payOrder(e, t) {
|
|
882
|
-
return y(`/me/orders/${
|
|
880
|
+
return y(`/me/orders/${f(e)}/pay`, {
|
|
883
881
|
method: "POST",
|
|
884
882
|
body: {
|
|
885
883
|
payment: t.payment,
|
|
@@ -890,39 +888,39 @@ function ke(e = {}) {
|
|
|
890
888
|
});
|
|
891
889
|
},
|
|
892
890
|
confirmOrder(e, t) {
|
|
893
|
-
return y(`/me/orders/${
|
|
891
|
+
return y(`/me/orders/${f(e)}/confirm`, {
|
|
894
892
|
method: "POST",
|
|
895
893
|
body: t?.signature ? { signature: t.signature } : {}
|
|
896
894
|
});
|
|
897
895
|
},
|
|
898
896
|
confirmPaymentMethod(e, t) {
|
|
899
|
-
return
|
|
897
|
+
return d(z, `/me/payment-methods/${f(e)}/confirm`, {
|
|
900
898
|
method: "POST",
|
|
901
899
|
body: t ? { capture: t } : {}
|
|
902
900
|
});
|
|
903
901
|
},
|
|
904
902
|
async removePaymentMethod(e) {
|
|
905
|
-
return (await
|
|
903
|
+
return (await u(`/me/payment-methods/${f(e)}`, { method: "DELETE" })).status === 202 ? "pending" : "removed";
|
|
906
904
|
},
|
|
907
905
|
async setDefaultPaymentMethod(e) {
|
|
908
|
-
await
|
|
906
|
+
await u(`/me/default-payment-methods/${f(e.currency.toUpperCase())}`, {
|
|
909
907
|
method: "PUT",
|
|
910
908
|
body: { payment_method_id: e.paymentMethodId }
|
|
911
909
|
});
|
|
912
910
|
},
|
|
913
911
|
listPayments(e = {}) {
|
|
914
|
-
return
|
|
912
|
+
return d(h, "/me/payments", {
|
|
915
913
|
query: {
|
|
916
|
-
...
|
|
914
|
+
...v(e, 20),
|
|
917
915
|
rail: e.rail
|
|
918
916
|
},
|
|
919
917
|
signal: e.signal
|
|
920
918
|
});
|
|
921
919
|
},
|
|
922
920
|
getEntitlements(e = {}) {
|
|
923
|
-
return
|
|
921
|
+
return d(_, "/me/entitlements", {
|
|
924
922
|
query: {
|
|
925
|
-
...
|
|
923
|
+
...v(e, 500),
|
|
926
924
|
at: e.at,
|
|
927
925
|
prefix: e.prefix
|
|
928
926
|
},
|
|
@@ -930,10 +928,10 @@ function ke(e = {}) {
|
|
|
930
928
|
});
|
|
931
929
|
},
|
|
932
930
|
getAccount(e) {
|
|
933
|
-
return
|
|
931
|
+
return d(ce, "/me", { signal: e });
|
|
934
932
|
},
|
|
935
933
|
setLowBalanceLine(e) {
|
|
936
|
-
return
|
|
934
|
+
return d(J, `/me/low-balance-lines/${f(e.currency.toUpperCase())}`, {
|
|
937
935
|
method: "PUT",
|
|
938
936
|
body: {
|
|
939
937
|
amount: e.amount,
|
|
@@ -942,7 +940,7 @@ function ke(e = {}) {
|
|
|
942
940
|
});
|
|
943
941
|
},
|
|
944
942
|
getUsage(e) {
|
|
945
|
-
return
|
|
943
|
+
return d(ue, "/me/usage", {
|
|
946
944
|
query: {
|
|
947
945
|
currency: e.currency,
|
|
948
946
|
group_by: e.groupBy,
|
|
@@ -954,27 +952,14 @@ function ke(e = {}) {
|
|
|
954
952
|
signal: e.signal
|
|
955
953
|
});
|
|
956
954
|
},
|
|
957
|
-
async listProducts(e) {
|
|
958
|
-
return e.keys.length === 0 ? {
|
|
959
|
-
data: [],
|
|
960
|
-
next_cursor: null
|
|
961
|
-
} : u(v, "/products", {
|
|
962
|
-
query: {
|
|
963
|
-
merchant: e.merchant,
|
|
964
|
-
keys: e.keys
|
|
965
|
-
},
|
|
966
|
-
signal: e.signal,
|
|
967
|
-
public: !0
|
|
968
|
-
});
|
|
969
|
-
},
|
|
970
955
|
createNetworkLinkChallenge() {
|
|
971
|
-
return
|
|
956
|
+
return d(ve, "/me/network-link/challenges", {
|
|
972
957
|
method: "POST",
|
|
973
958
|
body: {}
|
|
974
959
|
});
|
|
975
960
|
},
|
|
976
961
|
createNetworkLink(e) {
|
|
977
|
-
return
|
|
962
|
+
return d(ye, "/me/network-link", {
|
|
978
963
|
method: "POST",
|
|
979
964
|
body: {
|
|
980
965
|
challenge_id: e.challengeId,
|
|
@@ -983,22 +968,22 @@ function ke(e = {}) {
|
|
|
983
968
|
});
|
|
984
969
|
},
|
|
985
970
|
getConfig(e) {
|
|
986
|
-
return
|
|
971
|
+
return d(ge, "/config", {
|
|
987
972
|
signal: e,
|
|
988
973
|
public: !0
|
|
989
974
|
});
|
|
990
975
|
},
|
|
991
976
|
getCustomerConfig(e) {
|
|
992
|
-
return
|
|
977
|
+
return d(_e, "/me/config", { signal: e });
|
|
993
978
|
},
|
|
994
979
|
currencies: o
|
|
995
980
|
};
|
|
996
981
|
}
|
|
997
|
-
function
|
|
982
|
+
function Oe(e) {
|
|
998
983
|
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e.toUpperCase(), t]));
|
|
999
984
|
}
|
|
1000
985
|
var $ = (e) => e instanceof X || e instanceof Error && e.name === "WalletRejectedError" || e instanceof t && e.code === "wallet_rejected";
|
|
1001
986
|
//#endregion
|
|
1002
|
-
export { t as C, a as D, i as E, o as O, c as S, r as T,
|
|
987
|
+
export { t as C, a as D, i as E, o as O, c as S, r as T, m as _, De as a, d as b, Ce as c, ne as d, re as f, v as g, y as h, X as i, T as l, C as m, be as n, Se as o, O as p, we as r, $ as s, xe as t, te as u, _ as v, n as w, u as x, f as y };
|
|
1003
988
|
|
|
1004
|
-
//# sourceMappingURL=client-
|
|
989
|
+
//# sourceMappingURL=client-rFrCMrkn.js.map
|