Files
twenty/packages/twenty-front/src/modules/auth/states/currentWorkspaceState.ts
T
neo773 b03f044d0f feat(messaging): add workspace toggle to sync internal emails (#20457)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2026-05-11 19:42:51 +00:00

59 lines
1.5 KiB
TypeScript

import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
import {
type Application,
type Role,
type Workspace,
} from '~/generated-metadata/graphql';
export type CurrentWorkspace = Pick<
Workspace,
| 'id'
| 'inviteHash'
| 'logo'
| 'displayName'
| 'allowImpersonation'
| 'featureFlags'
| 'activationStatus'
| 'billingSubscriptions'
| 'billingEntitlements'
| 'currentBillingSubscription'
| 'workspaceMembersCount'
| 'isPublicInviteLinkEnabled'
| 'isGoogleAuthEnabled'
| 'isGoogleAuthBypassEnabled'
| 'isMicrosoftAuthEnabled'
| 'isMicrosoftAuthBypassEnabled'
| 'isPasswordAuthEnabled'
| 'isPasswordAuthBypassEnabled'
| 'isCustomDomainEnabled'
| 'hasValidEnterpriseKey'
| 'hasValidSignedEnterpriseKey'
| 'hasValidEnterpriseValidityToken'
| 'subdomain'
| 'customDomain'
| 'workspaceUrls'
| 'metadataVersion'
| 'isTwoFactorAuthenticationEnforced'
| 'trashRetentionDays'
| 'eventLogRetentionDays'
| 'fastModel'
| 'smartModel'
| 'aiAdditionalInstructions'
| 'editableProfileFields'
| 'enabledAiModelIds'
| 'useRecommendedModels'
| 'isInternalMessagesImportEnabled'
> & {
defaultRole?: Omit<Role, 'workspaceMembers' | 'agents' | 'apiKeys'> | null;
workspaceCustomApplication: Pick<Application, 'id'> | null;
installedApplications: Pick<
Application,
'id' | 'name' | 'universalIdentifier' | 'logo'
>[];
};
export const currentWorkspaceState = createAtomState<CurrentWorkspace | null>({
key: 'currentWorkspaceState',
defaultValue: null,
});