@readyfor/api-client-base 0.206.0-pr972.a0fd0c3 → 0.207.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/apiClientConfigStore.d.mts +0 -2
- package/dist/apiClientConfigStore.d.ts +0 -2
- package/dist/{chunk-HBZIYFCM.mjs → chunk-GD73YYGW.mjs} +3 -9
- package/dist/fetcher.js +3 -9
- package/dist/fetcher.mjs +1 -1
- package/dist/index.js +3 -9
- package/dist/index.mjs +1 -1
- package/dist/react/ApiClientConfigProvider.d.mts +0 -1
- package/dist/react/ApiClientConfigProvider.d.ts +0 -1
- package/dist/react/index.d.mts +0 -1
- package/dist/react/index.d.ts +0 -1
- package/dist/react/useApiClientConfig.d.mts +0 -1
- package/dist/react/useApiClientConfig.d.ts +0 -1
- package/package.json +8 -7
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Store } from './store.mjs';
|
|
2
|
-
import { HTTPError } from './apiError.mjs';
|
|
3
2
|
|
|
4
3
|
type DeserializeResponseConfig = {
|
|
5
4
|
forceDeserializeResponse?: false;
|
|
@@ -13,7 +12,6 @@ type LoggingConfig = {
|
|
|
13
12
|
type RequestConfig = {
|
|
14
13
|
hostName?: string | ((path: string) => string);
|
|
15
14
|
defaultRequestInit?: RequestInit;
|
|
16
|
-
onError?: (error: HTTPError) => void;
|
|
17
15
|
};
|
|
18
16
|
type Config = RequestConfig & DeserializeResponseConfig & LoggingConfig;
|
|
19
17
|
declare const store: Store<Config>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Store } from './store.js';
|
|
2
|
-
import { HTTPError } from './apiError.js';
|
|
3
2
|
|
|
4
3
|
type DeserializeResponseConfig = {
|
|
5
4
|
forceDeserializeResponse?: false;
|
|
@@ -13,7 +12,6 @@ type LoggingConfig = {
|
|
|
13
12
|
type RequestConfig = {
|
|
14
13
|
hostName?: string | ((path: string) => string);
|
|
15
14
|
defaultRequestInit?: RequestInit;
|
|
16
|
-
onError?: (error: HTTPError) => void;
|
|
17
15
|
};
|
|
18
16
|
type Config = RequestConfig & DeserializeResponseConfig & LoggingConfig;
|
|
19
17
|
declare const store: Store<Config>;
|
|
@@ -39,9 +39,7 @@ var createTextFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
39
39
|
const body = await res.text();
|
|
40
40
|
if (res.ok) return body;
|
|
41
41
|
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
42
|
-
|
|
43
|
-
store.getState().onError?.(error);
|
|
44
|
-
throw error;
|
|
42
|
+
throw new HTTPError(code, body);
|
|
45
43
|
});
|
|
46
44
|
var createBlobFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(input, {
|
|
47
45
|
...defaultRequestInit,
|
|
@@ -56,9 +54,7 @@ var createBlobFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
56
54
|
const body = await res.blob();
|
|
57
55
|
if (res.ok) return { body, headers: res.headers };
|
|
58
56
|
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
59
|
-
|
|
60
|
-
store.getState().onError?.(error);
|
|
61
|
-
throw error;
|
|
57
|
+
throw new HTTPError(code, body);
|
|
62
58
|
});
|
|
63
59
|
var createVoidFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(input, {
|
|
64
60
|
...defaultRequestInit,
|
|
@@ -73,9 +69,7 @@ var createVoidFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
73
69
|
if (res.ok) return;
|
|
74
70
|
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
75
71
|
const body = await res.text();
|
|
76
|
-
|
|
77
|
-
store.getState().onError?.(error);
|
|
78
|
-
throw error;
|
|
72
|
+
throw new HTTPError(code, body);
|
|
79
73
|
});
|
|
80
74
|
|
|
81
75
|
export {
|
package/dist/fetcher.js
CHANGED
|
@@ -130,9 +130,7 @@ var createTextFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
130
130
|
const body = await res.text();
|
|
131
131
|
if (res.ok) return body;
|
|
132
132
|
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
133
|
-
|
|
134
|
-
store.getState().onError?.(error);
|
|
135
|
-
throw error;
|
|
133
|
+
throw new HTTPError(code, body);
|
|
136
134
|
});
|
|
137
135
|
var createBlobFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(input, {
|
|
138
136
|
...defaultRequestInit,
|
|
@@ -147,9 +145,7 @@ var createBlobFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
147
145
|
const body = await res.blob();
|
|
148
146
|
if (res.ok) return { body, headers: res.headers };
|
|
149
147
|
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
150
|
-
|
|
151
|
-
store.getState().onError?.(error);
|
|
152
|
-
throw error;
|
|
148
|
+
throw new HTTPError(code, body);
|
|
153
149
|
});
|
|
154
150
|
var createVoidFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(input, {
|
|
155
151
|
...defaultRequestInit,
|
|
@@ -164,9 +160,7 @@ var createVoidFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
164
160
|
if (res.ok) return;
|
|
165
161
|
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
166
162
|
const body = await res.text();
|
|
167
|
-
|
|
168
|
-
store.getState().onError?.(error);
|
|
169
|
-
throw error;
|
|
163
|
+
throw new HTTPError(code, body);
|
|
170
164
|
});
|
|
171
165
|
// Annotate the CommonJS export names for ESM import in node:
|
|
172
166
|
0 && (module.exports = {
|
package/dist/fetcher.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -167,9 +167,7 @@ var createTextFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
167
167
|
const body = await res.text();
|
|
168
168
|
if (res.ok) return body;
|
|
169
169
|
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
170
|
-
|
|
171
|
-
store.getState().onError?.(error);
|
|
172
|
-
throw error;
|
|
170
|
+
throw new HTTPError(code, body);
|
|
173
171
|
});
|
|
174
172
|
var createBlobFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(input, {
|
|
175
173
|
...defaultRequestInit,
|
|
@@ -184,9 +182,7 @@ var createBlobFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
184
182
|
const body = await res.blob();
|
|
185
183
|
if (res.ok) return { body, headers: res.headers };
|
|
186
184
|
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
187
|
-
|
|
188
|
-
store.getState().onError?.(error);
|
|
189
|
-
throw error;
|
|
185
|
+
throw new HTTPError(code, body);
|
|
190
186
|
});
|
|
191
187
|
var createVoidFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(input, {
|
|
192
188
|
...defaultRequestInit,
|
|
@@ -201,9 +197,7 @@ var createVoidFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
201
197
|
if (res.ok) return;
|
|
202
198
|
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
203
199
|
const body = await res.text();
|
|
204
|
-
|
|
205
|
-
store.getState().onError?.(error);
|
|
206
|
-
throw error;
|
|
200
|
+
throw new HTTPError(code, body);
|
|
207
201
|
});
|
|
208
202
|
|
|
209
203
|
// src/requestUrl.ts
|
package/dist/index.mjs
CHANGED
package/dist/react/index.d.mts
CHANGED
package/dist/react/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@readyfor/api-client-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.207.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -20,14 +20,17 @@
|
|
|
20
20
|
"require": "./dist/react/index.js"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsup"
|
|
25
|
+
},
|
|
23
26
|
"dependencies": {
|
|
24
27
|
"qs": "6.14.0",
|
|
25
28
|
"zod": "^3.24.1"
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
31
|
"@types/qs": "6.9.18",
|
|
29
|
-
"@types/react": "
|
|
30
|
-
"@types/use-sync-external-store": "
|
|
32
|
+
"@types/react": "19.1.0",
|
|
33
|
+
"@types/use-sync-external-store": "1.5.0",
|
|
31
34
|
"react": "catalog:react19",
|
|
32
35
|
"swr": "catalog:",
|
|
33
36
|
"use-sync-external-store": "catalog:use-sync-external-store"
|
|
@@ -60,7 +63,5 @@
|
|
|
60
63
|
"src"
|
|
61
64
|
]
|
|
62
65
|
},
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}
|
|
66
|
+
"gitHead": "5ddb40dfc66fe9b3369a2635bba21f87a163d3df"
|
|
67
|
+
}
|