@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.cjs
CHANGED
|
@@ -10475,14 +10475,15 @@ async function resolveRelayFromInvitation(input) {
|
|
|
10475
10475
|
const addressable = candidates.filter(
|
|
10476
10476
|
(n) => typeof n.relayUrl === "string" && n.relayUrl.length > 0
|
|
10477
10477
|
);
|
|
10478
|
-
|
|
10478
|
+
const [firstAddressable] = addressable;
|
|
10479
|
+
if (firstAddressable === void 0) {
|
|
10479
10480
|
return {
|
|
10480
10481
|
ok: false,
|
|
10481
10482
|
step: "no-relay-url",
|
|
10482
10483
|
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."
|
|
10483
10484
|
};
|
|
10484
10485
|
}
|
|
10485
|
-
const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ??
|
|
10486
|
+
const chosen = addressable.find((n) => n.canExecute) ?? addressable.find((n) => n.fresh) ?? firstAddressable;
|
|
10486
10487
|
return {
|
|
10487
10488
|
ok: true,
|
|
10488
10489
|
relayUrl: chosen.relayUrl,
|
|
@@ -10847,7 +10848,10 @@ function newer(a, b) {
|
|
|
10847
10848
|
return false;
|
|
10848
10849
|
}
|
|
10849
10850
|
function selectLatestBundle(bundles) {
|
|
10850
|
-
return bundles.filter((b) => !b.yanked && typeof b.appVersion === "string" && b.appVersion.length > 0).reduce(
|
|
10851
|
+
return bundles.filter((b) => !b.yanked && typeof b.appVersion === "string" && b.appVersion.length > 0).reduce(
|
|
10852
|
+
(best, b) => !best || newer(b.appVersion, best.appVersion) ? b : best,
|
|
10853
|
+
void 0
|
|
10854
|
+
);
|
|
10851
10855
|
}
|
|
10852
10856
|
async function fetchRegistryBundles(registryUrl, pkg, fetchFn = globalThis.fetch) {
|
|
10853
10857
|
const url = `${registryUrl.replace(/\/+$/, "")}/api/v2/bundles?package=${encodeURIComponent(pkg)}`;
|