@readyfor/api-client-base 0.276.0-pr1079.eb4a7f2 → 0.276.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/{chunk-3CIIRYKM.mjs → chunk-4HID36YE.mjs} +0 -17
- package/dist/fetcher.d.ts +1 -6
- package/dist/fetcher.js +0 -18
- package/dist/fetcher.mjs +1 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -3
- package/package.json +1 -1
|
@@ -76,22 +76,6 @@ var createBlobFetcher = (customRequestInit = {}) => (input, requestInit = {}) =>
|
|
|
76
76
|
store.getState().onError?.(error);
|
|
77
77
|
throw error;
|
|
78
78
|
});
|
|
79
|
-
var createFileOrBlobFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(
|
|
80
|
-
input,
|
|
81
|
-
mergeRequestInit(
|
|
82
|
-
defaultRequestInit,
|
|
83
|
-
mergeRequestInit(customRequestInit, requestInit)
|
|
84
|
-
)
|
|
85
|
-
).then(async (res) => {
|
|
86
|
-
const body = await res.blob();
|
|
87
|
-
if (res.ok) return { body, headers: res.headers };
|
|
88
|
-
const code = Object.values(errorStatusCode).includes(res.status) ? res.status : 999;
|
|
89
|
-
const error = new HTTPError(code, body);
|
|
90
|
-
throw error;
|
|
91
|
-
}).catch((error) => {
|
|
92
|
-
store.getState().onError?.(error);
|
|
93
|
-
throw error;
|
|
94
|
-
});
|
|
95
79
|
var createVoidFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(
|
|
96
80
|
input,
|
|
97
81
|
mergeRequestInit(
|
|
@@ -113,6 +97,5 @@ export {
|
|
|
113
97
|
createJsonFetcher,
|
|
114
98
|
createTextFetcher,
|
|
115
99
|
createBlobFetcher,
|
|
116
|
-
createFileOrBlobFetcher,
|
|
117
100
|
createVoidFetcher
|
|
118
101
|
};
|
package/dist/fetcher.d.ts
CHANGED
|
@@ -7,11 +7,6 @@ type BlobFetcherResponse = {
|
|
|
7
7
|
headers: Headers;
|
|
8
8
|
};
|
|
9
9
|
declare const createBlobFetcher: (customRequestInit?: RequestInit) => (input: RequestInfo, requestInit?: RequestInit) => Promise<BlobFetcherResponse>;
|
|
10
|
-
type FileOrBlobFetcherResponse = {
|
|
11
|
-
body: File | Blob;
|
|
12
|
-
headers: Headers;
|
|
13
|
-
};
|
|
14
|
-
declare const createFileOrBlobFetcher: (customRequestInit?: RequestInit) => (input: RequestInfo, requestInit?: RequestInit) => Promise<FileOrBlobFetcherResponse>;
|
|
15
10
|
declare const createVoidFetcher: (customRequestInit?: RequestInit) => (input: RequestInfo, requestInit?: RequestInit) => Promise<void>;
|
|
16
11
|
|
|
17
|
-
export { type BlobFetcherResponse,
|
|
12
|
+
export { type BlobFetcherResponse, createBlobFetcher, createJsonFetcher, createTextFetcher, createVoidFetcher };
|
package/dist/fetcher.js
CHANGED
|
@@ -19,7 +19,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var fetcher_exports = {};
|
|
20
20
|
__export(fetcher_exports, {
|
|
21
21
|
createBlobFetcher: () => createBlobFetcher,
|
|
22
|
-
createFileOrBlobFetcher: () => createFileOrBlobFetcher,
|
|
23
22
|
createJsonFetcher: () => createJsonFetcher,
|
|
24
23
|
createTextFetcher: () => createTextFetcher,
|
|
25
24
|
createVoidFetcher: () => createVoidFetcher
|
|
@@ -94,22 +93,6 @@ const createBlobFetcher = (customRequestInit = {}) => (input, requestInit = {})
|
|
|
94
93
|
import_apiClientConfigStore.store.getState().onError?.(error);
|
|
95
94
|
throw error;
|
|
96
95
|
});
|
|
97
|
-
const createFileOrBlobFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(
|
|
98
|
-
input,
|
|
99
|
-
(0, import_requestInit.mergeRequestInit)(
|
|
100
|
-
defaultRequestInit,
|
|
101
|
-
(0, import_requestInit.mergeRequestInit)(customRequestInit, requestInit)
|
|
102
|
-
)
|
|
103
|
-
).then(async (res) => {
|
|
104
|
-
const body = await res.blob();
|
|
105
|
-
if (res.ok) return { body, headers: res.headers };
|
|
106
|
-
const code = Object.values(import_apiError.errorStatusCode).includes(res.status) ? res.status : 999;
|
|
107
|
-
const error = new import_apiError.HTTPError(code, body);
|
|
108
|
-
throw error;
|
|
109
|
-
}).catch((error) => {
|
|
110
|
-
import_apiClientConfigStore.store.getState().onError?.(error);
|
|
111
|
-
throw error;
|
|
112
|
-
});
|
|
113
96
|
const createVoidFetcher = (customRequestInit = {}) => (input, requestInit = {}) => fetch(
|
|
114
97
|
input,
|
|
115
98
|
(0, import_requestInit.mergeRequestInit)(
|
|
@@ -129,7 +112,6 @@ const createVoidFetcher = (customRequestInit = {}) => (input, requestInit = {})
|
|
|
129
112
|
// Annotate the CommonJS export names for ESM import in node:
|
|
130
113
|
0 && (module.exports = {
|
|
131
114
|
createBlobFetcher,
|
|
132
|
-
createFileOrBlobFetcher,
|
|
133
115
|
createJsonFetcher,
|
|
134
116
|
createTextFetcher,
|
|
135
117
|
createVoidFetcher
|
package/dist/fetcher.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createBlobFetcher,
|
|
3
|
-
createFileOrBlobFetcher,
|
|
4
3
|
createJsonFetcher,
|
|
5
4
|
createTextFetcher,
|
|
6
5
|
createVoidFetcher
|
|
7
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4HID36YE.mjs";
|
|
8
7
|
import "./chunk-PY35XWDS.mjs";
|
|
9
8
|
import "./chunk-F77IR5JD.mjs";
|
|
10
9
|
import "./chunk-2ORFVC4H.mjs";
|
|
@@ -13,7 +12,6 @@ import "./chunk-3SEO7S3Q.mjs";
|
|
|
13
12
|
import "./chunk-JCZWXJBU.mjs";
|
|
14
13
|
export {
|
|
15
14
|
createBlobFetcher,
|
|
16
|
-
createFileOrBlobFetcher,
|
|
17
15
|
createJsonFetcher,
|
|
18
16
|
createTextFetcher,
|
|
19
17
|
createVoidFetcher
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Config, RequestConfig, buildRequestInitWithDefaultConfig, setApiClientConfig, store } from './apiClientConfigStore.js';
|
|
2
2
|
export { ErrorStatusCode, HTTPError, errorStatusCode, errorTitle, getErrorStatus } from './apiError.js';
|
|
3
|
-
export { BlobFetcherResponse,
|
|
3
|
+
export { BlobFetcherResponse, createBlobFetcher, createJsonFetcher, createTextFetcher, createVoidFetcher } from './fetcher.js';
|
|
4
4
|
export { __internal__requestUrl } from './requestUrl.js';
|
|
5
5
|
export { Store, createStore } from './store.js';
|
|
6
6
|
export { ForceDig, QueryPropsFor } from './types.js';
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createBlobFetcher,
|
|
3
|
-
createFileOrBlobFetcher,
|
|
4
3
|
createJsonFetcher,
|
|
5
4
|
createTextFetcher,
|
|
6
5
|
createVoidFetcher
|
|
7
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4HID36YE.mjs";
|
|
8
7
|
import {
|
|
9
8
|
HTTPError,
|
|
10
9
|
errorStatusCode,
|
|
@@ -36,7 +35,6 @@ export {
|
|
|
36
35
|
__internal__requestUrl,
|
|
37
36
|
buildRequestInitWithDefaultConfig,
|
|
38
37
|
createBlobFetcher,
|
|
39
|
-
createFileOrBlobFetcher,
|
|
40
38
|
createJsonFetcher,
|
|
41
39
|
createStore,
|
|
42
40
|
createTextFetcher,
|