@rebilly/instruments 16.140.0 → 16.142.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 +2 -2
- package/dist/index.js +26 -9
- package/dist/index.min.js +9 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
## [16.
|
|
1
|
+
## [16.142.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v16.141.0...instruments/core-v16.142.0) (2026-07-01)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
* **
|
|
6
|
+
* **rebilly-js-sdk:** Add module-scoped type exports ([#23085](https://github.com/Rebilly/rebilly/issues/23085)) ([dec9dee](https://github.com/Rebilly/rebilly/commit/dec9dee6263cc3882a194ea96b2235eb04a32ac5))
|
package/dist/index.js
CHANGED
|
@@ -5779,7 +5779,7 @@ function O$1({ options: e2 }) {
|
|
|
5779
5779
|
}
|
|
5780
5780
|
function o2() {
|
|
5781
5781
|
const g = {
|
|
5782
|
-
"REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((m2) => m2).join("/")}@
|
|
5782
|
+
"REB-API-CONSUMER": `${["Rebilly", e2.appName, "js-sdk"].filter((m2) => m2).join("/")}@dec9dee`
|
|
5783
5783
|
};
|
|
5784
5784
|
return e2.apiKey && (g["REB-APIKEY"] = e2.apiKey), g;
|
|
5785
5785
|
}
|
|
@@ -13183,20 +13183,31 @@ async function fetchInvoiceAndProducts({
|
|
|
13183
13183
|
data
|
|
13184
13184
|
}) {
|
|
13185
13185
|
return Endpoint(async () => {
|
|
13186
|
-
var _a;
|
|
13186
|
+
var _a, _b;
|
|
13187
13187
|
validateStorefront(state.storefront);
|
|
13188
13188
|
validateOptions$1(state.options);
|
|
13189
13189
|
state.storefront.setSessionToken(state.options.jwt);
|
|
13190
13190
|
const { fields } = await state.storefront.invoices.get({
|
|
13191
13191
|
...data,
|
|
13192
|
-
expand: "items.*.product"
|
|
13192
|
+
expand: "items.*.product,items.*.plan"
|
|
13193
|
+
});
|
|
13194
|
+
const products = (_a = fields.items) == null ? void 0 : _a.filter((item) => {
|
|
13195
|
+
var _a2;
|
|
13196
|
+
return (_a2 = item._embedded) == null ? void 0 : _a2.product;
|
|
13197
|
+
}).map((item) => {
|
|
13198
|
+
var _a2;
|
|
13199
|
+
return new ProductModel((_a2 = item._embedded) == null ? void 0 : _a2.product);
|
|
13193
13200
|
});
|
|
13194
|
-
const
|
|
13201
|
+
const plans = (_b = fields.items) == null ? void 0 : _b.filter((item) => {
|
|
13202
|
+
var _a2;
|
|
13203
|
+
return (_a2 = item._embedded) == null ? void 0 : _a2.plan;
|
|
13204
|
+
}).map((item) => {
|
|
13195
13205
|
var _a2;
|
|
13196
|
-
return new
|
|
13206
|
+
return new PlanModel((_a2 = item._embedded) == null ? void 0 : _a2.plan).toPayload();
|
|
13197
13207
|
});
|
|
13198
13208
|
return {
|
|
13199
13209
|
products,
|
|
13210
|
+
plans,
|
|
13200
13211
|
invoice: new InvoiceModel(fields)
|
|
13201
13212
|
};
|
|
13202
13213
|
});
|
|
@@ -13577,7 +13588,8 @@ async function fetchData({
|
|
|
13577
13588
|
fetchAccountAndWebsite: fetchAccountAndWebsite$1 = fetchAccountAndWebsite,
|
|
13578
13589
|
fetchInstruments = fetchPaymentInstrument,
|
|
13579
13590
|
fetchDepositRequest: fetchDepositRequest$1 = fetchDepositRequest,
|
|
13580
|
-
fetchPayoutRequest: fetchPayoutRequest$1 = fetchPayoutRequest
|
|
13591
|
+
fetchPayoutRequest: fetchPayoutRequest$1 = fetchPayoutRequest,
|
|
13592
|
+
fetchPlansFromAddonsBumpOffer: fetchPlansFromAddonsBumpOffer$1 = fetchPlansFromAddonsBumpOffer
|
|
13581
13593
|
} = {}) {
|
|
13582
13594
|
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t2, _u;
|
|
13583
13595
|
try {
|
|
@@ -13618,15 +13630,17 @@ async function fetchData({
|
|
|
13618
13630
|
});
|
|
13619
13631
|
}
|
|
13620
13632
|
let productsPromise;
|
|
13633
|
+
let invoicePlans;
|
|
13621
13634
|
const invoiceId = ((_e2 = state.options) == null ? void 0 : _e2.invoiceId) || ((_g = (_f = state.data) == null ? void 0 : _f.transaction) == null ? void 0 : _g.invoiceId);
|
|
13622
13635
|
if (invoiceId) {
|
|
13623
|
-
const { invoice, products: products2 } = await fetchInvoiceAndProducts$1({
|
|
13636
|
+
const { invoice, products: products2, plans: plans2 } = await fetchInvoiceAndProducts$1({
|
|
13624
13637
|
data: {
|
|
13625
13638
|
id: invoiceId
|
|
13626
13639
|
}
|
|
13627
13640
|
});
|
|
13628
13641
|
productsPromise = Promise.resolve(products2);
|
|
13629
13642
|
state.data.invoice = invoice;
|
|
13643
|
+
invoicePlans = plans2;
|
|
13630
13644
|
}
|
|
13631
13645
|
const isManageInstruments = [
|
|
13632
13646
|
(_i = (_h = state.options) == null ? void 0 : _h.paymentInstruments) == null ? void 0 : _i.allowDeactivate,
|
|
@@ -13670,7 +13684,7 @@ async function fetchData({
|
|
|
13670
13684
|
resolve([]);
|
|
13671
13685
|
});
|
|
13672
13686
|
if (((_s = state.options) == null ? void 0 : _s.addons) || ((_t2 = state.options) == null ? void 0 : _t2.bumpOffer)) {
|
|
13673
|
-
plansPromise = fetchPlansFromAddonsBumpOffer();
|
|
13687
|
+
plansPromise = fetchPlansFromAddonsBumpOffer$1();
|
|
13674
13688
|
}
|
|
13675
13689
|
let [
|
|
13676
13690
|
readyToPayout,
|
|
@@ -13701,7 +13715,10 @@ async function fetchData({
|
|
|
13701
13715
|
readyToPay,
|
|
13702
13716
|
previewPurchase,
|
|
13703
13717
|
products,
|
|
13704
|
-
plans
|
|
13718
|
+
plans: [
|
|
13719
|
+
...Array.isArray(invoicePlans) ? invoicePlans : [],
|
|
13720
|
+
...Array.isArray(plans) ? plans : []
|
|
13721
|
+
],
|
|
13705
13722
|
availableInstruments,
|
|
13706
13723
|
isManageInstruments
|
|
13707
13724
|
});
|