@calimero-network/mero-js 19.10.0 → 19.12.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 -1
- package/dist/admin-api/admin-client.js +19 -0
- package/dist/admin-api/admin-types.d.ts +83 -0
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +2 -2
- package/dist/index.cjs +29 -0
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +29 -0
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from '../http-client/index.js';
|
|
2
|
-
import type { HealthStatus, 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, RelinkDeviceRequest, RelinkDeviceResponseData, AccountDeviceEntry, AccountApplicationEntry, RevokeAccountDeviceRequest, RevokeAccountDeviceResponseData, GroupInfoResponseData, CreateGroupRequest, CreateGroupResponseData, DeleteGroupResponseData, ListGroupMembersResponseData, ListGroupContextsResponseData, AddGroupMembersRequest, RemoveGroupMembersRequest, UpdateMemberRoleRequest, MemberCapabilities, SetMemberCapabilitiesRequest, SetDefaultCapabilitiesRequest, SetMemberAutoFollowRequest, SetSubgroupVisibilityRequest, SetTeeAdmissionPolicyRequest, GetTeeAdmissionPolicyResponseData, 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, AdmitJoinRequest, AdmitJoinResponseData } from './admin-types.js';
|
|
2
|
+
import type { HealthStatus, 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, RelinkDeviceRequest, RelinkDeviceResponseData, RescopeDeviceRequest, RescopeDeviceResponseData, LabelDeviceRequest, LabelDeviceResponseData, AccountDeviceEntry, AccountApplicationEntry, RevokeAccountDeviceRequest, RevokeAccountDeviceResponseData, GroupInfoResponseData, CreateGroupRequest, CreateGroupResponseData, DeleteGroupResponseData, ListGroupMembersResponseData, ListGroupContextsResponseData, AddGroupMembersRequest, RemoveGroupMembersRequest, UpdateMemberRoleRequest, MemberCapabilities, SetMemberCapabilitiesRequest, SetDefaultCapabilitiesRequest, SetMemberAutoFollowRequest, SetSubgroupVisibilityRequest, SetTeeAdmissionPolicyRequest, GetTeeAdmissionPolicyResponseData, 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, AdmitJoinRequest, AdmitJoinResponseData } from './admin-types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Compare two version strings by SemVer 2.0 precedence, ascending: negative if
|
|
5
5
|
* `a < b`, positive if `a > b`, `0` if equal. Build metadata (`+...`) is stripped
|
|
@@ -272,6 +272,21 @@ export declare class AdminApiClient {
|
|
|
272
272
|
* would make the accidental request the widest one.
|
|
273
273
|
*/
|
|
274
274
|
relinkAccountDevice(deviceId: string, request?: RelinkDeviceRequest): Promise<RelinkDeviceResponseData>;
|
|
275
|
+
/**
|
|
276
|
+
* Replace a device's scope outright, in one root-signed op.
|
|
277
|
+
*
|
|
278
|
+
* {@link relinkAccountDevice} only ever adds applications; this is how a
|
|
279
|
+
* scope is narrowed - or an `all` device is given a fixed list instead. The
|
|
280
|
+
* device need not be online.
|
|
281
|
+
*/
|
|
282
|
+
rescopeAccountDevice(deviceId: string, request: RescopeDeviceRequest): Promise<RescopeDeviceResponseData>;
|
|
283
|
+
/**
|
|
284
|
+
* Name a device of this account, for a listing to render.
|
|
285
|
+
*
|
|
286
|
+
* Run on the node holding the account root to name any device; a paired
|
|
287
|
+
* node is accepted only for that device's own id.
|
|
288
|
+
*/
|
|
289
|
+
labelAccountDevice(deviceId: string, request: LabelDeviceRequest): Promise<LabelDeviceResponseData>;
|
|
275
290
|
/**
|
|
276
291
|
* Every device of this account, as this node sees them - its own included.
|
|
277
292
|
*
|
|
@@ -587,6 +587,25 @@ export class AdminApiClient {
|
|
|
587
587
|
async relinkAccountDevice(deviceId, request) {
|
|
588
588
|
return unwrap(await this.httpClient.post(`/admin-api/account/devices/${deviceId}/relink`, request ?? {}));
|
|
589
589
|
}
|
|
590
|
+
/**
|
|
591
|
+
* Replace a device's scope outright, in one root-signed op.
|
|
592
|
+
*
|
|
593
|
+
* {@link relinkAccountDevice} only ever adds applications; this is how a
|
|
594
|
+
* scope is narrowed - or an `all` device is given a fixed list instead. The
|
|
595
|
+
* device need not be online.
|
|
596
|
+
*/
|
|
597
|
+
async rescopeAccountDevice(deviceId, request) {
|
|
598
|
+
return unwrap(await this.httpClient.put(`/admin-api/account/devices/${encodeURIComponent(deviceId)}/scope`, request));
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Name a device of this account, for a listing to render.
|
|
602
|
+
*
|
|
603
|
+
* Run on the node holding the account root to name any device; a paired
|
|
604
|
+
* node is accepted only for that device's own id.
|
|
605
|
+
*/
|
|
606
|
+
async labelAccountDevice(deviceId, request) {
|
|
607
|
+
return unwrap(await this.httpClient.put(`/admin-api/account/devices/${encodeURIComponent(deviceId)}/label`, request));
|
|
608
|
+
}
|
|
590
609
|
/**
|
|
591
610
|
* Every device of this account, as this node sees them - its own included.
|
|
592
611
|
*
|
|
@@ -530,6 +530,18 @@ export interface NodeIdentity {
|
|
|
530
530
|
* a root nor has paired with the id; absent on an old node.
|
|
531
531
|
*/
|
|
532
532
|
accountNamespaceId?: string | null;
|
|
533
|
+
/**
|
|
534
|
+
* The account that withdrew this node's device, absent on a node no
|
|
535
|
+
* revocation has reached.
|
|
536
|
+
*/
|
|
537
|
+
revokedFrom?: RevokedFromEntry;
|
|
538
|
+
}
|
|
539
|
+
/** Which account withdrew this node's device, and which device it was. */
|
|
540
|
+
export interface RevokedFromEntry {
|
|
541
|
+
/** The account the device spoke for, 64 hex characters. */
|
|
542
|
+
accountId: string;
|
|
543
|
+
/** The device that was withdrawn, 64 hex characters. */
|
|
544
|
+
deviceId: string;
|
|
533
545
|
}
|
|
534
546
|
/**
|
|
535
547
|
* @deprecated Use {@link AdminApiClient.getNodeIdentity} instead. Nothing here
|
|
@@ -811,6 +823,25 @@ export interface RelinkDeviceRequest {
|
|
|
811
823
|
*/
|
|
812
824
|
applications?: string[];
|
|
813
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* The scope to hold: every application, or only the ones named.
|
|
828
|
+
*
|
|
829
|
+
* A tagged shape rather than a list whose emptiness means everything - `all`
|
|
830
|
+
* and `only: []` differ by a whole order of magnitude in what they grant, and
|
|
831
|
+
* an empty `only` is refused rather than treated as `all`.
|
|
832
|
+
*/
|
|
833
|
+
export type DeviceScope = 'all' | {
|
|
834
|
+
only: string[];
|
|
835
|
+
};
|
|
836
|
+
/**
|
|
837
|
+
* Replace a device's scope outright, in one root-signed op.
|
|
838
|
+
*
|
|
839
|
+
* {@link relinkAccountDevice} only ever adds applications; this is how a
|
|
840
|
+
* scope is narrowed, or an `all` device is given a fixed list instead.
|
|
841
|
+
*/
|
|
842
|
+
export interface RescopeDeviceRequest {
|
|
843
|
+
scope: DeviceScope;
|
|
844
|
+
}
|
|
814
845
|
/** One namespace the relink published the device's link into. */
|
|
815
846
|
export interface RelinkOutcomeEntry {
|
|
816
847
|
/** The namespace id, 64 hex characters. */
|
|
@@ -834,6 +865,31 @@ export interface RelinkSkipEntry {
|
|
|
834
865
|
*/
|
|
835
866
|
reason: string;
|
|
836
867
|
}
|
|
868
|
+
/** One namespace a scope replacement no longer reaches. */
|
|
869
|
+
export interface RescopeDescopeEntry {
|
|
870
|
+
/** The namespace id, 64 hex characters. */
|
|
871
|
+
namespaceId: string;
|
|
872
|
+
/**
|
|
873
|
+
* Whether the scope key was rotated. `false` means the device stopped writing
|
|
874
|
+
* there but still holds the key it had, until an admin rotates.
|
|
875
|
+
*/
|
|
876
|
+
keyRotated: boolean;
|
|
877
|
+
}
|
|
878
|
+
/** The scope a device now holds, and what each namespace did about it. */
|
|
879
|
+
export interface RescopeDeviceResponseData {
|
|
880
|
+
/** The account the device speaks for, 64 hex characters. */
|
|
881
|
+
accountId: string;
|
|
882
|
+
/** The device that was rescoped, 64 hex characters. */
|
|
883
|
+
deviceId: string;
|
|
884
|
+
/** The scope after the request, 64 hex each. Empty means every application. */
|
|
885
|
+
applications: string[];
|
|
886
|
+
/** Namespaces the new scope no longer reaches. */
|
|
887
|
+
descoped: RescopeDescopeEntry[];
|
|
888
|
+
/** Namespaces the device was linked into by this call. */
|
|
889
|
+
linkedIn: RelinkOutcomeEntry[];
|
|
890
|
+
/** Namespaces nothing was published into, and why. */
|
|
891
|
+
skipped: RelinkSkipEntry[];
|
|
892
|
+
}
|
|
837
893
|
/** What the relink repaired, and what it left alone. */
|
|
838
894
|
export interface RelinkDeviceResponseData {
|
|
839
895
|
/** The account the device speaks for, 64 hex characters. */
|
|
@@ -879,6 +935,33 @@ export interface AccountDeviceEntry {
|
|
|
879
935
|
* hex characters each. Empty for a certified device not yet bound anywhere.
|
|
880
936
|
*/
|
|
881
937
|
namespaces: string[];
|
|
938
|
+
/**
|
|
939
|
+
* The replicated name the account gave this device, absent while it has
|
|
940
|
+
* none. Every device of the account reads the same one.
|
|
941
|
+
*/
|
|
942
|
+
label?: string;
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Name a device of this account, for a listing to render.
|
|
946
|
+
*
|
|
947
|
+
* Run on the node holding the account root to name any device; a paired node
|
|
948
|
+
* is accepted only for that device's own id.
|
|
949
|
+
*/
|
|
950
|
+
export interface LabelDeviceRequest {
|
|
951
|
+
/** Trimmed, non-empty, bounded and free of control characters. */
|
|
952
|
+
label: string;
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* The name that was published, and the epoch that orders it against a rename
|
|
956
|
+
* another device of the account made at the same time.
|
|
957
|
+
*/
|
|
958
|
+
export interface LabelDeviceResponseData {
|
|
959
|
+
/** The account the device speaks for, 64 hex characters. */
|
|
960
|
+
accountId: string;
|
|
961
|
+
/** The device that was named, 64 hex characters. */
|
|
962
|
+
deviceId: string;
|
|
963
|
+
label: string;
|
|
964
|
+
labelEpoch: number;
|
|
882
965
|
}
|
|
883
966
|
/**
|
|
884
967
|
* One application this account speaks in, derived from the namespaces this node
|