@calimero-network/mero-react 9.9.1 → 9.11.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 +27 -2
- package/dist/index.cjs +286 -211
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +90 -9
- package/dist/index.d.ts +90 -9
- package/dist/index.js +284 -213
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -527,13 +527,22 @@ interface LoginModalProps {
|
|
|
527
527
|
*/
|
|
528
528
|
localNodePorts?: readonly number[];
|
|
529
529
|
/**
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
* exactly the node dialog, with no tabs.
|
|
530
|
+
* The second way in: a **Cloud** tab, signing in with a Calimero account by
|
|
531
|
+
* enrolling this tab's device key at the wallet.
|
|
533
532
|
*
|
|
534
|
-
*
|
|
533
|
+
* - **Omitted** (the default): the tab is shown, sourced from
|
|
534
|
+
* `useAccountEnrolment()` inside the modal — enrolment starts from the tab,
|
|
535
|
+
* and a page coming back from the wallet is completed here, whether or not
|
|
536
|
+
* the modal is open. Nothing to wire; the modal must be inside a
|
|
537
|
+
* `MeroProvider`.
|
|
538
|
+
* - **`false`**: no Cloud tab and no tabs at all — the node dialog as it was.
|
|
539
|
+
* The modal reads no enrolment callback, leaving it to whichever component
|
|
540
|
+
* does.
|
|
541
|
+
* - **An object**: the caller's own enrolment, used verbatim; the modal reads
|
|
542
|
+
* none itself. The values are `useAccountEnrolment`'s, as `ConnectButton`
|
|
543
|
+
* passes them.
|
|
535
544
|
*/
|
|
536
|
-
cloud?: {
|
|
545
|
+
cloud?: false | {
|
|
537
546
|
/** Start enrolment — normally `useAccountEnrolment().goToWallet`. */
|
|
538
547
|
onEnrol: () => void;
|
|
539
548
|
/** What the last enrolment had to say, shown on the Cloud tab. */
|
|
@@ -544,8 +553,12 @@ interface LoginModalProps {
|
|
|
544
553
|
customWallet?: boolean;
|
|
545
554
|
};
|
|
546
555
|
/**
|
|
547
|
-
* The tab selected when the modal opens.
|
|
548
|
-
*
|
|
556
|
+
* The tab selected when the modal opens. Ignored with `cloud={false}`.
|
|
557
|
+
*
|
|
558
|
+
* Default `'node'` — except that a modal sourcing its own Cloud tab opens on
|
|
559
|
+
* `'cloud'` when the page is coming back from the wallet, so whatever the
|
|
560
|
+
* completion has to say is where the person is looking. An explicit value
|
|
561
|
+
* always wins.
|
|
549
562
|
*/
|
|
550
563
|
initialTab?: LoginModalTab;
|
|
551
564
|
}
|
|
@@ -554,7 +567,7 @@ type LoginModalTab = 'node' | 'cloud';
|
|
|
554
567
|
/**
|
|
555
568
|
* LoginModal - Connection modal component
|
|
556
569
|
*/
|
|
557
|
-
declare function LoginModal({ onConnect, onClose, isOpen, theme, localNodePorts, cloud, initialTab, }: LoginModalProps): React.ReactPortal | null;
|
|
570
|
+
declare function LoginModal({ onConnect, onClose, isOpen, theme, localNodePorts, cloud, initialTab: initialTabProp, }: LoginModalProps): React.ReactPortal | null;
|
|
558
571
|
|
|
559
572
|
interface AccountSignInPanelProps {
|
|
560
573
|
/** Start enrolment — normally `useAccountEnrolment().goToWallet`. */
|
|
@@ -1106,6 +1119,53 @@ declare const HA_ACCOUNT_NOT_LINKED_MESSAGE = "link this account to your cloud u
|
|
|
1106
1119
|
*/
|
|
1107
1120
|
declare const HA_REFUSAL_MESSAGES: Record<string, string>;
|
|
1108
1121
|
|
|
1122
|
+
/**
|
|
1123
|
+
* An application's id, computed the way merod computes it.
|
|
1124
|
+
*
|
|
1125
|
+
* core's `ApplicationId::for_bundle(package, signer_id)` is
|
|
1126
|
+
* `sha256(borsh((package, signer_id)))`: the package name and the publisher's
|
|
1127
|
+
* signing key together decide which app a bundle IS, and the version is not an
|
|
1128
|
+
* input, so every version a publisher ships under one package installs as the
|
|
1129
|
+
* same application. A node learns the id when it installs the bundle; an
|
|
1130
|
+
* account installs nothing, so it has to derive the id from the same two
|
|
1131
|
+
* inputs — both of which the registry's bundle listing carries.
|
|
1132
|
+
*/
|
|
1133
|
+
/** A bundle entry as `GET {registry}/api/v2/bundles?package=…` lists it. */
|
|
1134
|
+
interface RegistryBundle {
|
|
1135
|
+
package?: string;
|
|
1136
|
+
signerId?: string;
|
|
1137
|
+
appVersion?: string;
|
|
1138
|
+
yanked?: boolean;
|
|
1139
|
+
publishedAt?: string;
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* `sha256(borsh((pkg, signerId)))` as lowercase hex: core's
|
|
1143
|
+
* `ApplicationId::for_bundle`. A borsh tuple is its fields concatenated.
|
|
1144
|
+
*/
|
|
1145
|
+
declare function applicationIdForBundle(pkg: string, signerId: string): Promise<string>;
|
|
1146
|
+
/**
|
|
1147
|
+
* The entry a package resolves to: its newest version that is not yanked. The
|
|
1148
|
+
* one rule for "latest", shared by the version lookup and the id derivation so
|
|
1149
|
+
* the two cannot disagree about which bundle an account is founding on.
|
|
1150
|
+
*/
|
|
1151
|
+
declare function selectLatestBundle<B extends RegistryBundle>(bundles: readonly B[]): B | undefined;
|
|
1152
|
+
interface ResolvedApplication {
|
|
1153
|
+
applicationId: string;
|
|
1154
|
+
signerId: string;
|
|
1155
|
+
version: string;
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* The application id an account founds `pkg` on, learned from the registry.
|
|
1159
|
+
*
|
|
1160
|
+
* Refused when the non-yanked versions of `pkg` name more than one publisher:
|
|
1161
|
+
* that is two different applications under one package name (the id binds the
|
|
1162
|
+
* signer), and picking either silently would commit the founder — who signs
|
|
1163
|
+
* `TargetApplicationSet` naming the id — to an app it did not choose.
|
|
1164
|
+
*/
|
|
1165
|
+
declare function resolveApplicationIdFromRegistry(registryUrl: string, pkg: string, deps?: {
|
|
1166
|
+
fetch?: typeof fetch;
|
|
1167
|
+
}): Promise<ResolvedApplication>;
|
|
1168
|
+
|
|
1109
1169
|
/**
|
|
1110
1170
|
* An account's group management through a relay: one delegated governance op
|
|
1111
1171
|
* per call (`RelayClient.govern`), posted to the relay that serves the group's
|
|
@@ -1283,6 +1343,27 @@ declare function useJoinInvitation(): {
|
|
|
1283
1343
|
* - `returning` is true when this page load carries an enrolment callback,
|
|
1284
1344
|
* success or error, so a caller can show the place the note appears.
|
|
1285
1345
|
*/
|
|
1346
|
+
/**
|
|
1347
|
+
* Whether this page load is the one coming back from the wallet — a completed
|
|
1348
|
+
* enrolment or a declined one — WITHOUT consuming it.
|
|
1349
|
+
*
|
|
1350
|
+
* `useAccountEnrolment` reads the callback once and strips it from the address
|
|
1351
|
+
* bar, so a second reader finds nothing. That makes `returning` from the hook
|
|
1352
|
+
* unusable for the one decision that has to be taken before the hook runs: a
|
|
1353
|
+
* component that owns `LoginModal`'s `isOpen` and wants the dialog open on the
|
|
1354
|
+
* way back. This is the answer for it, as a `useState` initialiser:
|
|
1355
|
+
*
|
|
1356
|
+
* ```tsx
|
|
1357
|
+
* const [open, setOpen] = useState(isReturningFromWallet);
|
|
1358
|
+
* <LoginModal isOpen={open} ... /> // sources its own Cloud tab, lands on it
|
|
1359
|
+
* ```
|
|
1360
|
+
*
|
|
1361
|
+
* The parent's initialiser runs before the modal's hook reads the fragment, so
|
|
1362
|
+
* the two agree. `ConnectButton` needs none of this: it owns both.
|
|
1363
|
+
*/
|
|
1364
|
+
declare function isReturningFromWallet(location?: {
|
|
1365
|
+
hash: string;
|
|
1366
|
+
} | undefined): boolean;
|
|
1286
1367
|
interface UseAccountEnrolmentOptions {
|
|
1287
1368
|
/**
|
|
1288
1369
|
* Point enrolment at a wallet other than the hosted one.
|
|
@@ -2093,4 +2174,4 @@ declare function clearContextIdentity(): void;
|
|
|
2093
2174
|
*/
|
|
2094
2175
|
declare function clearAllStorage(): void;
|
|
2095
2176
|
|
|
2096
|
-
export { type AccountAdminDeps, type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, type BootstrapFailure, type BootstrapFromInvitationInput, type BootstrapResult, type BootstrapStep, type BootstrapSuccess, CalimeroLogo, type CalimeroLogoProps, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type DelegatedCredential, type DelegatedSession, type ExecutionResult, type FoundedDelegatedNamespace, HA_ACCOUNT_NOT_LINKED_MESSAGE, HA_REFUSAL_MESSAGES, InvitationNotClaimableError, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, type JoinWithNodeFailure, type JoinWithNodeInput, type JoinWithNodeResult, type JoinWithNodeStep, type JoinWithNodeSuccess, LoginModal, type LoginModalProps, type LoginModalTab, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, NoRelayError, NotForAccountError, type RelayResolutionFailure, type RelayResolutionStep, type ResolveRelayFromInvitationInput, type ResolveRelayResult, type ResolvedInvitationRelay, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, bootstrapFromInvitation, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearDelegatedCredential, clearNodeUrl, clearTokenNodeUrl, createAccountAdmin, createDelegatedContext, createNodeAdmin, cssVar, defaultMeroTheme, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getTokenNodeUrl, isFinalInvitationError, joinWithNode, listDelegatedContexts, localStorageTokenStorage, normaliseAccount, pinRelayNodeKey, readDelegatedCredential, readPinnedRelayNodeKey, readRelayMap, relayForContext, rememberRelay, resolveMeroTheme, resolveRelayFromInvitation, saveDelegatedCredential, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, themeToCssVars, useAccountEnrolment, useAddGroupMembers, useAppVersion, useApplicationContexts, useBlobInfo, useBlobUrl, useContextDiscovery, useContextGroup, useContexts, useCreateContext, useCreateGroupInNamespace, useCreateNamespace, useCreateNamespaceInvitation, useCreatePrivateContext, useDefaultCapabilities, useDelegatedBootstrap, useDeleteContext, useDeleteGroup, useDeleteNamespace, useDetachContextFromGroup, useEphemeral, useExecute, useGroupAppVersion, useGroupCapabilities, useGroupContexts, useGroupInfo, useGroupInvitations, useGroupMembers, useGroupMetadata, useGroupUpgradeStatus, useInstallFromRegistry, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
|
2177
|
+
export { type AccountAdminDeps, type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, type BootstrapFailure, type BootstrapFromInvitationInput, type BootstrapResult, type BootstrapStep, type BootstrapSuccess, CalimeroLogo, type CalimeroLogoProps, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type DelegatedCredential, type DelegatedSession, type ExecutionResult, type FoundedDelegatedNamespace, HA_ACCOUNT_NOT_LINKED_MESSAGE, HA_REFUSAL_MESSAGES, InvitationNotClaimableError, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, type JoinWithNodeFailure, type JoinWithNodeInput, type JoinWithNodeResult, type JoinWithNodeStep, type JoinWithNodeSuccess, LoginModal, type LoginModalProps, type LoginModalTab, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, NoRelayError, NotForAccountError, type RegistryBundle, type RelayResolutionFailure, type RelayResolutionStep, type ResolveRelayFromInvitationInput, type ResolveRelayResult, type ResolvedApplication, type ResolvedInvitationRelay, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, applicationIdForBundle, bootstrapFromInvitation, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearDelegatedCredential, clearNodeUrl, clearTokenNodeUrl, createAccountAdmin, createDelegatedContext, createNodeAdmin, cssVar, defaultMeroTheme, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getTokenNodeUrl, isFinalInvitationError, isReturningFromWallet, joinWithNode, listDelegatedContexts, localStorageTokenStorage, normaliseAccount, pinRelayNodeKey, readDelegatedCredential, readPinnedRelayNodeKey, readRelayMap, relayForContext, rememberRelay, resolveApplicationIdFromRegistry, resolveMeroTheme, resolveRelayFromInvitation, saveDelegatedCredential, selectLatestBundle, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, themeToCssVars, useAccountEnrolment, useAddGroupMembers, useAppVersion, useApplicationContexts, useBlobInfo, useBlobUrl, useContextDiscovery, useContextGroup, useContexts, useCreateContext, useCreateGroupInNamespace, useCreateNamespace, useCreateNamespaceInvitation, useCreatePrivateContext, useDefaultCapabilities, useDelegatedBootstrap, useDeleteContext, useDeleteGroup, useDeleteNamespace, useDetachContextFromGroup, useEphemeral, useExecute, useGroupAppVersion, useGroupCapabilities, useGroupContexts, useGroupInfo, useGroupInvitations, useGroupMembers, useGroupMetadata, useGroupUpgradeStatus, useInstallFromRegistry, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
package/dist/index.d.ts
CHANGED
|
@@ -527,13 +527,22 @@ interface LoginModalProps {
|
|
|
527
527
|
*/
|
|
528
528
|
localNodePorts?: readonly number[];
|
|
529
529
|
/**
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
* exactly the node dialog, with no tabs.
|
|
530
|
+
* The second way in: a **Cloud** tab, signing in with a Calimero account by
|
|
531
|
+
* enrolling this tab's device key at the wallet.
|
|
533
532
|
*
|
|
534
|
-
*
|
|
533
|
+
* - **Omitted** (the default): the tab is shown, sourced from
|
|
534
|
+
* `useAccountEnrolment()` inside the modal — enrolment starts from the tab,
|
|
535
|
+
* and a page coming back from the wallet is completed here, whether or not
|
|
536
|
+
* the modal is open. Nothing to wire; the modal must be inside a
|
|
537
|
+
* `MeroProvider`.
|
|
538
|
+
* - **`false`**: no Cloud tab and no tabs at all — the node dialog as it was.
|
|
539
|
+
* The modal reads no enrolment callback, leaving it to whichever component
|
|
540
|
+
* does.
|
|
541
|
+
* - **An object**: the caller's own enrolment, used verbatim; the modal reads
|
|
542
|
+
* none itself. The values are `useAccountEnrolment`'s, as `ConnectButton`
|
|
543
|
+
* passes them.
|
|
535
544
|
*/
|
|
536
|
-
cloud?: {
|
|
545
|
+
cloud?: false | {
|
|
537
546
|
/** Start enrolment — normally `useAccountEnrolment().goToWallet`. */
|
|
538
547
|
onEnrol: () => void;
|
|
539
548
|
/** What the last enrolment had to say, shown on the Cloud tab. */
|
|
@@ -544,8 +553,12 @@ interface LoginModalProps {
|
|
|
544
553
|
customWallet?: boolean;
|
|
545
554
|
};
|
|
546
555
|
/**
|
|
547
|
-
* The tab selected when the modal opens.
|
|
548
|
-
*
|
|
556
|
+
* The tab selected when the modal opens. Ignored with `cloud={false}`.
|
|
557
|
+
*
|
|
558
|
+
* Default `'node'` — except that a modal sourcing its own Cloud tab opens on
|
|
559
|
+
* `'cloud'` when the page is coming back from the wallet, so whatever the
|
|
560
|
+
* completion has to say is where the person is looking. An explicit value
|
|
561
|
+
* always wins.
|
|
549
562
|
*/
|
|
550
563
|
initialTab?: LoginModalTab;
|
|
551
564
|
}
|
|
@@ -554,7 +567,7 @@ type LoginModalTab = 'node' | 'cloud';
|
|
|
554
567
|
/**
|
|
555
568
|
* LoginModal - Connection modal component
|
|
556
569
|
*/
|
|
557
|
-
declare function LoginModal({ onConnect, onClose, isOpen, theme, localNodePorts, cloud, initialTab, }: LoginModalProps): React.ReactPortal | null;
|
|
570
|
+
declare function LoginModal({ onConnect, onClose, isOpen, theme, localNodePorts, cloud, initialTab: initialTabProp, }: LoginModalProps): React.ReactPortal | null;
|
|
558
571
|
|
|
559
572
|
interface AccountSignInPanelProps {
|
|
560
573
|
/** Start enrolment — normally `useAccountEnrolment().goToWallet`. */
|
|
@@ -1106,6 +1119,53 @@ declare const HA_ACCOUNT_NOT_LINKED_MESSAGE = "link this account to your cloud u
|
|
|
1106
1119
|
*/
|
|
1107
1120
|
declare const HA_REFUSAL_MESSAGES: Record<string, string>;
|
|
1108
1121
|
|
|
1122
|
+
/**
|
|
1123
|
+
* An application's id, computed the way merod computes it.
|
|
1124
|
+
*
|
|
1125
|
+
* core's `ApplicationId::for_bundle(package, signer_id)` is
|
|
1126
|
+
* `sha256(borsh((package, signer_id)))`: the package name and the publisher's
|
|
1127
|
+
* signing key together decide which app a bundle IS, and the version is not an
|
|
1128
|
+
* input, so every version a publisher ships under one package installs as the
|
|
1129
|
+
* same application. A node learns the id when it installs the bundle; an
|
|
1130
|
+
* account installs nothing, so it has to derive the id from the same two
|
|
1131
|
+
* inputs — both of which the registry's bundle listing carries.
|
|
1132
|
+
*/
|
|
1133
|
+
/** A bundle entry as `GET {registry}/api/v2/bundles?package=…` lists it. */
|
|
1134
|
+
interface RegistryBundle {
|
|
1135
|
+
package?: string;
|
|
1136
|
+
signerId?: string;
|
|
1137
|
+
appVersion?: string;
|
|
1138
|
+
yanked?: boolean;
|
|
1139
|
+
publishedAt?: string;
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* `sha256(borsh((pkg, signerId)))` as lowercase hex: core's
|
|
1143
|
+
* `ApplicationId::for_bundle`. A borsh tuple is its fields concatenated.
|
|
1144
|
+
*/
|
|
1145
|
+
declare function applicationIdForBundle(pkg: string, signerId: string): Promise<string>;
|
|
1146
|
+
/**
|
|
1147
|
+
* The entry a package resolves to: its newest version that is not yanked. The
|
|
1148
|
+
* one rule for "latest", shared by the version lookup and the id derivation so
|
|
1149
|
+
* the two cannot disagree about which bundle an account is founding on.
|
|
1150
|
+
*/
|
|
1151
|
+
declare function selectLatestBundle<B extends RegistryBundle>(bundles: readonly B[]): B | undefined;
|
|
1152
|
+
interface ResolvedApplication {
|
|
1153
|
+
applicationId: string;
|
|
1154
|
+
signerId: string;
|
|
1155
|
+
version: string;
|
|
1156
|
+
}
|
|
1157
|
+
/**
|
|
1158
|
+
* The application id an account founds `pkg` on, learned from the registry.
|
|
1159
|
+
*
|
|
1160
|
+
* Refused when the non-yanked versions of `pkg` name more than one publisher:
|
|
1161
|
+
* that is two different applications under one package name (the id binds the
|
|
1162
|
+
* signer), and picking either silently would commit the founder — who signs
|
|
1163
|
+
* `TargetApplicationSet` naming the id — to an app it did not choose.
|
|
1164
|
+
*/
|
|
1165
|
+
declare function resolveApplicationIdFromRegistry(registryUrl: string, pkg: string, deps?: {
|
|
1166
|
+
fetch?: typeof fetch;
|
|
1167
|
+
}): Promise<ResolvedApplication>;
|
|
1168
|
+
|
|
1109
1169
|
/**
|
|
1110
1170
|
* An account's group management through a relay: one delegated governance op
|
|
1111
1171
|
* per call (`RelayClient.govern`), posted to the relay that serves the group's
|
|
@@ -1283,6 +1343,27 @@ declare function useJoinInvitation(): {
|
|
|
1283
1343
|
* - `returning` is true when this page load carries an enrolment callback,
|
|
1284
1344
|
* success or error, so a caller can show the place the note appears.
|
|
1285
1345
|
*/
|
|
1346
|
+
/**
|
|
1347
|
+
* Whether this page load is the one coming back from the wallet — a completed
|
|
1348
|
+
* enrolment or a declined one — WITHOUT consuming it.
|
|
1349
|
+
*
|
|
1350
|
+
* `useAccountEnrolment` reads the callback once and strips it from the address
|
|
1351
|
+
* bar, so a second reader finds nothing. That makes `returning` from the hook
|
|
1352
|
+
* unusable for the one decision that has to be taken before the hook runs: a
|
|
1353
|
+
* component that owns `LoginModal`'s `isOpen` and wants the dialog open on the
|
|
1354
|
+
* way back. This is the answer for it, as a `useState` initialiser:
|
|
1355
|
+
*
|
|
1356
|
+
* ```tsx
|
|
1357
|
+
* const [open, setOpen] = useState(isReturningFromWallet);
|
|
1358
|
+
* <LoginModal isOpen={open} ... /> // sources its own Cloud tab, lands on it
|
|
1359
|
+
* ```
|
|
1360
|
+
*
|
|
1361
|
+
* The parent's initialiser runs before the modal's hook reads the fragment, so
|
|
1362
|
+
* the two agree. `ConnectButton` needs none of this: it owns both.
|
|
1363
|
+
*/
|
|
1364
|
+
declare function isReturningFromWallet(location?: {
|
|
1365
|
+
hash: string;
|
|
1366
|
+
} | undefined): boolean;
|
|
1286
1367
|
interface UseAccountEnrolmentOptions {
|
|
1287
1368
|
/**
|
|
1288
1369
|
* Point enrolment at a wallet other than the hosted one.
|
|
@@ -2093,4 +2174,4 @@ declare function clearContextIdentity(): void;
|
|
|
2093
2174
|
*/
|
|
2094
2175
|
declare function clearAllStorage(): void;
|
|
2095
2176
|
|
|
2096
|
-
export { type AccountAdminDeps, type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, type BootstrapFailure, type BootstrapFromInvitationInput, type BootstrapResult, type BootstrapStep, type BootstrapSuccess, CalimeroLogo, type CalimeroLogoProps, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type DelegatedCredential, type DelegatedSession, type ExecutionResult, type FoundedDelegatedNamespace, HA_ACCOUNT_NOT_LINKED_MESSAGE, HA_REFUSAL_MESSAGES, InvitationNotClaimableError, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, type JoinWithNodeFailure, type JoinWithNodeInput, type JoinWithNodeResult, type JoinWithNodeStep, type JoinWithNodeSuccess, LoginModal, type LoginModalProps, type LoginModalTab, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, NoRelayError, NotForAccountError, type RelayResolutionFailure, type RelayResolutionStep, type ResolveRelayFromInvitationInput, type ResolveRelayResult, type ResolvedInvitationRelay, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, bootstrapFromInvitation, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearDelegatedCredential, clearNodeUrl, clearTokenNodeUrl, createAccountAdmin, createDelegatedContext, createNodeAdmin, cssVar, defaultMeroTheme, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getTokenNodeUrl, isFinalInvitationError, joinWithNode, listDelegatedContexts, localStorageTokenStorage, normaliseAccount, pinRelayNodeKey, readDelegatedCredential, readPinnedRelayNodeKey, readRelayMap, relayForContext, rememberRelay, resolveMeroTheme, resolveRelayFromInvitation, saveDelegatedCredential, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, themeToCssVars, useAccountEnrolment, useAddGroupMembers, useAppVersion, useApplicationContexts, useBlobInfo, useBlobUrl, useContextDiscovery, useContextGroup, useContexts, useCreateContext, useCreateGroupInNamespace, useCreateNamespace, useCreateNamespaceInvitation, useCreatePrivateContext, useDefaultCapabilities, useDelegatedBootstrap, useDeleteContext, useDeleteGroup, useDeleteNamespace, useDetachContextFromGroup, useEphemeral, useExecute, useGroupAppVersion, useGroupCapabilities, useGroupContexts, useGroupInfo, useGroupInvitations, useGroupMembers, useGroupMetadata, useGroupUpgradeStatus, useInstallFromRegistry, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|
|
2177
|
+
export { type AccountAdminDeps, type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, type BootstrapFailure, type BootstrapFromInvitationInput, type BootstrapResult, type BootstrapStep, type BootstrapSuccess, CalimeroLogo, type CalimeroLogoProps, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type DelegatedCredential, type DelegatedSession, type ExecutionResult, type FoundedDelegatedNamespace, HA_ACCOUNT_NOT_LINKED_MESSAGE, HA_REFUSAL_MESSAGES, InvitationNotClaimableError, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, type JoinWithNodeFailure, type JoinWithNodeInput, type JoinWithNodeResult, type JoinWithNodeStep, type JoinWithNodeSuccess, LoginModal, type LoginModalProps, type LoginModalTab, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, NoRelayError, NotForAccountError, type RegistryBundle, type RelayResolutionFailure, type RelayResolutionStep, type ResolveRelayFromInvitationInput, type ResolveRelayResult, type ResolvedApplication, type ResolvedInvitationRelay, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, applicationIdForBundle, bootstrapFromInvitation, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearDelegatedCredential, clearNodeUrl, clearTokenNodeUrl, createAccountAdmin, createDelegatedContext, createNodeAdmin, cssVar, defaultMeroTheme, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getTokenNodeUrl, isFinalInvitationError, isReturningFromWallet, joinWithNode, listDelegatedContexts, localStorageTokenStorage, normaliseAccount, pinRelayNodeKey, readDelegatedCredential, readPinnedRelayNodeKey, readRelayMap, relayForContext, rememberRelay, resolveApplicationIdFromRegistry, resolveMeroTheme, resolveRelayFromInvitation, saveDelegatedCredential, selectLatestBundle, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, themeToCssVars, useAccountEnrolment, useAddGroupMembers, useAppVersion, useApplicationContexts, useBlobInfo, useBlobUrl, useContextDiscovery, useContextGroup, useContexts, useCreateContext, useCreateGroupInNamespace, useCreateNamespace, useCreateNamespaceInvitation, useCreatePrivateContext, useDefaultCapabilities, useDelegatedBootstrap, useDeleteContext, useDeleteGroup, useDeleteNamespace, useDetachContextFromGroup, useEphemeral, useExecute, useGroupAppVersion, useGroupCapabilities, useGroupContexts, useGroupInfo, useGroupInvitations, useGroupMembers, useGroupMetadata, useGroupUpgradeStatus, useInstallFromRegistry, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaceIdentity, useNamespaces, useNamespacesForApplication, useNodeIdentity, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
|