@calimero-network/mero-js 25.0.4 → 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/join-with-node.js +2 -1
- package/dist/account/relay-from-invitation.js +5 -3
- package/dist/admin-api/admin-client.js +91 -92
- package/dist/auth-api/auth-client.js +5 -4
- package/dist/cloud/cloud-client.js +10 -9
- package/dist/http-client/path-segment.d.ts +1 -0
- package/dist/http-client/path-segment.js +8 -0
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +4 -4
- package/dist/index.cjs +127 -117
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +127 -117
- package/dist/index.mjs.map +3 -3
- package/dist/relay/relay-client.js +8 -7
- package/package.json +1 -1
|
@@ -34,6 +34,7 @@ import { signCreationWarrant } from '../warrant/creation-warrant.js';
|
|
|
34
34
|
import { signGovernanceWarrant } from '../warrant/governance-warrant.js';
|
|
35
35
|
import { defaultCapabilitiesSetOp, targetApplicationSetOp, foundedNamespaceId, namespaceCreatedOp, } from '../warrant/governance-op.js';
|
|
36
36
|
import { HTTPError } from '../http-client/web-client.js';
|
|
37
|
+
import { pathSegment } from '../http-client/path-segment.js';
|
|
37
38
|
import { fromHex, hex } from '../crypto/internal.js';
|
|
38
39
|
/** How long a freshly minted warrant stays presentable, in seconds. */
|
|
39
40
|
const DEFAULT_TTL_SECONDS = 300;
|
|
@@ -137,7 +138,7 @@ export class RelayClient {
|
|
|
137
138
|
* as diagnostics after a failure.
|
|
138
139
|
*/
|
|
139
140
|
async describe(contextId) {
|
|
140
|
-
const body = await this.json('GET', `/admin-api/contexts/${
|
|
141
|
+
const body = await this.json('GET', `/admin-api/contexts/${pathSegment(contextId)}/intents`);
|
|
141
142
|
return body.data;
|
|
142
143
|
}
|
|
143
144
|
/**
|
|
@@ -172,7 +173,7 @@ export class RelayClient {
|
|
|
172
173
|
notAfter: BigInt(Math.floor(Date.now() / 1000)) + BigInt(ttl),
|
|
173
174
|
signer,
|
|
174
175
|
});
|
|
175
|
-
const body = await this.json('POST', `/admin-api/contexts/${
|
|
176
|
+
const body = await this.json('POST', `/admin-api/contexts/${pathSegment(contextId)}/intents`, { method, argsJson, warrant, authorProof: this.config.authorProof });
|
|
176
177
|
return { rootHash: body.data.rootHash, returns: body.data.returns ?? null };
|
|
177
178
|
}
|
|
178
179
|
/**
|
|
@@ -182,7 +183,7 @@ export class RelayClient {
|
|
|
182
183
|
* only queue behind the next resend. A refusal throws with its `status`.
|
|
183
184
|
*/
|
|
184
185
|
async presenceIntent(contextId, body) {
|
|
185
|
-
await this.jsonOnce('POST', `/admin-api/contexts/${
|
|
186
|
+
await this.jsonOnce('POST', `/admin-api/contexts/${pathSegment(contextId)}/presence-intents`, body);
|
|
186
187
|
}
|
|
187
188
|
/**
|
|
188
189
|
* Ask the relay what it can do about creating contexts in `groupId`.
|
|
@@ -192,7 +193,7 @@ export class RelayClient {
|
|
|
192
193
|
*/
|
|
193
194
|
async describeCreation(groupId, opts = {}) {
|
|
194
195
|
const query = opts.author ? `?author=${encodeURIComponent(opts.author)}` : '';
|
|
195
|
-
const body = await this.json('GET', `/admin-api/groups/${
|
|
196
|
+
const body = await this.json('GET', `/admin-api/groups/${pathSegment(groupId)}/context-intents${query}`);
|
|
196
197
|
return body.data;
|
|
197
198
|
}
|
|
198
199
|
/**
|
|
@@ -250,7 +251,7 @@ export class RelayClient {
|
|
|
250
251
|
notAfter: BigInt(Math.floor(Date.now() / 1000)) + BigInt(ttl),
|
|
251
252
|
signer,
|
|
252
253
|
});
|
|
253
|
-
const body = await this.json('POST', `/admin-api/groups/${
|
|
254
|
+
const body = await this.json('POST', `/admin-api/groups/${pathSegment(input.groupId)}/context-intents`, { warrant, authorProof: this.config.authorProof, initArgs });
|
|
254
255
|
return {
|
|
255
256
|
contextId: body.data.contextId,
|
|
256
257
|
groupId: body.data.groupId,
|
|
@@ -262,7 +263,7 @@ export class RelayClient {
|
|
|
262
263
|
* `groupId`, and which account and key a warrant must name.
|
|
263
264
|
*/
|
|
264
265
|
async describeGovernance(groupId) {
|
|
265
|
-
const body = await this.json('GET', `/admin-api/groups/${
|
|
266
|
+
const body = await this.json('GET', `/admin-api/groups/${pathSegment(groupId)}/governance-intents`);
|
|
266
267
|
return body.data;
|
|
267
268
|
}
|
|
268
269
|
/**
|
|
@@ -405,7 +406,7 @@ export class RelayClient {
|
|
|
405
406
|
return result;
|
|
406
407
|
}
|
|
407
408
|
async postGovernance(groupId, op, warrant) {
|
|
408
|
-
const body = await this.json('POST', `/admin-api/groups/${
|
|
409
|
+
const body = await this.json('POST', `/admin-api/groups/${pathSegment(groupId)}/governance-intents`, {
|
|
409
410
|
warrant,
|
|
410
411
|
authorProof: this.config.authorProof,
|
|
411
412
|
op: hex(op.bytes),
|