@calimero-network/mero-js 26.6.0 → 26.7.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 +16 -2
- package/dist/admin-api/admin-client.js +18 -3
- package/dist/admin-api/admin-types.d.ts +8 -0
- package/dist/index.browser.mjs +1 -1
- package/dist/index.browser.mjs.map +2 -2
- package/dist/index.cjs +24 -3
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +24 -3
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
|
@@ -219,6 +219,13 @@ export declare class AdminApiClient {
|
|
|
219
219
|
*/
|
|
220
220
|
admitJoin(namespaceId: string, request: AdmitJoinRequest): Promise<AdmitJoinResponseData>;
|
|
221
221
|
joinNamespace(namespaceId: string, request: JoinNamespaceRequest): Promise<JoinNamespaceResponseData>;
|
|
222
|
+
/**
|
|
223
|
+
* Bring back a namespace the user removed from this node while the account
|
|
224
|
+
* stayed a member (POST /admin-api/namespaces/:namespace_id/join, no
|
|
225
|
+
* invitation). Such namespaces are the `forgotten` ones in
|
|
226
|
+
* {@link listNamespacesForApplication}.
|
|
227
|
+
*/
|
|
228
|
+
restoreNamespace(namespaceId: string): Promise<JoinNamespaceResponseData>;
|
|
222
229
|
/**
|
|
223
230
|
* Join the namespace an invitation grants, and say what happened — including
|
|
224
231
|
* when the request failed but the join landed anyway.
|
|
@@ -623,8 +630,15 @@ export declare class AdminApiClient {
|
|
|
623
630
|
leaveGroup(groupId: string): Promise<void>;
|
|
624
631
|
/** Leave a context (POST /admin-api/contexts/:context_id/leave). */
|
|
625
632
|
leaveContext(contextId: string): Promise<void>;
|
|
626
|
-
/**
|
|
627
|
-
|
|
633
|
+
/**
|
|
634
|
+
* Leave a namespace (POST /admin-api/namespaces/:namespace_id/leave).
|
|
635
|
+
*
|
|
636
|
+
* With `purge`, every device of the account also takes the namespace off its
|
|
637
|
+
* disk. Core reads `purge` from the query string, so it is not in the body.
|
|
638
|
+
*/
|
|
639
|
+
leaveNamespace(namespaceId: string, options?: {
|
|
640
|
+
purge?: boolean;
|
|
641
|
+
}): Promise<void>;
|
|
628
642
|
/** Issue a group ownership proof (POST /admin-api/groups/:group_id/issue-ownership-proof). */
|
|
629
643
|
issueOwnershipProof(groupId: string, request: IssueOwnershipProofRequest): Promise<IssueOwnershipProofResponseData>;
|
|
630
644
|
/** Issue a namespace ownership proof (POST /admin-api/groups/:group_id/issue-namespace-ownership-proof). */
|
|
@@ -523,6 +523,15 @@ export class AdminApiClient {
|
|
|
523
523
|
}
|
|
524
524
|
return data;
|
|
525
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Bring back a namespace the user removed from this node while the account
|
|
528
|
+
* stayed a member (POST /admin-api/namespaces/:namespace_id/join, no
|
|
529
|
+
* invitation). Such namespaces are the `forgotten` ones in
|
|
530
|
+
* {@link listNamespacesForApplication}.
|
|
531
|
+
*/
|
|
532
|
+
async restoreNamespace(namespaceId) {
|
|
533
|
+
return unwrap(await this.httpClient.post(`/admin-api/namespaces/${pathSegment(namespaceId)}/join`, {}, { timeoutMs: 65000 }));
|
|
534
|
+
}
|
|
526
535
|
/**
|
|
527
536
|
* Join the namespace an invitation grants, and say what happened — including
|
|
528
537
|
* when the request failed but the join landed anyway.
|
|
@@ -1137,9 +1146,15 @@ export class AdminApiClient {
|
|
|
1137
1146
|
async leaveContext(contextId) {
|
|
1138
1147
|
await this.httpClient.post(`/admin-api/contexts/${pathSegment(contextId)}/leave`, {});
|
|
1139
1148
|
}
|
|
1140
|
-
/**
|
|
1141
|
-
|
|
1142
|
-
|
|
1149
|
+
/**
|
|
1150
|
+
* Leave a namespace (POST /admin-api/namespaces/:namespace_id/leave).
|
|
1151
|
+
*
|
|
1152
|
+
* With `purge`, every device of the account also takes the namespace off its
|
|
1153
|
+
* disk. Core reads `purge` from the query string, so it is not in the body.
|
|
1154
|
+
*/
|
|
1155
|
+
async leaveNamespace(namespaceId, options = {}) {
|
|
1156
|
+
const query = options.purge ? '?purge=true' : '';
|
|
1157
|
+
await this.httpClient.post(`/admin-api/namespaces/${pathSegment(namespaceId)}/leave${query}`, {});
|
|
1143
1158
|
}
|
|
1144
1159
|
/** Issue a group ownership proof (POST /admin-api/groups/:group_id/issue-ownership-proof). */
|
|
1145
1160
|
async issueOwnershipProof(groupId, request) {
|
|
@@ -377,6 +377,12 @@ export interface Namespace {
|
|
|
377
377
|
* current on another. Absent when nothing is held, and on nodes that predate it.
|
|
378
378
|
*/
|
|
379
379
|
heldOps?: NamespaceHeldOps;
|
|
380
|
+
/**
|
|
381
|
+
* The user removed this namespace from this node and the account is still a
|
|
382
|
+
* member. Set only by {@link AdminApiClient.listNamespacesForApplication};
|
|
383
|
+
* {@link AdminApiClient.restoreNamespace} brings it back.
|
|
384
|
+
*/
|
|
385
|
+
forgotten?: boolean;
|
|
380
386
|
}
|
|
381
387
|
/** The group ops a namespace holds unapplied on the node that answered. */
|
|
382
388
|
export interface NamespaceHeldOps {
|
|
@@ -669,6 +675,8 @@ export interface JoinNamespaceResponseData {
|
|
|
669
675
|
* is how the caller addresses the member it just became.
|
|
670
676
|
*/
|
|
671
677
|
memberAccount: string;
|
|
678
|
+
/** The name a restored namespace had when it was removed. Set only by a restore. */
|
|
679
|
+
name?: string;
|
|
672
680
|
}
|
|
673
681
|
export interface CreateGroupInNamespaceRequest {
|
|
674
682
|
groupName?: string;
|