@calimero-network/mero-js 19.17.0 → 19.18.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/events/sse.d.ts +2 -0
- package/dist/events/sse.js +5 -2
- package/dist/http-client/http-factory.d.ts +1 -0
- package/dist/http-client/http-factory.js +3 -3
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +8 -5
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +2 -2
- package/dist/mero-js.d.ts +2 -0
- package/dist/mero-js.js +2 -0
- package/package.json +1 -1
package/dist/mero-js.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface MeroJsConfig {
|
|
|
21
21
|
timeoutMs?: number;
|
|
22
22
|
/** Request credentials mode for fetch (omit, same-origin, include) */
|
|
23
23
|
requestCredentials?: RequestCredentials;
|
|
24
|
+
/** Custom fetch for every HTTP request (`auth`, `admin`, `rpc`, `events`). Defaults to global `fetch`. */
|
|
25
|
+
fetch?: typeof fetch;
|
|
24
26
|
/** Optional token store for persistence */
|
|
25
27
|
tokenStore?: TokenStore;
|
|
26
28
|
/**
|
package/dist/mero-js.js
CHANGED
|
@@ -77,6 +77,7 @@ export class MeroJs {
|
|
|
77
77
|
const getProof = resolveProofSigner(this.config.requestProof);
|
|
78
78
|
this.httpClient = createBrowserHttpClient({
|
|
79
79
|
baseUrl: this.config.baseUrl,
|
|
80
|
+
fetch: this.config.fetch,
|
|
80
81
|
getProof,
|
|
81
82
|
getAuthToken: async () => {
|
|
82
83
|
const token = await this.getValidToken();
|
|
@@ -153,6 +154,7 @@ export class MeroJs {
|
|
|
153
154
|
if (!this.sseClient) {
|
|
154
155
|
this.sseClient = new SseClient({
|
|
155
156
|
baseUrl: this.config.baseUrl,
|
|
157
|
+
fetch: this.config.fetch,
|
|
156
158
|
getAuthToken: async () => {
|
|
157
159
|
const token = await this.getValidToken();
|
|
158
160
|
return token?.access_token || '';
|