Skip to content

The open alternative to Salesforce, designed for AI.

1.7 KB
Raw Blame
import { type APP_LOCALES } from 'twenty-shared/translations';

import { type FlatApiKey } from 'src/engine/core-modules/api-key/types/flat-api-key.type';
import { type FlatApplication } from 'src/engine/core-modules/application/types/flat-application.type';
import { type RawAuthContext } from 'src/engine/core-modules/auth/types/auth-context.type';
import { type FlatAuthContextUser } from 'src/engine/core-modules/auth/types/flat-auth-context-user.type';
import { type JwtTokenTypeEnum } from 'src/engine/core-modules/auth/types/jwt-token-type.enum';
import { type FlatUserWorkspace } from 'src/engine/core-modules/user-workspace/types/flat-user-workspace.type';
import { type FlatWorkspace } from 'src/engine/core-modules/workspace/types/flat-workspace.type';
import { type AuthProviderEnum } from 'src/engine/core-modules/workspace/types/workspace.type';
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';

declare module 'express-serve-static-core' {
  interface Request {
    user?: FlatAuthContextUser | null;
    apiKey?: FlatApiKey | null;
    application?: FlatApplication | null;
    agentId?: string;
    userWorkspace?: FlatUserWorkspace;
    locale: keyof typeof APP_LOCALES;
    workspace?: FlatWorkspace;
    workspaceId?: string;
    workspaceMetadataVersion?: number;
    workspaceMemberId?: string;
    workspaceMember?: WorkspaceMemberWorkspaceEntity;
    userWorkspaceId?: string;
    authProvider?: AuthProviderEnum | null;
    impersonationContext?: RawAuthContext['impersonationContext'];
    tokenType?: JwtTokenTypeEnum;
    authenticatedAt?: Date;
    executedRootResolvers?: string[];
    mcpMethod?: string;
    mcpToolName?: string;
  }
}