@calimero-network/mero-js 33.1.0 → 33.2.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/client/calimero-client.d.ts +23 -0
- package/dist/client/calimero-client.js +111 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/dist/index.browser.mjs +3 -3
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +97 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +97 -0
- package/dist/index.mjs.map +2 -2
- package/dist/runtime/transport.d.ts +4 -1
- package/dist/runtime/transport.js +4 -0
- package/package.json +1 -1
|
@@ -172,12 +172,15 @@ export declare class NodeTransport implements Transport {
|
|
|
172
172
|
private current;
|
|
173
173
|
/** The refresh under way, which every request that needs one shares. */
|
|
174
174
|
private refreshing;
|
|
175
|
-
|
|
175
|
+
/** The backoff between retries, for a caller that retries a request the routes do not. */
|
|
176
|
+
readonly retry: Required<RetryOptions>;
|
|
176
177
|
/** Rejections of the underlying `fetch` itself: the node could not be reached or dropped the connection. */
|
|
177
178
|
private readonly networkFailures;
|
|
178
179
|
/** The directory the node list came from, if it came from one. */
|
|
179
180
|
private source;
|
|
180
181
|
constructor(options: NodeTransportOptions);
|
|
182
|
+
/** Whether `error` is a `fetch` that got no answer: the node could not be reached or dropped the connection. */
|
|
183
|
+
isNetworkFailure(error: unknown): boolean;
|
|
181
184
|
/** Re-read the node list from `source` when it is due, and after a failover. */
|
|
182
185
|
useDirectory(source: DirectorySource): void;
|
|
183
186
|
/** The node requests go to now: `baseUrl`, until a `421 WRONG_NODE` or a failover moved on. */
|
|
@@ -185,6 +185,10 @@ export class NodeTransport {
|
|
|
185
185
|
};
|
|
186
186
|
this.raw = raw;
|
|
187
187
|
}
|
|
188
|
+
/** Whether `error` is a `fetch` that got no answer: the node could not be reached or dropped the connection. */
|
|
189
|
+
isNetworkFailure(error) {
|
|
190
|
+
return error instanceof TypeError && this.networkFailures.has(error);
|
|
191
|
+
}
|
|
188
192
|
/** Re-read the node list from `source` when it is due, and after a failover. */
|
|
189
193
|
useDirectory(source) {
|
|
190
194
|
this.source = source;
|