@calimero-network/mero-js 22.9.0 → 23.0.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 +22 -2
- package/dist/admin-api/admin-client.js +38 -2
- package/dist/admin-api/admin-types.d.ts +60 -0
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +4 -4
- package/dist/index.cjs +258 -15
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/index.mjs +258 -15
- package/dist/index.mjs.map +4 -4
- package/dist/namespace-op/namespace-op.d.ts +19 -1
- package/dist/namespace-op/namespace-op.js +19 -1
- package/dist/owner-op/index.d.ts +2 -0
- package/dist/owner-op/index.js +3 -0
- package/dist/owner-op/owner-op.d.ts +119 -0
- package/dist/owner-op/owner-op.js +214 -0
- package/dist/warrant/governance-op.d.ts +31 -1
- package/dist/warrant/governance-op.js +30 -1
- package/dist/warrant/index.d.ts +2 -2
- package/dist/warrant/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient, HTTPError } from '../http-client/index.js';
|
|
2
|
-
import type { HealthStatus, ReadinessStatus, AdminAuthStatus, InstallApplicationRequest, InstallApplicationResponseData, InstallDevApplicationRequest, UninstallApplicationResponseData, ListApplicationsResponseData, GetApplicationResponseData, ApplicationVersionEntry, GetApplicationAbiResponseData, GetLatestVersionResponseData, ListPackagesResponseData, ListVersionsResponseData, CreateContextRequest, CreateContextResponseData, DeleteContextResponseData, GetContextsResponseData, Context, GenerateContextIdentityResponseData, GetContextIdentitiesResponseData, JoinContextResponseData, JoinSubgroupInheritanceResponseData, ContextGroupResponseData, ContextStorageResponseData, InviteSpecializedNodeRequest, InviteSpecializedNodeResponseData, UpdateContextApplicationRequest, ResyncContextRequest, ResyncContextResponseData, ContextsWithExecutorsResponseData, UploadBlobRequest, UploadBlobResponseData, DeleteBlobResponseData, ListBlobsResponseData, GetBlobInfoResponseData, BlobReadOptions, CreateContextAliasRequest, CreateApplicationAliasRequest, CreateDeviceAliasRequest, CreateAliasResponseData, LookupAliasResponseData, DeleteAliasResponseData, ListAliasesResponseData, ListNamespacesResponseData, CreateNamespaceRequest, CreateNamespaceResponseData, DeleteNamespaceResponseData, CreateNamespaceInvitationRequest, CreateNamespaceInvitationResponseData, CreateRecursiveInvitationResponseData, JoinNamespaceRequest, JoinNamespaceResponseData, CreateGroupInNamespaceRequest, CreateGroupInNamespaceResponseData, SubgroupEntry, Namespace, NamespaceIdentity, NodeIdentity, AccountPairInitRequest, AccountPairInitResponseData, AccountPairCompleteRequest, AccountPairCompleteResponseData, AccountSignWithRootRequest, AccountSignWithRootResponseData, RelinkDeviceRequest, RelinkDeviceResponseData, RescopeDeviceRequest, RescopeDeviceResponseData, LabelDeviceRequest, LabelDeviceResponseData, AccountDeviceEntry, AccountApplicationEntry, RevokeAccountDeviceRequest, LinkAccountDeviceRequest, LinkAccountDeviceResponseData, RevokeAccountDeviceResponseData, MemberDevicesEntry, ListMemberDevicesOptions, GroupInfoResponseData, CreateGroupRequest, CreateGroupResponseData, DeleteGroupResponseData, ListGroupMembersResponseData, ListGroupContextsResponseData, AddGroupMembersRequest, RemoveGroupMembersRequest, UpdateMemberRoleRequest, MemberCapabilities, SetMemberCapabilitiesRequest, SetDefaultCapabilitiesRequest, SetMemberAutoFollowRequest, SetSubgroupVisibilityRequest, SetTeeAdmissionPolicyRequest, GetTeeAdmissionPolicyResponseData, SetTeeAuthoringPolicyRequest, SetGroupMetadataRequest, SetMemberMetadataRequest, SetContextMetadataRequest, MetadataRecord, SyncGroupResponseData, UpgradeGroupRequest, UpgradeGroupResponseData, GroupUpgradeStatusResponseData, MigrationStatus, CascadeStatusEntry, RetryGroupUpgradeResponseData, ReparentGroupRequest, ReparentGroupResponseData, IssueOwnershipProofRequest, IssueNamespaceOwnershipProofRequest, IssueOwnershipProofResponseData, CreateGroupInvitationRequest, CreateGroupInvitationResponseData, CreateRecursiveGroupInvitationResponseData, JoinGroupRequest, JoinGroupResponseData, TeeInfoResponseData, TeeAttestRequest, TeeAttestResponseData, TeeVerifyQuoteRequest, TeeVerifyQuoteResponseData, PerformIntentRequest, PerformIntentResponseData, IntentRelayInfo, QueryContextRequest, QueryContextResponseData, ListMemberDevicesResponseData, SealToAccountRequest, SealedEnvelope, AdmitJoinRequest, AdmitJoinResponseData, WarrantNonceState } from './admin-types.js';
|
|
2
|
+
import type { HealthStatus, ReadinessStatus, AdminAuthStatus, InstallApplicationRequest, InstallApplicationResponseData, InstallDevApplicationRequest, UninstallApplicationResponseData, ListApplicationsResponseData, GetApplicationResponseData, ApplicationVersionEntry, GetApplicationAbiResponseData, GetLatestVersionResponseData, ListPackagesResponseData, ListVersionsResponseData, CreateContextRequest, CreateContextResponseData, DeleteContextResponseData, GetContextsResponseData, Context, GenerateContextIdentityResponseData, GetContextIdentitiesResponseData, JoinContextResponseData, JoinSubgroupInheritanceResponseData, ContextGroupResponseData, ContextStorageResponseData, InviteSpecializedNodeRequest, InviteSpecializedNodeResponseData, UpdateContextApplicationRequest, ResyncContextRequest, ResyncContextResponseData, ContextsWithExecutorsResponseData, UploadBlobRequest, UploadBlobResponseData, DeleteBlobResponseData, ListBlobsResponseData, GetBlobInfoResponseData, BlobReadOptions, CreateContextAliasRequest, CreateApplicationAliasRequest, CreateDeviceAliasRequest, CreateAliasResponseData, LookupAliasResponseData, DeleteAliasResponseData, ListAliasesResponseData, ListNamespacesResponseData, CreateNamespaceRequest, CreateNamespaceResponseData, DeleteNamespaceResponseData, CreateNamespaceInvitationRequest, CreateNamespaceInvitationResponseData, CreateRecursiveInvitationResponseData, JoinNamespaceRequest, JoinNamespaceResponseData, CreateGroupInNamespaceRequest, CreateGroupInNamespaceResponseData, SubgroupEntry, Namespace, NamespaceIdentity, NodeIdentity, AccountPairInitRequest, AccountPairInitResponseData, AccountPairCompleteRequest, AccountPairCompleteResponseData, AccountSignWithRootRequest, AccountSignWithRootResponseData, RelinkDeviceRequest, RelinkDeviceResponseData, RescopeDeviceRequest, RescopeDeviceResponseData, LabelDeviceRequest, LabelDeviceResponseData, AccountDeviceEntry, AccountApplicationEntry, RevokeAccountDeviceRequest, LinkAccountDeviceRequest, LinkAccountDeviceResponseData, RevokeAccountDeviceResponseData, MemberDevicesEntry, ListMemberDevicesOptions, GroupInfoResponseData, CreateGroupRequest, CreateGroupResponseData, DeleteGroupResponseData, ListGroupMembersResponseData, ListGroupContextsResponseData, AddGroupMembersRequest, RemoveGroupMembersRequest, UpdateMemberRoleRequest, MemberCapabilities, SetMemberCapabilitiesRequest, SetDefaultCapabilitiesRequest, SetMemberAutoFollowRequest, SetSubgroupVisibilityRequest, SetTeeAdmissionPolicyRequest, GetTeeAdmissionPolicyResponseData, SetTeeAuthoringPolicyRequest, TransferOwnershipRequest, ChangeNamespaceAdminRequest, OwnerDeleteGroupRequest, RootGuardedOpRequest, SetGroupMetadataRequest, SetMemberMetadataRequest, SetContextMetadataRequest, MetadataRecord, SyncGroupResponseData, UpgradeGroupRequest, UpgradeGroupResponseData, GroupUpgradeStatusResponseData, MigrationStatus, CascadeStatusEntry, RetryGroupUpgradeResponseData, ReparentGroupRequest, ReparentGroupResponseData, IssueOwnershipProofRequest, IssueNamespaceOwnershipProofRequest, IssueOwnershipProofResponseData, CreateGroupInvitationRequest, CreateGroupInvitationResponseData, CreateRecursiveGroupInvitationResponseData, JoinGroupRequest, JoinGroupResponseData, TeeInfoResponseData, TeeAttestRequest, TeeAttestResponseData, TeeVerifyQuoteRequest, TeeVerifyQuoteResponseData, PerformIntentRequest, PerformIntentResponseData, IntentRelayInfo, QueryContextRequest, QueryContextResponseData, ListMemberDevicesResponseData, SealToAccountRequest, SealedEnvelope, AdmitJoinRequest, AdmitJoinResponseData, WarrantNonceState } from './admin-types.js';
|
|
3
3
|
import { type RedeemOutcome } from './redeem-invitation.js';
|
|
4
4
|
/**
|
|
5
5
|
* Thrown when a node answers the warrant-nonce route with a 404.
|
|
@@ -676,8 +676,28 @@ export declare class AdminApiClient {
|
|
|
676
676
|
* and admitted TEEs stay members. The node applies the same op as
|
|
677
677
|
* `setTeeAuthoringPolicy(groupId, { allowedMrtd: [] })`. `groupId` must be a
|
|
678
678
|
* namespace root.
|
|
679
|
+
*
|
|
680
|
+
* `rootProof` is the signing admin's own root proof for that empty policy
|
|
681
|
+
* (`teeAuthoringPolicyOp([])`); omit it on a node that holds that root.
|
|
682
|
+
*/
|
|
683
|
+
disableTeeAuthoringPolicy(groupId: string, options?: RootGuardedOpRequest): Promise<void>;
|
|
684
|
+
/**
|
|
685
|
+
* Hand the group to `newOwner`, who must already be one of its admins.
|
|
686
|
+
* Owner-only, and it needs the owner account's root proof; see
|
|
687
|
+
* {@link RootGuardedOpRequest}.
|
|
688
|
+
*/
|
|
689
|
+
transferOwnership(groupId: string, request: TransferOwnershipRequest): Promise<void>;
|
|
690
|
+
/**
|
|
691
|
+
* Repoint the namespace's admin pin at `newAdmin`, a member of its root.
|
|
692
|
+
* Owner-only, with the owner account's root proof; see {@link RootGuardedOpRequest}.
|
|
693
|
+
*/
|
|
694
|
+
changeNamespaceAdmin(namespaceId: string, request: ChangeNamespaceAdminRequest): Promise<void>;
|
|
695
|
+
/**
|
|
696
|
+
* Delete a group through the owner-only path: it must hold no contexts, and
|
|
697
|
+
* the op needs the owner account's root proof. {@link deleteGroup} is the
|
|
698
|
+
* admin-level cascading delete.
|
|
679
699
|
*/
|
|
680
|
-
|
|
700
|
+
ownerDeleteGroup(groupId: string, request?: OwnerDeleteGroupRequest): Promise<void>;
|
|
681
701
|
setGroupMetadata(groupId: string, request: SetGroupMetadataRequest): Promise<void>;
|
|
682
702
|
getGroupMetadata(groupId: string): Promise<MetadataRecord | null>;
|
|
683
703
|
setMemberMetadata(groupId: string, identity: string, request: SetMemberMetadataRequest): Promise<void>;
|
|
@@ -1192,9 +1192,45 @@ export class AdminApiClient {
|
|
|
1192
1192
|
* and admitted TEEs stay members. The node applies the same op as
|
|
1193
1193
|
* `setTeeAuthoringPolicy(groupId, { allowedMrtd: [] })`. `groupId` must be a
|
|
1194
1194
|
* namespace root.
|
|
1195
|
+
*
|
|
1196
|
+
* `rootProof` is the signing admin's own root proof for that empty policy
|
|
1197
|
+
* (`teeAuthoringPolicyOp([])`); omit it on a node that holds that root.
|
|
1198
|
+
*/
|
|
1199
|
+
async disableTeeAuthoringPolicy(groupId, options = {}) {
|
|
1200
|
+
const path = `/admin-api/groups/${groupId}/settings/tee-authoring-policy`;
|
|
1201
|
+
if (options.rootProof === undefined) {
|
|
1202
|
+
await this.httpClient.delete(path);
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1205
|
+
await this.httpClient.request(path, {
|
|
1206
|
+
method: 'DELETE',
|
|
1207
|
+
body: JSON.stringify({ rootProof: options.rootProof }),
|
|
1208
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
// ---- Root-guarded owner ops (core schema 18) ----
|
|
1212
|
+
/**
|
|
1213
|
+
* Hand the group to `newOwner`, who must already be one of its admins.
|
|
1214
|
+
* Owner-only, and it needs the owner account's root proof; see
|
|
1215
|
+
* {@link RootGuardedOpRequest}.
|
|
1216
|
+
*/
|
|
1217
|
+
async transferOwnership(groupId, request) {
|
|
1218
|
+
await this.httpClient.post(`/admin-api/groups/${groupId}/transfer-ownership`, request);
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Repoint the namespace's admin pin at `newAdmin`, a member of its root.
|
|
1222
|
+
* Owner-only, with the owner account's root proof; see {@link RootGuardedOpRequest}.
|
|
1223
|
+
*/
|
|
1224
|
+
async changeNamespaceAdmin(namespaceId, request) {
|
|
1225
|
+
await this.httpClient.post(`/admin-api/namespaces/${namespaceId}/admin`, request);
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Delete a group through the owner-only path: it must hold no contexts, and
|
|
1229
|
+
* the op needs the owner account's root proof. {@link deleteGroup} is the
|
|
1230
|
+
* admin-level cascading delete.
|
|
1195
1231
|
*/
|
|
1196
|
-
async
|
|
1197
|
-
await this.httpClient.
|
|
1232
|
+
async ownerDeleteGroup(groupId, request = {}) {
|
|
1233
|
+
await this.httpClient.post(`/admin-api/groups/${groupId}/owner-delete`, request);
|
|
1198
1234
|
}
|
|
1199
1235
|
// ---- Group / member / context metadata ----
|
|
1200
1236
|
async setGroupMetadata(groupId, request) {
|
|
@@ -1337,6 +1337,19 @@ export interface GroupInfo {
|
|
|
1337
1337
|
* `null` if no metadata has ever been set for this group.
|
|
1338
1338
|
*/
|
|
1339
1339
|
metadata?: MetadataRecord | null;
|
|
1340
|
+
/** Hex hash of the group's authorization-relevant state, for convergence polling. */
|
|
1341
|
+
groupStateHash?: string;
|
|
1342
|
+
/**
|
|
1343
|
+
* The namespace this group belongs to (itself, for a namespace root). An
|
|
1344
|
+
* owner-op root proof binds it. Absent from nodes before core schema 18.
|
|
1345
|
+
*/
|
|
1346
|
+
namespaceId?: string;
|
|
1347
|
+
/**
|
|
1348
|
+
* How many root-guarded owner ops this group has applied: the `counter` a
|
|
1349
|
+
* root proof for its next one must name. Absent from nodes before core
|
|
1350
|
+
* schema 18.
|
|
1351
|
+
*/
|
|
1352
|
+
ownerOpCounter?: number;
|
|
1340
1353
|
}
|
|
1341
1354
|
export type GroupInfoResponseData = GroupInfo;
|
|
1342
1355
|
/**
|
|
@@ -1513,6 +1526,12 @@ export interface MeasurementTeeAdmissionPolicyRequest {
|
|
|
1513
1526
|
acceptMock: boolean;
|
|
1514
1527
|
/** Absent means `replica`. */
|
|
1515
1528
|
mode?: TeeAdmissionMode;
|
|
1529
|
+
/**
|
|
1530
|
+
* Hex borsh of the signing admin's own root proof for this policy op
|
|
1531
|
+
* ({@link signOwnerOpProof} with the matching policy encoder). Omit it on a
|
|
1532
|
+
* node that holds that admin's account root, which signs one itself.
|
|
1533
|
+
*/
|
|
1534
|
+
rootProof?: string;
|
|
1516
1535
|
}
|
|
1517
1536
|
/** A policy that admits by signed release. The node refuses measurement lists beside it. */
|
|
1518
1537
|
export interface SignedReleaseTeeAdmissionPolicyRequest {
|
|
@@ -1521,6 +1540,12 @@ export interface SignedReleaseTeeAdmissionPolicyRequest {
|
|
|
1521
1540
|
acceptMock: boolean;
|
|
1522
1541
|
/** Absent means `replica`. */
|
|
1523
1542
|
mode?: TeeAdmissionMode;
|
|
1543
|
+
/**
|
|
1544
|
+
* Hex borsh of the signing admin's own root proof for this policy op
|
|
1545
|
+
* ({@link signOwnerOpProof} with the matching policy encoder). Omit it on a
|
|
1546
|
+
* node that holds that admin's account root, which signs one itself.
|
|
1547
|
+
*/
|
|
1548
|
+
rootProof?: string;
|
|
1524
1549
|
}
|
|
1525
1550
|
export type SetTeeAdmissionPolicyRequest = MeasurementTeeAdmissionPolicyRequest | SignedReleaseTeeAdmissionPolicyRequest;
|
|
1526
1551
|
export type SetTeeAdmissionPolicyResponseData = Record<string, never>;
|
|
@@ -1551,7 +1576,42 @@ export interface GetTeeAdmissionPolicyResponseData {
|
|
|
1551
1576
|
*/
|
|
1552
1577
|
export interface SetTeeAuthoringPolicyRequest {
|
|
1553
1578
|
allowedMrtd: string[];
|
|
1579
|
+
/**
|
|
1580
|
+
* Hex borsh of the signing admin's own root proof for this policy op
|
|
1581
|
+
* ({@link signOwnerOpProof} with the matching policy encoder). Omit it on a
|
|
1582
|
+
* node that holds that admin's account root, which signs one itself.
|
|
1583
|
+
*/
|
|
1584
|
+
rootProof?: string;
|
|
1585
|
+
}
|
|
1586
|
+
/**
|
|
1587
|
+
* The root proof an owner-level op carries (core schema 18).
|
|
1588
|
+
*
|
|
1589
|
+
* A device key alone cannot transfer a group, repoint a namespace's admin,
|
|
1590
|
+
* delete a group through the owner-only path, or set a TEE policy: each needs a
|
|
1591
|
+
* proof signed by the account's ROOT key. On a node that holds that root (as
|
|
1592
|
+
* `merod init` provisions) omit `rootProof` and the node signs it. Otherwise sign
|
|
1593
|
+
* one offline with {@link signOwnerOpProof}, over the group's current
|
|
1594
|
+
* `ownerOpCounter` and `namespaceId` from {@link GroupInfo}. Each proof applies
|
|
1595
|
+
* once. Without either, the node answers `403`.
|
|
1596
|
+
*/
|
|
1597
|
+
export interface RootGuardedOpRequest {
|
|
1598
|
+
/** Hex borsh of an `AccountProof<OwnerOpAuthorization>`. */
|
|
1599
|
+
rootProof?: string;
|
|
1554
1600
|
}
|
|
1601
|
+
/** Hand a group to `newOwner`, an account (64 hex) that is already one of its admins. */
|
|
1602
|
+
export interface TransferOwnershipRequest extends RootGuardedOpRequest {
|
|
1603
|
+
newOwner: string;
|
|
1604
|
+
}
|
|
1605
|
+
/** Repoint a namespace's admin pin at `newAdmin`, an account that is a member of its root. */
|
|
1606
|
+
export interface ChangeNamespaceAdminRequest extends RootGuardedOpRequest {
|
|
1607
|
+
newAdmin: string;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* The owner-only deletion of a group that holds no contexts. The admin-level
|
|
1611
|
+
* cascading delete is {@link AdminApiClient.deleteGroup}.
|
|
1612
|
+
*/
|
|
1613
|
+
export type OwnerDeleteGroupRequest = RootGuardedOpRequest;
|
|
1614
|
+
export type RootGuardedOpResponseData = Record<string, never>;
|
|
1555
1615
|
export type SetTeeAuthoringPolicyResponseData = Record<string, never>;
|
|
1556
1616
|
/**
|
|
1557
1617
|
* Generic metadata record attached to a group, group member, or
|