@calimero-network/mero-js 26.11.0 → 27.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/README.md +73 -288
- package/dist/cloud-v2/attestation.d.ts +91 -0
- package/dist/cloud-v2/attestation.js +135 -0
- package/dist/cloud-v2/capabilities.d.ts +30 -0
- package/dist/cloud-v2/capabilities.js +31 -0
- package/dist/cloud-v2/client.d.ts +426 -0
- package/dist/cloud-v2/client.js +646 -0
- package/dist/cloud-v2/errors.d.ts +98 -0
- package/dist/cloud-v2/errors.js +165 -0
- package/dist/cloud-v2/index.d.ts +10 -0
- package/dist/cloud-v2/index.js +5 -0
- package/dist/cloud-v2/passkey.d.ts +27 -0
- package/dist/cloud-v2/passkey.js +73 -0
- package/dist/crypto/internal.d.ts +3 -37
- package/dist/crypto/internal.js +3 -72
- package/dist/index.browser.mjs +4 -2
- package/dist/index.browser.mjs.map +4 -4
- package/dist/index.cjs +1750 -12772
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +3 -56
- package/dist/index.js +14 -75
- package/dist/index.mjs +1750 -12772
- package/dist/index.mjs.map +4 -4
- package/dist/sealed/index.d.ts +4 -4
- package/dist/sealed/index.js +2 -2
- package/dist/sealed/release.d.ts +21 -76
- package/dist/sealed/release.js +24 -108
- package/dist/sealed/sealed.d.ts +8 -56
- package/dist/sealed/sealed.js +11 -89
- package/dist/sealed/verify.d.ts +7 -13
- package/dist/sealed/verify.js +3 -7
- package/package.json +8 -13
- package/dist/account/account-admin.d.ts +0 -80
- package/dist/account/account-admin.js +0 -346
- package/dist/account/account.d.ts +0 -196
- package/dist/account/account.js +0 -269
- package/dist/account/application-id.d.ts +0 -50
- package/dist/account/application-id.js +0 -83
- package/dist/account/bootstrap-from-invitation.d.ts +0 -110
- package/dist/account/bootstrap-from-invitation.js +0 -80
- package/dist/account/create-context.d.ts +0 -103
- package/dist/account/create-context.js +0 -267
- package/dist/account/govern.d.ts +0 -24
- package/dist/account/govern.js +0 -50
- package/dist/account/index.d.ts +0 -26
- package/dist/account/index.js +0 -15
- package/dist/account/join-as-account.d.ts +0 -23
- package/dist/account/join-as-account.js +0 -34
- package/dist/account/join-with-node.d.ts +0 -115
- package/dist/account/join-with-node.js +0 -161
- package/dist/account/node-admin.d.ts +0 -20
- package/dist/account/node-admin.js +0 -33
- package/dist/account/relay-from-invitation.d.ts +0 -137
- package/dist/account/relay-from-invitation.js +0 -180
- package/dist/account/relay-login-error.d.ts +0 -32
- package/dist/account/relay-login-error.js +0 -34
- package/dist/account/session.d.ts +0 -266
- package/dist/account/session.js +0 -915
- package/dist/account/wordlist.d.ts +0 -16
- package/dist/account/wordlist.js +0 -273
- package/dist/admin-api/admin-client.d.ts +0 -688
- package/dist/admin-api/admin-client.js +0 -1230
- package/dist/admin-api/admin-factory.d.ts +0 -14
- package/dist/admin-api/admin-factory.js +0 -22
- package/dist/admin-api/admin-types.d.ts +0 -2046
- package/dist/admin-api/admin-types.js +0 -12
- package/dist/admin-api/index.d.ts +0 -4
- package/dist/admin-api/index.js +0 -5
- package/dist/admin-api/redeem-invitation.d.ts +0 -101
- package/dist/admin-api/redeem-invitation.js +0 -200
- package/dist/auth/index.d.ts +0 -34
- package/dist/auth/index.js +0 -67
- package/dist/auth-api/auth-client.d.ts +0 -31
- package/dist/auth-api/auth-client.js +0 -117
- package/dist/auth-api/auth-factory.d.ts +0 -7
- package/dist/auth-api/auth-factory.js +0 -41
- package/dist/auth-api/auth-types.d.ts +0 -130
- package/dist/auth-api/auth-types.js +0 -2
- package/dist/auth-api/index.d.ts +0 -3
- package/dist/auth-api/index.js +0 -4
- package/dist/capabilities.d.ts +0 -84
- package/dist/capabilities.js +0 -117
- package/dist/cloud/account-ownership.d.ts +0 -63
- package/dist/cloud/account-ownership.js +0 -87
- package/dist/cloud/cloud-client.d.ts +0 -949
- package/dist/cloud/cloud-client.js +0 -1068
- package/dist/cloud/connect.d.ts +0 -213
- package/dist/cloud/connect.js +0 -260
- package/dist/cloud/enrol-redirect.d.ts +0 -181
- package/dist/cloud/enrol-redirect.js +0 -244
- package/dist/cloud/index.d.ts +0 -12
- package/dist/cloud/index.js +0 -10
- package/dist/cloud/link-redirect.d.ts +0 -95
- package/dist/cloud/link-redirect.js +0 -121
- package/dist/cloud/link-state.d.ts +0 -36
- package/dist/cloud/link-state.js +0 -104
- package/dist/cloud/routing-proof.d.ts +0 -113
- package/dist/cloud/routing-proof.js +0 -96
- package/dist/device-cert/device-cert.d.ts +0 -189
- package/dist/device-cert/device-cert.js +0 -239
- package/dist/device-cert/device-scope.d.ts +0 -58
- package/dist/device-cert/device-scope.js +0 -76
- package/dist/device-cert/index.d.ts +0 -4
- package/dist/device-cert/index.js +0 -3
- package/dist/ephemeral/codec.d.ts +0 -4
- package/dist/ephemeral/codec.js +0 -12
- package/dist/ephemeral/index.d.ts +0 -57
- package/dist/ephemeral/index.js +0 -101
- package/dist/ephemeral/types.d.ts +0 -27
- package/dist/ephemeral/types.js +0 -1
- package/dist/errors/classify.d.ts +0 -65
- package/dist/errors/classify.js +0 -117
- package/dist/errors/index.d.ts +0 -2
- package/dist/errors/index.js +0 -1
- package/dist/events/group.d.ts +0 -95
- package/dist/events/group.js +0 -10
- package/dist/events/index.d.ts +0 -5
- package/dist/events/index.js +0 -2
- package/dist/events/sse.d.ts +0 -127
- package/dist/events/sse.js +0 -469
- package/dist/events/ws.d.ts +0 -57
- package/dist/events/ws.js +0 -212
- package/dist/http-client/api-response.d.ts +0 -15
- package/dist/http-client/api-response.js +0 -1
- package/dist/http-client/http-factory.d.ts +0 -71
- package/dist/http-client/http-factory.js +0 -68
- package/dist/http-client/http-types.d.ts +0 -87
- package/dist/http-client/http-types.js +0 -1
- package/dist/http-client/index.d.ts +0 -7
- package/dist/http-client/index.js +0 -11
- package/dist/http-client/path-segment.d.ts +0 -1
- package/dist/http-client/path-segment.js +0 -8
- package/dist/http-client/retry.d.ts +0 -5
- package/dist/http-client/retry.js +0 -82
- package/dist/http-client/signal-utils.d.ts +0 -2
- package/dist/http-client/signal-utils.js +0 -41
- package/dist/http-client/web-client.d.ts +0 -80
- package/dist/http-client/web-client.js +0 -557
- package/dist/invitation/index.d.ts +0 -2
- package/dist/invitation/index.js +0 -2
- package/dist/invitation/invitation.d.ts +0 -106
- package/dist/invitation/invitation.js +0 -104
- package/dist/login/index.d.ts +0 -4
- package/dist/login/index.js +0 -3
- package/dist/login/login.d.ts +0 -111
- package/dist/login/login.js +0 -110
- package/dist/login/session.d.ts +0 -124
- package/dist/login/session.js +0 -141
- package/dist/mero-js.d.ts +0 -231
- package/dist/mero-js.js +0 -469
- package/dist/namespace-op/index.d.ts +0 -2
- package/dist/namespace-op/index.js +0 -3
- package/dist/namespace-op/namespace-op.d.ts +0 -150
- package/dist/namespace-op/namespace-op.js +0 -191
- package/dist/nodeDiscovery.d.ts +0 -47
- package/dist/nodeDiscovery.js +0 -101
- package/dist/owner-op/index.d.ts +0 -2
- package/dist/owner-op/index.js +0 -3
- package/dist/owner-op/owner-op.d.ts +0 -119
- package/dist/owner-op/owner-op.js +0 -214
- package/dist/presence/relay-presence.d.ts +0 -56
- package/dist/presence/relay-presence.js +0 -107
- package/dist/presence/statement.d.ts +0 -12
- package/dist/presence/statement.js +0 -17
- package/dist/relay/index.d.ts +0 -4
- package/dist/relay/index.js +0 -2
- package/dist/relay/nonce-source.d.ts +0 -72
- package/dist/relay/nonce-source.js +0 -111
- package/dist/relay/relay-client.d.ts +0 -472
- package/dist/relay/relay-client.js +0 -518
- package/dist/relay-attestation/attest-node-key.d.ts +0 -66
- package/dist/relay-attestation/attest-node-key.js +0 -110
- package/dist/relay-attestation/index.d.ts +0 -1
- package/dist/relay-attestation/index.js +0 -1
- package/dist/request/caller-proof.d.ts +0 -43
- package/dist/request/caller-proof.js +0 -36
- package/dist/request/index.d.ts +0 -3
- package/dist/request/index.js +0 -3
- package/dist/request/proof-signer.d.ts +0 -49
- package/dist/request/proof-signer.js +0 -59
- package/dist/request/request-sig.d.ts +0 -99
- package/dist/request/request-sig.js +0 -95
- package/dist/request-proof/authorizer.d.ts +0 -41
- package/dist/request-proof/authorizer.js +0 -60
- package/dist/request-proof/index.d.ts +0 -4
- package/dist/request-proof/index.js +0 -2
- package/dist/request-proof/request-proof.d.ts +0 -53
- package/dist/request-proof/request-proof.js +0 -95
- package/dist/rpc/index.d.ts +0 -64
- package/dist/rpc/index.js +0 -78
- package/dist/signer/index.d.ts +0 -2
- package/dist/signer/index.js +0 -3
- package/dist/signer/signer.d.ts +0 -92
- package/dist/signer/signer.js +0 -147
- package/dist/token-store/index.d.ts +0 -27
- package/dist/token-store/index.js +0 -62
- package/dist/transport/index.d.ts +0 -6
- package/dist/transport/index.js +0 -3
- package/dist/transport/mero-client.d.ts +0 -294
- package/dist/transport/mero-client.js +0 -386
- package/dist/transport/relay-observer.d.ts +0 -152
- package/dist/transport/relay-observer.js +0 -173
- package/dist/transport/relay-transport.d.ts +0 -73
- package/dist/transport/relay-transport.js +0 -94
- package/dist/transport/types.d.ts +0 -100
- package/dist/transport/types.js +0 -32
- package/dist/types/api-response.d.ts +0 -15
- package/dist/types/api-response.js +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/dist/warrant/creation-warrant.d.ts +0 -163
- package/dist/warrant/creation-warrant.js +0 -194
- package/dist/warrant/governance-op.d.ts +0 -202
- package/dist/warrant/governance-op.js +0 -355
- package/dist/warrant/governance-warrant.d.ts +0 -124
- package/dist/warrant/governance-warrant.js +0 -164
- package/dist/warrant/index.d.ts +0 -8
- package/dist/warrant/index.js +0 -5
- package/dist/warrant/warrant.d.ts +0 -188
- package/dist/warrant/warrant.js +0 -202
|
@@ -1,688 +0,0 @@
|
|
|
1
|
-
import { HttpClient } 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, UpdateContextApplicationRequest, ResyncContextRequest, ResyncContextResponseData, ContextsWithExecutorsResponseData, UploadBlobRequest, UploadBlobResponseData, DeleteBlobResponseData, ListBlobsResponseData, GetBlobInfoResponseData, BlobReadOptions, CreateContextAliasRequest, CreateApplicationAliasRequest, CreateDeviceAliasRequest, CreateAliasResponseData, LookupAliasResponseData, DeleteAliasResponseData, ListAliasesResponseData, ListNamespacesResponseData, CreateNamespaceRequest, CreateNamespaceResponseData, OutboundApproval, SetOutboundApprovalRequest, SetOutboundApprovalResponseData, DeleteNamespaceResponseData, CreateNamespaceInvitationRequest, CreateNamespaceInvitationResponseData, CreateRecursiveInvitationResponseData, JoinNamespaceRequest, JoinNamespaceResponseData, CreateGroupInNamespaceRequest, CreateGroupInNamespaceResponseData, SubgroupEntry, Namespace, 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, ActivateGroupUpgradeRequest, ActivateGroupUpgradeResponseData, UpgradeGroupRequest, UpgradeGroupResponseData, GroupUpgradeStatusResponseData, MissingRelease, MigrationStatus, NamespaceRevokedDevices, CascadeStatusEntry, RetryGroupUpgradeResponseData, ReparentGroupRequest, ReparentGroupResponseData, IssueOwnershipProofRequest, IssueNamespaceOwnershipProofRequest, IssueOwnershipProofResponseData, CreateGroupInvitationRequest, CreateGroupInvitationResponseData, CreateRecursiveGroupInvitationResponseData, JoinGroupRequest, JoinGroupResponseData, TeeInfoResponseData, TeeAttestRequest, TeeAttestResponseData, PerformIntentRequest, PerformIntentResponseData, IntentRelayInfo, QueryContextRequest, QueryContextResponseData, ListMemberDevicesResponseData, SealToAccountRequest, SealedEnvelope, AdmitJoinRequest, AdmitJoinResponseData, CreateAccessGrantRequest, AccessGrant, CreatedAccessGrant, RevokeAccessGrantResponseData, AccessGrantCallRequest, AccessGrantCallResponseData } from './admin-types.js';
|
|
3
|
-
import { type RedeemOutcome } from './redeem-invitation.js';
|
|
4
|
-
/**
|
|
5
|
-
* Compare two version strings by SemVer 2.0 precedence, ascending: negative if
|
|
6
|
-
* `a < b`, positive if `a > b`, `0` if equal. Build metadata (`+...`) is stripped
|
|
7
|
-
* and ignored. The numeric `major.minor.patch` core is compared field-by-field
|
|
8
|
-
* (numerically when both parse, so `1.10.0 > 1.9.0`; a missing field is `0`). A
|
|
9
|
-
* version WITH a pre-release ranks below the same core without one, and
|
|
10
|
-
* pre-release identifiers compare per spec: dot-separated, numeric identifiers
|
|
11
|
-
* numerically, alphanumeric lexically by ASCII, numeric below alphanumeric, and a
|
|
12
|
-
* shorter set of identifiers loses when all preceding fields are equal.
|
|
13
|
-
*/
|
|
14
|
-
export declare function compareSemver(a: string, b: string): number;
|
|
15
|
-
export declare class AdminApiClient {
|
|
16
|
-
private httpClient;
|
|
17
|
-
constructor(httpClient: HttpClient);
|
|
18
|
-
healthCheck(): Promise<HealthStatus>;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the node has finished starting and its store answers. Public, like
|
|
21
|
-
* {@link healthCheck}; unlike it, a node that is up but not ready answers
|
|
22
|
-
* `503`, which this surfaces as an `HTTPError` whose body names the stage.
|
|
23
|
-
*/
|
|
24
|
-
readinessCheck(): Promise<ReadinessStatus>;
|
|
25
|
-
isAuthed(): Promise<AdminAuthStatus>;
|
|
26
|
-
/**
|
|
27
|
-
* Install a published application by its `package@version` coordinates. The
|
|
28
|
-
* node resolves and fetches them from its own configured `[registry]`, so no
|
|
29
|
-
* URL is passed and none is accepted. A 502 means the node's source has
|
|
30
|
-
* nothing published at those coordinates. This is the discrete "download"
|
|
31
|
-
* step an Updates flow pairs with a subsequent `upgradeGroup`.
|
|
32
|
-
*/
|
|
33
|
-
installApplication(request: InstallApplicationRequest): Promise<InstallApplicationResponseData>;
|
|
34
|
-
/**
|
|
35
|
-
* List a package's published versions from the registry, newest-first by
|
|
36
|
-
* semver. Reads the registry's V2 bundle listing
|
|
37
|
-
* (`GET {registry}/api/v2/bundles?package={package}`), taking each bundle's
|
|
38
|
-
* `appVersion`. Registry-side data — distinct from the node's
|
|
39
|
-
* installed-version list — and the source an Updates view compares against
|
|
40
|
-
* the running `Context.applicationVersion` to detect "a new version exists".
|
|
41
|
-
*/
|
|
42
|
-
getRegistryVersions(registryUrl: string, packageName: string): Promise<string[]>;
|
|
43
|
-
installDevApplication(request: InstallDevApplicationRequest): Promise<InstallApplicationResponseData>;
|
|
44
|
-
uninstallApplication(appId: string): Promise<UninstallApplicationResponseData>;
|
|
45
|
-
listApplications(): Promise<ListApplicationsResponseData>;
|
|
46
|
-
getApplication(appId: string): Promise<GetApplicationResponseData>;
|
|
47
|
-
/**
|
|
48
|
-
* Installed-blob inventory for an application — one entry per locally installed
|
|
49
|
-
* version. This is the *installed* inventory (source for a "pick a version to
|
|
50
|
-
* pin" UI); the registry equivalent is `listPackageVersions`.
|
|
51
|
-
*/
|
|
52
|
-
listApplicationVersions(applicationId: string): Promise<ApplicationVersionEntry[]>;
|
|
53
|
-
/**
|
|
54
|
-
* The application's embedded `wasm-abi/1` manifest. Omit `serviceName` for
|
|
55
|
-
* single-service apps; core 400s if the ABI is absent or the name is ambiguous.
|
|
56
|
-
*/
|
|
57
|
-
getApplicationAbi(applicationId: string, serviceName?: string): Promise<GetApplicationAbiResponseData>;
|
|
58
|
-
listPackages(): Promise<ListPackagesResponseData>;
|
|
59
|
-
listPackageVersions(packageName: string): Promise<ListVersionsResponseData>;
|
|
60
|
-
getLatestPackageVersion(packageName: string): Promise<GetLatestVersionResponseData>;
|
|
61
|
-
createContext(request: CreateContextRequest): Promise<CreateContextResponseData>;
|
|
62
|
-
deleteContext(contextId: string): Promise<DeleteContextResponseData>;
|
|
63
|
-
getContexts(): Promise<GetContextsResponseData>;
|
|
64
|
-
getContext(contextId: string): Promise<Context>;
|
|
65
|
-
getContextsForApplication(applicationId: string): Promise<GetContextsResponseData>;
|
|
66
|
-
generateContextIdentity(): Promise<GenerateContextIdentityResponseData>;
|
|
67
|
-
getContextIdentities(contextId: string): Promise<GetContextIdentitiesResponseData>;
|
|
68
|
-
getContextIdentitiesOwned(contextId: string): Promise<GetContextIdentitiesResponseData>;
|
|
69
|
-
joinContext(contextId: string): Promise<JoinContextResponseData>;
|
|
70
|
-
getContextGroup(contextId: string): Promise<ContextGroupResponseData>;
|
|
71
|
-
getContextStorage(contextId: string): Promise<ContextStorageResponseData>;
|
|
72
|
-
/** Sync one context, or every context when `contextId` is omitted. */
|
|
73
|
-
syncContext(contextId?: string): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* Kick off a full state re-pull for a context (operator recovery for a
|
|
76
|
-
* stranded context). `force` re-pulls even when the node does not flag the
|
|
77
|
-
* context as stranded.
|
|
78
|
-
*/
|
|
79
|
-
resyncContext(contextId: string, request?: ResyncContextRequest): Promise<ResyncContextResponseData>;
|
|
80
|
-
updateContextApplication(contextId: string, request: UpdateContextApplicationRequest): Promise<void>;
|
|
81
|
-
getContextsWithExecutorsForApplication(applicationId: string): Promise<ContextsWithExecutorsResponseData>;
|
|
82
|
-
uploadBlob(request: UploadBlobRequest): Promise<UploadBlobResponseData>;
|
|
83
|
-
deleteBlob(blobId: string): Promise<DeleteBlobResponseData>;
|
|
84
|
-
listBlobs(): Promise<ListBlobsResponseData>;
|
|
85
|
-
/**
|
|
86
|
-
* Blob-read query params. `context_id` is the same snake_case param
|
|
87
|
-
* {@link uploadBlob} announces with; building it in one place keeps the read
|
|
88
|
-
* side from drifting from the write side.
|
|
89
|
-
*/
|
|
90
|
-
private blobPath;
|
|
91
|
-
/**
|
|
92
|
-
* Download a blob's raw bytes. `GET /admin-api/blobs/:id` streams the blob
|
|
93
|
-
* content (e.g. `application/gzip`), NOT JSON — so fetch it as an ArrayBuffer.
|
|
94
|
-
* Use {@link listBlobs} for `{ blobId, size }` metadata.
|
|
95
|
-
*
|
|
96
|
-
* Without `contextId` the read is local-only: the node answers from its own
|
|
97
|
-
* blob store and returns immediately, or 404s. Passing `contextId` opts into
|
|
98
|
-
* network discovery — the node probes that context's peers (availability
|
|
99
|
-
* nodes first) for a holder, then transfers the bytes. Budget for it: core
|
|
100
|
-
* bounds discovery by a ~30s deadline, and the transfer is on top of that, so
|
|
101
|
-
* the worst case is well past what a UI should block on unhinted.
|
|
102
|
-
*/
|
|
103
|
-
getBlob(blobId: string, options?: BlobReadOptions): Promise<ArrayBuffer>;
|
|
104
|
-
/**
|
|
105
|
-
* Fetch a blob's metadata without downloading it. `HEAD /admin-api/blobs/:id`
|
|
106
|
-
* returns the info in response headers (size via `content-length`, plus
|
|
107
|
-
* `x-blob-id`/`x-blob-hash`/`x-blob-mime-type`).
|
|
108
|
-
*
|
|
109
|
-
* Without `contextId` this is a local-only presence check that returns
|
|
110
|
-
* immediately. Passing `contextId` opts into the same network discovery
|
|
111
|
-
* {@link getBlob} uses — presence and size answered by probing the context's
|
|
112
|
-
* peers, with no transfer — so it inherits core's ~30s discovery deadline as
|
|
113
|
-
* its worst case. A probe only carries `found` and `size`, so a peer-sourced
|
|
114
|
-
* answer has no `hash`/`mimeType`; read `source` to tell the two apart.
|
|
115
|
-
*/
|
|
116
|
-
getBlobInfo(blobId: string, options?: BlobReadOptions): Promise<GetBlobInfoResponseData>;
|
|
117
|
-
createContextAlias(request: CreateContextAliasRequest): Promise<CreateAliasResponseData>;
|
|
118
|
-
createApplicationAlias(request: CreateApplicationAliasRequest): Promise<CreateAliasResponseData>;
|
|
119
|
-
lookupContextAlias(name: string): Promise<LookupAliasResponseData>;
|
|
120
|
-
lookupApplicationAlias(name: string): Promise<LookupAliasResponseData>;
|
|
121
|
-
deleteContextAlias(name: string): Promise<DeleteAliasResponseData>;
|
|
122
|
-
deleteApplicationAlias(name: string): Promise<DeleteAliasResponseData>;
|
|
123
|
-
listContextAliases(): Promise<ListAliasesResponseData>;
|
|
124
|
-
listApplicationAliases(): Promise<ListAliasesResponseData>;
|
|
125
|
-
createDeviceAlias(request: CreateDeviceAliasRequest): Promise<CreateAliasResponseData>;
|
|
126
|
-
lookupDeviceAlias(name: string): Promise<LookupAliasResponseData>;
|
|
127
|
-
deleteDeviceAlias(name: string): Promise<DeleteAliasResponseData>;
|
|
128
|
-
listDeviceAliases(): Promise<ListAliasesResponseData>;
|
|
129
|
-
listNamespaces(): Promise<ListNamespacesResponseData>;
|
|
130
|
-
getNamespace(namespaceId: string): Promise<Namespace>;
|
|
131
|
-
/**
|
|
132
|
-
* Who this node is — the account it writes as, the device it is, the key it
|
|
133
|
-
* signs with, and the account root a second device pairs against.
|
|
134
|
-
*
|
|
135
|
-
* Takes no namespace, and that is the point: one root key is one account
|
|
136
|
-
* everywhere, and a node signs with one key, so none of it varies by
|
|
137
|
-
* namespace.
|
|
138
|
-
*/
|
|
139
|
-
getNodeIdentity(): Promise<NodeIdentity>;
|
|
140
|
-
/**
|
|
141
|
-
* Ask this node to run one method on a member's behalf, under a warrant that
|
|
142
|
-
* member signed.
|
|
143
|
-
*
|
|
144
|
-
* The node executes and signs the envelope with its own key; the change is
|
|
145
|
-
* attributed to the **author**. Both halves travel together, so every peer
|
|
146
|
-
* re-checks that the member consented instead of trusting the relay.
|
|
147
|
-
*
|
|
148
|
-
* Three things have to be true first, and none is implied by the others:
|
|
149
|
-
*
|
|
150
|
-
* - the author's **account** is a member of the group owning the context —
|
|
151
|
-
* their device joins nothing and is in no group's binding rows, which is
|
|
152
|
-
* exactly the case a device certificate covers;
|
|
153
|
-
* - this node holds `CAN_AUTHOR_ON_BEHALF` on that group, which is implied by
|
|
154
|
-
* neither membership nor admin;
|
|
155
|
-
* - the warrant has not been spent. It is single-use: presenting a valid one
|
|
156
|
-
* twice is refused, because the signature stays valid forever and replay is
|
|
157
|
-
* not forgery.
|
|
158
|
-
*
|
|
159
|
-
* A refusal comes back as a `403` carrying the reason — "an admin must grant
|
|
160
|
-
* CAN_AUTHOR_ON_BEHALF to …", or that the nonce is already spent — so a caller
|
|
161
|
-
* can tell which precondition failed rather than only that one did.
|
|
162
|
-
*
|
|
163
|
-
* Mint the warrant with {@link signWarrant}; see
|
|
164
|
-
* {@link PerformIntentRequest.warrant}.
|
|
165
|
-
*/
|
|
166
|
-
performIntent(contextId: string, request: PerformIntentRequest): Promise<PerformIntentResponseData>;
|
|
167
|
-
/**
|
|
168
|
-
* Read a context as the session's ACCOUNT, without minting a warrant.
|
|
169
|
-
*
|
|
170
|
-
* Needs an account-authenticated session — one from {@link login}, not the
|
|
171
|
-
* admin password login — and refuses otherwise with a `401`. The account must
|
|
172
|
-
* be a member of the group owning the context (`403` if not), and the method
|
|
173
|
-
* must be declared read-only in the app's ABI (`409` if not; a write needs
|
|
174
|
-
* {@link performIntent}).
|
|
175
|
-
*/
|
|
176
|
-
queryContext(contextId: string, request: QueryContextRequest): Promise<QueryContextResponseData>;
|
|
177
|
-
/**
|
|
178
|
-
* Issue an access grant: a token whose holder may call `request.methods` in
|
|
179
|
-
* `contextId`, as this node, with no session of its own.
|
|
180
|
-
*
|
|
181
|
-
* A grant only narrows: each method must be one this session's own token may
|
|
182
|
-
* execute in the context (`403` otherwise), and an account session is refused
|
|
183
|
-
* (`403`), since a granted call runs as the node. The token is in the answer
|
|
184
|
-
* once and never again; the node keeps only its hash.
|
|
185
|
-
*/
|
|
186
|
-
createAccessGrant(contextId: string, request: CreateAccessGrantRequest): Promise<CreatedAccessGrant>;
|
|
187
|
-
/** The access grants of `contextId` this session could have issued. */
|
|
188
|
-
listAccessGrants(contextId: string): Promise<AccessGrant[]>;
|
|
189
|
-
/** Revoke an access grant. A grant this session cannot see is a `404`. */
|
|
190
|
-
revokeAccessGrant(contextId: string, grantId: string): Promise<RevokeAccessGrantResponseData>;
|
|
191
|
-
/**
|
|
192
|
-
* Call one method under an access grant. The token is the whole credential:
|
|
193
|
-
* the route is public on every node, so this works from a client holding no
|
|
194
|
-
* session at all. A method the grant does not name, an unknown or revoked
|
|
195
|
-
* token, and an expired grant are each a `403`.
|
|
196
|
-
*/
|
|
197
|
-
callWithAccessGrant(contextId: string, request: AccessGrantCallRequest): Promise<AccessGrantCallResponseData>;
|
|
198
|
-
/**
|
|
199
|
-
* Ask what this node can do for a member in `contextId`, before they sign
|
|
200
|
-
* anything.
|
|
201
|
-
*
|
|
202
|
-
* The facts {@link performIntent} needs and a client cannot derive: whose
|
|
203
|
-
* account and key go in the warrant's `executor` and `executor_key`, which
|
|
204
|
-
* release it pins, and whether this node holds `CAN_AUTHOR_ON_BEHALF` on the
|
|
205
|
-
* owning group.
|
|
206
|
-
* `canAuthorOnBehalf: false` comes back as an answer rather than an error, as
|
|
207
|
-
* it is the default state of every context, so a caller can say "an admin of
|
|
208
|
-
* `groupId` must grant it to `executorAccount`" instead of presenting a
|
|
209
|
-
* warrant that will be refused after the author has spent a nonce on it.
|
|
210
|
-
*
|
|
211
|
-
* `404` means the context belongs to no group, this node holds no account or
|
|
212
|
-
* identity in it yet, or its group names no release yet; no warrant can be
|
|
213
|
-
* spent here until that changes.
|
|
214
|
-
*
|
|
215
|
-
* For a caller with no credential on the node at all — a browser tab holding
|
|
216
|
-
* one signing key — use `RelayClient`, which reads this same route on a node
|
|
217
|
-
* run as a relay.
|
|
218
|
-
*/
|
|
219
|
-
getIntentRelay(contextId: string): Promise<IntentRelayInfo>;
|
|
220
|
-
listNamespacesForApplication(applicationId: string): Promise<ListNamespacesResponseData>;
|
|
221
|
-
createNamespace(request: CreateNamespaceRequest): Promise<CreateNamespaceResponseData>;
|
|
222
|
-
/** What `namespaceId` approves for outbound requests, one entry per publisher. */
|
|
223
|
-
listOutboundApprovals(namespaceId: string): Promise<OutboundApproval[]>;
|
|
224
|
-
/**
|
|
225
|
-
* Set what `namespaceId` approves for the publisher of `request.applicationId`
|
|
226
|
-
* to exactly `request.approve`: `'manifest'` or a list of URL prefixes, and
|
|
227
|
-
* `[]` revokes everything. Takes effect at the app's next run.
|
|
228
|
-
*/
|
|
229
|
-
setOutboundApproval(namespaceId: string, request: SetOutboundApprovalRequest): Promise<SetOutboundApprovalResponseData>;
|
|
230
|
-
deleteNamespace(namespaceId: string): Promise<DeleteNamespaceResponseData>;
|
|
231
|
-
createNamespaceInvitation(namespaceId: string, request?: CreateNamespaceInvitationRequest): Promise<CreateNamespaceInvitationResponseData | CreateRecursiveInvitationResponseData>;
|
|
232
|
-
/**
|
|
233
|
-
* Present a join this caller signed to a node the inviter named as an
|
|
234
|
-
* admitter.
|
|
235
|
-
*
|
|
236
|
-
* For a member with no node. `joinNamespace` publishes the membership op from
|
|
237
|
-
* the node making the call; this hands an already-signed op to somebody else's
|
|
238
|
-
* node to publish. The distinction matters because a keyholder has nowhere to
|
|
239
|
-
* publish from.
|
|
240
|
-
*
|
|
241
|
-
* The op must be signed by the **device key** in the credential it carries —
|
|
242
|
-
* every peer checks that when applying a join. So the admitter cannot author
|
|
243
|
-
* this, only carry it: a hostile one can refuse, and nothing else. It cannot
|
|
244
|
-
* admit a different account, change the group, or grant a role.
|
|
245
|
-
*
|
|
246
|
-
* @param namespaceId the namespace being joined, 64 hex
|
|
247
|
-
* @param request the invitation and the hex-encoded signed op
|
|
248
|
-
*/
|
|
249
|
-
admitJoin(namespaceId: string, request: AdmitJoinRequest): Promise<AdmitJoinResponseData>;
|
|
250
|
-
joinNamespace(namespaceId: string, request: JoinNamespaceRequest): Promise<JoinNamespaceResponseData>;
|
|
251
|
-
/**
|
|
252
|
-
* Bring back a namespace the user removed from this node while the account
|
|
253
|
-
* stayed a member (POST /admin-api/namespaces/:namespace_id/join, no
|
|
254
|
-
* invitation). Such namespaces are the `forgotten` ones in
|
|
255
|
-
* {@link listNamespacesForApplication}.
|
|
256
|
-
*/
|
|
257
|
-
restoreNamespace(namespaceId: string): Promise<JoinNamespaceResponseData>;
|
|
258
|
-
/**
|
|
259
|
-
* Join the namespace an invitation grants, and say what happened — including
|
|
260
|
-
* when the request failed but the join landed anyway.
|
|
261
|
-
*
|
|
262
|
-
* Use this rather than {@link joinNamespace} whenever someone is following an
|
|
263
|
-
* invitation. A join waits for a member to come online and can outlast any
|
|
264
|
-
* proxy in front of the node; the request then fails while the join
|
|
265
|
-
* succeeds. This sends the join once, then checks {@link listNamespaces}:
|
|
266
|
-
* a failed request whose namespace is listed is `already-member`, a success.
|
|
267
|
-
*
|
|
268
|
-
* Never throws for an ordinary failure. A failed outcome carries a `reason`
|
|
269
|
-
* read off the node's status (core rc.56+), and `retryable`, which says
|
|
270
|
-
* whether to keep the invitation for another attempt.
|
|
271
|
-
*
|
|
272
|
-
* @param namespaceId the namespace the invitation names, 64 hex
|
|
273
|
-
* @param invitation the signed invitation, as the inviter's node minted it
|
|
274
|
-
* @param options `groupName` is sent with the join; `teamName` is echoed back
|
|
275
|
-
* on a successful outcome for the caller's UI
|
|
276
|
-
*/
|
|
277
|
-
redeemInvitation(namespaceId: string, invitation: JoinNamespaceRequest['invitation'], options?: {
|
|
278
|
-
groupName?: string;
|
|
279
|
-
teamName?: string;
|
|
280
|
-
}): Promise<RedeemOutcome>;
|
|
281
|
-
createGroupInNamespace(namespaceId: string, request?: CreateGroupInNamespaceRequest): Promise<CreateGroupInNamespaceResponseData>;
|
|
282
|
-
listNamespaceGroups(namespaceId: string): Promise<SubgroupEntry[]>;
|
|
283
|
-
/**
|
|
284
|
-
* Mint this node a device for an account that already lives somewhere else -
|
|
285
|
-
* the first half of pairing, run on the joining node.
|
|
286
|
-
*
|
|
287
|
-
* Publishes nothing and needs no key: it produces the device id, the two
|
|
288
|
-
* public keys and the signature that the account holder's
|
|
289
|
-
* {@link completeAccountPairing} certifies, plus a code to read out to them
|
|
290
|
-
* over a channel the payload does not travel on. Until that second half runs,
|
|
291
|
-
* the device this mints is inert.
|
|
292
|
-
*
|
|
293
|
-
* Takes a set of namespaces rather than one, and takes it from the caller
|
|
294
|
-
* because this node cannot discover it: a node that is a member of nothing can
|
|
295
|
-
* neither read the account's namespace set off a DAG nor derive it. One device
|
|
296
|
-
* covers however many are named - the certificate is over the account, not a
|
|
297
|
-
* scope - so there is one id and one code to hand over regardless.
|
|
298
|
-
*/
|
|
299
|
-
initAccountPairing(request: AccountPairInitRequest): Promise<AccountPairInitResponseData>;
|
|
300
|
-
/**
|
|
301
|
-
* Certify a device another node minted, link it, and deliver its scope keys -
|
|
302
|
-
* the second half of pairing, run on the node that holds the account root.
|
|
303
|
-
*
|
|
304
|
-
* Every field but `applications` is copied verbatim out of that node's
|
|
305
|
-
* {@link initAccountPairing} answer. Only this side can complete it: the
|
|
306
|
-
* certificate is signed by the account root, which never leaves the node that
|
|
307
|
-
* holds it.
|
|
308
|
-
*
|
|
309
|
-
* The scope is named in applications, not namespaces, because that is the
|
|
310
|
-
* question a person can answer - a namespace is an implementation unit they
|
|
311
|
-
* never chose. Leave it out to grant every application.
|
|
312
|
-
*/
|
|
313
|
-
completeAccountPairing(request: AccountPairCompleteRequest): Promise<AccountPairCompleteResponseData>;
|
|
314
|
-
/**
|
|
315
|
-
* Re-run the pairing fan-out for a device this account already certified,
|
|
316
|
-
* against the namespaces this node takes part in now.
|
|
317
|
-
*
|
|
318
|
-
* Pairing is a snapshot, and this is how it is repeated. A namespace created
|
|
319
|
-
* or joined afterwards holds no binding for a device paired before it, and the
|
|
320
|
-
* symptom is silence - the device simply never sees that namespace. Nothing
|
|
321
|
-
* but the id is needed to repair it: the certificate is already held here,
|
|
322
|
-
* root-signed and naming no namespace, so a fresh endorsement and a key wrap
|
|
323
|
-
* are all a later namespace is missing. The device does not have to be online.
|
|
324
|
-
*
|
|
325
|
-
* Passing `applications` widens the device's stored scope as well as
|
|
326
|
-
* repairing. Passing none - or an empty list - repairs against the scope
|
|
327
|
-
* already stored, which is deliberately NOT the "every application" that an
|
|
328
|
-
* empty list means on {@link completeAccountPairing}: overloading it here
|
|
329
|
-
* would make the accidental request the widest one.
|
|
330
|
-
*/
|
|
331
|
-
relinkAccountDevice(deviceId: string, request?: RelinkDeviceRequest): Promise<RelinkDeviceResponseData>;
|
|
332
|
-
/**
|
|
333
|
-
* Replace a device's scope outright, in one root-signed op.
|
|
334
|
-
*
|
|
335
|
-
* {@link relinkAccountDevice} only ever adds applications; this is how a
|
|
336
|
-
* scope is narrowed - or an `all` device is given a fixed list instead. The
|
|
337
|
-
* device need not be online.
|
|
338
|
-
*/
|
|
339
|
-
rescopeAccountDevice(deviceId: string, request: RescopeDeviceRequest): Promise<RescopeDeviceResponseData>;
|
|
340
|
-
/**
|
|
341
|
-
* Sign a payload an outside verifier specified, with this account's root.
|
|
342
|
-
*
|
|
343
|
-
* The counterpart to a verifier that issued a challenge and will check the
|
|
344
|
-
* signature against the account id it derives — the cloud's account link and
|
|
345
|
-
* login exchanges being the ones this exists for. The root never leaves the
|
|
346
|
-
* node, so this is the only way a client can produce that signature.
|
|
347
|
-
*
|
|
348
|
-
* `domain` is a NAME from a closed set the node knows, never the domain bytes.
|
|
349
|
-
* That is the security property rather than an encoding preference: signing
|
|
350
|
-
* caller-supplied bytes under a caller-supplied prefix would be an oracle over
|
|
351
|
-
* the one key that can certify a device. A node refuses a name it does not
|
|
352
|
-
* know, and refuses one whose bytes could be extended into a credential of its
|
|
353
|
-
* own.
|
|
354
|
-
*
|
|
355
|
-
* What comes back proves possession of the root and nothing else. Whether the
|
|
356
|
-
* payload is a challenge anyone issued, whether it is fresh, and whether the
|
|
357
|
-
* holder may link this account are the verifier's to decide — it issued the
|
|
358
|
-
* challenge and knows who to.
|
|
359
|
-
*
|
|
360
|
-
* ```ts
|
|
361
|
-
* const { nonce } = await cloud.getAccountLoginChallenge();
|
|
362
|
-
* const { rootPublicKey, signature } = await admin.signWithAccountRoot({
|
|
363
|
-
* domain: 'mdma.account-login',
|
|
364
|
-
* payload: hexEncodeUtf8(nonce),
|
|
365
|
-
* });
|
|
366
|
-
* await cloud.submitAccountLogin({ rootPublicKey, nonce, signature });
|
|
367
|
-
* ```
|
|
368
|
-
*/
|
|
369
|
-
signWithAccountRoot(request: AccountSignWithRootRequest): Promise<AccountSignWithRootResponseData>;
|
|
370
|
-
/**
|
|
371
|
-
* Name a device of this account, for a listing to render.
|
|
372
|
-
*
|
|
373
|
-
* Run on the node holding the account root to name any device; a paired
|
|
374
|
-
* node is accepted only for that device's own id.
|
|
375
|
-
*/
|
|
376
|
-
labelAccountDevice(deviceId: string, request: LabelDeviceRequest): Promise<LabelDeviceResponseData>;
|
|
377
|
-
/**
|
|
378
|
-
* Every device of this account, as this node sees them - its own included.
|
|
379
|
-
*
|
|
380
|
-
* Joined from the node-local certificate cache and the live bindings of every
|
|
381
|
-
* namespace this node takes part in, so it is this node's view rather than a
|
|
382
|
-
* global one: a device certified by another holder appears with an empty
|
|
383
|
-
* `applications`, because the certificate that would name its scope is not
|
|
384
|
-
* cached here.
|
|
385
|
-
*
|
|
386
|
-
* The wire wraps this in `devices` rather than the usual `data`; the array is
|
|
387
|
-
* what a caller wants, so that wrapper is not passed on.
|
|
388
|
-
*/
|
|
389
|
-
listAccountDevices(): Promise<AccountDeviceEntry[]>;
|
|
390
|
-
/**
|
|
391
|
-
* Every application this account speaks in, with the namespaces targeting each.
|
|
392
|
-
*
|
|
393
|
-
* What a device-scoping UI lists: {@link completeAccountPairing} and
|
|
394
|
-
* {@link relinkAccountDevice} both take applications, and this is where the
|
|
395
|
-
* ids they take come from. Derived from the namespaces this node takes part
|
|
396
|
-
* in, so an application installed with no namespace yet is absent - it has
|
|
397
|
-
* nothing to scope a device to until one exists.
|
|
398
|
-
*
|
|
399
|
-
* Wrapped in `applications` on the wire rather than `data`, unwrapped here for
|
|
400
|
-
* the same reason {@link listAccountDevices} unwraps `devices`.
|
|
401
|
-
*/
|
|
402
|
-
listAccountApplications(): Promise<AccountApplicationEntry[]>;
|
|
403
|
-
/**
|
|
404
|
-
* Withdraw a device from this account, terminally.
|
|
405
|
-
*
|
|
406
|
-
* Two authorities reach the same endpoint. An admin may revoke any device and
|
|
407
|
-
* rotates the scope key as it goes. The account holder may revoke its own with
|
|
408
|
-
* a root-signed `proof`, which does not rotate - so read
|
|
409
|
-
* {@link RevokeAccountDeviceResponseData.revokedIn} rather than assuming the
|
|
410
|
-
* device lost its access: a namespace reporting `keyRotated: false` has
|
|
411
|
-
* stopped the device writing but leaves it able to read until an admin
|
|
412
|
-
* rotates.
|
|
413
|
-
*
|
|
414
|
-
* `namespaceId` names where to publish from, not the extent of the revocation:
|
|
415
|
-
* a device belongs to the account, so every namespace holding a binding for it
|
|
416
|
-
* is withdrawn from and reported back.
|
|
417
|
-
*
|
|
418
|
-
* **Revocation is forward-only.** It withdraws the device's authority from
|
|
419
|
-
* here on and does NOT retract past authorship: ops the device already signed
|
|
420
|
-
* keep verifying and stay in the DAG, because the certificate that authorised
|
|
421
|
-
* them was valid when the signature was made. Nothing in this system can
|
|
422
|
-
* un-author what a device wrote, so a UI built on this call must not offer
|
|
423
|
-
* that - "this device can no longer act" is the only claim it supports.
|
|
424
|
-
*/
|
|
425
|
-
revokeAccountDevice(namespaceId: string, request: RevokeAccountDeviceRequest): Promise<RevokeAccountDeviceResponseData>;
|
|
426
|
-
/**
|
|
427
|
-
* Carry the device link of an account **this node does not hold**, so the
|
|
428
|
-
* namespace binds that device's key to the account.
|
|
429
|
-
*
|
|
430
|
-
* The relay half of a nodeless account minting invitations. An account added
|
|
431
|
-
* to a group by account holds its grants but has no device bound, so peers
|
|
432
|
-
* refuse whatever its device signs as "bound to no account". The credential
|
|
433
|
-
* and scope are root-signed and self-certifying; this node adds its own
|
|
434
|
-
* member endorsement and publishes the `AccountDeviceLinked`. After that the
|
|
435
|
-
* device signs invitations itself — see `signGroupInvitation`.
|
|
436
|
-
*
|
|
437
|
-
* Refusals: `400` when a proof does not verify or the scope does not reach
|
|
438
|
-
* this namespace (re-sign it), `403` when the device was revoked here or the
|
|
439
|
-
* account is a member of nothing in the namespace (add it first).
|
|
440
|
-
*/
|
|
441
|
-
linkAccountDevice(namespaceId: string, request: LinkAccountDeviceRequest): Promise<LinkAccountDeviceResponseData>;
|
|
442
|
-
getGroupInfo(groupId: string): Promise<GroupInfoResponseData>;
|
|
443
|
-
/** Thin wrapper over {@link getGroupInfo}: returns the group's `defaultCapabilities` bitmask. */
|
|
444
|
-
getDefaultCapabilities(groupId: string): Promise<number>;
|
|
445
|
-
/** Thin wrapper over {@link getGroupInfo}: returns the group's `subgroupVisibility`. */
|
|
446
|
-
getSubgroupVisibility(groupId: string): Promise<string>;
|
|
447
|
-
deleteGroup(groupId: string): Promise<DeleteGroupResponseData>;
|
|
448
|
-
listGroupMembers(groupId: string): Promise<ListGroupMembersResponseData>;
|
|
449
|
-
/**
|
|
450
|
-
* Account -> devices for the members of a group, as its live bindings record
|
|
451
|
-
* them.
|
|
452
|
-
*
|
|
453
|
-
* The join between a group member listing, which names accounts, and a
|
|
454
|
-
* context's identities, which name bare signing keys - both 64 hex, and
|
|
455
|
-
* nothing but the source tells them apart. Batch rather than per-account
|
|
456
|
-
* because the key -> account direction gets asked about arbitrary authors,
|
|
457
|
-
* which a per-account route would answer in N calls.
|
|
458
|
-
*
|
|
459
|
-
* What comes back is **caller-scoped by the node**: an admin of the group sees
|
|
460
|
-
* every member's devices, a plain member only its own entry. A single-entry
|
|
461
|
-
* answer is therefore a statement about this caller's role, not about the
|
|
462
|
-
* group's size.
|
|
463
|
-
*
|
|
464
|
-
* Only live bindings appear, so a revoked device is absent here - use
|
|
465
|
-
* {@link listAccountDevices} for the account's own devices, which keeps a
|
|
466
|
-
* revoked one with `revoked: true`. Absence here never means the device never
|
|
467
|
-
* acted: revocation is forward-only and its past ops remain in the DAG.
|
|
468
|
-
*
|
|
469
|
-
* Wrapped in `members` on the wire rather than `data`, unwrapped here for the
|
|
470
|
-
* same reason {@link listAccountDevices} unwraps `devices`.
|
|
471
|
-
*/
|
|
472
|
-
listGroupMemberDevices(groupId: string, options?: ListMemberDevicesOptions): Promise<MemberDevicesEntry[]>;
|
|
473
|
-
/**
|
|
474
|
-
* Member accounts in the group and the devices bound to each. An admin node
|
|
475
|
-
* sees every account; a plain member only its own. `403` if this node is not a
|
|
476
|
-
* member of the group.
|
|
477
|
-
*/
|
|
478
|
-
listMemberDevices(groupId: string, options?: ListMemberDevicesOptions): Promise<ListMemberDevicesResponseData>;
|
|
479
|
-
/**
|
|
480
|
-
* Seal a small payload to a member account's root key. This node must be a
|
|
481
|
-
* member of the group, and `account` must be an account the group knows, so
|
|
482
|
-
* the route reaches no further than the caller already does.
|
|
483
|
-
*/
|
|
484
|
-
sealToAccount(groupId: string, account: string, request: SealToAccountRequest): Promise<SealedEnvelope>;
|
|
485
|
-
listGroupContexts(groupId: string): Promise<ListGroupContextsResponseData>;
|
|
486
|
-
addGroupMembers(groupId: string, request: AddGroupMembersRequest): Promise<void>;
|
|
487
|
-
removeGroupMembers(groupId: string, request: RemoveGroupMembersRequest): Promise<void>;
|
|
488
|
-
/**
|
|
489
|
-
* `identity` is the member's ACCOUNT (64 hex), as returned by
|
|
490
|
-
* {@link listGroupMembers} — not the signing key that added them. Both are
|
|
491
|
-
* 64 hex, so nothing but the source tells them apart.
|
|
492
|
-
*/
|
|
493
|
-
updateMemberRole(groupId: string, identity: string, request: UpdateMemberRoleRequest): Promise<void>;
|
|
494
|
-
/**
|
|
495
|
-
* `identity` is the member's ACCOUNT (64 hex), as returned by
|
|
496
|
-
* {@link listGroupMembers} — not the signing key that added them. Both are
|
|
497
|
-
* 64 hex, so nothing but the source tells them apart.
|
|
498
|
-
*/
|
|
499
|
-
getMemberCapabilities(groupId: string, identity: string): Promise<MemberCapabilities>;
|
|
500
|
-
/**
|
|
501
|
-
* `identity` is the member's ACCOUNT (64 hex), as returned by
|
|
502
|
-
* {@link listGroupMembers} — not the signing key that added them. Both are
|
|
503
|
-
* 64 hex, so nothing but the source tells them apart.
|
|
504
|
-
*/
|
|
505
|
-
setMemberCapabilities(groupId: string, identity: string, request: SetMemberCapabilitiesRequest): Promise<void>;
|
|
506
|
-
setDefaultCapabilities(groupId: string, request: SetDefaultCapabilitiesRequest): Promise<void>;
|
|
507
|
-
/**
|
|
508
|
-
* Make every member admitted to `groupId` from now on able to relay a
|
|
509
|
-
* delegated write, without a per-node governance op each time.
|
|
510
|
-
*
|
|
511
|
-
* `CAN_AUTHOR_ON_BEHALF` is implied by nothing — not membership, not admin —
|
|
512
|
-
* so every group is authorship-closed and each fleet relay otherwise needs an
|
|
513
|
-
* admin to grant it individually, at the moment the relay is assigned and the
|
|
514
|
-
* admin is not watching. Setting it in the group's DEFAULT mask is core's own
|
|
515
|
-
* answer to that: `add_member` seeds a non-admin's capability row from the
|
|
516
|
-
* default, so an attested node admitted afterwards lands open.
|
|
517
|
-
*
|
|
518
|
-
* Call it on the NAMESPACE (the root group). A grant resolves through the
|
|
519
|
-
* membership anchor, so one at the root reaches every Open subgroup beneath
|
|
520
|
-
* it, which is where contexts actually live; a `Restricted` subgroup is a
|
|
521
|
-
* membership boundary and needs its own call.
|
|
522
|
-
*
|
|
523
|
-
* ### Two things this does not do
|
|
524
|
-
*
|
|
525
|
-
* **It is not retroactive.** The default is copied into a member's row when
|
|
526
|
-
* that member is admitted, so nodes already admitted keep the row they got.
|
|
527
|
-
* Use {@link grantAuthorship} for those — or call this at namespace creation,
|
|
528
|
-
* which is the only point that needs no backfill at all.
|
|
529
|
-
*
|
|
530
|
-
* **It does not reach admins.** Core seeds the default only for non-admin
|
|
531
|
-
* roles, and `CAN_AUTHOR_ON_BEHALF` is deliberately not implied by admin. An
|
|
532
|
-
* admin's own node therefore stays closed and needs {@link grantAuthorship}.
|
|
533
|
-
*
|
|
534
|
-
* ### What it widens
|
|
535
|
-
*
|
|
536
|
-
* Every future non-admin member of the group, not only attested TEE nodes, so
|
|
537
|
-
* any of them may be named as a warrant's `executor`. The bound worth knowing
|
|
538
|
-
* before deciding: an executor cannot FORGE. A delegated write is authorized
|
|
539
|
-
* by the author's own warrant — signed by their device key, committed to one
|
|
540
|
-
* context, method and exact arguments, with its nonce checked unspent — so a
|
|
541
|
-
* holder can only spend a warrant it was deliberately handed. What it does
|
|
542
|
-
* gain is the arguments in cleartext and the choice of when, or whether, to
|
|
543
|
-
* publish.
|
|
544
|
-
*
|
|
545
|
-
* Read-modify-write rather than a blind set: core seeds a new group's default
|
|
546
|
-
* with `CAN_JOIN_OPEN_SUBGROUPS`, and overwriting that would quietly stop
|
|
547
|
-
* every later member inheriting into Open subgroups.
|
|
548
|
-
*
|
|
549
|
-
* Returns the resulting mask and whether an op was published — it is a no-op
|
|
550
|
-
* when the bit is already set, so it is safe to call on every startup.
|
|
551
|
-
*/
|
|
552
|
-
openToDelegatedExecution(groupId: string): Promise<{
|
|
553
|
-
changed: boolean;
|
|
554
|
-
defaultCapabilities: number;
|
|
555
|
-
}>;
|
|
556
|
-
/**
|
|
557
|
-
* Grant `account` the authorship bit on `groupId`, leaving its other
|
|
558
|
-
* capabilities alone.
|
|
559
|
-
*
|
|
560
|
-
* The per-member counterpart to {@link openToDelegatedExecution}, and what
|
|
561
|
-
* closes the gap that method cannot: a relay admitted BEFORE the default was
|
|
562
|
-
* set, and an admin's own node, which never receives the default at all.
|
|
563
|
-
*
|
|
564
|
-
* `account` is the member's ACCOUNT id (64 hex) as `listGroupMembers` returns
|
|
565
|
-
* it — for a fleet relay, the `account` the cloud reports for that node. Not
|
|
566
|
-
* the signing key that added them; both are 64 hex, so nothing but the source
|
|
567
|
-
* tells them apart.
|
|
568
|
-
*
|
|
569
|
-
* Read-modify-write, so it adds the bit rather than replacing the member's
|
|
570
|
-
* mask. A no-op when the member already holds it.
|
|
571
|
-
*/
|
|
572
|
-
grantAuthorship(groupId: string, account: string): Promise<{
|
|
573
|
-
changed: boolean;
|
|
574
|
-
capabilities: number;
|
|
575
|
-
}>;
|
|
576
|
-
setSubgroupVisibility(groupId: string, request: SetSubgroupVisibilityRequest): Promise<void>;
|
|
577
|
-
setTeeAdmissionPolicy(groupId: string, request: SetTeeAdmissionPolicyRequest): Promise<void>;
|
|
578
|
-
getTeeAdmissionPolicy(groupId: string): Promise<GetTeeAdmissionPolicyResponseData>;
|
|
579
|
-
/**
|
|
580
|
-
* Sets which admitted TEEs may author as the TEE authority. Pass
|
|
581
|
-
* `{ allowedMrtd: [] }` to turn TEE authorship off. `groupId` must be a
|
|
582
|
-
* namespace root; the node refuses a subgroup. The node exposes no read-back
|
|
583
|
-
* route for this policy.
|
|
584
|
-
*/
|
|
585
|
-
setTeeAuthoringPolicy(groupId: string, request: SetTeeAuthoringPolicyRequest): Promise<void>;
|
|
586
|
-
/**
|
|
587
|
-
* Turns TEE authorship off in the namespace: every TEE loses its authority,
|
|
588
|
-
* and admitted TEEs stay members. The node applies the same op as
|
|
589
|
-
* `setTeeAuthoringPolicy(groupId, { allowedMrtd: [] })`. `groupId` must be a
|
|
590
|
-
* namespace root.
|
|
591
|
-
*
|
|
592
|
-
* `rootProof` is the signing admin's own root proof for that empty policy
|
|
593
|
-
* (`teeAuthoringPolicyOp([])`); omit it on a node that holds that root.
|
|
594
|
-
*/
|
|
595
|
-
disableTeeAuthoringPolicy(groupId: string, options?: RootGuardedOpRequest): Promise<void>;
|
|
596
|
-
/**
|
|
597
|
-
* Hand the group to `newOwner`, who must already be one of its admins.
|
|
598
|
-
* Owner-only, and it needs the owner account's root proof; see
|
|
599
|
-
* {@link RootGuardedOpRequest}.
|
|
600
|
-
*/
|
|
601
|
-
transferOwnership(groupId: string, request: TransferOwnershipRequest): Promise<void>;
|
|
602
|
-
/**
|
|
603
|
-
* Repoint the namespace's admin pin at `newAdmin`, a member of its root.
|
|
604
|
-
* Owner-only, with the owner account's root proof; see {@link RootGuardedOpRequest}.
|
|
605
|
-
*/
|
|
606
|
-
changeNamespaceAdmin(namespaceId: string, request: ChangeNamespaceAdminRequest): Promise<void>;
|
|
607
|
-
/**
|
|
608
|
-
* Delete a group through the owner-only path: it must hold no contexts, and
|
|
609
|
-
* the op needs the owner account's root proof. {@link deleteGroup} is the
|
|
610
|
-
* admin-level cascading delete.
|
|
611
|
-
*/
|
|
612
|
-
ownerDeleteGroup(groupId: string, request?: OwnerDeleteGroupRequest): Promise<void>;
|
|
613
|
-
setGroupMetadata(groupId: string, request: SetGroupMetadataRequest): Promise<void>;
|
|
614
|
-
getGroupMetadata(groupId: string): Promise<MetadataRecord | null>;
|
|
615
|
-
setMemberMetadata(groupId: string, identity: string, request: SetMemberMetadataRequest): Promise<void>;
|
|
616
|
-
/**
|
|
617
|
-
* `identity` is the member's ACCOUNT (64 hex), as returned by
|
|
618
|
-
* {@link listGroupMembers} — not the signing key that added them. Both are
|
|
619
|
-
* 64 hex, so nothing but the source tells them apart.
|
|
620
|
-
*/
|
|
621
|
-
getMemberMetadata(groupId: string, identity: string): Promise<MetadataRecord | null>;
|
|
622
|
-
setContextMetadata(groupId: string, contextId: string, request: SetContextMetadataRequest): Promise<void>;
|
|
623
|
-
getContextMetadata(groupId: string, contextId: string): Promise<MetadataRecord | null>;
|
|
624
|
-
syncGroup(groupId: string): Promise<SyncGroupResponseData>;
|
|
625
|
-
upgradeGroup(groupId: string, request: UpgradeGroupRequest): Promise<UpgradeGroupResponseData>;
|
|
626
|
-
getGroupUpgradeStatus(groupId: string): Promise<GroupUpgradeStatusResponseData>;
|
|
627
|
-
/** Releases to install before activating the upgrade, in list order (oldest first). An older server returns []. */
|
|
628
|
-
getGroupMissingReleases(groupId: string): Promise<MissingRelease[]>;
|
|
629
|
-
/**
|
|
630
|
-
* The operator-facing "have all peers migrated?" rollup for a namespace.
|
|
631
|
-
* The handler serializes the payload directly, so there is no `{ data }`
|
|
632
|
-
* envelope to unwrap here (unlike most admin reads).
|
|
633
|
-
*/
|
|
634
|
-
getMigrationStatus(namespaceId: string): Promise<MigrationStatus>;
|
|
635
|
-
/** Revoked devices and withdrawn slots of a namespace; 403 unless this node is a bound member. */
|
|
636
|
-
listNamespaceRevokedDevices(namespaceId: string): Promise<NamespaceRevokedDevices>;
|
|
637
|
-
/** Per-group cascade-migration snapshots for a namespace. */
|
|
638
|
-
getCascadeStatus(namespaceId: string): Promise<CascadeStatusEntry[]>;
|
|
639
|
-
/** Switch this node's contexts in a namespace onto its stored upgrade target; 409 if an `expected*` guard differs. */
|
|
640
|
-
activateGroupUpgrade(namespaceId: string, request?: ActivateGroupUpgradeRequest): Promise<ActivateGroupUpgradeResponseData>;
|
|
641
|
-
retryGroupUpgrade(groupId: string): Promise<RetryGroupUpgradeResponseData>;
|
|
642
|
-
/** Move `childGroupId` under `request.newParentId`. */
|
|
643
|
-
reparentGroup(childGroupId: string, request: ReparentGroupRequest): Promise<ReparentGroupResponseData>;
|
|
644
|
-
listSubgroups(groupId: string): Promise<SubgroupEntry[]>;
|
|
645
|
-
detachContextFromGroup(groupId: string, contextId: string): Promise<void>;
|
|
646
|
-
createGroupInvitation(groupId: string, request?: CreateGroupInvitationRequest): Promise<CreateGroupInvitationResponseData | CreateRecursiveGroupInvitationResponseData>;
|
|
647
|
-
joinGroup(request: JoinGroupRequest): Promise<JoinGroupResponseData>;
|
|
648
|
-
joinSubgroupInheritance(groupId: string): Promise<JoinSubgroupInheritanceResponseData>;
|
|
649
|
-
getTeeInfo(): Promise<TeeInfoResponseData>;
|
|
650
|
-
teeAttest(request: TeeAttestRequest): Promise<TeeAttestResponseData>;
|
|
651
|
-
getPeersCount(): Promise<{
|
|
652
|
-
count: number;
|
|
653
|
-
}>;
|
|
654
|
-
/** Node network status (GET /admin-api/network/status). */
|
|
655
|
-
getNetworkStatus(): Promise<unknown>;
|
|
656
|
-
/** Node storage/usage stats (GET /admin-api/usage). */
|
|
657
|
-
getUsage(): Promise<unknown>;
|
|
658
|
-
/** Create a standalone group (POST /admin-api/groups). */
|
|
659
|
-
createGroup(request: CreateGroupRequest): Promise<CreateGroupResponseData>;
|
|
660
|
-
/** Leave a group (POST /admin-api/groups/:group_id/leave). */
|
|
661
|
-
leaveGroup(groupId: string): Promise<void>;
|
|
662
|
-
/** Leave a context (POST /admin-api/contexts/:context_id/leave). */
|
|
663
|
-
leaveContext(contextId: string): Promise<void>;
|
|
664
|
-
/**
|
|
665
|
-
* Leave a namespace (POST /admin-api/namespaces/:namespace_id/leave).
|
|
666
|
-
*
|
|
667
|
-
* With `purge`, every device of the account also takes the namespace off its
|
|
668
|
-
* disk. Core reads `purge` from the query string, so it is not in the body.
|
|
669
|
-
*/
|
|
670
|
-
leaveNamespace(namespaceId: string, options?: {
|
|
671
|
-
purge?: boolean;
|
|
672
|
-
}): Promise<void>;
|
|
673
|
-
/** Issue a group ownership proof (POST /admin-api/groups/:group_id/issue-ownership-proof). */
|
|
674
|
-
issueOwnershipProof(groupId: string, request: IssueOwnershipProofRequest): Promise<IssueOwnershipProofResponseData>;
|
|
675
|
-
/** Issue a namespace ownership proof (POST /admin-api/groups/:group_id/issue-namespace-ownership-proof). */
|
|
676
|
-
issueNamespaceOwnershipProof(groupId: string, request: IssueNamespaceOwnershipProofRequest): Promise<IssueOwnershipProofResponseData>;
|
|
677
|
-
/**
|
|
678
|
-
* Set a member's auto-follow flag (PUT
|
|
679
|
-
* /admin-api/groups/:group_id/members/:identity/auto-follow).
|
|
680
|
-
*
|
|
681
|
-
* `identity` is the member's ACCOUNT (64 hex), as returned by
|
|
682
|
-
* {@link listGroupMembers} — not the signing key that added them. Both are
|
|
683
|
-
* 64 hex, so nothing but the source tells them apart.
|
|
684
|
-
*/
|
|
685
|
-
setMemberAutoFollow(groupId: string, identity: string, request: SetMemberAutoFollowRequest): Promise<void>;
|
|
686
|
-
/** Abort a namespace migration (POST /admin-api/groups/:namespace_id/migration/abort). */
|
|
687
|
-
abortMigration(namespaceId: string): Promise<unknown>;
|
|
688
|
-
}
|