@leg3ndy/otto-bridge 0.1.2 → 0.1.3
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/README.md +1 -1
- package/dist/http.js +9 -1
- package/dist/types.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/http.js
CHANGED
|
@@ -4,7 +4,15 @@ function normalizeBaseUrl(apiBaseUrl) {
|
|
|
4
4
|
return raw.replace(/\/+$/, "");
|
|
5
5
|
}
|
|
6
6
|
async function requestJson(apiBaseUrl, pathname, init) {
|
|
7
|
-
const
|
|
7
|
+
const requestUrl = `${normalizeBaseUrl(apiBaseUrl)}${pathname}`;
|
|
8
|
+
let response;
|
|
9
|
+
try {
|
|
10
|
+
response = await fetch(requestUrl, init);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
14
|
+
throw new Error(`Request failed for ${requestUrl}: ${detail}`);
|
|
15
|
+
}
|
|
8
16
|
const payload = (await response.json().catch(() => null));
|
|
9
17
|
if (!response.ok) {
|
|
10
18
|
const detail = payload && typeof payload === "object" && payload !== null
|
package/dist/types.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const BRIDGE_CONFIG_VERSION = 1;
|
|
2
|
-
export const BRIDGE_VERSION = "0.1.
|
|
2
|
+
export const BRIDGE_VERSION = "0.1.3";
|
|
3
3
|
export const BRIDGE_PACKAGE_NAME = "@leg3ndy/otto-bridge";
|
|
4
4
|
export const DEFAULT_API_BASE_URL = "http://localhost:8000";
|
|
5
5
|
export const DEFAULT_POLL_INTERVAL_MS = 3000;
|