@calimero-network/mero-js 22.0.0 → 22.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.
@@ -1252,6 +1252,18 @@ export interface GroupInfo {
1252
1252
  metadata?: MetadataRecord | null;
1253
1253
  }
1254
1254
  export type GroupInfoResponseData = GroupInfo;
1255
+ /**
1256
+ * A group member's role, as the node serializes it (PascalCase).
1257
+ *
1258
+ * The two TEE roles are minted by hardware-attestation admission only, never by
1259
+ * an invitation or a role change:
1260
+ * - `ReadOnlyTee` — a TEE **replica**: replicates and anchors sync, never
1261
+ * relays a member's write (a relay intent to one is refused with a 403).
1262
+ * - `RelayTee` — a TEE **relay**: a replica that may also author members'
1263
+ * writes under their signed warrants, with no `CAN_AUTHOR_ON_BEHALF` grant.
1264
+ * Admitted when the namespace's {@link TeeAdmissionMode} is `relay`.
1265
+ */
1266
+ export type GroupMemberRole = 'Admin' | 'Member' | 'ReadOnly' | 'ReadOnlyTee' | 'RelayTee';
1255
1267
  export interface GroupMember {
1256
1268
  /**
1257
1269
  * The member's ACCOUNT: 64 hex characters.
@@ -1264,7 +1276,7 @@ export interface GroupMember {
1264
1276
  * to {@link GroupMemberInput}.
1265
1277
  */
1266
1278
  identity: string;
1267
- role: string;
1279
+ role: GroupMemberRole;
1268
1280
  name?: string;
1269
1281
  }
1270
1282
  export interface ListGroupMembersResponseData {
@@ -1399,6 +1411,14 @@ export interface SignedReleaseTeePolicy {
1399
1411
  /** The oldest release admitted (`2.3.72`); any signed release when absent. */
1400
1412
  minReleaseVersion?: string;
1401
1413
  }
1414
+ /**
1415
+ * Which role a namespace admits attested TEE nodes with: `replica`
1416
+ * (`ReadOnlyTee`, the default) or `relay` (`RelayTee`, which may also author
1417
+ * members' writes under their warrants). Part of the admin-signed policy, so
1418
+ * every node admits with the same role; changing it converts the TEEs already
1419
+ * admitted.
1420
+ */
1421
+ export type TeeAdmissionMode = 'replica' | 'relay';
1402
1422
  /** A policy that lists the measurements it admits. */
1403
1423
  export interface MeasurementTeeAdmissionPolicyRequest {
1404
1424
  allowedMrtd: string[];
@@ -1408,16 +1428,22 @@ export interface MeasurementTeeAdmissionPolicyRequest {
1408
1428
  allowedRtmr3: string[];
1409
1429
  allowedTcbStatuses: string[];
1410
1430
  acceptMock: boolean;
1431
+ /** Absent means `replica`. */
1432
+ mode?: TeeAdmissionMode;
1411
1433
  }
1412
1434
  /** A policy that admits by signed release. The node refuses measurement lists beside it. */
1413
1435
  export interface SignedReleaseTeeAdmissionPolicyRequest {
1414
1436
  signedRelease: SignedReleaseTeePolicy;
1415
1437
  allowedTcbStatuses: string[];
1416
1438
  acceptMock: boolean;
1439
+ /** Absent means `replica`. */
1440
+ mode?: TeeAdmissionMode;
1417
1441
  }
1418
1442
  export type SetTeeAdmissionPolicyRequest = MeasurementTeeAdmissionPolicyRequest | SignedReleaseTeeAdmissionPolicyRequest;
1419
1443
  export type SetTeeAdmissionPolicyResponseData = Record<string, never>;
1420
1444
  export interface GetTeeAdmissionPolicyResponseData {
1445
+ /** `false` when no policy is set; the rest are then empty. */
1446
+ enabled?: boolean;
1421
1447
  allowedMrtd: string[];
1422
1448
  allowedRtmr0: string[];
1423
1449
  allowedRtmr1: string[];
@@ -1427,6 +1453,11 @@ export interface GetTeeAdmissionPolicyResponseData {
1427
1453
  acceptMock: boolean;
1428
1454
  /** Set when the policy admits by signed release; the lists are then empty. */
1429
1455
  signedRelease?: SignedReleaseTeePolicy;
1456
+ /**
1457
+ * The role admitted TEEs receive. `replica` for a policy set before the mode
1458
+ * existed; absent only from a node that predates it.
1459
+ */
1460
+ mode?: TeeAdmissionMode;
1430
1461
  }
1431
1462
  /**
1432
1463
  * Which admitted TEEs may author as the group's TEE authority (the writer behind
@@ -1,3 +1,4 @@
1
+ import type { GroupMemberRole } from '../admin-api/admin-types.js';
1
2
  /** Parsed group-membership event (core's untagged `NodeEvent` group variant). */
2
3
  export interface GroupMembershipEventData {
3
4
  groupId: string;
@@ -10,7 +11,7 @@ export interface GroupMembershipEventData {
10
11
  memberAccount: string;
11
12
  /** Absent on `MemberRemoved`, and on a `MemberJoined` inherited from an Open
12
13
  * subgroup. Core's set is closed. */
13
- role?: 'Admin' | 'Member' | 'ReadOnly' | 'ReadOnlyTee';
14
+ role?: GroupMemberRole;
14
15
  };
15
16
  }
16
17
  /**