@vertz/fetch 0.2.20 → 0.2.22
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.js +8 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -47,7 +47,8 @@ class FetchClient {
|
|
|
47
47
|
method,
|
|
48
48
|
headers,
|
|
49
49
|
body: serializedBody,
|
|
50
|
-
signal
|
|
50
|
+
signal,
|
|
51
|
+
credentials: this.config.credentials
|
|
51
52
|
});
|
|
52
53
|
if (options?.body !== undefined) {
|
|
53
54
|
request.headers.set("Content-Type", "application/json");
|
|
@@ -58,7 +59,8 @@ class FetchClient {
|
|
|
58
59
|
method: authedRequest.method,
|
|
59
60
|
headers: authedRequest.headers,
|
|
60
61
|
body: serializedBody,
|
|
61
|
-
signal: authedRequest.signal
|
|
62
|
+
signal: authedRequest.signal,
|
|
63
|
+
credentials: this.config.credentials
|
|
62
64
|
}) : await this.fetchFn(authedRequest);
|
|
63
65
|
if (!response.ok) {
|
|
64
66
|
const body = await this.safeParseJSON(response);
|
|
@@ -145,7 +147,8 @@ class FetchClient {
|
|
|
145
147
|
method: options.method,
|
|
146
148
|
headers,
|
|
147
149
|
body: serializedBody,
|
|
148
|
-
signal
|
|
150
|
+
signal,
|
|
151
|
+
credentials: this.config.credentials
|
|
149
152
|
});
|
|
150
153
|
const authedRequest = await this.applyAuth(request);
|
|
151
154
|
await this.config.hooks?.beforeRequest?.(authedRequest);
|
|
@@ -153,7 +156,8 @@ class FetchClient {
|
|
|
153
156
|
method: authedRequest.method,
|
|
154
157
|
headers: authedRequest.headers,
|
|
155
158
|
body: serializedBody,
|
|
156
|
-
signal: authedRequest.signal
|
|
159
|
+
signal: authedRequest.signal,
|
|
160
|
+
credentials: this.config.credentials
|
|
157
161
|
}) : await this.fetchFn(authedRequest);
|
|
158
162
|
if (!response.ok) {
|
|
159
163
|
const body = await this.safeParseJSON(response);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertz/fetch",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Type-safe HTTP client for Vertz",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@vertz/errors": "^0.2.
|
|
28
|
+
"@vertz/errors": "^0.2.21"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "bunup",
|