@scalar/api-client 0.11.2 → 0.11.4
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 +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @scalar/api-client
|
|
2
2
|
|
|
3
|
+
## 0.11.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 037029cc: fix: parse axios error responses as blobs
|
|
8
|
+
|
|
9
|
+
## 0.11.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [d4fff0de]
|
|
14
|
+
- @scalar/use-codemirror@0.8.3
|
|
15
|
+
|
|
3
16
|
## 0.11.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendRequest.d.ts","sourceRoot":"","sources":["../../src/helpers/sendRequest.ts"],"names":[],"mappings":"AAIA,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":"AAIA,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,CA8K/B"}
|
package/dist/index.js
CHANGED
|
@@ -27435,15 +27435,18 @@ async function sendRequest(request, proxyUrl) {
|
|
|
27435
27435
|
data,
|
|
27436
27436
|
error: false
|
|
27437
27437
|
};
|
|
27438
|
-
}).catch((error) => {
|
|
27438
|
+
}).catch(async (error) => {
|
|
27439
27439
|
const { response: errorResponse } = error;
|
|
27440
|
+
const blob = errorResponse.data;
|
|
27441
|
+
const data = blob.type === "application/json" ? await blob.text() : blob;
|
|
27440
27442
|
return {
|
|
27441
27443
|
headers: {
|
|
27442
|
-
"content-type": "application/json; charset=utf-8"
|
|
27444
|
+
"content-type": "application/json; charset=utf-8",
|
|
27445
|
+
...errorResponse["headers"]
|
|
27443
27446
|
},
|
|
27444
27447
|
...errorResponse,
|
|
27445
27448
|
statusCode: (errorResponse == null ? void 0 : errorResponse.status) ?? 0,
|
|
27446
|
-
data: JSON.stringify(
|
|
27449
|
+
data: data ?? JSON.stringify({ error: error.code })
|
|
27447
27450
|
};
|
|
27448
27451
|
});
|
|
27449
27452
|
return {
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"rest",
|
|
14
14
|
"testing"
|
|
15
15
|
],
|
|
16
|
-
"version": "0.11.
|
|
16
|
+
"version": "0.11.4",
|
|
17
17
|
"engines": {
|
|
18
18
|
"node": ">=18"
|
|
19
19
|
},
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"pretty-ms": "^8.0.0",
|
|
45
45
|
"vue": "^3.3.0",
|
|
46
46
|
"@scalar/themes": "0.5.4",
|
|
47
|
-
"@scalar/use-codemirror": "0.8.
|
|
47
|
+
"@scalar/use-codemirror": "0.8.3",
|
|
48
48
|
"@scalar/use-keyboard-event": "0.5.8",
|
|
49
49
|
"@scalar/use-modal": "0.2.3"
|
|
50
50
|
},
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"vite-plugin-css-injected-by-js": "^3.3.0",
|
|
58
58
|
"vitest": "^0.34.4",
|
|
59
59
|
"vue-tsc": "^1.8.19",
|
|
60
|
-
"@scalar/api-client-proxy": "0.5.
|
|
60
|
+
"@scalar/api-client-proxy": "0.5.16",
|
|
61
61
|
"@scalar/echo-server": "0.5.8"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|