@betterstore/sdk 0.3.23 → 0.3.24
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 +6 -0
- package/dist/index.js +2 -4
- package/dist/index.mjs +2 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -312,7 +312,6 @@ var Customer = class {
|
|
|
312
312
|
var customer_default = Customer;
|
|
313
313
|
|
|
314
314
|
// src/helpers/index.ts
|
|
315
|
-
var import_axios5 = __toESM(require("axios"));
|
|
316
315
|
var Helpers = class {
|
|
317
316
|
constructor(proxy) {
|
|
318
317
|
this.proxy = proxy;
|
|
@@ -397,9 +396,8 @@ var Helpers = class {
|
|
|
397
396
|
}
|
|
398
397
|
getExchangeRate(baseCurrency, targetCurrency) {
|
|
399
398
|
return __async(this, null, function* () {
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
);
|
|
399
|
+
const apiClient = createApiClient("", this.proxy);
|
|
400
|
+
const { data } = yield apiClient.get(`/helpers/rates/${baseCurrency}`);
|
|
403
401
|
const rate = data.rates[targetCurrency];
|
|
404
402
|
if (!rate) {
|
|
405
403
|
throw new Error("Could not get exchange rate for target currency");
|
package/dist/index.mjs
CHANGED
|
@@ -273,7 +273,6 @@ var Customer = class {
|
|
|
273
273
|
var customer_default = Customer;
|
|
274
274
|
|
|
275
275
|
// src/helpers/index.ts
|
|
276
|
-
import axios2 from "axios";
|
|
277
276
|
var Helpers = class {
|
|
278
277
|
constructor(proxy) {
|
|
279
278
|
this.proxy = proxy;
|
|
@@ -358,9 +357,8 @@ var Helpers = class {
|
|
|
358
357
|
}
|
|
359
358
|
getExchangeRate(baseCurrency, targetCurrency) {
|
|
360
359
|
return __async(this, null, function* () {
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
);
|
|
360
|
+
const apiClient = createApiClient("", this.proxy);
|
|
361
|
+
const { data } = yield apiClient.get(`/helpers/rates/${baseCurrency}`);
|
|
364
362
|
const rate = data.rates[targetCurrency];
|
|
365
363
|
if (!rate) {
|
|
366
364
|
throw new Error("Could not get exchange rate for target currency");
|