@msafe/sui3-sdk 0.0.42-pre-ec49ba8.0 → 0.0.42-pre-e22a1ab.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/index.cjs +10 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/backend/BackendImpl.ts +13 -14
package/dist/index.cjs
CHANGED
|
@@ -10443,22 +10443,21 @@ var BackendImpl = class _BackendImpl {
|
|
|
10443
10443
|
}
|
|
10444
10444
|
async get(url, config) {
|
|
10445
10445
|
const fullUrl = this.getFullUrl(url);
|
|
10446
|
-
|
|
10447
|
-
|
|
10448
|
-
|
|
10449
|
-
throw
|
|
10446
|
+
const response = await import_axios2.default.get(fullUrl, config);
|
|
10447
|
+
if (import_axios2.default.isAxiosError(response)) {
|
|
10448
|
+
const error = BackendError2.fromError(response);
|
|
10449
|
+
throw error ?? new Error(response.statusText);
|
|
10450
10450
|
}
|
|
10451
|
+
return response;
|
|
10451
10452
|
}
|
|
10452
10453
|
async post(url, data, config) {
|
|
10453
10454
|
const fullUrl = this.getFullUrl(url);
|
|
10454
|
-
|
|
10455
|
-
|
|
10456
|
-
|
|
10457
|
-
|
|
10458
|
-
} catch (e) {
|
|
10459
|
-
console.log("\u{1F680} ~ BackendImpl ~ e:", e);
|
|
10460
|
-
throw BackendError2.fromError(e) ?? e;
|
|
10455
|
+
const response = await import_axios2.default.post(fullUrl, data, config);
|
|
10456
|
+
if (import_axios2.default.isAxiosError(response)) {
|
|
10457
|
+
const error = BackendError2.fromError(response);
|
|
10458
|
+
throw error ?? new Error(response.statusText);
|
|
10461
10459
|
}
|
|
10460
|
+
return response;
|
|
10462
10461
|
}
|
|
10463
10462
|
getFullUrl(url) {
|
|
10464
10463
|
return url.startsWith(this.apiURL) ? url : `${this.apiURL}${addPrefix(url, "/")}`;
|