@calimero-network/mero-js 22.0.0 → 22.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/README.md +7 -5
- package/dist/admin-api/admin-types.d.ts +32 -1
- package/dist/cloud/cloud-client.d.ts +44 -14
- package/dist/cloud/cloud-client.js +82 -37
- package/dist/cloud/connect.d.ts +2 -1
- package/dist/cloud/connect.js +23 -12
- package/dist/events/group.d.ts +2 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +85 -42
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +85 -42
- package/dist/index.mjs.map +2 -2
- package/dist/namespace-op/namespace-op.d.ts +8 -2
- package/dist/namespace-op/namespace-op.js +8 -2
- package/dist/relay/relay-client.d.ts +7 -4
- package/dist/relay/relay-client.js +7 -4
- package/package.json +1 -1
|
@@ -14,8 +14,14 @@
|
|
|
14
14
|
* op, which is what the e2e does.
|
|
15
15
|
*/
|
|
16
16
|
import type { SignedGroupOpenInvitation } from '../admin-api/admin-types.js';
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Core's `SIGNED_NAMESPACE_OP_SCHEMA_VERSION`. A node refuses any other value.
|
|
19
|
+
*
|
|
20
|
+
* 12: core gained the `RelayTee` role and the TEE admission policy's
|
|
21
|
+
* replica/relay mode. No layout this module signs changed; the version moves
|
|
22
|
+
* with core's so a v11 node and a v12 node never share a namespace.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SIGNED_NAMESPACE_OP_SCHEMA_VERSION = 12;
|
|
19
25
|
/**
|
|
20
26
|
* Borsh-encode a `SignedGroupOpenInvitation`.
|
|
21
27
|
*
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { concat, derivePublicKey, fromHex, hex, importSigningKey, u32le, u64le, } from '../crypto/internal.js';
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Core's `SIGNED_NAMESPACE_OP_SCHEMA_VERSION`. A node refuses any other value.
|
|
4
|
+
*
|
|
5
|
+
* 12: core gained the `RelayTee` role and the TEE admission policy's
|
|
6
|
+
* replica/relay mode. No layout this module signs changed; the version moves
|
|
7
|
+
* with core's so a v11 node and a v12 node never share a namespace.
|
|
8
|
+
*/
|
|
9
|
+
export const SIGNED_NAMESPACE_OP_SCHEMA_VERSION = 12;
|
|
4
10
|
/** Domain prefixed to the signable bytes; core's `NAMESPACE_GOVERNANCE_SIGN_DOMAIN`. */
|
|
5
11
|
const NAMESPACE_SIGN_DOMAIN = new TextEncoder().encode('calimero.namespace.v1');
|
|
6
12
|
/** `NamespaceOp::Root` is the first variant. */
|
|
@@ -95,10 +95,13 @@ export interface IntentResult<T = unknown> {
|
|
|
95
95
|
* Thrown when a relay refuses an intent, carrying which precondition failed.
|
|
96
96
|
*
|
|
97
97
|
* The distinction is the whole reason this type exists. A `403` from this
|
|
98
|
-
* endpoint means one of
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* or
|
|
98
|
+
* endpoint means one of several unrelated things — no grant on the relay, the
|
|
99
|
+
* relay is a TEE replica (`ReadOnlyTee`) or a `ReadOnly` member (neither ever
|
|
100
|
+
* relays), the author is
|
|
101
|
+
* not a member or is read-only in the context, or the nonce was already spent
|
|
102
|
+
* — and they send a caller somewhere completely different: ask an admin, pick
|
|
103
|
+
* a relay the namespace admits in `relay` mode, ask for an invitation, or just
|
|
104
|
+
* retry. Collapsing them into "forbidden" makes a retryable replay look
|
|
102
105
|
* like a permissions bug.
|
|
103
106
|
*/
|
|
104
107
|
export declare class IntentRefusedError extends Error {
|
|
@@ -35,10 +35,13 @@ const DEFAULT_TTL_SECONDS = 300;
|
|
|
35
35
|
* Thrown when a relay refuses an intent, carrying which precondition failed.
|
|
36
36
|
*
|
|
37
37
|
* The distinction is the whole reason this type exists. A `403` from this
|
|
38
|
-
* endpoint means one of
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* or
|
|
38
|
+
* endpoint means one of several unrelated things — no grant on the relay, the
|
|
39
|
+
* relay is a TEE replica (`ReadOnlyTee`) or a `ReadOnly` member (neither ever
|
|
40
|
+
* relays), the author is
|
|
41
|
+
* not a member or is read-only in the context, or the nonce was already spent
|
|
42
|
+
* — and they send a caller somewhere completely different: ask an admin, pick
|
|
43
|
+
* a relay the namespace admits in `relay` mode, ask for an invitation, or just
|
|
44
|
+
* retry. Collapsing them into "forbidden" makes a retryable replay look
|
|
42
45
|
* like a permissions bug.
|
|
43
46
|
*/
|
|
44
47
|
export class IntentRefusedError extends Error {
|