@readyfor/api-client-base 0.206.0-pr972.a0fd0c3 → 0.206.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.
@@ -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
- const error = new HTTPError(code, body);
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
- const error = new HTTPError(code, body);
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
- const error = new HTTPError(code, body);
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
- const error = new HTTPError(code, body);
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
- const error = new HTTPError(code, body);
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
- const error = new HTTPError(code, body);
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
@@ -3,7 +3,7 @@ import {
3
3
  createJsonFetcher,
4
4
  createTextFetcher,
5
5
  createVoidFetcher
6
- } from "./chunk-HBZIYFCM.mjs";
6
+ } from "./chunk-GD73YYGW.mjs";
7
7
  import "./chunk-PY35XWDS.mjs";
8
8
  import "./chunk-JCZWXJBU.mjs";
9
9
  import "./chunk-472P3XVV.mjs";
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
- const error = new HTTPError(code, body);
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
- const error = new HTTPError(code, body);
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
- const error = new HTTPError(code, body);
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
@@ -3,7 +3,7 @@ import {
3
3
  createJsonFetcher,
4
4
  createTextFetcher,
5
5
  createVoidFetcher
6
- } from "./chunk-HBZIYFCM.mjs";
6
+ } from "./chunk-GD73YYGW.mjs";
7
7
  import {
8
8
  HTTPError,
9
9
  errorStatusCode,
@@ -2,7 +2,6 @@ import { FC, ReactNode } from 'react';
2
2
  import { Config } from '../apiClientConfigStore.mjs';
3
3
  import { Store } from '../store.mjs';
4
4
  import { SWRConfiguration } from 'swr';
5
- import '../apiError.mjs';
6
5
 
7
6
  type Configuration = Config & {
8
7
  swr?: SWRConfiguration;
@@ -2,7 +2,6 @@ import { FC, ReactNode } from 'react';
2
2
  import { Config } from '../apiClientConfigStore.js';
3
3
  import { Store } from '../store.js';
4
4
  import { SWRConfiguration } from 'swr';
5
- import '../apiError.js';
6
5
 
7
6
  type Configuration = Config & {
8
7
  swr?: SWRConfiguration;
@@ -4,5 +4,4 @@ export { useApiClientConfig, useApiClientConfigWithSelector, useRequestInit } fr
4
4
  import 'react';
5
5
  import '../apiClientConfigStore.mjs';
6
6
  import '../store.mjs';
7
- import '../apiError.mjs';
8
7
  import 'swr';
@@ -4,5 +4,4 @@ export { useApiClientConfig, useApiClientConfigWithSelector, useRequestInit } fr
4
4
  import 'react';
5
5
  import '../apiClientConfigStore.js';
6
6
  import '../store.js';
7
- import '../apiError.js';
8
7
  import 'swr';
@@ -1,6 +1,5 @@
1
1
  import { Config } from '../apiClientConfigStore.mjs';
2
2
  import '../store.mjs';
3
- import '../apiError.mjs';
4
3
 
5
4
  declare const useApiClientConfig: () => Config;
6
5
  declare const useApiClientConfigWithSelector: <T>(selector: (state: Config) => T) => T;
@@ -1,6 +1,5 @@
1
1
  import { Config } from '../apiClientConfigStore.js';
2
2
  import '../store.js';
3
- import '../apiError.js';
4
3
 
5
4
  declare const useApiClientConfig: () => Config;
6
5
  declare const useApiClientConfigWithSelector: <T>(selector: (state: Config) => T) => T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readyfor/api-client-base",
3
- "version": "0.206.0-pr972.a0fd0c3",
3
+ "version": "0.206.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": "catalog:react19",
30
- "@types/use-sync-external-store": "catalog: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
- "scripts": {
64
- "build": "tsup"
65
- }
66
- }
66
+ "gitHead": "968c043144f91e8082b84a77011b734509dcec9e"
67
+ }