@calimero-network/mero-js 25.0.5 → 25.0.6
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/account/application-id.d.ts +3 -1
- package/dist/account/relay-from-invitation.js +3 -2
- package/dist/index.browser.mjs +1 -1
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +7 -3
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10190,14 +10190,15 @@ async function resolveRelayFromInvitation(input) {
|
|
|
10190
10190
|
const addressable = candidates.filter(
|
|
10191
10191
|
(n) => typeof n.relayUrl === "string" && n.relayUrl.length > 0
|
|
10192
10192
|
);
|
|
10193
|
-
|
|
10193
|
+
const [firstAddressable] = addressable;
|
|
10194
|
+
if (firstAddressable === void 0) {
|
|
10194
10195
|
return {
|
|
10195
10196
|
ok: false,
|
|
10196
10197
|
step: "no-relay-url",
|
|
10197
10198
|
reason: "A node your invitation names can admit you, but the cloud knows no address for it yet, so there would be nothing to connect through afterwards. Try again shortly."
|
|
10198
10199
|
};
|
|
10199
10200
|
}
|
|
10200
|
-
const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ??
|
|
10201
|
+
const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ?? firstAddressable;
|
|
10201
10202
|
return {
|
|
10202
10203
|
ok: true,
|
|
10203
10204
|
relayUrl: chosen.relayUrl,
|
|
@@ -10562,7 +10563,10 @@ function newer(a, b) {
|
|
|
10562
10563
|
return false;
|
|
10563
10564
|
}
|
|
10564
10565
|
function selectLatestBundle(bundles) {
|
|
10565
|
-
return bundles.filter((b) => !b.yanked && typeof b.appVersion === "string" && b.appVersion.length > 0).reduce(
|
|
10566
|
+
return bundles.filter((b) => !b.yanked && typeof b.appVersion === "string" && b.appVersion.length > 0).reduce(
|
|
10567
|
+
(best, b) => !best || newer(b.appVersion, best.appVersion) ? b : best,
|
|
10568
|
+
void 0
|
|
10569
|
+
);
|
|
10566
10570
|
}
|
|
10567
10571
|
async function fetchRegistryBundles(registryUrl, pkg, fetchFn = globalThis.fetch) {
|
|
10568
10572
|
const url = `${registryUrl.replace(/\/+$/, "")}/api/v2/bundles?package=${encodeURIComponent(pkg)}`;
|