@calimero-network/mero-react 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -699,7 +699,14 @@ declare function resetInvitationCaptureForTests(): void;
699
699
  * `noun` is what the app calls the thing being joined: "team", "space", "vault".
700
700
  * The reason is mero-js's (`redeemInvitation`), read off the node's status.
701
701
  */
702
- declare function describeInviteFailure(reason: InviteFailureReason, noun?: string): string | null;
702
+ /**
703
+ * The reasons mero-js names for a join refusal, including the two it added for
704
+ * a link already used and a removal. Listed here as well so this builds against
705
+ * a mero-js that does not name them yet; such a mero-js reports both as
706
+ * `refused`.
707
+ */
708
+ type JoinFailureReason = InviteFailureReason | 'already-used' | 'removed';
709
+ declare function describeInviteFailure(reason: JoinFailureReason, noun?: string): string | null;
703
710
 
704
711
  /** What the token carries, once the app's codec has read it. */
705
712
  interface ParsedInvitation {
@@ -1010,11 +1017,13 @@ declare function useJoinInvitation(): {
1010
1017
  * Cloud tab and `ConnectButtonAccount` share one copy of it: the device keys,
1011
1018
  * the redirect to the wallet, and the completion when the tab comes back.
1012
1019
  *
1013
- * - `goToWallet` generates (or reuses) this tab's device keys, remembers a state
1014
- * parameter, and leaves for the wallet.
1015
- * - On the way back, the callback is read ONCE during render, the state is
1016
- * checked against the one sent, the certificate is completed and saved, the
1017
- * account's relays are looked up, and `connectWithAccount` connects.
1020
+ * - `goToWallet` generates (or reuses) this tab's device keys and leaves for the
1021
+ * wallet. mero-js's `deviceEnrolmentUrl` remembers the request under a fresh
1022
+ * state.
1023
+ * - On the way back, the callback is read ONCE during render, the certificate
1024
+ * is completed and saved (`completeDeviceEnrolment` refuses an answer to a
1025
+ * request this browser did not start, and spends its state), the account's
1026
+ * relays are looked up, and `connectWithAccount` connects.
1018
1027
  * - `note` is what the person should be told about that — an error, or a
1019
1028
  * connection with nowhere to write yet.
1020
1029
  * - `returning` is true when this page load carries an enrolment callback,
@@ -1836,4 +1845,4 @@ declare function clearAllStorage(): void;
1836
1845
  */
1837
1846
  declare function isDesktopWindow(): boolean;
1838
1847
 
1839
- export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, type CapturedInvitation, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, type InvitationDialogProps, type InvitationDialogStage, InvitationGate, type InvitationGateProps, type InviteRedemption, type InviteState, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, JoinSyncBanner, type JoinSyncBannerProps, type JoinSyncOptions, type JoinSyncState, LoginModal, type LoginModalProps, type LoginModalTab, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ParsedInvitation, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, type UseInviteRedemptionOptions, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeInvitation, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaces, useNamespacesForApplication, useNodeIdentity, usePendingInvitation, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
1848
+ export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, type CapturedInvitation, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, type InvitationDialogProps, type InvitationDialogStage, InvitationGate, type InvitationGateProps, type InviteRedemption, type InviteState, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, type JoinFailureReason, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, JoinSyncBanner, type JoinSyncBannerProps, type JoinSyncOptions, type JoinSyncState, LoginModal, type LoginModalProps, type LoginModalTab, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ParsedInvitation, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, type UseInviteRedemptionOptions, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeInvitation, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaces, useNamespacesForApplication, useNodeIdentity, usePendingInvitation, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
package/dist/index.d.ts CHANGED
@@ -699,7 +699,14 @@ declare function resetInvitationCaptureForTests(): void;
699
699
  * `noun` is what the app calls the thing being joined: "team", "space", "vault".
700
700
  * The reason is mero-js's (`redeemInvitation`), read off the node's status.
701
701
  */
702
- declare function describeInviteFailure(reason: InviteFailureReason, noun?: string): string | null;
702
+ /**
703
+ * The reasons mero-js names for a join refusal, including the two it added for
704
+ * a link already used and a removal. Listed here as well so this builds against
705
+ * a mero-js that does not name them yet; such a mero-js reports both as
706
+ * `refused`.
707
+ */
708
+ type JoinFailureReason = InviteFailureReason | 'already-used' | 'removed';
709
+ declare function describeInviteFailure(reason: JoinFailureReason, noun?: string): string | null;
703
710
 
704
711
  /** What the token carries, once the app's codec has read it. */
705
712
  interface ParsedInvitation {
@@ -1010,11 +1017,13 @@ declare function useJoinInvitation(): {
1010
1017
  * Cloud tab and `ConnectButtonAccount` share one copy of it: the device keys,
1011
1018
  * the redirect to the wallet, and the completion when the tab comes back.
1012
1019
  *
1013
- * - `goToWallet` generates (or reuses) this tab's device keys, remembers a state
1014
- * parameter, and leaves for the wallet.
1015
- * - On the way back, the callback is read ONCE during render, the state is
1016
- * checked against the one sent, the certificate is completed and saved, the
1017
- * account's relays are looked up, and `connectWithAccount` connects.
1020
+ * - `goToWallet` generates (or reuses) this tab's device keys and leaves for the
1021
+ * wallet. mero-js's `deviceEnrolmentUrl` remembers the request under a fresh
1022
+ * state.
1023
+ * - On the way back, the callback is read ONCE during render, the certificate
1024
+ * is completed and saved (`completeDeviceEnrolment` refuses an answer to a
1025
+ * request this browser did not start, and spends its state), the account's
1026
+ * relays are looked up, and `connectWithAccount` connects.
1018
1027
  * - `note` is what the person should be told about that — an error, or a
1019
1028
  * connection with nowhere to write yet.
1020
1029
  * - `returning` is true when this page load carries an enrolment callback,
@@ -1836,4 +1845,4 @@ declare function clearAllStorage(): void;
1836
1845
  */
1837
1846
  declare function isDesktopWindow(): boolean;
1838
1847
 
1839
- export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, type CapturedInvitation, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, type InvitationDialogProps, type InvitationDialogStage, InvitationGate, type InvitationGateProps, type InviteRedemption, type InviteState, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, JoinSyncBanner, type JoinSyncBannerProps, type JoinSyncOptions, type JoinSyncState, LoginModal, type LoginModalProps, type LoginModalTab, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ParsedInvitation, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, type UseInviteRedemptionOptions, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeInvitation, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaces, useNamespacesForApplication, useNodeIdentity, usePendingInvitation, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
1848
+ export { type AccountEnrolment, AccountSignInPanel, type AccountSignInPanelProps, type AppContext, AppMode, type ApplicationContextRecord, type BlobHookOptions, CalimeroLogo, type CalimeroLogoProps, type CapturedInvitation, ConnectButton, ConnectButtonAccount, type ConnectButtonAccountProps, type ConnectButtonProps, ConnectionType, type ContextDiscoveryOptions, type ContextDiscoveryState, type CreatePrivateContextRequest, type CustomConnectionConfig, DEFAULT_MIGRATION_POLL_INTERVAL_MS, type ExecutionResult, INVITATION_PARAM, INVITATION_READY_MS, InvitationDialog, type InvitationDialogProps, type InvitationDialogStage, InvitationGate, type InvitationGateProps, type InviteRedemption, type InviteState, JOIN_ACTION, JOIN_SYNC_MAX_MS, JOIN_SYNC_POLL_MS, JOIN_SYNC_WATCHDOG_MS, type JoinFailureReason, type JoinInvitationInput, type JoinInvitationResult, type JoinInvitationStep, JoinSyncBanner, type JoinSyncBannerProps, type JoinSyncOptions, type JoinSyncState, LoginModal, type LoginModalProps, type LoginModalTab, MAX_AUTO_JOIN_ATTEMPTS, MERO_CSS_VARS, type MeroCapabilities, MeroContext, type MeroContextValue, MeroProvider, type MeroProviderConfig, type MeroProviderProps, type MeroTheme, MigrationAdminPanel, type MigrationAdminPanelProps, MigrationPendingBanner, type MigrationPendingBannerProps, type MutationOptions, type ParsedInvitation, type ResolvedMeroTheme, type SetMetadataInput, type SubscriptionEventData, type SubscriptionInput, type UseAccountEnrolmentOptions, type UseBlobUrlOptions, type UseDelegatedBootstrapOptions, type UseDelegatedBootstrapResult, type UseEphemeralOptions, type UseEphemeralResult, type UseInviteRedemptionOptions, buildInviteLink, clearAllStorage, clearApplicationId, clearContextId, clearContextIdentity, clearNamespaceJustJoined, clearNodeUrl, clearTokenNodeUrl, cssVar, defaultMeroTheme, describeInviteFailure, getApplicationId, getContextId, getContextIdentity, getNodeUrl, getPermissionsForMode, getTokenNodeUrl, invitationFromRaw, isDesktopWindow, isFinalInvitationError, isNamespaceJustJoined, isReturningFromWallet, localStorageTokenStorage, markNamespaceJustJoined, onInvitation, peekInvitation, primeInvitationCapture, resetInvitationCaptureForTests, resolveMeroTheme, setApplicationId, setContextId, setContextIdentity, setNodeUrl, setTokenNodeUrl, subscribeInvitation, subscribeJustJoined, themeToCssVars, urlWithoutInvitation, 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, useInviteRedemption, useJoinContext, useJoinGroup, useJoinInvitation, useJoinNamespace, useJoinSubgroupInheritance, useJoinSync, useLatestVersion, useMemberMetadata, useMero, useMigrationEvents, useMigrationStatus, useMyAuthoredMigration, useNamespace, useNamespaceGroups, useNamespaces, useNamespacesForApplication, useNodeIdentity, usePendingInvitation, useRedeemInvitation, useRemoveGroupMembers, useReparentGroup, useResyncContext, useRetryGroupUpgrade, useSetContextMetadata, useSetDefaultCapabilities, useSetGroupMetadata, useSetMemberMetadata, useSetSubgroupVisibility, useSetTeeAdmissionPolicy, useSubgroupVisibility, useSubgroups, useSubscription, useSyncGroup, useUpdateMemberRole, useUpgradeGroup, useUploadBlob };
package/dist/index.js CHANGED
@@ -855,7 +855,6 @@ function AccountSignInPanel({
855
855
  );
856
856
  }
857
857
  var DEVICE_KEY = "calimero.device";
858
- var STATE_KEY = "calimero.enrol.state";
859
858
  var HOSTED_WALLET = "https://wallet.cloud.calimero.network/account-enroll";
860
859
  var hex = (b) => [...new Uint8Array(b)].map((x) => x.toString(16).padStart(2, "0")).join("");
861
860
  function executorOf(relay) {
@@ -961,28 +960,10 @@ function useAccountEnrolment({
961
960
  (async () => {
962
961
  try {
963
962
  const keys = await deviceKeys();
964
- const sent = (() => {
965
- try {
966
- return sessionStorage.getItem(STATE_KEY);
967
- } catch {
968
- return null;
969
- }
970
- })();
971
- try {
972
- sessionStorage.removeItem(STATE_KEY);
973
- } catch {
974
- }
975
- if (!sent) {
976
- setNote(
977
- 'This enrolment could not be verified as one this tab started, so it was not accepted. Start again from "Enrol with your account".'
978
- );
979
- return;
980
- }
981
963
  const enrolled = await completeDeviceEnrolment({
982
964
  ...back,
983
965
  devicePublicKey: keys.signPk,
984
- kemPublicKey: keys.kemPk,
985
- expectState: sent
966
+ kemPublicKey: keys.kemPk
986
967
  });
987
968
  saveDelegatedCredential({
988
969
  account: enrolled.account,
@@ -1021,18 +1002,12 @@ function useAccountEnrolment({
1021
1002
  setNote(e instanceof Error ? e.message : String(e));
1022
1003
  return;
1023
1004
  }
1024
- const state = hex(crypto.getRandomValues(new Uint8Array(16)));
1025
- try {
1026
- sessionStorage.setItem(STATE_KEY, state);
1027
- } catch {
1028
- }
1029
1005
  window.location.assign(
1030
1006
  deviceEnrolmentUrl({
1031
1007
  walletUrl,
1032
1008
  devicePublicKey: keys.signPk,
1033
1009
  kemPublicKey: keys.kemPk,
1034
- returnTo: window.location.origin + window.location.pathname,
1035
- state
1010
+ returnTo: window.location.origin + window.location.pathname
1036
1011
  })
1037
1012
  );
1038
1013
  }, [walletUrl]);
@@ -4228,6 +4203,10 @@ function describeInviteFailure(reason, noun = "team") {
4228
4203
  return "This invitation has expired. Ask for a new link.";
4229
4204
  case "invalid":
4230
4205
  return "This invitation link isn't valid. Ask for a new one.";
4206
+ case "already-used":
4207
+ return `You've already used this link to join this ${noun} once. Ask an admin for a new link.`;
4208
+ case "removed":
4209
+ return `An admin removed you from this ${noun}. A new link won't let you back in; ask an admin to add you again.`;
4231
4210
  case "refused":
4232
4211
  return `You can't join this ${noun} with this invitation. Ask an admin to invite you again.`;
4233
4212
  case "signed-out":