@calimero-network/mero-js 25.0.4 → 25.0.5
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/join-with-node.js +2 -1
- package/dist/account/relay-from-invitation.js +2 -1
- 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 +120 -114
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +120 -114
- package/dist/index.mjs.map +3 -3
- package/dist/relay/relay-client.js +8 -7
- package/package.json +1 -1
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
*/
|
|
43
43
|
import { createLocalStorageNonceSource, } from '../relay/index.js';
|
|
44
44
|
import { signMemberJoinOp, } from '../namespace-op/index.js';
|
|
45
|
+
import { pathSegment } from '../http-client/path-segment.js';
|
|
45
46
|
/**
|
|
46
47
|
* Turn an admit refusal into the thing to go and do about it.
|
|
47
48
|
*
|
|
@@ -116,7 +117,7 @@ export async function joinWithNode(input) {
|
|
|
116
117
|
// at the typecheck rather than as a 400 from a node.
|
|
117
118
|
const body = { invitation: input.invitation, signedOp };
|
|
118
119
|
const url = input.admitUrl ??
|
|
119
|
-
`${origin(input.nodeUrl)}/admin-api/namespaces/${input.namespaceId}/admit`;
|
|
120
|
+
`${origin(input.nodeUrl)}/admin-api/namespaces/${pathSegment(input.namespaceId)}/admit`;
|
|
120
121
|
const doFetch = input.deps?.fetch ?? fetch;
|
|
121
122
|
let response;
|
|
122
123
|
try {
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
* sends the user to the wrong place.
|
|
51
51
|
*/
|
|
52
52
|
import { CloudClient, } from '../cloud/index.js';
|
|
53
|
+
import { pathSegment } from '../http-client/path-segment.js';
|
|
53
54
|
/**
|
|
54
55
|
* Normalise a hex account for comparison: lower-cased, `0x` stripped.
|
|
55
56
|
*
|
|
@@ -166,7 +167,7 @@ export async function resolveRelayFromInvitation(input) {
|
|
|
166
167
|
// The cloud's ready-made URL when it gave one, so the path is never rebuilt
|
|
167
168
|
// from a guess; the fallback is the documented route on the same origin.
|
|
168
169
|
admitUrl: chosen.admitUrl ??
|
|
169
|
-
`${chosen.relayUrl.replace(/\/+$/, '')}/admin-api/namespaces/${input.namespaceId}/admit`,
|
|
170
|
+
`${chosen.relayUrl.replace(/\/+$/, '')}/admin-api/namespaces/${pathSegment(input.namespaceId)}/admit`,
|
|
170
171
|
admitterAccount: chosen.account,
|
|
171
172
|
peerId: chosen.peerId,
|
|
172
173
|
writable: chosen.canExecute,
|