@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.cjs
CHANGED
|
@@ -68,6 +68,7 @@ __export(index_exports, {
|
|
|
68
68
|
RELEASE_VERIFIER: () => RELEASE_VERIFIER,
|
|
69
69
|
RecoveryNotReady: () => RecoveryNotReady,
|
|
70
70
|
ReleaseDeadlineError: () => ReleaseDeadlineError,
|
|
71
|
+
RuntimeTooOld: () => RuntimeTooOld,
|
|
71
72
|
SEALED_CONTENT_TYPE: () => SEALED_CONTENT_TYPE,
|
|
72
73
|
SEALED_PATH: () => SEALED_PATH,
|
|
73
74
|
SealedTransportError: () => SealedTransportError,
|
|
@@ -1539,6 +1540,14 @@ var ReleaseDeadlineError = class extends CalimeroError {
|
|
|
1539
1540
|
this.after = typeof details.after === "string" ? details.after : "";
|
|
1540
1541
|
}
|
|
1541
1542
|
};
|
|
1543
|
+
var RuntimeTooOld = class extends CalimeroError {
|
|
1544
|
+
constructor(message, details = {}) {
|
|
1545
|
+
super(409, "RUNTIME_TOO_OLD", message, details);
|
|
1546
|
+
this.name = "RuntimeTooOld";
|
|
1547
|
+
this.minRuntimeVersion = typeof details.minRuntimeVersion === "string" ? details.minRuntimeVersion : "";
|
|
1548
|
+
this.nodes = Array.isArray(details.nodes) ? details.nodes : [];
|
|
1549
|
+
}
|
|
1550
|
+
};
|
|
1542
1551
|
var ConsentStale = class extends CalimeroError {
|
|
1543
1552
|
constructor(message, details = {}) {
|
|
1544
1553
|
super(409, "CONSENT_STALE", message, details);
|
|
@@ -1674,6 +1683,8 @@ function errorFrom(status, body, retryAfterHeader) {
|
|
|
1674
1683
|
return new IdempotencyMismatch(message, details);
|
|
1675
1684
|
case "409 RELEASE_DEADLINE":
|
|
1676
1685
|
return new ReleaseDeadlineError(message, details);
|
|
1686
|
+
case "409 RUNTIME_TOO_OLD":
|
|
1687
|
+
return new RuntimeTooOld(message, details);
|
|
1677
1688
|
case "409 CONSENT_STALE":
|
|
1678
1689
|
return new ConsentStale(message, details);
|
|
1679
1690
|
case "403 ORIGIN_NOT_REGISTERED":
|
|
@@ -1941,12 +1952,16 @@ function pendingApprovalsFrom(report, rules, now = Date.now() / 1e3) {
|
|
|
1941
1952
|
for (const a of report.apps) {
|
|
1942
1953
|
const available = a.availableVersions ?? [];
|
|
1943
1954
|
if (a.package === null || available.length === 0) continue;
|
|
1955
|
+
const latest = available[available.length - 1];
|
|
1956
|
+
const reachable = a.latestReachable === void 0 ? latest : a.latestReachable;
|
|
1944
1957
|
upgrades.push({
|
|
1945
1958
|
app: a.app,
|
|
1946
1959
|
name: a.name ?? null,
|
|
1947
1960
|
package: a.package.package,
|
|
1948
1961
|
from: a.package.version,
|
|
1949
|
-
to:
|
|
1962
|
+
to: reachable ?? latest,
|
|
1963
|
+
reachable: reachable !== null,
|
|
1964
|
+
blocked: a.latestBlocked ?? null,
|
|
1950
1965
|
available,
|
|
1951
1966
|
actionable: upgradesActionable
|
|
1952
1967
|
});
|
|
@@ -2823,8 +2838,10 @@ var CalimeroClient = class _CalimeroClient {
|
|
|
2823
2838
|
}
|
|
2824
2839
|
/**
|
|
2825
2840
|
* Move an app to another release of its package (`{ version }`), another
|
|
2826
|
-
* package, or a bundle hash
|
|
2827
|
-
*
|
|
2841
|
+
* package, or a bundle hash. An upgrade is code only: the app moves to any
|
|
2842
|
+
* newer release in one step. Answers the upgrade's entry; one the app's
|
|
2843
|
+
* group refuses rejects with code `UPGRADE_FAILED` (422), and one a
|
|
2844
|
+
* replica's node is too old to run with {@link RuntimeTooOld} (409).
|
|
2828
2845
|
* Where owners hold app upgrades, the node asks for the approval of
|
|
2829
2846
|
* whoever the package's manifest names (`412 CONFIRM_REQUIRED`), which
|
|
2830
2847
|
* `passkey` gives. Refused (`403`) to a session opened on an app's
|