@calimero-network/mero-js 11.0.0 → 11.1.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/dist/admin-api/admin-client.d.ts +29 -1
- package/dist/admin-api/admin-client.js +32 -4
- package/dist/admin-api/admin-types.d.ts +51 -0
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +3 -3
- package/dist/index.cjs +32 -4
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +32 -4
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1062,11 +1062,39 @@ var AdminApiClient = class {
|
|
|
1062
1062
|
async getNamespace(namespaceId) {
|
|
1063
1063
|
return unwrap(await this.httpClient.get(`/admin-api/namespaces/${namespaceId}`));
|
|
1064
1064
|
}
|
|
1065
|
+
/**
|
|
1066
|
+
* Who this node is — the account it writes as, the device it is, the key it
|
|
1067
|
+
* signs with, and the account root a second device pairs against.
|
|
1068
|
+
*
|
|
1069
|
+
* Takes no namespace, and that is the point: one root key is one account
|
|
1070
|
+
* everywhere, and a node signs with one key, so none of it varies by
|
|
1071
|
+
* namespace.
|
|
1072
|
+
*/
|
|
1073
|
+
async getNodeIdentity() {
|
|
1074
|
+
return unwrap(await this.httpClient.get("/admin-api/identity"));
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* @deprecated Use {@link getNodeIdentity} instead. Every field this returns is
|
|
1078
|
+
* node-level, so the namespace was only ever decoration — it now delegates to
|
|
1079
|
+
* the node-level route and reshapes the answer.
|
|
1080
|
+
*
|
|
1081
|
+
* Three consequences of that delegation, all visible to a caller who relied on
|
|
1082
|
+
* the old route's behaviour:
|
|
1083
|
+
*
|
|
1084
|
+
* - **No participation gate.** The namespace route answered 404 when this node
|
|
1085
|
+
* had never joined the namespace; this answers whatever the node's identity
|
|
1086
|
+
* is, regardless. If you were using it to ask "am I in this namespace?", ask
|
|
1087
|
+
* {@link listNamespaces} instead — that is the question you were really
|
|
1088
|
+
* asking.
|
|
1089
|
+
* - **`namespaceId` is echoed verbatim.** The old route resolved a subgroup id
|
|
1090
|
+
* to its root namespace and returned that; passing a subgroup id here gives
|
|
1091
|
+
* the subgroup id back.
|
|
1092
|
+
* - **404 means something else.** Previously "not my namespace", now "this node
|
|
1093
|
+
* holds no account root yet".
|
|
1094
|
+
*/
|
|
1065
1095
|
async getNamespaceIdentity(namespaceId) {
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1068
|
-
);
|
|
1069
|
-
return r?.data ?? r;
|
|
1096
|
+
const node = await this.getNodeIdentity();
|
|
1097
|
+
return { namespaceId, publicKey: node.publicKey, account: node.accountId };
|
|
1070
1098
|
}
|
|
1071
1099
|
async listNamespacesForApplication(applicationId) {
|
|
1072
1100
|
return unwrap(await this.httpClient.get(`/admin-api/namespaces/for-application/${applicationId}`));
|