@scalar/api-client 0.7.34 → 0.7.36
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 +13 -0
- package/dist/helpers/sendRequest.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 0.7.36
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bc23e62: fix: don’t trim / from the path, if it’s the only character
|
|
8
|
+
|
|
9
|
+
## 0.7.35
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fdaabfe: fix: surface proxy internal service errors
|
|
14
|
+
- fdaabfe: fix: catch axios errors and show them in the response
|
|
15
|
+
|
|
3
16
|
## 0.7.34
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/sendRequest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,aAAa,EACb,iBAAiB,EAClB,MAAM,UAAU,CAAA;AAUjB;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/sendRequest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAGV,aAAa,EACb,iBAAiB,EAClB,MAAM,UAAU,CAAA;AAUjB;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAsI/B"}
|
package/dist/index.js
CHANGED
|
@@ -25588,7 +25588,7 @@ const normalizePath = (path) => {
|
|
|
25588
25588
|
return "";
|
|
25589
25589
|
}
|
|
25590
25590
|
let normalizedPath = path.trim();
|
|
25591
|
-
if (normalizedPath.startsWith("/")) {
|
|
25591
|
+
if (normalizedPath.length > 1 && normalizedPath.startsWith("/")) {
|
|
25592
25592
|
normalizedPath = normalizedPath.slice(1);
|
|
25593
25593
|
}
|
|
25594
25594
|
return normalizedPath;
|
|
@@ -26535,9 +26535,12 @@ async function sendRequest(request, proxyUrl) {
|
|
|
26535
26535
|
}).catch((error) => {
|
|
26536
26536
|
const { response: errorResponse } = error;
|
|
26537
26537
|
return {
|
|
26538
|
+
headers: {
|
|
26539
|
+
"content-type": "application/json"
|
|
26540
|
+
},
|
|
26538
26541
|
...errorResponse,
|
|
26539
|
-
statusCode: errorResponse.status,
|
|
26540
|
-
data: JSON.stringify(errorResponse.data)
|
|
26542
|
+
statusCode: (errorResponse == null ? void 0 : errorResponse.status) ?? 0,
|
|
26543
|
+
data: JSON.stringify((errorResponse == null ? void 0 : errorResponse.data) ?? { error: error.code })
|
|
26541
26544
|
};
|
|
26542
26545
|
});
|
|
26543
26546
|
return {
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"rest",
|
|
14
14
|
"testing"
|
|
15
15
|
],
|
|
16
|
-
"version": "0.7.
|
|
16
|
+
"version": "0.7.36",
|
|
17
17
|
"engines": {
|
|
18
18
|
"node": ">=20"
|
|
19
19
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"vite-plugin-css-injected-by-js": "^3.3.0",
|
|
59
59
|
"vitest": "^0.34.4",
|
|
60
60
|
"vue-tsc": "^1.8.19",
|
|
61
|
-
"@scalar/api-client-proxy": "0.5.
|
|
61
|
+
"@scalar/api-client-proxy": "0.5.11",
|
|
62
62
|
"@scalar/echo-server": "0.5.5"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|