@calimero-network/mero-js 29.14.0 → 29.15.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/README.md +1 -1
- package/dist/cloud-v2/approvals.d.ts +39 -2
- package/dist/cloud-v2/approvals.js +5 -1
- package/dist/cloud-v2/client.d.ts +5 -3
- package/dist/cloud-v2/client.js +5 -3
- package/dist/cloud-v2/errors.d.ts +18 -0
- package/dist/cloud-v2/errors.js +16 -0
- package/dist/cloud-v2/index.d.ts +2 -2
- package/dist/cloud-v2/index.js +1 -1
- package/dist/index.browser.mjs +3 -3
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +20 -3
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +20 -3
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1406,6 +1406,14 @@ var ReleaseDeadlineError = class extends CalimeroError {
|
|
|
1406
1406
|
this.after = typeof details.after === "string" ? details.after : "";
|
|
1407
1407
|
}
|
|
1408
1408
|
};
|
|
1409
|
+
var RuntimeTooOld = class extends CalimeroError {
|
|
1410
|
+
constructor(message, details = {}) {
|
|
1411
|
+
super(409, "RUNTIME_TOO_OLD", message, details);
|
|
1412
|
+
this.name = "RuntimeTooOld";
|
|
1413
|
+
this.minRuntimeVersion = typeof details.minRuntimeVersion === "string" ? details.minRuntimeVersion : "";
|
|
1414
|
+
this.nodes = Array.isArray(details.nodes) ? details.nodes : [];
|
|
1415
|
+
}
|
|
1416
|
+
};
|
|
1409
1417
|
var ConsentStale = class extends CalimeroError {
|
|
1410
1418
|
constructor(message, details = {}) {
|
|
1411
1419
|
super(409, "CONSENT_STALE", message, details);
|
|
@@ -1541,6 +1549,8 @@ function errorFrom(status, body, retryAfterHeader) {
|
|
|
1541
1549
|
return new IdempotencyMismatch(message, details);
|
|
1542
1550
|
case "409 RELEASE_DEADLINE":
|
|
1543
1551
|
return new ReleaseDeadlineError(message, details);
|
|
1552
|
+
case "409 RUNTIME_TOO_OLD":
|
|
1553
|
+
return new RuntimeTooOld(message, details);
|
|
1544
1554
|
case "409 CONSENT_STALE":
|
|
1545
1555
|
return new ConsentStale(message, details);
|
|
1546
1556
|
case "403 ORIGIN_NOT_REGISTERED":
|
|
@@ -1808,12 +1818,16 @@ function pendingApprovalsFrom(report, rules, now = Date.now() / 1e3) {
|
|
|
1808
1818
|
for (const a of report.apps) {
|
|
1809
1819
|
const available = a.availableVersions ?? [];
|
|
1810
1820
|
if (a.package === null || available.length === 0) continue;
|
|
1821
|
+
const latest = available[available.length - 1];
|
|
1822
|
+
const reachable = a.latestReachable === void 0 ? latest : a.latestReachable;
|
|
1811
1823
|
upgrades.push({
|
|
1812
1824
|
app: a.app,
|
|
1813
1825
|
name: a.name ?? null,
|
|
1814
1826
|
package: a.package.package,
|
|
1815
1827
|
from: a.package.version,
|
|
1816
|
-
to:
|
|
1828
|
+
to: reachable ?? latest,
|
|
1829
|
+
reachable: reachable !== null,
|
|
1830
|
+
blocked: a.latestBlocked ?? null,
|
|
1817
1831
|
available,
|
|
1818
1832
|
actionable: upgradesActionable
|
|
1819
1833
|
});
|
|
@@ -2690,8 +2704,10 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
2690
2704
|
}
|
|
2691
2705
|
/**
|
|
2692
2706
|
* Move an app to another release of its package (`{ version }`), another
|
|
2693
|
-
* package, or a bundle hash
|
|
2694
|
-
*
|
|
2707
|
+
* package, or a bundle hash. An upgrade is code only: the app moves to any
|
|
2708
|
+
* newer release in one step. Answers the upgrade's entry; one the app's
|
|
2709
|
+
* group refuses rejects with code `UPGRADE_FAILED` (422), and one a
|
|
2710
|
+
* replica's node is too old to run with {@link RuntimeTooOld} (409).
|
|
2695
2711
|
* Where owners hold app upgrades, the node asks for the approval of
|
|
2696
2712
|
* whoever the package's manifest names (`412 CONFIRM_REQUIRED`), which
|
|
2697
2713
|
* `passkey` gives. Refused (`403`) to a session opened on an app's
|
|
@@ -3855,6 +3871,7 @@ export {
|
|
|
3855
3871
|
RELEASE_VERIFIER,
|
|
3856
3872
|
RecoveryNotReady,
|
|
3857
3873
|
ReleaseDeadlineError,
|
|
3874
|
+
RuntimeTooOld,
|
|
3858
3875
|
SEALED_CONTENT_TYPE,
|
|
3859
3876
|
SEALED_PATH,
|
|
3860
3877
|
SealedTransportError,
|