@techstuff-dev/foundation-api-utils 1.25.0 → 1.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/lib/hooks/index.d.ts +20 -12
- package/dist/@types/lib/services/content/content.interfaces.d.ts +2 -2
- package/dist/@types/lib/services/payment/index.d.ts +563 -39
- package/dist/@types/lib/store/index.d.ts +50 -30
- package/dist/index.esm.js +20 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -755,13 +755,13 @@ var formatLongform = function (data) {
|
|
|
755
755
|
updated: (_h = (_g = item === null || item === void 0 ? void 0 : item._source) === null || _g === void 0 ? void 0 : _g.updated) === null || _h === void 0 ? void 0 : _h[0],
|
|
756
756
|
title: (_k = (_j = item === null || item === void 0 ? void 0 : item._source) === null || _j === void 0 ? void 0 : _j.display_title) === null || _k === void 0 ? void 0 : _k[0],
|
|
757
757
|
synopsis: (_m = (_l = item === null || item === void 0 ? void 0 : item._source) === null || _l === void 0 ? void 0 : _l.synopsis) === null || _m === void 0 ? void 0 : _m[0],
|
|
758
|
-
|
|
759
|
-
|
|
758
|
+
imagePoster: (_p = (_o = item === null || item === void 0 ? void 0 : item._source) === null || _o === void 0 ? void 0 : _o.image_style_poster) === null || _p === void 0 ? void 0 : _p[0],
|
|
759
|
+
imageThumb: (_r = (_q = item === null || item === void 0 ? void 0 : item._source) === null || _q === void 0 ? void 0 : _q.image_style_thumb) === null || _r === void 0 ? void 0 : _r[0],
|
|
760
760
|
duration: (_t = (_s = item === null || item === void 0 ? void 0 : item._source) === null || _s === void 0 ? void 0 : _s.duration) === null || _t === void 0 ? void 0 : _t[0],
|
|
761
761
|
releaseDate: (_v = (_u = item === null || item === void 0 ? void 0 : item._source) === null || _u === void 0 ? void 0 : _u.release_date) === null || _v === void 0 ? void 0 : _v[0],
|
|
762
762
|
video: (_x = (_w = item === null || item === void 0 ? void 0 : item._source) === null || _w === void 0 ? void 0 : _w.video) === null || _x === void 0 ? void 0 : _x[0],
|
|
763
|
-
|
|
764
|
-
|
|
763
|
+
imageUrl: (_z = (_y = item === null || item === void 0 ? void 0 : item._source) === null || _y === void 0 ? void 0 : _y.image_url) === null || _z === void 0 ? void 0 : _z[0],
|
|
764
|
+
episodeNumber: (_1 = (_0 = item === null || item === void 0 ? void 0 : item._source) === null || _0 === void 0 ? void 0 : _0.episode_number) === null || _1 === void 0 ? void 0 : _1[0],
|
|
765
765
|
};
|
|
766
766
|
});
|
|
767
767
|
};
|
|
@@ -1211,7 +1211,7 @@ var paymentApi = react.createApi({
|
|
|
1211
1211
|
}); },
|
|
1212
1212
|
credentials: 'include',
|
|
1213
1213
|
}),
|
|
1214
|
-
tagTypes: ['UserSubscription', 'Plans'],
|
|
1214
|
+
tagTypes: ['UserSubscription', 'Plans', 'TaxRates', 'PromoCodes'],
|
|
1215
1215
|
// keepUnusedDataFor: 300,
|
|
1216
1216
|
endpoints: function (builder) { return ({
|
|
1217
1217
|
/**
|
|
@@ -1233,10 +1233,24 @@ var paymentApi = react.createApi({
|
|
|
1233
1233
|
query: function () { return '/payment/plans'; },
|
|
1234
1234
|
providesTags: ['Plans'],
|
|
1235
1235
|
}),
|
|
1236
|
+
getTaxRates: builder.query({
|
|
1237
|
+
query: function () { return ({
|
|
1238
|
+
url: '/payment/tax-rates',
|
|
1239
|
+
method: 'GET',
|
|
1240
|
+
}); },
|
|
1241
|
+
providesTags: ['TaxRates'],
|
|
1242
|
+
}),
|
|
1243
|
+
checkPromoCode: builder.query({
|
|
1244
|
+
query: function (promoCode) { return ({
|
|
1245
|
+
url: "/payment/coupon/".concat(promoCode),
|
|
1246
|
+
method: 'GET',
|
|
1247
|
+
}); },
|
|
1248
|
+
providesTags: ['PromoCodes'],
|
|
1249
|
+
}),
|
|
1236
1250
|
}); },
|
|
1237
1251
|
});
|
|
1238
1252
|
// Export hooks for usage in functional components.
|
|
1239
|
-
paymentApi.useCheckUserSubscriptionQuery; paymentApi.useLazyCheckUserSubscriptionQuery; paymentApi.useGetPaymentPlansQuery; paymentApi.useLazyGetPaymentPlansQuery;
|
|
1253
|
+
paymentApi.useCheckUserSubscriptionQuery; paymentApi.useLazyCheckUserSubscriptionQuery; paymentApi.useGetPaymentPlansQuery; paymentApi.useLazyGetPaymentPlansQuery; paymentApi.useGetTaxRatesQuery; paymentApi.useLazyGetTaxRatesQuery; paymentApi.useCheckPromoCodeQuery; paymentApi.useLazyCheckPromoCodeQuery;
|
|
1240
1254
|
|
|
1241
1255
|
function applyCoupon(coupon, netTotal) {
|
|
1242
1256
|
var discountedAmount = netTotal * (Number(coupon.discount) / 100);
|