Skip to content

The open alternative to Salesforce, designed for AI.

Add admin panel workspace detail page with chat viewer (#19579)

Félix Malfait09806d7d8cce
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index 6a05e4f1690..0dd22ae576c 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -1573,9 +1573,27 @@ enum LogicFunctionExecutionStatus {
ERROR
}
-type BillingTrialPeriod {
- duration: Float!
- isCreditCardRequired: Boolean!
+type FeatureFlag {
+ key: FeatureFlagKey!
+ value: Boolean!
+}
+
+enum FeatureFlagKey {
+ IS_UNIQUE_INDEXES_ENABLED
+ IS_JSON_FILTER_ENABLED
+ IS_AI_ENABLED
+ IS_COMMAND_MENU_ITEM_ENABLED
+ IS_MARKETPLACE_SETTING_TAB_VISIBLE
+ IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED
+ IS_PUBLIC_DOMAIN_ENABLED
+ IS_EMAILING_DOMAIN_ENABLED
+ IS_JUNCTION_RELATIONS_ENABLED
+ IS_DRAFT_EMAIL_ENABLED
+ IS_CONNECTED_ACCOUNT_MIGRATED
+ IS_RICH_TEXT_V1_MIGRATED
+ IS_RECORD_PAGE_LAYOUT_GLOBAL_EDITION_ENABLED
+ IS_RECORD_TABLE_WIDGET_ENABLED
+ IS_DATASOURCE_MIGRATED
}
type WorkspaceUrls {
@@ -1583,6 +1601,89 @@ type WorkspaceUrls {
subdomainUrl: String!
}
+type UserInfo {
+ id: UUID!
+ email: String!
+ firstName: String
+ lastName: String
+ createdAt: DateTime!
+}
+
+type WorkspaceInfo {
+ id: UUID!
+ name: String!
+ allowImpersonation: Boolean!
+ logo: String
+ totalUsers: Float!
+ activationStatus: WorkspaceActivationStatus!
+ createdAt: DateTime!
+ workspaceUrls: WorkspaceUrls!
+ users: [UserInfo!]!
+ featureFlags: [FeatureFlag!]!
+}
+
+type UserLookup {
+ user: UserInfo!
+ workspaces: [WorkspaceInfo!]!
+}
+
+type AdminPanelRecentUser {
+ id: UUID!
+ email: String!
+ firstName: String
+ lastName: String
+ createdAt: DateTime!
+ workspaceName: String
+ workspaceId: UUID
+}
+
+type AdminPanelTopWorkspace {
+ id: UUID!
+ name: String!
+ totalUsers: Int!
+ subdomain: String!
+}
+
+type AdminWorkspaceChatThread {
+ id: UUID!
+ title: String
+ totalInputTokens: Int!
+ totalOutputTokens: Int!
+ conversationSize: Int!
+ createdAt: DateTime!
+ updatedAt: DateTime!
+}
+
+type AdminChatMessagePart {
+ type: String!
+ textContent: String
+ toolName: String
+}
+
+type AdminChatMessage {
+ id: UUID!
+ role: AgentMessageRole!
+ parts: [AdminChatMessagePart!]!
+ createdAt: DateTime!
+}
+
+"""Role of a message in a chat thread"""
+enum AgentMessageRole {
+ SYSTEM
+ USER
+ ASSISTANT
+}
+
+type AdminChatThreadMessages {
+ thread: AdminWorkspaceChatThread!
+ messages: [AdminChatMessage!]!
+}
+
+type BillingTrialPeriod {
+ duration: Float!
+ isCreditCardRequired: Boolean!
+}
+
type SSOIdentityProvider {
id: UUID!
name: String!
@@ -1729,24 +1830,6 @@ type PublicFeatureFlag {
metadata: PublicFeatureFlagMetadata!
}
-enum FeatureFlagKey {
- IS_UNIQUE_INDEXES_ENABLED
- IS_JSON_FILTER_ENABLED
- IS_AI_ENABLED
- IS_COMMAND_MENU_ITEM_ENABLED
- IS_MARKETPLACE_SETTING_TAB_VISIBLE
- IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED
- IS_PUBLIC_DOMAIN_ENABLED
- IS_EMAILING_DOMAIN_ENABLED
- IS_JUNCTION_RELATIONS_ENABLED
- IS_DRAFT_EMAIL_ENABLED
- IS_CONNECTED_ACCOUNT_MIGRATED
- IS_RICH_TEXT_V1_MIGRATED
- IS_RECORD_PAGE_LAYOUT_GLOBAL_EDITION_ENABLED
- IS_RECORD_TABLE_WIDGET_ENABLED
- IS_DATASOURCE_MIGRATED
-}
-
type ClientConfigMaintenanceMode {
startAt: DateTime!
endAt: DateTime!
@@ -1930,34 +2013,6 @@ type SystemHealth {
services: [SystemHealthService!]!
}
-type FeatureFlag {
- key: FeatureFlagKey!
- value: Boolean!
-}
-
-type UserInfo {
- id: UUID!
- email: String!
- firstName: String
- lastName: String
-}
-
-type WorkspaceInfo {
- id: UUID!
- name: String!
- allowImpersonation: Boolean!
- logo: String
- totalUsers: Float!
- workspaceUrls: WorkspaceUrls!
- users: [UserInfo!]!
- featureFlags: [FeatureFlag!]!
-}
-
-type UserLookup {
- user: UserInfo!
- workspaces: [WorkspaceInfo!]!
-}
-
type VersionInfo {
currentVersion: String
latestVersion: String!
@@ -3285,6 +3340,9 @@ type Query {
getConnectedImapSmtpCaldavAccount(id: UUID!): ConnectedImapSmtpCaldavAccount!
getAutoCompleteAddress(address: String!, token: String!, country: String, isFieldCity: Boolean): [AutocompleteResult!]!
getAddressDetails(placeId: String!, token: String!): PlaceDetailsResult!
+ userLookupAdminPanel(userIdentifier: String!): UserLookup!
+ adminPanelRecentUsers(searchTerm: String = ""): [AdminPanelRecentUser!]!
+ adminPanelTopWorkspaces(searchTerm: String = ""): [AdminPanelTopWorkspace!]!
getConfigVariablesGrouped: ConfigVariables!
getSystemHealthStatus: SystemHealth!
getIndicatorHealthStatus(indicatorId: HealthIndicatorId!): AdminPanelHealthServiceData!
@@ -3299,6 +3357,9 @@ type Query {
getModelsDevSuggestions(providerType: String!): [ModelsDevModelSuggestion!]!
getAdminAiUsageByWorkspace(periodStart: DateTime, periodEnd: DateTime): [UsageBreakdownItem!]!
getMaintenanceMode: MaintenanceMode
+ workspaceLookupAdminPanel(workspaceId: UUID!): UserLookup!
+ getAdminWorkspaceChatThreads(workspaceId: UUID!): [AdminWorkspaceChatThread!]!
+ getAdminChatThreadMessages(threadId: UUID!): AdminChatThreadMessages!
getUsageAnalytics(input: UsageAnalyticsInput): UsageAnalytics!
getPostgresCredentials: PostgresCredentials
findManyPublicDomains: [PublicDomain!]!
@@ -3611,7 +3672,6 @@ type Mutation {
startChannelSync(connectedAccountId: UUID!): ChannelSyncSuccess!
saveImapSmtpCaldavAccount(accountOwnerId: UUID!, handle: String!, connectionParameters: EmailAccountConnectionParameters!, id: UUID): ImapSmtpCaldavConnectionSuccess!
updateLabPublicFeatureFlag(input: UpdateLabPublicFeatureFlagInput!): FeatureFlag!
- userLookupAdminPanel(userIdentifier: String!): UserLookup!
updateWorkspaceFeatureFlag(workspaceId: UUID!, featureFlag: String!, value: Boolean!): Boolean!
setAdminAiModelEnabled(modelId: String!, enabled: Boolean!): Boolean!
setAdminAiModelsEnabled(modelIds: [String!]!, enabled: Boolean!): Boolean!
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index b99a7eb632b..407f11718cd 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -1283,18 +1283,110 @@ export interface LogicFunctionExecutionResult {
/** Status of the logic function execution */
export type LogicFunctionExecutionStatus = 'IDLE' | 'SUCCESS' | 'ERROR'
-export interface BillingTrialPeriod {
- duration: Scalars['Float']
- isCreditCardRequired: Scalars['Boolean']
- __typename: 'BillingTrialPeriod'
+export interface FeatureFlag {
+ key: FeatureFlagKey
+ value: Scalars['Boolean']
+ __typename: 'FeatureFlag'
}
+export type FeatureFlagKey = 'IS_UNIQUE_INDEXES_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_AI_ENABLED' | 'IS_COMMAND_MENU_ITEM_ENABLED' | 'IS_MARKETPLACE_SETTING_TAB_VISIBLE' | 'IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED' | 'IS_PUBLIC_DOMAIN_ENABLED' | 'IS_EMAILING_DOMAIN_ENABLED' | 'IS_JUNCTION_RELATIONS_ENABLED' | 'IS_DRAFT_EMAIL_ENABLED' | 'IS_CONNECTED_ACCOUNT_MIGRATED' | 'IS_RICH_TEXT_V1_MIGRATED' | 'IS_RECORD_PAGE_LAYOUT_GLOBAL_EDITION_ENABLED' | 'IS_RECORD_TABLE_WIDGET_ENABLED' | 'IS_DATASOURCE_MIGRATED'
+
export interface WorkspaceUrls {
customUrl?: Scalars['String']
subdomainUrl: Scalars['String']
__typename: 'WorkspaceUrls'
}
+export interface UserInfo {
+ id: Scalars['UUID']
+ email: Scalars['String']
+ firstName?: Scalars['String']
+ lastName?: Scalars['String']
+ createdAt: Scalars['DateTime']
+ __typename: 'UserInfo'
+}
+
+export interface WorkspaceInfo {
+ id: Scalars['UUID']
+ name: Scalars['String']
+ allowImpersonation: Scalars['Boolean']
+ logo?: Scalars['String']
+ totalUsers: Scalars['Float']
+ activationStatus: WorkspaceActivationStatus
+ createdAt: Scalars['DateTime']
+ workspaceUrls: WorkspaceUrls
+ users: UserInfo[]
+ featureFlags: FeatureFlag[]
+ __typename: 'WorkspaceInfo'
+}
+
+export interface UserLookup {
+ user: UserInfo
+ workspaces: WorkspaceInfo[]
+ __typename: 'UserLookup'
+}
+
+export interface AdminPanelRecentUser {
+ id: Scalars['UUID']
+ email: Scalars['String']
+ firstName?: Scalars['String']
+ lastName?: Scalars['String']
+ createdAt: Scalars['DateTime']
+ workspaceName?: Scalars['String']
+ workspaceId?: Scalars['UUID']
+ __typename: 'AdminPanelRecentUser'
+}
+
+export interface AdminPanelTopWorkspace {
+ id: Scalars['UUID']
+ name: Scalars['String']
+ totalUsers: Scalars['Int']
+ subdomain: Scalars['String']
+ __typename: 'AdminPanelTopWorkspace'
+}
+
+export interface AdminWorkspaceChatThread {
+ id: Scalars['UUID']
+ title?: Scalars['String']
+ totalInputTokens: Scalars['Int']
+ totalOutputTokens: Scalars['Int']
+ conversationSize: Scalars['Int']
+ createdAt: Scalars['DateTime']
+ updatedAt: Scalars['DateTime']
+ __typename: 'AdminWorkspaceChatThread'
+}
+
+export interface AdminChatMessagePart {
+ type: Scalars['String']
+ textContent?: Scalars['String']
+ toolName?: Scalars['String']
+ __typename: 'AdminChatMessagePart'
+}
+
+export interface AdminChatMessage {
+ id: Scalars['UUID']
+ role: AgentMessageRole
+ parts: AdminChatMessagePart[]
+ createdAt: Scalars['DateTime']
+ __typename: 'AdminChatMessage'
+}
+
+
+/** Role of a message in a chat thread */
+export type AgentMessageRole = 'SYSTEM' | 'USER' | 'ASSISTANT'
+
+export interface AdminChatThreadMessages {
+ thread: AdminWorkspaceChatThread
+ messages: AdminChatMessage[]
+ __typename: 'AdminChatThreadMessages'
+}
+
+export interface BillingTrialPeriod {
+ duration: Scalars['Float']
+ isCreditCardRequired: Scalars['Boolean']
+ __typename: 'BillingTrialPeriod'
+}
+
export interface SSOIdentityProvider {
id: Scalars['UUID']
name: Scalars['String']
@@ -1437,8 +1529,6 @@ export interface PublicFeatureFlag {
__typename: 'PublicFeatureFlag'
}
-export type FeatureFlagKey = 'IS_UNIQUE_INDEXES_ENABLED' | 'IS_JSON_FILTER_ENABLED' | 'IS_AI_ENABLED' | 'IS_COMMAND_MENU_ITEM_ENABLED' | 'IS_MARKETPLACE_SETTING_TAB_VISIBLE' | 'IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED' | 'IS_PUBLIC_DOMAIN_ENABLED' | 'IS_EMAILING_DOMAIN_ENABLED' | 'IS_JUNCTION_RELATIONS_ENABLED' | 'IS_DRAFT_EMAIL_ENABLED' | 'IS_CONNECTED_ACCOUNT_MIGRATED' | 'IS_RICH_TEXT_V1_MIGRATED' | 'IS_RECORD_PAGE_LAYOUT_GLOBAL_EDITION_ENABLED' | 'IS_RECORD_TABLE_WIDGET_ENABLED' | 'IS_DATASOURCE_MIGRATED'
-
export interface ClientConfigMaintenanceMode {
startAt: Scalars['DateTime']
endAt: Scalars['DateTime']
@@ -1589,38 +1679,6 @@ export interface SystemHealth {
__typename: 'SystemHealth'
}
-export interface FeatureFlag {
- key: FeatureFlagKey
- value: Scalars['Boolean']
- __typename: 'FeatureFlag'
-}
-
-export interface UserInfo {
- id: Scalars['UUID']
- email: Scalars['String']
- firstName?: Scalars['String']
- lastName?: Scalars['String']
- __typename: 'UserInfo'
-}
-
-export interface WorkspaceInfo {
- id: Scalars['UUID']
- name: Scalars['String']
- allowImpersonation: Scalars['Boolean']
- logo?: Scalars['String']
- totalUsers: Scalars['Float']
- workspaceUrls: WorkspaceUrls
- users: UserInfo[]
- featureFlags: FeatureFlag[]
- __typename: 'WorkspaceInfo'
-}
-
-export interface UserLookup {
- user: UserInfo
- workspaces: WorkspaceInfo[]
- __typename: 'UserLookup'
-}
-
export interface VersionInfo {
currentVersion?: Scalars['String']
latestVersion: Scalars['String']
@@ -2846,6 +2904,9 @@ export interface Query {
getConnectedImapSmtpCaldavAccount: ConnectedImapSmtpCaldavAccount
getAutoCompleteAddress: AutocompleteResult[]
getAddressDetails: PlaceDetailsResult
+ userLookupAdminPanel: UserLookup
+ adminPanelRecentUsers: AdminPanelRecentUser[]
+ adminPanelTopWorkspaces: AdminPanelTopWorkspace[]
getConfigVariablesGrouped: ConfigVariables
getSystemHealthStatus: SystemHealth
getIndicatorHealthStatus: AdminPanelHealthServiceData
@@ -2860,6 +2921,9 @@ export interface Query {
getModelsDevSuggestions: ModelsDevModelSuggestion[]
getAdminAiUsageByWorkspace: UsageBreakdownItem[]
getMaintenanceMode?: MaintenanceMode
+ workspaceLookupAdminPanel: UserLookup
+ getAdminWorkspaceChatThreads: AdminWorkspaceChatThread[]
+ getAdminChatThreadMessages: AdminChatThreadMessages
getUsageAnalytics: UsageAnalytics
getPostgresCredentials?: PostgresCredentials
findManyPublicDomains: PublicDomain[]
@@ -3065,7 +3129,6 @@ export interface Mutation {
startChannelSync: ChannelSyncSuccess
saveImapSmtpCaldavAccount: ImapSmtpCaldavConnectionSuccess
updateLabPublicFeatureFlag: FeatureFlag
- userLookupAdminPanel: UserLookup
updateWorkspaceFeatureFlag: Scalars['Boolean']
setAdminAiModelEnabled: Scalars['Boolean']
setAdminAiModelsEnabled: Scalars['Boolean']
@@ -4456,9 +4519,9 @@ export interface LogicFunctionExecutionResultGenqlSelection{
__scalar?: boolean | number
}
-export interface BillingTrialPeriodGenqlSelection{
- duration?: boolean | number
- isCreditCardRequired?: boolean | number
+export interface FeatureFlagGenqlSelection{
+ key?: boolean | number
+ value?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
}
@@ -4470,6 +4533,102 @@ export interface WorkspaceUrlsGenqlSelection{
__scalar?: boolean | number
}
+export interface UserInfoGenqlSelection{
+ id?: boolean | number
+ email?: boolean | number
+ firstName?: boolean | number
+ lastName?: boolean | number
+ createdAt?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface WorkspaceInfoGenqlSelection{
+ id?: boolean | number
+ name?: boolean | number
+ allowImpersonation?: boolean | number
+ logo?: boolean | number
+ totalUsers?: boolean | number
+ activationStatus?: boolean | number
+ createdAt?: boolean | number
+ workspaceUrls?: WorkspaceUrlsGenqlSelection
+ users?: UserInfoGenqlSelection
+ featureFlags?: FeatureFlagGenqlSelection
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface UserLookupGenqlSelection{
+ user?: UserInfoGenqlSelection
+ workspaces?: WorkspaceInfoGenqlSelection
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface AdminPanelRecentUserGenqlSelection{
+ id?: boolean | number
+ email?: boolean | number
+ firstName?: boolean | number
+ lastName?: boolean | number
+ createdAt?: boolean | number
+ workspaceName?: boolean | number
+ workspaceId?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface AdminPanelTopWorkspaceGenqlSelection{
+ id?: boolean | number
+ name?: boolean | number
+ totalUsers?: boolean | number
+ subdomain?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface AdminWorkspaceChatThreadGenqlSelection{
+ id?: boolean | number
+ title?: boolean | number
+ totalInputTokens?: boolean | number
+ totalOutputTokens?: boolean | number
+ conversationSize?: boolean | number
+ createdAt?: boolean | number
+ updatedAt?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface AdminChatMessagePartGenqlSelection{
+ type?: boolean | number
+ textContent?: boolean | number
+ toolName?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface AdminChatMessageGenqlSelection{
+ id?: boolean | number
+ role?: boolean | number
+ parts?: AdminChatMessagePartGenqlSelection
+ createdAt?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface AdminChatThreadMessagesGenqlSelection{
+ thread?: AdminWorkspaceChatThreadGenqlSelection
+ messages?: AdminChatMessageGenqlSelection
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface BillingTrialPeriodGenqlSelection{
+ duration?: boolean | number
+ isCreditCardRequired?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
export interface SSOIdentityProviderGenqlSelection{
id?: boolean | number
name?: boolean | number
@@ -4767,42 +4926,6 @@ export interface SystemHealthGenqlSelection{
__scalar?: boolean | number
}
-export interface FeatureFlagGenqlSelection{
- key?: boolean | number
- value?: boolean | number
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
-export interface UserInfoGenqlSelection{
- id?: boolean | number
- email?: boolean | number
- firstName?: boolean | number
- lastName?: boolean | number
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
-export interface WorkspaceInfoGenqlSelection{
- id?: boolean | number
- name?: boolean | number
- allowImpersonation?: boolean | number
- logo?: boolean | number
- totalUsers?: boolean | number
- workspaceUrls?: WorkspaceUrlsGenqlSelection
- users?: UserInfoGenqlSelection
- featureFlags?: FeatureFlagGenqlSelection
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
-export interface UserLookupGenqlSelection{
- user?: UserInfoGenqlSelection
- workspaces?: WorkspaceInfoGenqlSelection
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
export interface VersionInfoGenqlSelection{
currentVersion?: boolean | number
latestVersion?: boolean | number
@@ -6142,6 +6265,9 @@ export interface QueryGenqlSelection{
getConnectedImapSmtpCaldavAccount?: (ConnectedImapSmtpCaldavAccountGenqlSelection & { __args: {id: Scalars['UUID']} })
getAutoCompleteAddress?: (AutocompleteResultGenqlSelection & { __args: {address: Scalars['String'], token: Scalars['String'], country?: (Scalars['String'] | null), isFieldCity?: (Scalars['Boolean'] | null)} })
getAddressDetails?: (PlaceDetailsResultGenqlSelection & { __args: {placeId: Scalars['String'], token: Scalars['String']} })
+ userLookupAdminPanel?: (UserLookupGenqlSelection & { __args: {userIdentifier: Scalars['String']} })
+ adminPanelRecentUsers?: (AdminPanelRecentUserGenqlSelection & { __args?: {searchTerm?: (Scalars['String'] | null)} })
+ adminPanelTopWorkspaces?: (AdminPanelTopWorkspaceGenqlSelection & { __args?: {searchTerm?: (Scalars['String'] | null)} })
getConfigVariablesGrouped?: ConfigVariablesGenqlSelection
getSystemHealthStatus?: SystemHealthGenqlSelection
getIndicatorHealthStatus?: (AdminPanelHealthServiceDataGenqlSelection & { __args: {indicatorId: HealthIndicatorId} })
@@ -6156,6 +6282,9 @@ export interface QueryGenqlSelection{
getModelsDevSuggestions?: (ModelsDevModelSuggestionGenqlSelection & { __args: {providerType: Scalars['String']} })
getAdminAiUsageByWorkspace?: (UsageBreakdownItemGenqlSelection & { __args?: {periodStart?: (Scalars['DateTime'] | null), periodEnd?: (Scalars['DateTime'] | null)} })
getMaintenanceMode?: MaintenanceModeGenqlSelection
+ workspaceLookupAdminPanel?: (UserLookupGenqlSelection & { __args: {workspaceId: Scalars['UUID']} })
+ getAdminWorkspaceChatThreads?: (AdminWorkspaceChatThreadGenqlSelection & { __args: {workspaceId: Scalars['UUID']} })
+ getAdminChatThreadMessages?: (AdminChatThreadMessagesGenqlSelection & { __args: {threadId: Scalars['UUID']} })
getUsageAnalytics?: (UsageAnalyticsGenqlSelection & { __args?: {input?: (UsageAnalyticsInput | null)} })
getPostgresCredentials?: PostgresCredentialsGenqlSelection
findManyPublicDomains?: PublicDomainGenqlSelection
@@ -6380,7 +6509,6 @@ export interface MutationGenqlSelection{
startChannelSync?: (ChannelSyncSuccessGenqlSelection & { __args: {connectedAccountId: Scalars['UUID']} })
saveImapSmtpCaldavAccount?: (ImapSmtpCaldavConnectionSuccessGenqlSelection & { __args: {accountOwnerId: Scalars['UUID'], handle: Scalars['String'], connectionParameters: EmailAccountConnectionParameters, id?: (Scalars['UUID'] | null)} })
updateLabPublicFeatureFlag?: (FeatureFlagGenqlSelection & { __args: {input: UpdateLabPublicFeatureFlagInput} })
- userLookupAdminPanel?: (UserLookupGenqlSelection & { __args: {userIdentifier: Scalars['String']} })
updateWorkspaceFeatureFlag?: { __args: {workspaceId: Scalars['UUID'], featureFlag: Scalars['String'], value: Scalars['Boolean']} }
setAdminAiModelEnabled?: { __args: {modelId: Scalars['String'], enabled: Scalars['Boolean']} }
setAdminAiModelsEnabled?: { __args: {modelIds: Scalars['String'][], enabled: Scalars['Boolean']} }
@@ -7576,10 +7704,10 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
- const BillingTrialPeriod_possibleTypes: string[] = ['BillingTrialPeriod']
- export const isBillingTrialPeriod = (obj?: { __typename?: any } | null): obj is BillingTrialPeriod => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isBillingTrialPeriod"')
- return BillingTrialPeriod_possibleTypes.includes(obj.__typename)
+ const FeatureFlag_possibleTypes: string[] = ['FeatureFlag']
+ export const isFeatureFlag = (obj?: { __typename?: any } | null): obj is FeatureFlag => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isFeatureFlag"')
+ return FeatureFlag_possibleTypes.includes(obj.__typename)
}
@@ -7592,6 +7720,86 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
+ const UserInfo_possibleTypes: string[] = ['UserInfo']
+ export const isUserInfo = (obj?: { __typename?: any } | null): obj is UserInfo => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isUserInfo"')
+ return UserInfo_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const WorkspaceInfo_possibleTypes: string[] = ['WorkspaceInfo']
+ export const isWorkspaceInfo = (obj?: { __typename?: any } | null): obj is WorkspaceInfo => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isWorkspaceInfo"')
+ return WorkspaceInfo_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const UserLookup_possibleTypes: string[] = ['UserLookup']
+ export const isUserLookup = (obj?: { __typename?: any } | null): obj is UserLookup => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isUserLookup"')
+ return UserLookup_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const AdminPanelRecentUser_possibleTypes: string[] = ['AdminPanelRecentUser']
+ export const isAdminPanelRecentUser = (obj?: { __typename?: any } | null): obj is AdminPanelRecentUser => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isAdminPanelRecentUser"')
+ return AdminPanelRecentUser_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const AdminPanelTopWorkspace_possibleTypes: string[] = ['AdminPanelTopWorkspace']
+ export const isAdminPanelTopWorkspace = (obj?: { __typename?: any } | null): obj is AdminPanelTopWorkspace => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isAdminPanelTopWorkspace"')
+ return AdminPanelTopWorkspace_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const AdminWorkspaceChatThread_possibleTypes: string[] = ['AdminWorkspaceChatThread']
+ export const isAdminWorkspaceChatThread = (obj?: { __typename?: any } | null): obj is AdminWorkspaceChatThread => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isAdminWorkspaceChatThread"')
+ return AdminWorkspaceChatThread_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const AdminChatMessagePart_possibleTypes: string[] = ['AdminChatMessagePart']
+ export const isAdminChatMessagePart = (obj?: { __typename?: any } | null): obj is AdminChatMessagePart => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isAdminChatMessagePart"')
+ return AdminChatMessagePart_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const AdminChatMessage_possibleTypes: string[] = ['AdminChatMessage']
+ export const isAdminChatMessage = (obj?: { __typename?: any } | null): obj is AdminChatMessage => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isAdminChatMessage"')
+ return AdminChatMessage_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const AdminChatThreadMessages_possibleTypes: string[] = ['AdminChatThreadMessages']
+ export const isAdminChatThreadMessages = (obj?: { __typename?: any } | null): obj is AdminChatThreadMessages => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isAdminChatThreadMessages"')
+ return AdminChatThreadMessages_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const BillingTrialPeriod_possibleTypes: string[] = ['BillingTrialPeriod']
+ export const isBillingTrialPeriod = (obj?: { __typename?: any } | null): obj is BillingTrialPeriod => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isBillingTrialPeriod"')
+ return BillingTrialPeriod_possibleTypes.includes(obj.__typename)
+ }
+
+
+
const SSOIdentityProvider_possibleTypes: string[] = ['SSOIdentityProvider']
export const isSSOIdentityProvider = (obj?: { __typename?: any } | null): obj is SSOIdentityProvider => {
if (!obj?.__typename) throw new Error('__typename is missing in "isSSOIdentityProvider"')
@@ -7824,38 +8032,6 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
- const FeatureFlag_possibleTypes: string[] = ['FeatureFlag']
- export const isFeatureFlag = (obj?: { __typename?: any } | null): obj is FeatureFlag => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isFeatureFlag"')
- return FeatureFlag_possibleTypes.includes(obj.__typename)
- }
-
-
-
- const UserInfo_possibleTypes: string[] = ['UserInfo']
- export const isUserInfo = (obj?: { __typename?: any } | null): obj is UserInfo => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isUserInfo"')
- return UserInfo_possibleTypes.includes(obj.__typename)
- }
-
-
-
- const WorkspaceInfo_possibleTypes: string[] = ['WorkspaceInfo']
- export const isWorkspaceInfo = (obj?: { __typename?: any } | null): obj is WorkspaceInfo => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isWorkspaceInfo"')
- return WorkspaceInfo_possibleTypes.includes(obj.__typename)
- }
-
-
-
- const UserLookup_possibleTypes: string[] = ['UserLookup']
- export const isUserLookup = (obj?: { __typename?: any } | null): obj is UserLookup => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isUserLookup"')
- return UserLookup_possibleTypes.includes(obj.__typename)
- }
-
-
-
const VersionInfo_possibleTypes: string[] = ['VersionInfo']
export const isVersionInfo = (obj?: { __typename?: any } | null): obj is VersionInfo => {
if (!obj?.__typename) throw new Error('__typename is missing in "isVersionInfo"')
@@ -9280,6 +9456,30 @@ export const enumLogicFunctionExecutionStatus = {
ERROR: 'ERROR' as const
}
+export const enumFeatureFlagKey = {
+ IS_UNIQUE_INDEXES_ENABLED: 'IS_UNIQUE_INDEXES_ENABLED' as const,
+ IS_JSON_FILTER_ENABLED: 'IS_JSON_FILTER_ENABLED' as const,
+ IS_AI_ENABLED: 'IS_AI_ENABLED' as const,
+ IS_COMMAND_MENU_ITEM_ENABLED: 'IS_COMMAND_MENU_ITEM_ENABLED' as const,
+ IS_MARKETPLACE_SETTING_TAB_VISIBLE: 'IS_MARKETPLACE_SETTING_TAB_VISIBLE' as const,
+ IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED: 'IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED' as const,
+ IS_PUBLIC_DOMAIN_ENABLED: 'IS_PUBLIC_DOMAIN_ENABLED' as const,
+ IS_EMAILING_DOMAIN_ENABLED: 'IS_EMAILING_DOMAIN_ENABLED' as const,
+ IS_JUNCTION_RELATIONS_ENABLED: 'IS_JUNCTION_RELATIONS_ENABLED' as const,
+ IS_DRAFT_EMAIL_ENABLED: 'IS_DRAFT_EMAIL_ENABLED' as const,
+ IS_CONNECTED_ACCOUNT_MIGRATED: 'IS_CONNECTED_ACCOUNT_MIGRATED' as const,
+ IS_RICH_TEXT_V1_MIGRATED: 'IS_RICH_TEXT_V1_MIGRATED' as const,
+ IS_RECORD_PAGE_LAYOUT_GLOBAL_EDITION_ENABLED: 'IS_RECORD_PAGE_LAYOUT_GLOBAL_EDITION_ENABLED' as const,
+ IS_RECORD_TABLE_WIDGET_ENABLED: 'IS_RECORD_TABLE_WIDGET_ENABLED' as const,
+ IS_DATASOURCE_MIGRATED: 'IS_DATASOURCE_MIGRATED' as const
+}
+
+export const enumAgentMessageRole = {
+ SYSTEM: 'SYSTEM' as const,
+ USER: 'USER' as const,
+ ASSISTANT: 'ASSISTANT' as const
+}
+
export const enumIdentityProviderType = {
OIDC: 'OIDC' as const,
SAML: 'SAML' as const
@@ -9309,24 +9509,6 @@ export const enumCaptchaDriverType = {
TURNSTILE: 'TURNSTILE' as const
}
-export const enumFeatureFlagKey = {
- IS_UNIQUE_INDEXES_ENABLED: 'IS_UNIQUE_INDEXES_ENABLED' as const,
- IS_JSON_FILTER_ENABLED: 'IS_JSON_FILTER_ENABLED' as const,
- IS_AI_ENABLED: 'IS_AI_ENABLED' as const,
- IS_COMMAND_MENU_ITEM_ENABLED: 'IS_COMMAND_MENU_ITEM_ENABLED' as const,
- IS_MARKETPLACE_SETTING_TAB_VISIBLE: 'IS_MARKETPLACE_SETTING_TAB_VISIBLE' as const,
- IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED: 'IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED' as const,
- IS_PUBLIC_DOMAIN_ENABLED: 'IS_PUBLIC_DOMAIN_ENABLED' as const,
- IS_EMAILING_DOMAIN_ENABLED: 'IS_EMAILING_DOMAIN_ENABLED' as const,
- IS_JUNCTION_RELATIONS_ENABLED: 'IS_JUNCTION_RELATIONS_ENABLED' as const,
- IS_DRAFT_EMAIL_ENABLED: 'IS_DRAFT_EMAIL_ENABLED' as const,
- IS_CONNECTED_ACCOUNT_MIGRATED: 'IS_CONNECTED_ACCOUNT_MIGRATED' as const,
- IS_RICH_TEXT_V1_MIGRATED: 'IS_RICH_TEXT_V1_MIGRATED' as const,
- IS_RECORD_PAGE_LAYOUT_GLOBAL_EDITION_ENABLED: 'IS_RECORD_PAGE_LAYOUT_GLOBAL_EDITION_ENABLED' as const,
- IS_RECORD_TABLE_WIDGET_ENABLED: 'IS_RECORD_TABLE_WIDGET_ENABLED' as const,
- IS_DATASOURCE_MIGRATED: 'IS_DATASOURCE_MIGRATED' as const
-}
-
export const enumConfigSource = {
ENVIRONMENT: 'ENVIRONMENT' as const,
DATABASE: 'DATABASE' as const,
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index 295d46703c0..04c9a41b041 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -48,49 +48,50 @@ export default {
150,
152,
156,
- 160,
- 161,
- 167,
+ 158,
+ 168,
172,
- 175,
+ 173,
179,
184,
- 185,
187,
- 192,
- 197,
+ 195,
+ 196,
198,
- 214,
- 231,
- 248,
- 285,
- 286,
- 296,
- 297,
- 333,
- 334,
- 335,
- 336,
- 338,
- 339,
+ 203,
+ 208,
+ 209,
+ 221,
+ 238,
+ 255,
+ 292,
+ 293,
+ 303,
+ 304,
340,
341,
342,
343,
- 344,
+ 345,
346,
+ 347,
348,
- 356,
- 362,
+ 349,
+ 350,
+ 351,
+ 353,
+ 355,
363,
- 364,
- 366,
+ 369,
+ 370,
+ 371,
373,
380,
- 411,
- 492,
- 497,
- 498
+ 387,
+ 418,
+ 499,
+ 504,
+ 505
],
"types": {
"BillingProductDTO": {
@@ -788,10 +789,10 @@ export default {
3
],
"relation": [
- 247
+ 254
],
"morphRelations": [
- 247
+ 254
],
"object": [
46
@@ -850,7 +851,7 @@ export default {
36
],
"objectMetadata": [
- 240,
+ 247,
{
"paging": [
39,
@@ -863,7 +864,7 @@ export default {
}
],
"indexFieldMetadatas": [
- 238,
+ 245,
{
"paging": [
39,
@@ -1108,7 +1109,7 @@ export default {
37
],
"fields": [
- 245,
+ 252,
{
"paging": [
39,
@@ -1121,7 +1122,7 @@ export default {
}
],
"indexMetadatas": [
- 243,
+ 250,
{
"paging": [
39,
@@ -1693,7 +1694,7 @@ export default {
49
],
"featureFlags": [
- 200
+ 157
],
"billingSubscriptions": [
131
@@ -1702,7 +1703,7 @@ export default {
131
],
"billingEntitlements": [
- 230
+ 237
],
"hasValidEnterpriseKey": [
6
@@ -1714,7 +1715,7 @@ export default {
6
],
"workspaceUrls": [
- 158
+ 159
],
"workspaceCustomApplicationId": [
1
@@ -1806,7 +1807,7 @@ export default {
20
],
"deletedWorkspaceMembers": [
- 229
+ 236
],
"hasPassword": [
6
@@ -1818,7 +1819,7 @@ export default {
17
],
"availableWorkspaces": [
- 228
+ 235
],
"__typename": [
1
@@ -3174,17 +3175,18 @@ export default {
]
},
"LogicFunctionExecutionStatus": {},
- "BillingTrialPeriod": {
- "duration": [
- 11
+ "FeatureFlag": {
+ "key": [
+ 158
],
- "isCreditCardRequired": [
+ "value": [
6
],
"__typename": [
1
]
},
+ "FeatureFlagKey": {},
"WorkspaceUrls": {
"customUrl": [
1
@@ -3196,6 +3198,195 @@ export default {
1
]
},
+ "UserInfo": {
+ "id": [
+ 3
+ ],
+ "email": [
+ 1
+ ],
+ "firstName": [
+ 1
+ ],
+ "lastName": [
+ 1
+ ],
+ "createdAt": [
+ 4
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "WorkspaceInfo": {
+ "id": [
+ 3
+ ],
+ "name": [
+ 1
+ ],
+ "allowImpersonation": [
+ 6
+ ],
+ "logo": [
+ 1
+ ],
+ "totalUsers": [
+ 11
+ ],
+ "activationStatus": [
+ 67
+ ],
+ "createdAt": [
+ 4
+ ],
+ "workspaceUrls": [
+ 159
+ ],
+ "users": [
+ 160
+ ],
+ "featureFlags": [
+ 157
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "UserLookup": {
+ "user": [
+ 160
+ ],
+ "workspaces": [
+ 161
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "AdminPanelRecentUser": {
+ "id": [
+ 3
+ ],
+ "email": [
+ 1
+ ],
+ "firstName": [
+ 1
+ ],
+ "lastName": [
+ 1
+ ],
+ "createdAt": [
+ 4
+ ],
+ "workspaceName": [
+ 1
+ ],
+ "workspaceId": [
+ 3
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "AdminPanelTopWorkspace": {
+ "id": [
+ 3
+ ],
+ "name": [
+ 1
+ ],
+ "totalUsers": [
+ 21
+ ],
+ "subdomain": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "AdminWorkspaceChatThread": {
+ "id": [
+ 3
+ ],
+ "title": [
+ 1
+ ],
+ "totalInputTokens": [
+ 21
+ ],
+ "totalOutputTokens": [
+ 21
+ ],
+ "conversationSize": [
+ 21
+ ],
+ "createdAt": [
+ 4
+ ],
+ "updatedAt": [
+ 4
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "AdminChatMessagePart": {
+ "type": [
+ 1
+ ],
+ "textContent": [
+ 1
+ ],
+ "toolName": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "AdminChatMessage": {
+ "id": [
+ 3
+ ],
+ "role": [
+ 168
+ ],
+ "parts": [
+ 166
+ ],
+ "createdAt": [
+ 4
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "AgentMessageRole": {},
+ "AdminChatThreadMessages": {
+ "thread": [
+ 165
+ ],
+ "messages": [
+ 167
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "BillingTrialPeriod": {
+ "duration": [
+ 11
+ ],
+ "isCreditCardRequired": [
+ 6
+ ],
+ "__typename": [
+ 1
+ ]
+ },
"SSOIdentityProvider": {
"id": [
3
@@ -3204,10 +3395,10 @@ export default {
1
],
"type": [
- 160
+ 172
],
"status": [
- 161
+ 173
],
"issuer": [
1
@@ -3220,7 +3411,7 @@ export default {
"SSOIdentityProviderStatus": {},
"AuthProviders": {
"sso": [
- 159
+ 171
],
"google": [
6
@@ -3257,10 +3448,10 @@ export default {
3
],
"authProviders": [
- 162
+ 174
],
"authBypassProviders": [
- 163
+ 175
],
"logo": [
1
@@ -3269,7 +3460,7 @@ export default {
1
],
"workspaceUrls": [
- 158
+ 159
],
"__typename": [
1
@@ -3294,7 +3485,7 @@ export default {
1
],
"modelFamily": [
- 167
+ 179
],
"modelFamilyLabel": [
1
@@ -3309,7 +3500,7 @@ export default {
11
],
"nativeCapabilities": [
- 165
+ 177
],
"isDeprecated": [
6
@@ -3345,7 +3536,7 @@ export default {
1
],
"modelFamily": [
- 167
+ 179
],
"modelFamilyLabel": [
1
@@ -3395,7 +3586,7 @@ export default {
},
"AdminAIModels": {
"models": [
- 168
+ 180
],
"defaultSmartModelId": [
1
@@ -3415,7 +3606,7 @@ export default {
1
],
"trialPeriods": [
- 157
+ 170
],
"__typename": [
1
@@ -3423,7 +3614,7 @@ export default {
},
"Support": {
"supportDriver": [
- 172
+ 184
],
"supportFrontChatId": [
1
@@ -3449,7 +3640,7 @@ export default {
},
"Captcha": {
"provider": [
- 175
+ 187
],
"siteKey": [
1
@@ -3483,16 +3674,15 @@ export default {
},
"PublicFeatureFlag": {
"key": [
- 179
+ 158
],
"metadata": [
- 177
+ 189
],
"__typename": [
1
]
},
- "FeatureFlagKey": {},
"ClientConfigMaintenanceMode": {
"startAt": [
4
@@ -3512,13 +3702,13 @@ export default {
1
],
"authProviders": [
- 162
+ 174
],
"billing": [
- 170
+ 182
],
"aiModels": [
- 166
+ 178
],
"signInPrefilled": [
6
@@ -3539,25 +3729,25 @@ export default {
6
],
"support": [
- 171
+ 183
],
"isAttachmentPreviewEnabled": [
6
],
"sentry": [
- 173
+ 185
],
"captcha": [
- 174
+ 186
],
"api": [
- 176
+ 188
],
"canManageFeatureFlags": [
6
],
"publicFeatureFlags": [
- 178
+ 190
],
"isMicrosoftMessagingEnabled": [
6
@@ -3593,7 +3783,7 @@ export default {
6
],
"maintenance": [
- 180
+ 191
],
"__typename": [
1
@@ -3627,13 +3817,13 @@ export default {
6
],
"source": [
- 184
+ 195
],
"isEnvOnly": [
6
],
"type": [
- 185
+ 196
],
"options": [
15
@@ -3646,10 +3836,10 @@ export default {
"ConfigVariableType": {},
"ConfigVariablesGroupData": {
"variables": [
- 183
+ 194
],
"name": [
- 187
+ 198
],
"description": [
1
@@ -3664,7 +3854,7 @@ export default {
"ConfigVariablesGroup": {},
"ConfigVariables": {
"groups": [
- 186
+ 197
],
"__typename": [
1
@@ -3689,7 +3879,7 @@ export default {
21
],
"results": [
- 189
+ 200
],
"__typename": [
1
@@ -3706,7 +3896,7 @@ export default {
15
],
"state": [
- 192
+ 203
],
"timestamp": [
11
@@ -3756,7 +3946,7 @@ export default {
},
"QueueJobsResponse": {
"jobs": [
- 191
+ 202
],
"count": [
11
@@ -3768,7 +3958,7 @@ export default {
6
],
"retentionConfig": [
- 193
+ 204
],
"__typename": [
1
@@ -3779,7 +3969,7 @@ export default {
21
],
"results": [
- 189
+ 200
],
"__typename": [
1
@@ -3787,13 +3977,13 @@ export default {
},
"SystemHealthService": {
"id": [
- 197
+ 208
],
"label": [
1
],
"status": [
- 198
+ 209
],
"__typename": [
1
@@ -3803,75 +3993,7 @@ export default {
"AdminPanelHealthServiceStatus": {},
"SystemHealth": {
"services": [
- 196
- ],
- "__typename": [
- 1
- ]
- },
- "FeatureFlag": {
- "key": [
- 179
- ],
- "value": [
- 6
- ],
- "__typename": [
- 1
- ]
- },
- "UserInfo": {
- "id": [
- 3
- ],
- "email": [
- 1
- ],
- "firstName": [
- 1
- ],
- "lastName": [
- 1
- ],
- "__typename": [
- 1
- ]
- },
- "WorkspaceInfo": {
- "id": [
- 3
- ],
- "name": [
- 1
- ],
- "allowImpersonation": [
- 6
- ],
- "logo": [
- 1
- ],
- "totalUsers": [
- 11
- ],
- "workspaceUrls": [
- 158
- ],
- "users": [
- 201
- ],
- "featureFlags": [
- 200
- ],
- "__typename": [
- 1
- ]
- },
- "UserLookup": {
- "user": [
- 201
- ],
- "workspaces": [
- 202
+ 207
],
"__typename": [
1
@@ -3896,7 +4018,7 @@ export default {
1
],
"status": [
- 198
+ 209
],
"__typename": [
1
@@ -3904,7 +4026,7 @@ export default {
},
"AdminPanelHealthServiceData": {
"id": [
- 197
+ 208
],
"label": [
1
@@ -3913,7 +4035,7 @@ export default {
1
],
"status": [
- 198
+ 209
],
"errorMessage": [
1
@@ -3922,7 +4044,7 @@ export default {
1
],
"queues": [
- 205
+ 212
],
"__typename": [
1
@@ -4007,7 +4129,7 @@ export default {
1
],
"data": [
- 210
+ 217
],
"__typename": [
1
@@ -4050,13 +4172,13 @@ export default {
11
],
"timeRange": [
- 214
+ 221
],
"details": [
- 212
+ 219
],
"data": [
- 211
+ 218
],
"__typename": [
1
@@ -4082,7 +4204,7 @@ export default {
1
],
"versionDistribution": [
- 215
+ 222
],
"__typename": [
1
@@ -4148,7 +4270,7 @@ export default {
3
],
"type": [
- 160
+ 172
],
"issuer": [
1
@@ -4157,7 +4279,7 @@ export default {
1
],
"status": [
- 161
+ 173
],
"__typename": [
1
@@ -4176,7 +4298,7 @@ export default {
},
"FindAvailableSSOIDP": {
"type": [
- 160
+ 172
],
"id": [
3
@@ -4188,10 +4310,10 @@ export default {
1
],
"status": [
- 161
+ 173
],
"workspace": [
- 223
+ 230
],
"__typename": [
1
@@ -4202,7 +4324,7 @@ export default {
3
],
"type": [
- 160
+ 172
],
"issuer": [
1
@@ -4211,7 +4333,7 @@ export default {
1
],
"status": [
- 161
+ 173
],
"__typename": [
1
@@ -4219,7 +4341,7 @@ export default {
},
"SSOConnection": {
"type": [
- 160
+ 172
],
"id": [
3
@@ -4231,7 +4353,7 @@ export default {
1
],
"status": [
- 161
+ 173
],
"__typename": [
1
@@ -4254,13 +4376,13 @@ export default {
1
],
"workspaceUrls": [
- 158
+ 159
],
"logo": [
1
],
"sso": [
- 226
+ 233
],
"__typename": [
1
@@ -4268,10 +4390,10 @@ export default {
},
"AvailableWorkspaces": {
"availableWorkspacesForSignIn": [
- 227
+ 234
],
"availableWorkspacesForSignUp": [
- 227
+ 234
],
"__typename": [
1
@@ -4299,7 +4421,7 @@ export default {
},
"BillingEntitlement": {
"key": [
- 231
+ 238
],
"value": [
6
@@ -4337,7 +4459,7 @@ export default {
1
],
"records": [
- 232
+ 239
],
"__typename": [
1
@@ -4373,10 +4495,10 @@ export default {
},
"IndexConnection": {
"pageInfo": [
- 235
+ 242
],
"edges": [
- 234
+ 241
],
"__typename": [
1
@@ -4395,10 +4517,10 @@ export default {
},
"IndexIndexFieldMetadatasConnection": {
"pageInfo": [
- 235
+ 242
],
"edges": [
- 237
+ 244
],
"__typename": [
1
@@ -4417,10 +4539,10 @@ export default {
},
"IndexObjectMetadataConnection": {
"pageInfo": [
- 235
+ 242
],
"edges": [
- 239
+ 246
],
"__typename": [
1
@@ -4439,10 +4561,10 @@ export default {
},
"ObjectConnection": {
"pageInfo": [
- 235
+ 242
],
"edges": [
- 239
+ 246
],
"__typename": [
1
@@ -4450,10 +4572,10 @@ export default {
},
"ObjectIndexMetadatasConnection": {
"pageInfo": [
- 235
+ 242
],
"edges": [
- 234
+ 241
],
"__typename": [
1
@@ -4472,10 +4594,10 @@ export default {
},
"ObjectFieldsConnection": {
"pageInfo": [
- 235
+ 242
],
"edges": [
- 244
+ 251
],
"__typename": [
1
@@ -4494,7 +4616,7 @@ export default {
},
"Relation": {
"type": [
- 248
+ 255
],
"sourceObjectMetadata": [
46
@@ -4515,10 +4637,10 @@ export default {
"RelationType": {},
"FieldConnection": {
"pageInfo": [
- 235
+ 242
],
"edges": [
- 244
+ 251
],
"__typename": [
1
@@ -4537,10 +4659,10 @@ export default {
},
"ApplicationTokenPair": {
"applicationAccessToken": [
- 250
+ 257
],
"applicationRefreshToken": [
- 250
+ 257
],
"__typename": [
1
@@ -4587,7 +4709,7 @@ export default {
6
],
"applicationTokenPair": [
- 251
+ 258
],
"__typename": [
1
@@ -4635,10 +4757,10 @@ export default {
},
"AuthTokenPair": {
"accessOrWorkspaceAgnosticToken": [
- 250
+ 257
],
"refreshToken": [
- 250
+ 257
],
"__typename": [
1
@@ -4646,10 +4768,10 @@ export default {
},
"AvailableWorkspacesAndAccessTokens": {
"tokens": [
- 258
+ 265
],
"availableWorkspaces": [
- 228
+ 235
],
"__typename": [
1
@@ -4687,7 +4809,7 @@ export default {
},
"WorkspaceUrlsAndId": {
"workspaceUrls": [
- 158
+ 159
],
"id": [
3
@@ -4698,10 +4820,10 @@ export default {
},
"SignUp": {
"loginToken": [
- 250
+ 257
],
"workspace": [
- 263
+ 270
],
"__typename": [
1
@@ -4709,7 +4831,7 @@ export default {
},
"TransientToken": {
"transientToken": [
- 250
+ 257
],
"__typename": [
1
@@ -4731,10 +4853,10 @@ export default {
},
"VerifyEmailAndGetLoginToken": {
"loginToken": [
- 250
+ 257
],
"workspaceUrls": [
- 158
+ 159
],
"__typename": [
1
@@ -4750,7 +4872,7 @@ export default {
},
"AuthTokens": {
"tokens": [
- 258
+ 265
],
"__typename": [
1
@@ -4758,7 +4880,7 @@ export default {
},
"LoginToken": {
"loginToken": [
- 250
+ 257
],
"__typename": [
1
@@ -4788,10 +4910,10 @@ export default {
},
"Impersonate": {
"loginToken": [
- 250
+ 257
],
"workspace": [
- 263
+ 270
],
"__typename": [
1
@@ -4813,7 +4935,7 @@ export default {
1
],
"dailyUsage": [
- 274
+ 281
],
"__typename": [
1
@@ -4821,16 +4943,16 @@ export default {
},
"UsageAnalytics": {
"usageByUser": [
- 182
+ 193
],
"usageByOperationType": [
- 182
+ 193
],
"usageByModel": [
- 182
+ 193
],
"timeSeries": [
- 274
+ 281
],
"periodStart": [
4
@@ -4839,7 +4961,7 @@ export default {
4
],
"userDailyUsage": [
- 275
+ 282
],
"__typename": [
1
@@ -4996,13 +5118,13 @@ export default {
1
],
"driver": [
- 285
+ 292
],
"status": [
- 286
+ 293
],
"verificationRecords": [
- 283
+ 290
],
"verifiedAt": [
4
@@ -5049,7 +5171,7 @@ export default {
1
],
"location": [
- 288
+ 295
],
"__typename": [
1
@@ -5077,13 +5199,13 @@ export default {
},
"ImapSmtpCaldavConnectionParameters": {
"IMAP": [
- 290
+ 297
],
"SMTP": [
- 290
+ 297
],
"CALDAV": [
- 290
+ 297
],
"__typename": [
1
@@ -5103,7 +5225,7 @@ export default {
3
],
"connectionParameters": [
- 291
+ 298
],
"__typename": [
1
@@ -5148,10 +5270,10 @@ export default {
3
],
"frontComponent": [
- 252
+ 259
],
"engineComponentKey": [
- 296
+ 303
],
"label": [
1
@@ -5169,10 +5291,10 @@ export default {
6
],
"availabilityType": [
- 297
+ 304
],
"payload": [
- 298
+ 305
],
"hotKeys": [
1
@@ -5200,10 +5322,10 @@ export default {
"CommandMenuItemAvailabilityType": {},
"CommandMenuItemPayload": {
"on_PathCommandMenuItemPayload": [
- 299
+ 306
],
"on_ObjectMetadataCommandMenuItemPayload": [
- 300
+ 307
],
"__typename": [
1
@@ -5361,7 +5483,7 @@ export default {
1
],
"series": [
- 304
+ 311
],
"xAxisLabel": [
1
@@ -5410,7 +5532,7 @@ export default {
1
],
"data": [
- 306
+ 313
],
"__typename": [
1
@@ -5418,7 +5540,7 @@ export default {
},
"LineChartData": {
"series": [
- 307
+ 314
],
"xAxisLabel": [
1
@@ -5455,7 +5577,7 @@ export default {
},
"PieChartData": {
"data": [
- 309
+ 316
],
"showLegend": [
6
@@ -5522,7 +5644,7 @@ export default {
1
],
"connectionParameters": [
- 291
+ 298
],
"lastSignedInAt": [
4
@@ -5559,13 +5681,13 @@ export default {
},
"PublicImapSmtpCaldavConnectionParameters": {
"IMAP": [
- 313
+ 320
],
"SMTP": [
- 313
+ 320
],
"CALDAV": [
- 313
+ 320
],
"__typename": [
1
@@ -5606,7 +5728,7 @@ export default {
4
],
"connectionParameters": [
- 314
+ 321
],
"__typename": [
1
@@ -5662,13 +5784,13 @@ export default {
},
"EventLogQueryResult": {
"records": [
- 317
+ 324
],
"totalCount": [
21
],
"pageInfo": [
- 318
+ 325
],
"__typename": [
1
@@ -5767,7 +5889,7 @@ export default {
1
],
"parts": [
- 302
+ 309
],
"processedAt": [
4
@@ -5795,7 +5917,7 @@ export default {
},
"AISystemPromptPreview": {
"sections": [
- 323
+ 330
],
"estimatedTokenCount": [
21
@@ -5842,7 +5964,7 @@ export default {
},
"AgentChatThreadEdge": {
"node": [
- 321
+ 328
],
"cursor": [
40
@@ -5853,10 +5975,10 @@ export default {
},
"AgentChatThreadConnection": {
"pageInfo": [
- 235
+ 242
],
"edges": [
- 328
+ 335
],
"__typename": [
1
@@ -5893,10 +6015,10 @@ export default {
3
],
"evaluations": [
- 330
+ 337
],
"messages": [
- 322
+ 329
],
"createdAt": [
4
@@ -5913,19 +6035,19 @@ export default {
1
],
"syncStatus": [
- 333
+ 340
],
"syncStage": [
- 334
+ 341
],
"visibility": [
- 335
+ 342
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 336
+ 343
],
"isSyncEnabled": [
6
@@ -5961,22 +6083,22 @@ export default {
3
],
"visibility": [
- 338
+ 345
],
"handle": [
1
],
"type": [
- 339
+ 346
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 340
+ 347
],
"messageFolderImportPolicy": [
- 341
+ 348
],
"excludeNonProfessionalEmails": [
6
@@ -5985,7 +6107,7 @@ export default {
6
],
"pendingGroupEmailsAction": [
- 342
+ 349
],
"isSyncEnabled": [
6
@@ -5994,10 +6116,10 @@ export default {
4
],
"syncStatus": [
- 343
+ 350
],
"syncStage": [
- 344
+ 351
],
"syncStageStartedAt": [
4
@@ -6048,7 +6170,7 @@ export default {
1
],
"pendingSyncAction": [
- 346
+ 353
],
"messageChannelId": [
3
@@ -6066,7 +6188,7 @@ export default {
"MessageFolderPendingSyncAction": {},
"CollectionHash": {
"collectionName": [
- 348
+ 355
],
"hash": [
1
@@ -6133,13 +6255,13 @@ export default {
},
"MinimalMetadata": {
"objectMetadataItems": [
- 349
+ 356
],
"views": [
- 350
+ 357
],
"collectionHashes": [
- 347
+ 354
],
"__typename": [
1
@@ -6305,7 +6427,7 @@ export default {
2,
{
"input": [
- 354,
+ 361,
"GetApiKeyInput!"
]
}
@@ -6409,7 +6531,7 @@ export default {
32,
{
"input": [
- 355,
+ 362,
"LogicFunctionIdInput!"
]
}
@@ -6421,7 +6543,7 @@ export default {
15,
{
"input": [
- 355,
+ 362,
"LogicFunctionIdInput!"
]
}
@@ -6430,16 +6552,16 @@ export default {
1,
{
"input": [
- 355,
+ 362,
"LogicFunctionIdInput!"
]
}
],
"commandMenuItems": [
- 295
+ 302
],
"commandMenuItem": [
- 295,
+ 302,
{
"id": [
3,
@@ -6448,10 +6570,10 @@ export default {
}
],
"frontComponents": [
- 252
+ 259
],
"frontComponent": [
- 252,
+ 259,
{
"id": [
3,
@@ -6460,7 +6582,7 @@ export default {
}
],
"objectRecordCounts": [
- 241
+ 248
],
"object": [
46,
@@ -6472,7 +6594,7 @@ export default {
}
],
"objects": [
- 242,
+ 249,
{
"paging": [
39,
@@ -6494,7 +6616,7 @@ export default {
}
],
"indexMetadatas": [
- 236,
+ 243,
{
"paging": [
39,
@@ -6513,7 +6635,7 @@ export default {
25,
{
"input": [
- 357,
+ 364,
"AgentIdInput!"
]
}
@@ -6522,7 +6644,7 @@ export default {
29
],
"getToolIndex": [
- 301
+ 308
],
"getToolInputSchema": [
15,
@@ -6543,7 +6665,7 @@ export default {
}
],
"fields": [
- 249,
+ 256,
{
"paging": [
39,
@@ -6573,7 +6695,7 @@ export default {
}
],
"myMessageFolders": [
- 345,
+ 352,
{
"messageChannelId": [
3
@@ -6581,7 +6703,7 @@ export default {
}
],
"myMessageChannels": [
- 337,
+ 344,
{
"connectedAccountId": [
3
@@ -6589,10 +6711,10 @@ export default {
}
],
"myConnectedAccounts": [
- 312
+ 319
],
"connectedAccountById": [
- 315,
+ 322,
{
"id": [
3,
@@ -6601,10 +6723,10 @@ export default {
}
],
"connectedAccounts": [
- 312
+ 319
],
"myCalendarChannels": [
- 332,
+ 339,
{
"connectedAccountId": [
3
@@ -6612,10 +6734,10 @@ export default {
}
],
"webhooks": [
- 352
+ 359
],
"webhook": [
- 352,
+ 359,
{
"id": [
3,
@@ -6624,10 +6746,10 @@ export default {
}
],
"minimalMetadata": [
- 351
+ 358
],
"chatThread": [
- 321,
+ 328,
{
"id": [
3,
@@ -6636,7 +6758,7 @@ export default {
}
],
"chatMessages": [
- 322,
+ 329,
{
"threadId": [
3,
@@ -6645,7 +6767,7 @@ export default {
}
],
"chatStreamCatchupChunks": [
- 325,
+ 332,
{
"threadId": [
3,
@@ -6654,13 +6776,13 @@ export default {
}
],
"getAISystemPromptPreview": [
- 324
+ 331
],
"skills": [
- 320
+ 327
],
"skill": [
- 320,
+ 327,
{
"id": [
3,
@@ -6669,24 +6791,24 @@ export default {
}
],
"chatThreads": [
- 329,
+ 336,
{
"paging": [
39,
"CursorPaging!"
],
"filter": [
- 358,
+ 365,
"AgentChatThreadFilter!"
],
"sorting": [
- 361,
+ 368,
"[AgentChatThreadSort!]!"
]
}
],
"agentTurns": [
- 331,
+ 338,
{
"agentId": [
3,
@@ -6695,43 +6817,43 @@ export default {
}
],
"eventLogs": [
- 319,
+ 326,
{
"input": [
- 365,
+ 372,
"EventLogQueryInput!"
]
}
],
"pieChartData": [
- 310,
+ 317,
{
"input": [
- 369,
+ 376,
"PieChartDataInput!"
]
}
],
"lineChartData": [
- 308,
+ 315,
{
"input": [
- 370,
+ 377,
"LineChartDataInput!"
]
}
],
"barChartData": [
- 305,
+ 312,
{
"input": [
- 371,
+ 378,
"BarChartDataInput!"
]
}
],
"checkUserExists": [
- 271,
+ 278,
{
"email": [
1,
@@ -6743,7 +6865,7 @@ export default {
}
],
"checkWorkspaceInviteHashIsValid": [
- 272,
+ 279,
{
"inviteHash": [
1,
@@ -6761,7 +6883,7 @@ export default {
}
],
"validatePasswordResetToken": [
- 266,
+ 273,
{
"passwordResetToken": [
1,
@@ -6770,7 +6892,7 @@ export default {
}
],
"findApplicationRegistrationByClientId": [
- 218,
+ 225,
{
"clientId": [
1,
@@ -6800,7 +6922,7 @@ export default {
}
],
"findApplicationRegistrationStats": [
- 216,
+ 223,
{
"id": [
1,
@@ -6833,7 +6955,7 @@ export default {
66
],
"getPublicWorkspaceDataByDomain": [
- 164,
+ 176,
{
"origin": [
1
@@ -6841,10 +6963,10 @@ export default {
}
],
"getSSOIdentityProviders": [
- 224
+ 231
],
"getConnectedImapSmtpCaldavAccount": [
- 292,
+ 299,
{
"id": [
3,
@@ -6853,7 +6975,7 @@ export default {
}
],
"getAutoCompleteAddress": [
- 287,
+ 294,
{
"address": [
1,
@@ -6872,7 +6994,7 @@ export default {
}
],
"getAddressDetails": [
- 289,
+ 296,
{
"placeId": [
1,
@@ -6884,41 +7006,66 @@ export default {
]
}
],
+ "userLookupAdminPanel": [
+ 162,
+ {
+ "userIdentifier": [
+ 1,
+ "String!"
+ ]
+ }
+ ],
+ "adminPanelRecentUsers": [
+ 163,
+ {
+ "searchTerm": [
+ 1
+ ]
+ }
+ ],
+ "adminPanelTopWorkspaces": [
+ 164,
+ {
+ "searchTerm": [
+ 1
+ ]
+ }
+ ],
"getConfigVariablesGrouped": [
- 188
+ 199
],
"getSystemHealthStatus": [
- 199
+ 210
],
"getIndicatorHealthStatus": [
- 206,
+ 213,
{
"indicatorId": [
- 197,
+ 208,
"HealthIndicatorId!"
]
}
],
"getQueueMetrics": [
- 213,
+ 220,
{
"queueName": [
1,
"String!"
],
"timeRange": [
- 214
+ 221
]
}
],
"versionInfo": [
- 204
+ 211
],
"getAdminAiModels": [
- 169
+ 181
],
"getDatabaseConfigVariable": [
- 183,
+ 194,
{
"key": [
1,
@@ -6927,14 +7074,14 @@ export default {
}
],
"getQueueJobs": [
- 194,
+ 205,
{
"queueName": [
1,
"String!"
],
"state": [
- 192,
+ 203,
"JobState!"
],
"limit": [
@@ -6952,10 +7099,10 @@ export default {
15
],
"getModelsDevProviders": [
- 209
+ 216
],
"getModelsDevSuggestions": [
- 208,
+ 215,
{
"providerType": [
1,
@@ -6964,7 +7111,7 @@ export default {
}
],
"getAdminAiUsageByWorkspace": [
- 182,
+ 193,
{
"periodStart": [
4
@@ -6975,30 +7122,57 @@ export default {
}
],
"getMaintenanceMode": [
- 207
+ 214
+ ],
+ "workspaceLookupAdminPanel": [
+ 162,
+ {
+ "workspaceId": [
+ 3,
+ "UUID!"
+ ]
+ }
+ ],
+ "getAdminWorkspaceChatThreads": [
+ 165,
+ {
+ "workspaceId": [
+ 3,
+ "UUID!"
+ ]
+ }
+ ],
+ "getAdminChatThreadMessages": [
+ 169,
+ {
+ "threadId": [
+ 3,
+ "UUID!"
+ ]
+ }
],
"getUsageAnalytics": [
- 276,
+ 283,
{
"input": [
- 372
+ 379
]
}
],
"getPostgresCredentials": [
- 294
+ 301
],
"findManyPublicDomains": [
- 282
+ 289
],
"getEmailingDomains": [
- 284
+ 291
],
"findManyMarketplaceApps": [
- 280
+ 287
],
"findMarketplaceAppDetail": [
- 281,
+ 288,
{
"universalIdentifier": [
1,
@@ -7034,7 +7208,7 @@ export default {
},
"LogicFunctionIdInput": {
"id": [
- 356
+ 363
],
"__typename": [
1
@@ -7051,16 +7225,16 @@ export default {
},
"AgentChatThreadFilter": {
"and": [
- 358
+ 365
],
"or": [
- 358
+ 365
],
"id": [
42
],
"updatedAt": [
- 359
+ 366
],
"__typename": [
1
@@ -7098,10 +7272,10 @@ export default {
4
],
"between": [
- 360
+ 367
],
"notBetween": [
- 360
+ 367
],
"__typename": [
1
@@ -7120,13 +7294,13 @@ export default {
},
"AgentChatThreadSort": {
"field": [
- 362
+ 369
],
"direction": [
- 363
+ 370
],
"nulls": [
- 364
+ 371
],
"__typename": [
1
@@ -7137,10 +7311,10 @@ export default {
"SortNulls": {},
"EventLogQueryInput": {
"table": [
- 366
+ 373
],
"filters": [
- 367
+ 374
],
"first": [
21
@@ -7161,7 +7335,7 @@ export default {
1
],
"dateRange": [
- 368
+ 375
],
"recordId": [
1
@@ -7228,7 +7402,7 @@ export default {
1
],
"operationTypes": [
- 373
+ 380
],
"__typename": [
1
@@ -7240,7 +7414,7 @@ export default {
6,
{
"input": [
- 375,
+ 382,
"AddQuerySubscriptionInput!"
]
}
@@ -7249,7 +7423,7 @@ export default {
6,
{
"input": [
- 376,
+ 383,
"RemoveQueryFromEventStreamInput!"
]
}
@@ -7258,7 +7432,7 @@ export default {
146,
{
"inputs": [
- 377,
+ 384,
"[CreateNavigationMenuItemInput!]!"
]
}
@@ -7267,7 +7441,7 @@ export default {
146,
{
"input": [
- 377,
+ 384,
"CreateNavigationMenuItemInput!"
]
}
@@ -7276,7 +7450,7 @@ export default {
146,
{
"inputs": [
- 378,
+ 385,
"[UpdateOneNavigationMenuItemInput!]!"
]
}
@@ -7285,7 +7459,7 @@ export default {
146,
{
"input": [
- 378,
+ 385,
"UpdateOneNavigationMenuItemInput!"
]
}
@@ -7312,7 +7486,7 @@ export default {
142,
{
"file": [
- 380,
+ 387,
"Upload!"
]
}
@@ -7321,7 +7495,7 @@ export default {
142,
{
"file": [
- 380,
+ 387,
"Upload!"
]
}
@@ -7330,7 +7504,7 @@ export default {
142,
{
"file": [
- 380,
+ 387,
"Upload!"
]
}
@@ -7339,7 +7513,7 @@ export default {
142,
{
"file": [
- 380,
+ 387,
"Upload!"
]
}
@@ -7348,7 +7522,7 @@ export default {
142,
{
"file": [
- 380,
+ 387,
"Upload!"
]
}
@@ -7357,7 +7531,7 @@ export default {
142,
{
"file": [
- 380,
+ 387,
"Upload!"
],
"fieldMetadataId": [
@@ -7370,7 +7544,7 @@ export default {
142,
{
"file": [
- 380,
+ 387,
"Upload!"
],
"fieldMetadataUniversalIdentifier": [
@@ -7383,7 +7557,7 @@ export default {
52,
{
"input": [
- 381,
+ 388,
"CreateViewFilterGroupInput!"
]
}
@@ -7396,7 +7570,7 @@ export default {
"String!"
],
"input": [
- 382,
+ 389,
"UpdateViewFilterGroupInput!"
]
}
@@ -7423,7 +7597,7 @@ export default {
54,
{
"input": [
- 383,
+ 390,
"CreateViewFilterInput!"
]
}
@@ -7432,7 +7606,7 @@ export default {
54,
{
"input": [
- 384,
+ 391,
"UpdateViewFilterInput!"
]
}
@@ -7441,7 +7615,7 @@ export default {
54,
{
"input": [
- 386,
+ 393,
"DeleteViewFilterInput!"
]
}
@@ -7450,7 +7624,7 @@ export default {
54,
{
"input": [
- 387,
+ 394,
"DestroyViewFilterInput!"
]
}
@@ -7459,7 +7633,7 @@ export default {
60,
{
"input": [
- 388,
+ 395,
"CreateViewInput!"
]
}
@@ -7472,7 +7646,7 @@ export default {
"String!"
],
"input": [
- 389,
+ 396,
"UpdateViewInput!"
]
}
@@ -7499,7 +7673,7 @@ export default {
57,
{
"input": [
- 390,
+ 397,
"CreateViewSortInput!"
]
}
@@ -7508,7 +7682,7 @@ export default {
57,
{
"input": [
- 391,
+ 398,
"UpdateViewSortInput!"
]
}
@@ -7517,7 +7691,7 @@ export default {
6,
{
"input": [
- 393,
+ 400,
"DeleteViewSortInput!"
]
}
@@ -7526,7 +7700,7 @@ export default {
6,
{
"input": [
- 394,
+ 401,
"DestroyViewSortInput!"
]
}
@@ -7535,7 +7709,7 @@ export default {
50,
{
"input": [
- 395,
+ 402,
"UpdateViewFieldInput!"
]
}
@@ -7544,7 +7718,7 @@ export default {
50,
{
"input": [
- 397,
+ 404,
"CreateViewFieldInput!"
]
}
@@ -7553,7 +7727,7 @@ export default {
50,
{
"inputs": [
- 397,
+ 404,
"[CreateViewFieldInput!]!"
]
}
@@ -7562,7 +7736,7 @@ export default {
50,
{
"input": [
- 398,
+ 405,
"DeleteViewFieldInput!"
]
}
@@ -7571,7 +7745,7 @@ export default {
50,
{
"input": [
- 399,
+ 406,
"DestroyViewFieldInput!"
]
}
@@ -7580,7 +7754,7 @@ export default {
59,
{
"input": [
- 400,
+ 407,
"UpdateViewFieldGroupInput!"
]
}
@@ -7589,7 +7763,7 @@ export default {
59,
{
"input": [
- 402,
+ 409,
"CreateViewFieldGroupInput!"
]
}
@@ -7598,7 +7772,7 @@ export default {
59,
{
"inputs": [
- 402,
+ 409,
"[CreateViewFieldGroupInput!]!"
]
}
@@ -7607,7 +7781,7 @@ export default {
59,
{
"input": [
- 403,
+ 410,
"DeleteViewFieldGroupInput!"
]
}
@@ -7616,7 +7790,7 @@ export default {
59,
{
"input": [
- 404,
+ 411,
"DestroyViewFieldGroupInput!"
]
}
@@ -7625,7 +7799,7 @@ export default {
60,
{
"input": [
- 405,
+ 412,
"UpsertFieldsWidgetInput!"
]
}
@@ -7634,7 +7808,7 @@ export default {
2,
{
"input": [
- 408,
+ 415,
"CreateApiKeyInput!"
]
}
@@ -7643,7 +7817,7 @@ export default {
2,
{
"input": [
- 409,
+ 416,
"UpdateApiKeyInput!"
]
}
@@ -7652,7 +7826,7 @@ export default {
2,
{
"input": [
- 410,
+ 417,
"RevokeApiKeyInput!"
]
}
@@ -7694,7 +7868,7 @@ export default {
116,
{
"type": [
- 411,
+ 418,
"AnalyticsType!"
],
"name": [
@@ -7807,7 +7981,7 @@ export default {
141,
{
"input": [
- 412,
+ 419,
"CreateApprovedAccessDomainInput!"
]
}
@@ -7816,7 +7990,7 @@ export default {
6,
{
"input": [
- 413,
+ 420,
"DeleteApprovedAccessDomainInput!"
]
}
@@ -7825,7 +7999,7 @@ export default {
141,
{
"input": [
- 414,
+ 421,
"ValidateApprovedAccessDomainInput!"
]
}
@@ -7834,7 +8008,7 @@ export default {
113,
{
"input": [
- 415,
+ 422,
"CreatePageLayoutTabInput!"
]
}
@@ -7847,7 +8021,7 @@ export default {
"String!"
],
"input": [
- 416,
+ 423,
"UpdatePageLayoutTabInput!"
]
}
@@ -7865,7 +8039,7 @@ export default {
114,
{
"input": [
- 417,
+ 424,
"CreatePageLayoutInput!"
]
}
@@ -7878,7 +8052,7 @@ export default {
"String!"
],
"input": [
- 418,
+ 425,
"UpdatePageLayoutInput!"
]
}
@@ -7900,7 +8074,7 @@ export default {
"String!"
],
"input": [
- 419,
+ 426,
"UpdatePageLayoutWithTabsInput!"
]
}
@@ -7927,7 +8101,7 @@ export default {
75,
{
"input": [
- 423,
+ 430,
"CreatePageLayoutWidgetInput!"
]
}
@@ -7940,7 +8114,7 @@ export default {
"String!"
],
"input": [
- 424,
+ 431,
"UpdatePageLayoutWidgetInput!"
]
}
@@ -7958,7 +8132,7 @@ export default {
32,
{
"input": [
- 355,
+ 362,
"LogicFunctionIdInput!"
]
}
@@ -7967,7 +8141,7 @@ export default {
32,
{
"input": [
- 425,
+ 432,
"CreateLogicFunctionFromSourceInput!"
]
}
@@ -7976,7 +8150,7 @@ export default {
155,
{
"input": [
- 426,
+ 433,
"ExecuteOneLogicFunctionInput!"
]
}
@@ -7985,31 +8159,31 @@ export default {
6,
{
"input": [
- 427,
+ 434,
"UpdateLogicFunctionFromSourceInput!"
]
}
],
"createCommandMenuItem": [
- 295,
+ 302,
{
"input": [
- 429,
+ 436,
"CreateCommandMenuItemInput!"
]
}
],
"updateCommandMenuItem": [
- 295,
+ 302,
{
"input": [
- 430,
+ 437,
"UpdateCommandMenuItemInput!"
]
}
],
"deleteCommandMenuItem": [
- 295,
+ 302,
{
"id": [
3,
@@ -8018,25 +8192,25 @@ export default {
}
],
"createFrontComponent": [
- 252,
+ 259,
{
"input": [
- 431,
+ 438,
"CreateFrontComponentInput!"
]
}
],
"updateFrontComponent": [
- 252,
+ 259,
{
"input": [
- 432,
+ 439,
"UpdateFrontComponentInput!"
]
}
],
"deleteFrontComponent": [
- 252,
+ 259,
{
"id": [
3,
@@ -8048,7 +8222,7 @@ export default {
46,
{
"input": [
- 434,
+ 441,
"CreateOneObjectInput!"
]
}
@@ -8057,7 +8231,7 @@ export default {
46,
{
"input": [
- 436,
+ 443,
"DeleteOneObjectInput!"
]
}
@@ -8066,7 +8240,7 @@ export default {
46,
{
"input": [
- 437,
+ 444,
"UpdateOneObjectInput!"
]
}
@@ -8075,7 +8249,7 @@ export default {
25,
{
"input": [
- 439,
+ 446,
"CreateAgentInput!"
]
}
@@ -8084,7 +8258,7 @@ export default {
25,
{
"input": [
- 440,
+ 447,
"UpdateAgentInput!"
]
}
@@ -8093,7 +8267,7 @@ export default {
25,
{
"input": [
- 357,
+ 364,
"AgentIdInput!"
]
}
@@ -8115,7 +8289,7 @@ export default {
29,
{
"createRoleInput": [
- 441,
+ 448,
"CreateRoleInput!"
]
}
@@ -8124,7 +8298,7 @@ export default {
29,
{
"updateRoleInput": [
- 442,
+ 449,
"UpdateRoleInput!"
]
}
@@ -8142,7 +8316,7 @@ export default {
16,
{
"upsertObjectPermissionsInput": [
- 444,
+ 451,
"UpsertObjectPermissionsInput!"
]
}
@@ -8151,7 +8325,7 @@ export default {
27,
{
"upsertPermissionFlagsInput": [
- 446,
+ 453,
"UpsertPermissionFlagsInput!"
]
}
@@ -8160,16 +8334,16 @@ export default {
26,
{
"upsertFieldPermissionsInput": [
- 447,
+ 454,
"UpsertFieldPermissionsInput!"
]
}
],
"upsertRowLevelPermissionPredicates": [
- 246,
+ 253,
{
"input": [
- 449,
+ 456,
"UpsertRowLevelPermissionPredicatesInput!"
]
}
@@ -8200,7 +8374,7 @@ export default {
34,
{
"input": [
- 452,
+ 459,
"CreateOneFieldMetadataInput!"
]
}
@@ -8209,7 +8383,7 @@ export default {
34,
{
"input": [
- 454,
+ 461,
"UpdateOneFieldMetadataInput!"
]
}
@@ -8218,7 +8392,7 @@ export default {
34,
{
"input": [
- 456,
+ 463,
"DeleteOneFieldInput!"
]
}
@@ -8227,7 +8401,7 @@ export default {
56,
{
"input": [
- 457,
+ 464,
"CreateViewGroupInput!"
]
}
@@ -8236,7 +8410,7 @@ export default {
56,
{
"inputs": [
- 457,
+ 464,
"[CreateViewGroupInput!]!"
]
}
@@ -8245,7 +8419,7 @@ export default {
56,
{
"input": [
- 458,
+ 465,
"UpdateViewGroupInput!"
]
}
@@ -8254,7 +8428,7 @@ export default {
56,
{
"inputs": [
- 458,
+ 465,
"[UpdateViewGroupInput!]!"
]
}
@@ -8263,7 +8437,7 @@ export default {
56,
{
"input": [
- 460,
+ 467,
"DeleteViewGroupInput!"
]
}
@@ -8272,40 +8446,40 @@ export default {
56,
{
"input": [
- 461,
+ 468,
"DestroyViewGroupInput!"
]
}
],
"updateMessageFolder": [
- 345,
+ 352,
{
"input": [
- 462,
+ 469,
"UpdateMessageFolderInput!"
]
}
],
"updateMessageFolders": [
- 345,
+ 352,
{
"input": [
- 464,
+ 471,
"UpdateMessageFoldersInput!"
]
}
],
"updateMessageChannel": [
- 337,
+ 344,
{
"input": [
- 465,
+ 472,
"UpdateMessageChannelInput!"
]
}
],
"deleteConnectedAccount": [
- 312,
+ 319,
{
"id": [
3,
@@ -8314,34 +8488,34 @@ export default {
}
],
"updateCalendarChannel": [
- 332,
+ 339,
{
"input": [
- 467,
+ 474,
"UpdateCalendarChannelInput!"
]
}
],
"createWebhook": [
- 352,
+ 359,
{
"input": [
- 469,
+ 476,
"CreateWebhookInput!"
]
}
],
"updateWebhook": [
- 352,
+ 359,
{
"input": [
- 470,
+ 477,
"UpdateWebhookInput!"
]
}
],
"deleteWebhook": [
- 352,
+ 359,
{
"id": [
3,
@@ -8350,10 +8524,10 @@ export default {
}
],
"createChatThread": [
- 321
+ 328
],
"sendChatMessage": [
- 326,
+ 333,
{
"threadId": [
3,
@@ -8398,25 +8572,25 @@ export default {
}
],
"createSkill": [
- 320,
+ 327,
{
"input": [
- 472,
+ 479,
"CreateSkillInput!"
]
}
],
"updateSkill": [
- 320,
+ 327,
{
"input": [
- 473,
+ 480,
"UpdateSkillInput!"
]
}
],
"deleteSkill": [
- 320,
+ 327,
{
"id": [
3,
@@ -8425,7 +8599,7 @@ export default {
}
],
"activateSkill": [
- 320,
+ 327,
{
"id": [
3,
@@ -8434,7 +8608,7 @@ export default {
}
],
"deactivateSkill": [
- 320,
+ 327,
{
"id": [
3,
@@ -8443,7 +8617,7 @@ export default {
}
],
"evaluateAgentTurn": [
- 330,
+ 337,
{
"turnId": [
3,
@@ -8452,7 +8626,7 @@ export default {
}
],
"runEvaluationInput": [
- 331,
+ 338,
{
"agentId": [
3,
@@ -8465,7 +8639,7 @@ export default {
}
],
"duplicateDashboard": [
- 311,
+ 318,
{
"id": [
3,
@@ -8474,16 +8648,16 @@ export default {
}
],
"getAuthorizationUrlForSSO": [
- 261,
+ 268,
{
"input": [
- 474,
+ 481,
"GetAuthorizationUrlForSSOInput!"
]
}
],
"getLoginTokenFromCredentials": [
- 270,
+ 277,
{
"email": [
1,
@@ -8509,7 +8683,7 @@ export default {
}
],
"signIn": [
- 259,
+ 266,
{
"email": [
1,
@@ -8531,7 +8705,7 @@ export default {
}
],
"verifyEmailAndGetLoginToken": [
- 267,
+ 274,
{
"emailVerificationToken": [
1,
@@ -8551,7 +8725,7 @@ export default {
}
],
"verifyEmailAndGetWorkspaceAgnosticToken": [
- 259,
+ 266,
{
"emailVerificationToken": [
1,
@@ -8567,7 +8741,7 @@ export default {
}
],
"getAuthTokensFromOTP": [
- 269,
+ 276,
{
"otp": [
1,
@@ -8587,7 +8761,7 @@ export default {
}
],
"signUp": [
- 259,
+ 266,
{
"email": [
1,
@@ -8609,7 +8783,7 @@ export default {
}
],
"signUpInWorkspace": [
- 264,
+ 271,
{
"email": [
1,
@@ -8640,13 +8814,13 @@ export default {
}
],
"signUpInNewWorkspace": [
- 264
+ 271
],
"generateTransientToken": [
- 265
+ 272
],
"getAuthTokensFromLoginToken": [
- 269,
+ 276,
{
"loginToken": [
1,
@@ -8659,7 +8833,7 @@ export default {
}
],
"authorizeApp": [
- 257,
+ 264,
{
"clientId": [
1,
@@ -8681,7 +8855,7 @@ export default {
}
],
"renewToken": [
- 269,
+ 276,
{
"appToken": [
1,
@@ -8690,7 +8864,7 @@ export default {
}
],
"generateApiKeyToken": [
- 268,
+ 275,
{
"apiKeyId": [
3,
@@ -8703,7 +8877,7 @@ export default {
}
],
"emailPasswordResetLink": [
- 260,
+ 267,
{
"email": [
1,
@@ -8715,7 +8889,7 @@ export default {
}
],
"updatePasswordViaResetToken": [
- 262,
+ 269,
{
"passwordResetToken": [
1,
@@ -8728,10 +8902,10 @@ export default {
}
],
"createApplicationRegistration": [
- 217,
+ 224,
{
"input": [
- 475,
+ 482,
"CreateApplicationRegistrationInput!"
]
}
@@ -8740,7 +8914,7 @@ export default {
7,
{
"input": [
- 476,
+ 483,
"UpdateApplicationRegistrationInput!"
]
}
@@ -8755,7 +8929,7 @@ export default {
}
],
"rotateApplicationRegistrationClientSecret": [
- 219,
+ 226,
{
"id": [
1,
@@ -8767,7 +8941,7 @@ export default {
5,
{
"input": [
- 478,
+ 485,
"CreateApplicationRegistrationVariableInput!"
]
}
@@ -8776,7 +8950,7 @@ export default {
5,
{
"input": [
- 479,
+ 486,
"UpdateApplicationRegistrationVariableInput!"
]
}
@@ -8794,7 +8968,7 @@ export default {
7,
{
"file": [
- 380,
+ 387,
"Upload!"
],
"universalIdentifier": [
@@ -8816,7 +8990,7 @@ export default {
}
],
"initiateOTPProvisioning": [
- 255,
+ 262,
{
"loginToken": [
1,
@@ -8829,10 +9003,10 @@ export default {
}
],
"initiateOTPProvisioningForAuthenticatedUser": [
- 255
+ 262
],
"deleteTwoFactorAuthenticationMethod": [
- 254,
+ 261,
{
"twoFactorAuthenticationMethodId": [
3,
@@ -8841,7 +9015,7 @@ export default {
}
],
"verifyTwoFactorAuthenticationMethodForAuthenticatedUser": [
- 256,
+ 263,
{
"otp": [
1,
@@ -8874,7 +9048,7 @@ export default {
}
],
"resendEmailVerificationToken": [
- 220,
+ 227,
{
"email": [
1,
@@ -8890,7 +9064,7 @@ export default {
66,
{
"data": [
- 481,
+ 488,
"ActivateWorkspaceInput!"
]
}
@@ -8899,7 +9073,7 @@ export default {
66,
{
"data": [
- 482,
+ 489,
"UpdateWorkspaceInput!"
]
}
@@ -8908,46 +9082,46 @@ export default {
66
],
"checkCustomDomainValidRecords": [
- 233
+ 240
],
"createOIDCIdentityProvider": [
- 225,
+ 232,
{
"input": [
- 483,
+ 490,
"SetupOIDCSsoInput!"
]
}
],
"createSAMLIdentityProvider": [
- 225,
+ 232,
{
"input": [
- 484,
+ 491,
"SetupSAMLSsoInput!"
]
}
],
"deleteSSOIdentityProvider": [
- 221,
+ 228,
{
"input": [
- 485,
+ 492,
"DeleteSsoInput!"
]
}
],
"editSSOIdentityProvider": [
- 222,
+ 229,
{
"input": [
- 486,
+ 493,
"EditSsoInput!"
]
}
],
"impersonate": [
- 273,
+ 280,
{
"userId": [
3,
@@ -8960,16 +9134,16 @@ export default {
}
],
"sendEmail": [
- 316,
+ 323,
{
"input": [
- 487,
+ 494,
"SendEmailInput!"
]
}
],
"startChannelSync": [
- 303,
+ 310,
{
"connectedAccountId": [
3,
@@ -8978,7 +9152,7 @@ export default {
}
],
"saveImapSmtpCaldavAccount": [
- 293,
+ 300,
{
"accountOwnerId": [
3,
@@ -8989,7 +9163,7 @@ export default {
"String!"
],
"connectionParameters": [
- 489,
+ 496,
"EmailAccountConnectionParameters!"
],
"id": [
@@ -8998,23 +9172,14 @@ export default {
}
],
"updateLabPublicFeatureFlag": [
- 200,
+ 157,
{
"input": [
- 491,
+ 498,
"UpdateLabPublicFeatureFlagInput!"
]
}
],
- "userLookupAdminPanel": [
- 203,
- {
- "userIdentifier": [
- 1,
- "String!"
- ]
- }
- ],
"updateWorkspaceFeatureFlag": [
6,
{
@@ -9088,7 +9253,7 @@ export default {
6,
{
"role": [
- 492,
+ 499,
"AiModelRole!"
],
"modelId": [
@@ -9133,7 +9298,7 @@ export default {
}
],
"retryJobs": [
- 195,
+ 206,
{
"queueName": [
1,
@@ -9146,7 +9311,7 @@ export default {
}
],
"deleteJobs": [
- 190,
+ 201,
{
"queueName": [
1,
@@ -9226,13 +9391,13 @@ export default {
6
],
"enablePostgresProxy": [
- 294
+ 301
],
"disablePostgresProxy": [
- 294
+ 301
],
"createPublicDomain": [
- 282,
+ 289,
{
"domain": [
1,
@@ -9250,7 +9415,7 @@ export default {
}
],
"checkPublicDomainValidRecords": [
- 233,
+ 240,
{
"domain": [
1,
@@ -9259,14 +9424,14 @@ export default {
}
],
"createEmailingDomain": [
- 284,
+ 291,
{
"domain": [
1,
"String!"
],
"driver": [
- 285,
+ 292,
"EmailingDomainDriver!"
]
}
@@ -9281,7 +9446,7 @@ export default {
}
],
"verifyEmailingDomain": [
- 284,
+ 291,
{
"id": [
1,
@@ -9293,7 +9458,7 @@ export default {
68,
{
"input": [
- 493,
+ 500,
"CreateOneAppTokenInput!"
]
}
@@ -9329,7 +9494,7 @@ export default {
6,
{
"workspaceMigration": [
- 495,
+ 502,
"WorkspaceMigrationInput!"
]
}
@@ -9361,7 +9526,7 @@ export default {
}
],
"createDevelopmentApplication": [
- 277,
+ 284,
{
"universalIdentifier": [
1,
@@ -9374,7 +9539,7 @@ export default {
}
],
"generateApplicationToken": [
- 251,
+ 258,
{
"applicationId": [
3,
@@ -9383,7 +9548,7 @@ export default {
}
],
"syncApplication": [
- 278,
+ 285,
{
"manifest": [
15,
@@ -9392,10 +9557,10 @@ export default {
}
],
"uploadApplicationFile": [
- 279,
+ 286,
{
"file": [
- 380,
+ 387,
"Upload!"
],
"applicationUniversalIdentifier": [
@@ -9403,7 +9568,7 @@ export default {
"String!"
],
"fileFolder": [
- 498,
+ 505,
"FileFolder!"
],
"filePath": [
@@ -9426,7 +9591,7 @@ export default {
}
],
"renewApplicationToken": [
- 251,
+ 258,
{
"applicationRefreshToken": [
1,
@@ -9509,7 +9674,7 @@ export default {
3
],
"update": [
- 379
+ 386
],
"__typename": [
1
@@ -9613,7 +9778,7 @@ export default {
3
],
"update": [
- 385
+ 392
],
"__typename": [
1
@@ -9786,7 +9951,7 @@ export default {
3
],
"update": [
- 392
+ 399
],
"__typename": [
1
@@ -9821,7 +9986,7 @@ export default {
3
],
"update": [
- 396
+ 403
],
"__typename": [
1
@@ -9897,7 +10062,7 @@ export default {
3
],
"update": [
- 401
+ 408
],
"__typename": [
1
@@ -9961,10 +10126,10 @@ export default {
3
],
"groups": [
- 406
+ 413
],
"fields": [
- 407
+ 414
],
"__typename": [
1
@@ -9984,7 +10149,7 @@ export default {
6
],
"fields": [
- 407
+ 414
],
"__typename": [
1
@@ -10153,7 +10318,7 @@ export default {
3
],
"tabs": [
- 420
+ 427
],
"__typename": [
1
@@ -10176,7 +10341,7 @@ export default {
79
],
"widgets": [
- 421
+ 428
],
"__typename": [
1
@@ -10199,7 +10364,7 @@ export default {
3
],
"gridPosition": [
- 422
+ 429
],
"position": [
15
@@ -10248,7 +10413,7 @@ export default {
3
],
"gridPosition": [
- 422
+ 429
],
"position": [
15
@@ -10274,7 +10439,7 @@ export default {
3
],
"gridPosition": [
- 422
+ 429
],
"position": [
15
@@ -10346,7 +10511,7 @@ export default {
3
],
"update": [
- 428
+ 435
],
"__typename": [
1
@@ -10398,7 +10563,7 @@ export default {
3
],
"engineComponentKey": [
- 296
+ 303
],
"label": [
1
@@ -10416,7 +10581,7 @@ export default {
6
],
"availabilityType": [
- 297
+ 304
],
"hotKeys": [
1
@@ -10454,13 +10619,13 @@ export default {
6
],
"availabilityType": [
- 297
+ 304
],
"availabilityObjectMetadataId": [
3
],
"engineComponentKey": [
- 296
+ 303
],
"hotKeys": [
1
@@ -10500,7 +10665,7 @@ export default {
3
],
"update": [
- 433
+ 440
],
"__typename": [
1
@@ -10519,7 +10684,7 @@ export default {
},
"CreateOneObjectInput": {
"object": [
- 435
+ 442
],
"__typename": [
1
@@ -10579,7 +10744,7 @@ export default {
},
"UpdateOneObjectInput": {
"update": [
- 438
+ 445
],
"id": [
3
@@ -10751,7 +10916,7 @@ export default {
},
"UpdateRoleInput": {
"update": [
- 443
+ 450
],
"id": [
3
@@ -10806,7 +10971,7 @@ export default {
3
],
"objectPermissions": [
- 445
+ 452
],
"__typename": [
1
@@ -10848,7 +11013,7 @@ export default {
3
],
"fieldPermissions": [
- 448
+ 455
],
"__typename": [
1
@@ -10879,10 +11044,10 @@ export default {
3
],
"predicates": [
- 450
+ 457
],
"predicateGroups": [
- 451
+ 458
],
"__typename": [
1
@@ -10942,7 +11107,7 @@ export default {
},
"CreateOneFieldMetadataInput": {
"field": [
- 453
+ 460
],
"__typename": [
1
@@ -11015,7 +11180,7 @@ export default {
3
],
"update": [
- 455
+ 462
],
"__typename": [
1
@@ -11107,7 +11272,7 @@ export default {
3
],
"update": [
- 459
+ 466
],
"__typename": [
1
@@ -11151,7 +11316,7 @@ export default {
3
],
"update": [
- 463
+ 470
],
"__typename": [
1
@@ -11170,7 +11335,7 @@ export default {
3
],
"update": [
- 463
+ 470
],
"__typename": [
1
@@ -11181,7 +11346,7 @@ export default {
3
],
"update": [
- 466
+ 473
],
"__typename": [
1
@@ -11189,16 +11354,16 @@ export default {
},
"UpdateMessageChannelInputUpdates": {
"visibility": [
- 338
+ 345
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 340
+ 347
],
"messageFolderImportPolicy": [
- 341
+ 348
],
"isSyncEnabled": [
6
@@ -11218,7 +11383,7 @@ export default {
3
],
"update": [
- 468
+ 475
],
"__typename": [
1
@@ -11226,13 +11391,13 @@ export default {
},
"UpdateCalendarChannelInputUpdates": {
"visibility": [
- 335
+ 342
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 336
+ 343
],
"isSyncEnabled": [
6
@@ -11266,7 +11431,7 @@ export default {
3
],
"update": [
- 471
+ 478
],
"__typename": [
1
@@ -11371,7 +11536,7 @@ export default {
1
],
"update": [
- 477
+ 484
],
"__typename": [
1
@@ -11419,7 +11584,7 @@ export default {
1
],
"update": [
- 480
+ 487
],
"__typename": [
1
@@ -11571,7 +11736,7 @@ export default {
3
],
"status": [
- 161
+ 173
],
"__typename": [
1
@@ -11600,7 +11765,7 @@ export default {
1
],
"files": [
- 488
+ 495
],
"__typename": [
1
@@ -11619,13 +11784,13 @@ export default {
},
"EmailAccountConnectionParameters": {
"IMAP": [
- 490
+ 497
],
"SMTP": [
- 490
+ 497
],
"CALDAV": [
- 490
+ 497
],
"__typename": [
1
@@ -11665,7 +11830,7 @@ export default {
"AiModelRole": {},
"CreateOneAppTokenInput": {
"appToken": [
- 494
+ 501
],
"__typename": [
1
@@ -11681,7 +11846,7 @@ export default {
},
"WorkspaceMigrationInput": {
"actions": [
- 496
+ 503
],
"__typename": [
1
@@ -11689,10 +11854,10 @@ export default {
},
"WorkspaceMigrationDeleteActionInput": {
"type": [
- 497
+ 504
],
"metadataName": [
- 348
+ 355
],
"universalIdentifier": [
1
@@ -11714,16 +11879,16 @@ export default {
}
],
"logicFunctionLogs": [
- 253,
+ 260,
{
"input": [
- 500,
+ 507,
"LogicFunctionLogsInput!"
]
}
],
"onAgentChatEvent": [
- 327,
+ 334,
{
"threadId": [
3,
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 705dbfb46bd..79036d7b2b9 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -70,6 +70,27 @@ export type AdminAiModels = {
models: Array<AdminAiModelConfig>;
};
+export type AdminChatMessage = {
+ __typename?: 'AdminChatMessage';
+ createdAt: Scalars['DateTime'];
+ id: Scalars['UUID'];
+ parts: Array<AdminChatMessagePart>;
+ role: AgentMessageRole;
+};
+
+export type AdminChatMessagePart = {
+ __typename?: 'AdminChatMessagePart';
+ textContent?: Maybe<Scalars['String']>;
+ toolName?: Maybe<Scalars['String']>;
+ type: Scalars['String'];
+};
+
+export type AdminChatThreadMessages = {
+ __typename?: 'AdminChatThreadMessages';
+ messages: Array<AdminChatMessage>;
+ thread: AdminWorkspaceChatThread;
+};
+
export type AdminPanelHealthServiceData = {
__typename?: 'AdminPanelHealthServiceData';
description: Scalars['String'];
@@ -86,6 +107,25 @@ export enum AdminPanelHealthServiceStatus {
OUTAGE = 'OUTAGE'
}
+export type AdminPanelRecentUser = {
+ __typename?: 'AdminPanelRecentUser';
+ createdAt: Scalars['DateTime'];
+ email: Scalars['String'];
+ firstName?: Maybe<Scalars['String']>;
+ id: Scalars['UUID'];
+ lastName?: Maybe<Scalars['String']>;
+ workspaceId?: Maybe<Scalars['UUID']>;
+ workspaceName?: Maybe<Scalars['String']>;
+};
+
+export type AdminPanelTopWorkspace = {
+ __typename?: 'AdminPanelTopWorkspace';
+ id: Scalars['UUID'];
+ name: Scalars['String'];
+ subdomain: Scalars['String'];
+ totalUsers: Scalars['Int'];
+};
+
export type AdminPanelWorkerQueueHealth = {
__typename?: 'AdminPanelWorkerQueueHealth';
id: Scalars['String'];
@@ -93,6 +133,17 @@ export type AdminPanelWorkerQueueHealth = {
status: AdminPanelHealthServiceStatus;
};
+export type AdminWorkspaceChatThread = {
+ __typename?: 'AdminWorkspaceChatThread';
+ conversationSize: Scalars['Int'];
+ createdAt: Scalars['DateTime'];
+ id: Scalars['UUID'];
+ title?: Maybe<Scalars['String']>;
+ totalInputTokens: Scalars['Int'];
+ totalOutputTokens: Scalars['Int'];
+ updatedAt: Scalars['DateTime'];
+};
+
export type Agent = {
__typename?: 'Agent';
applicationId?: Maybe<Scalars['UUID']>;
@@ -214,6 +265,13 @@ export type AgentMessagePart = {
type: Scalars['String'];
};
+/** Role of a message in a chat thread */
+export enum AgentMessageRole {
+ ASSISTANT = 'ASSISTANT',
+ SYSTEM = 'SYSTEM',
+ USER = 'USER'
+}
+
export type AgentTurn = {
__typename?: 'AgentTurn';
agentId?: Maybe<Scalars['UUID']>;
@@ -2744,7 +2802,6 @@ export type Mutation = {
upsertObjectPermissions: Array<ObjectPermission>;
upsertPermissionFlags: Array<PermissionFlag>;
upsertRowLevelPermissionPredicates: UpsertRowLevelPermissionPredicatesResult;
- userLookupAdminPanel: UserLookup;
validateApprovedAccessDomain: ApprovedAccessDomain;
verifyEmailAndGetLoginToken: VerifyEmailAndGetLoginToken;
verifyEmailAndGetWorkspaceAgnosticToken: AvailableWorkspacesAndAccessTokens;
@@ -3806,11 +3863,6 @@ export type MutationUpsertRowLevelPermissionPredicatesArgs = {
};
-export type MutationUserLookupAdminPanelArgs = {
- userIdentifier: Scalars['String'];
-};
-
-
export type MutationValidateApprovedAccessDomainArgs = {
input: ValidateApprovedAccessDomainInput;
};
@@ -4314,6 +4366,8 @@ export type PublicWorkspaceData = {
export type Query = {
__typename?: 'Query';
+ adminPanelRecentUsers: Array<AdminPanelRecentUser>;
+ adminPanelTopWorkspaces: Array<AdminPanelTopWorkspace>;
agentTurns: Array<AgentTurn>;
apiKey?: Maybe<ApiKey>;
apiKeys: Array<ApiKey>;
@@ -4362,6 +4416,8 @@ export type Query = {
getAddressDetails: PlaceDetailsResult;
getAdminAiModels: AdminAiModels;
getAdminAiUsageByWorkspace: Array<UsageBreakdownItem>;
+ getAdminChatThreadMessages: AdminChatThreadMessages;
+ getAdminWorkspaceChatThreads: Array<AdminWorkspaceChatThread>;
getAiProviders: Scalars['JSON'];
getApprovedAccessDomains: Array<ApprovedAccessDomain>;
getAutoCompleteAddress: Array<AutocompleteResult>;
@@ -4423,10 +4479,22 @@ export type Query = {
pieChartData: PieChartData;
skill?: Maybe<Skill>;
skills: Array<Skill>;
+ userLookupAdminPanel: UserLookup;
validatePasswordResetToken: ValidatePasswordResetToken;
versionInfo: VersionInfo;
webhook?: Maybe<Webhook>;
webhooks: Array<Webhook>;
+ workspaceLookupAdminPanel: UserLookup;
+};
+
+
+export type QueryAdminPanelRecentUsersArgs = {
+ searchTerm?: InputMaybe<Scalars['String']>;
+};
+
+
+export type QueryAdminPanelTopWorkspacesArgs = {
+ searchTerm?: InputMaybe<Scalars['String']>;
};
@@ -4592,6 +4660,16 @@ export type QueryGetAdminAiUsageByWorkspaceArgs = {
};
+export type QueryGetAdminChatThreadMessagesArgs = {
+ threadId: Scalars['UUID'];
+};
+
+
+export type QueryGetAdminWorkspaceChatThreadsArgs = {
+ workspaceId: Scalars['UUID'];
+};
+
+
export type QueryGetAutoCompleteAddressArgs = {
address: Scalars['String'];
country?: InputMaybe<Scalars['String']>;
@@ -4818,6 +4896,11 @@ export type QuerySkillArgs = {
};
+export type QueryUserLookupAdminPanelArgs = {
+ userIdentifier: Scalars['String'];
+};
+
+
export type QueryValidatePasswordResetTokenArgs = {
passwordResetToken: Scalars['String'];
};
@@ -4827,6 +4910,11 @@ export type QueryWebhookArgs = {
id: Scalars['UUID'];
};
+
+export type QueryWorkspaceLookupAdminPanelArgs = {
+ workspaceId: Scalars['UUID'];
+};
+
export type QueueJob = {
__typename?: 'QueueJob';
attemptsMade: Scalars['Float'];
@@ -5850,6 +5938,7 @@ export type User = {
export type UserInfo = {
__typename?: 'UserInfo';
+ createdAt: Scalars['DateTime'];
email: Scalars['String'];
firstName?: Maybe<Scalars['String']>;
id: Scalars['UUID'];
@@ -6258,7 +6347,9 @@ export enum WorkspaceActivationStatus {
export type WorkspaceInfo = {
__typename?: 'WorkspaceInfo';
+ activationStatus: WorkspaceActivationStatus;
allowImpersonation: Scalars['Boolean'];
+ createdAt: Scalars['DateTime'];
featureFlags: Array<FeatureFlag>;
id: Scalars['UUID'];
logo?: Maybe<Scalars['String']>;
@@ -7367,6 +7458,8 @@ export type GetDatabaseConfigVariableQueryVariables = Exact<{
export type GetDatabaseConfigVariableQuery = { __typename?: 'Query', getDatabaseConfigVariable: { __typename?: 'ConfigVariable', name: string, description: string, value?: any | null, isSensitive: boolean, isEnvOnly: boolean, type: ConfigVariableType, options?: any | null, source: ConfigSource } };
+export type UserInfoFragmentFragment = { __typename?: 'UserInfo', id: string, email: string, firstName?: string | null, lastName?: string | null, createdAt: string };
+
export type UpdateWorkspaceFeatureFlagMutationVariables = Exact<{
workspaceId: Scalars['UUID'];
featureFlag: Scalars['String'];
@@ -7376,18 +7469,53 @@ export type UpdateWorkspaceFeatureFlagMutationVariables = Exact<{
export type UpdateWorkspaceFeatureFlagMutation = { __typename?: 'Mutation', updateWorkspaceFeatureFlag: boolean };
-export type UserLookupAdminPanelMutationVariables = Exact<{
- userIdentifier: Scalars['String'];
+export type AdminPanelRecentUsersQueryVariables = Exact<{
+ searchTerm?: InputMaybe<Scalars['String']>;
+}>;
+
+
+export type AdminPanelRecentUsersQuery = { __typename?: 'Query', adminPanelRecentUsers: Array<{ __typename?: 'AdminPanelRecentUser', id: string, email: string, firstName?: string | null, lastName?: string | null, createdAt: string, workspaceName?: string | null, workspaceId?: string | null }> };
+
+export type AdminPanelTopWorkspacesQueryVariables = Exact<{
+ searchTerm?: InputMaybe<Scalars['String']>;
+}>;
+
+
+export type AdminPanelTopWorkspacesQuery = { __typename?: 'Query', adminPanelTopWorkspaces: Array<{ __typename?: 'AdminPanelTopWorkspace', id: string, name: string, totalUsers: number, subdomain: string }> };
+
+export type GetAdminChatThreadMessagesQueryVariables = Exact<{
+ threadId: Scalars['UUID'];
}>;
-export type UserLookupAdminPanelMutation = { __typename?: 'Mutation', userLookupAdminPanel: { __typename?: 'UserLookup', user: { __typename?: 'UserInfo', id: string, email: string, firstName?: string | null, lastName?: string | null }, workspaces: Array<{ __typename?: 'WorkspaceInfo', id: string, name: string, logo?: string | null, totalUsers: number, allowImpersonation: boolean, workspaceUrls: { __typename?: 'WorkspaceUrls', customUrl?: string | null, subdomainUrl: string }, users: Array<{ __typename?: 'UserInfo', id: string, email: string, firstName?: string | null, lastName?: string | null }>, featureFlags: Array<{ __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean }> }> } };
+export type GetAdminChatThreadMessagesQuery = { __typename?: 'Query', getAdminChatThreadMessages: { __typename?: 'AdminChatThreadMessages', thread: { __typename?: 'AdminWorkspaceChatThread', id: string, title?: string | null, totalInputTokens: number, totalOutputTokens: number, conversationSize: number, createdAt: string, updatedAt: string }, messages: Array<{ __typename?: 'AdminChatMessage', id: string, role: AgentMessageRole, createdAt: string, parts: Array<{ __typename?: 'AdminChatMessagePart', type: string, textContent?: string | null, toolName?: string | null }> }> } };
+
+export type GetAdminWorkspaceChatThreadsQueryVariables = Exact<{
+ workspaceId: Scalars['UUID'];
+}>;
+
+
+export type GetAdminWorkspaceChatThreadsQuery = { __typename?: 'Query', getAdminWorkspaceChatThreads: Array<{ __typename?: 'AdminWorkspaceChatThread', id: string, title?: string | null, totalInputTokens: number, totalOutputTokens: number, conversationSize: number, createdAt: string, updatedAt: string }> };
export type GetVersionInfoQueryVariables = Exact<{ [key: string]: never; }>;
export type GetVersionInfoQuery = { __typename?: 'Query', versionInfo: { __typename?: 'VersionInfo', currentVersion?: string | null, latestVersion: string } };
+export type UserLookupAdminPanelQueryVariables = Exact<{
+ userIdentifier: Scalars['String'];
+}>;
+
+
+export type UserLookupAdminPanelQuery = { __typename?: 'Query', userLookupAdminPanel: { __typename?: 'UserLookup', user: { __typename?: 'UserInfo', id: string, email: string, firstName?: string | null, lastName?: string | null, createdAt: string }, workspaces: Array<{ __typename?: 'WorkspaceInfo', id: string, name: string, logo?: string | null, totalUsers: number, activationStatus: WorkspaceActivationStatus, createdAt: string, allowImpersonation: boolean, workspaceUrls: { __typename?: 'WorkspaceUrls', customUrl?: string | null, subdomainUrl: string }, users: Array<{ __typename?: 'UserInfo', id: string, email: string, firstName?: string | null, lastName?: string | null }>, featureFlags: Array<{ __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean }> }> } };
+
+export type WorkspaceLookupAdminPanelQueryVariables = Exact<{
+ workspaceId: Scalars['UUID'];
+}>;
+
+
+export type WorkspaceLookupAdminPanelQuery = { __typename?: 'Query', workspaceLookupAdminPanel: { __typename?: 'UserLookup', user: { __typename?: 'UserInfo', id: string, email: string, firstName?: string | null, lastName?: string | null, createdAt: string }, workspaces: Array<{ __typename?: 'WorkspaceInfo', id: string, name: string, allowImpersonation: boolean, logo?: string | null, totalUsers: number, activationStatus: WorkspaceActivationStatus, createdAt: string, workspaceUrls: { __typename?: 'WorkspaceUrls', customUrl?: string | null, subdomainUrl: string }, users: Array<{ __typename?: 'UserInfo', id: string, email: string, firstName?: string | null, lastName?: string | null }>, featureFlags: Array<{ __typename?: 'FeatureFlag', key: FeatureFlagKey, value: boolean }> }> } };
+
export type DeleteJobsMutationVariables = Exact<{
queueName: Scalars['String'];
jobIds: Array<Scalars['String']> | Scalars['String'];
@@ -8395,6 +8523,7 @@ export const MarketplaceAppFieldsFragmentDoc = {"kind":"Document","definitions":
export const NavigationMenuItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"NavigationMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NavigationMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"targetRecordId"}},{"kind":"Field","name":{"kind":"Name","value":"targetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"folderId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<NavigationMenuItemFieldsFragment, unknown>;
export const NavigationMenuItemQueryFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"NavigationMenuItemQueryFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NavigationMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"NavigationMenuItemFields"}},{"kind":"Field","name":{"kind":"Name","value":"targetRecordIdentifier"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"labelIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"imageIdentifier"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"NavigationMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"NavigationMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"targetRecordId"}},{"kind":"Field","name":{"kind":"Name","value":"targetObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"folderId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"link"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<NavigationMenuItemQueryFieldsFragment, unknown>;
export const PublicConnectionParamsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PublicConnectionParams"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PublicConnectionParametersOutput"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"host"}},{"kind":"Field","name":{"kind":"Name","value":"port"}},{"kind":"Field","name":{"kind":"Name","value":"secure"}},{"kind":"Field","name":{"kind":"Name","value":"username"}}]}}]} as unknown as DocumentNode<PublicConnectionParamsFragment, unknown>;
+export const UserInfoFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserInfoFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode<UserInfoFragmentFragment, unknown>;
export const ApplicationRegistrationFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ApplicationRegistrationFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ApplicationRegistration"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"oAuthClientId"}},{"kind":"Field","name":{"kind":"Name","value":"oAuthRedirectUris"}},{"kind":"Field","name":{"kind":"Name","value":"oAuthScopes"}},{"kind":"Field","name":{"kind":"Name","value":"sourceType"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePackage"}},{"kind":"Field","name":{"kind":"Name","value":"latestAvailableVersion"}},{"kind":"Field","name":{"kind":"Name","value":"isListed"}},{"kind":"Field","name":{"kind":"Name","value":"isFeatured"}},{"kind":"Field","name":{"kind":"Name","value":"ownerWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<ApplicationRegistrationFragmentFragment, unknown>;
export const BillingPriceLicensedFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingPriceLicensedFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingPriceLicensed"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"recurringInterval"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageType"}}]}}]} as unknown as DocumentNode<BillingPriceLicensedFragmentFragment, unknown>;
export const BillingPriceMeteredFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingPriceMeteredFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingPriceMetered"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"priceUsageType"}},{"kind":"Field","name":{"kind":"Name","value":"recurringInterval"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"tiers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"flatAmount"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"upTo"}}]}}]}}]} as unknown as DocumentNode<BillingPriceMeteredFragmentFragment, unknown>;
@@ -8562,8 +8691,13 @@ export const UpdateDatabaseConfigVariableDocument = {"kind":"Document","definiti
export const GetConfigVariablesGroupedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetConfigVariablesGrouped"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getConfigVariablesGrouped"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"groups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"isHiddenOnLoad"}},{"kind":"Field","name":{"kind":"Name","value":"variables"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"isSensitive"}},{"kind":"Field","name":{"kind":"Name","value":"isEnvOnly"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"options"}},{"kind":"Field","name":{"kind":"Name","value":"source"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetConfigVariablesGroupedQuery, GetConfigVariablesGroupedQueryVariables>;
export const GetDatabaseConfigVariableDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetDatabaseConfigVariable"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getDatabaseConfigVariable"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"isSensitive"}},{"kind":"Field","name":{"kind":"Name","value":"isEnvOnly"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"options"}},{"kind":"Field","name":{"kind":"Name","value":"source"}}]}}]}}]} as unknown as DocumentNode<GetDatabaseConfigVariableQuery, GetDatabaseConfigVariableQueryVariables>;
export const UpdateWorkspaceFeatureFlagDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateWorkspaceFeatureFlag"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"featureFlag"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"value"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateWorkspaceFeatureFlag"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"featureFlag"},"value":{"kind":"Variable","name":{"kind":"Name","value":"featureFlag"}}},{"kind":"Argument","name":{"kind":"Name","value":"value"},"value":{"kind":"Variable","name":{"kind":"Name","value":"value"}}}]}]}}]} as unknown as DocumentNode<UpdateWorkspaceFeatureFlagMutation, UpdateWorkspaceFeatureFlagMutationVariables>;
-export const UserLookupAdminPanelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UserLookupAdminPanel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"userIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userLookupAdminPanel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"userIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"userIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"totalUsers"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customUrl"}},{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"users"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"featureFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}}]} as unknown as DocumentNode<UserLookupAdminPanelMutation, UserLookupAdminPanelMutationVariables>;
+export const AdminPanelRecentUsersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AdminPanelRecentUsers"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"searchTerm"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminPanelRecentUsers"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"searchTerm"},"value":{"kind":"Variable","name":{"kind":"Name","value":"searchTerm"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceId"}}]}}]}}]} as unknown as DocumentNode<AdminPanelRecentUsersQuery, AdminPanelRecentUsersQueryVariables>;
+export const AdminPanelTopWorkspacesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"AdminPanelTopWorkspaces"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"searchTerm"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"adminPanelTopWorkspaces"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"searchTerm"},"value":{"kind":"Variable","name":{"kind":"Name","value":"searchTerm"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"totalUsers"}},{"kind":"Field","name":{"kind":"Name","value":"subdomain"}}]}}]}}]} as unknown as DocumentNode<AdminPanelTopWorkspacesQuery, AdminPanelTopWorkspacesQueryVariables>;
+export const GetAdminChatThreadMessagesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAdminChatThreadMessages"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getAdminChatThreadMessages"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"threadId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"threadId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"thread"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"totalInputTokens"}},{"kind":"Field","name":{"kind":"Name","value":"totalOutputTokens"}},{"kind":"Field","name":{"kind":"Name","value":"conversationSize"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"messages"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"parts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"textContent"}},{"kind":"Field","name":{"kind":"Name","value":"toolName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode<GetAdminChatThreadMessagesQuery, GetAdminChatThreadMessagesQueryVariables>;
+export const GetAdminWorkspaceChatThreadsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetAdminWorkspaceChatThreads"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getAdminWorkspaceChatThreads"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"title"}},{"kind":"Field","name":{"kind":"Name","value":"totalInputTokens"}},{"kind":"Field","name":{"kind":"Name","value":"totalOutputTokens"}},{"kind":"Field","name":{"kind":"Name","value":"conversationSize"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetAdminWorkspaceChatThreadsQuery, GetAdminWorkspaceChatThreadsQueryVariables>;
export const GetVersionInfoDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetVersionInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"versionInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentVersion"}},{"kind":"Field","name":{"kind":"Name","value":"latestVersion"}}]}}]}}]} as unknown as DocumentNode<GetVersionInfoQuery, GetVersionInfoQueryVariables>;
+export const UserLookupAdminPanelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UserLookupAdminPanel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"userIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userLookupAdminPanel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"userIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"userIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserInfoFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"totalUsers"}},{"kind":"Field","name":{"kind":"Name","value":"activationStatus"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customUrl"}},{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"users"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"featureFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserInfoFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode<UserLookupAdminPanelQuery, UserLookupAdminPanelQueryVariables>;
+export const WorkspaceLookupAdminPanelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"WorkspaceLookupAdminPanel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"workspaceLookupAdminPanel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserInfoFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"totalUsers"}},{"kind":"Field","name":{"kind":"Name","value":"activationStatus"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"customUrl"}},{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"users"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"featureFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserInfoFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"UserInfo"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]} as unknown as DocumentNode<WorkspaceLookupAdminPanelQuery, WorkspaceLookupAdminPanelQueryVariables>;
export const DeleteJobsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteJobs"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"queueName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"jobIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteJobs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"queueName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"queueName"}}},{"kind":"Argument","name":{"kind":"Name","value":"jobIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"jobIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deletedCount"}},{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}},{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}}]}}]}}]} as unknown as DocumentNode<DeleteJobsMutation, DeleteJobsMutationVariables>;
export const RetryJobsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RetryJobs"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"queueName"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"jobIds"}},"type":{"kind":"NonNullType","type":{"kind":"ListType","type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"retryJobs"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"queueName"},"value":{"kind":"Variable","name":{"kind":"Name","value":"queueName"}}},{"kind":"Argument","name":{"kind":"Name","value":"jobIds"},"value":{"kind":"Variable","name":{"kind":"Name","value":"jobIds"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"retriedCount"}},{"kind":"Field","name":{"kind":"Name","value":"results"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}},{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}}]}}]}}]} as unknown as DocumentNode<RetryJobsMutation, RetryJobsMutationVariables>;
export const GetIndicatorHealthStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetIndicatorHealthStatus"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"indicatorId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"HealthIndicatorId"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getIndicatorHealthStatus"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"indicatorId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"indicatorId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"errorMessage"}},{"kind":"Field","name":{"kind":"Name","value":"details"}},{"kind":"Field","name":{"kind":"Name","value":"queues"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"queueName"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]}}]} as unknown as DocumentNode<GetIndicatorHealthStatusQuery, GetIndicatorHealthStatusQueryVariables>;
diff --git a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
index be5c5dec0d0..d780ace58cf 100644
--- a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
+++ b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
@@ -425,6 +425,30 @@ const SettingsAdminNewAiModel = lazy(() =>
),
);
+const SettingsAdminUserDetail = lazy(() =>
+ import('~/pages/settings/admin-panel/SettingsAdminUserDetail').then(
+ (module) => ({
+ default: module.SettingsAdminUserDetail,
+ }),
+ ),
+);
+
+const SettingsAdminWorkspaceDetail = lazy(() =>
+ import('~/pages/settings/admin-panel/SettingsAdminWorkspaceDetail').then(
+ (module) => ({
+ default: module.SettingsAdminWorkspaceDetail,
+ }),
+ ),
+);
+
+const SettingsAdminWorkspaceChatThread = lazy(() =>
+ import('~/pages/settings/admin-panel/SettingsAdminWorkspaceChatThread').then(
+ (module) => ({
+ default: module.SettingsAdminWorkspaceChatThread,
+ }),
+ ),
+);
+
const SettingsUpdates = lazy(() =>
import('~/pages/settings/updates/SettingsUpdates').then((module) => ({
default: module.SettingsUpdates,
@@ -770,6 +794,18 @@ export const SettingsRoutes = ({ isAdminPageEnabled }: SettingsRoutesProps) => (
path={SettingsPath.AdminPanelAiProviderDetail}
element={<SettingsAdminAiProviderDetail />}
/>
+ <Route
+ path={SettingsPath.AdminPanelUserDetail}
+ element={<SettingsAdminUserDetail />}
+ />
+ <Route
+ path={SettingsPath.AdminPanelWorkspaceDetail}
+ element={<SettingsAdminWorkspaceDetail />}
+ />
+ <Route
+ path={SettingsPath.AdminPanelWorkspaceChatThread}
+ element={<SettingsAdminWorkspaceChatThread />}
+ />
</>
)}
diff --git a/packages/twenty-front/src/modules/auth/hooks/useImpersonationSession.ts b/packages/twenty-front/src/modules/auth/hooks/useImpersonationSession.ts
new file mode 100644
index 00000000000..3d44f6ce8d1
--- /dev/null
+++ b/packages/twenty-front/src/modules/auth/hooks/useImpersonationSession.ts
@@ -0,0 +1,95 @@
+import { useApolloClient } from '@apollo/client/react';
+import { useCallback } from 'react';
+import { useNavigate } from 'react-router-dom';
+import { useStore } from 'jotai';
+
+import { isAppEffectRedirectEnabledState } from '@/app/states/isAppEffectRedirectEnabledState';
+import { useAuth } from '@/auth/hooks/useAuth';
+import { tokenPairState } from '@/auth/states/tokenPairState';
+import { useClearSseClient } from '@/sse-db-event/hooks/useClearSseClient';
+import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser';
+import { type AuthTokenPair } from '~/generated-metadata/graphql';
+
+const IMPERSONATION_SESSION_KEY = 'impersonation_original_session';
+
+type StoredImpersonationSession = {
+ tokenPair: AuthTokenPair;
+ returnPath: string;
+};
+
+export const useImpersonationSession = () => {
+ const store = useStore();
+ const client = useApolloClient();
+ const navigate = useNavigate();
+ const { getAuthTokensFromLoginToken, signOut } = useAuth();
+ const { clearSseClient } = useClearSseClient();
+ const { loadCurrentUser } = useLoadCurrentUser();
+
+ const startImpersonating = useCallback(
+ async (loginToken: string, returnPath?: string) => {
+ const currentTokenPair = store.get(tokenPairState.atom);
+
+ if (currentTokenPair) {
+ const session: StoredImpersonationSession = {
+ tokenPair: currentTokenPair,
+ returnPath: returnPath ?? window.location.pathname,
+ };
+ sessionStorage.setItem(
+ IMPERSONATION_SESSION_KEY,
+ JSON.stringify(session),
+ );
+ }
+
+ clearSseClient();
+ await client.clearStore();
+
+ store.set(isAppEffectRedirectEnabledState.atom, false);
+ await getAuthTokensFromLoginToken(loginToken);
+ store.set(isAppEffectRedirectEnabledState.atom, true);
+ },
+ [store, client, clearSseClient, getAuthTokensFromLoginToken],
+ );
+
+ const stopImpersonating = useCallback(async () => {
+ const raw = sessionStorage.getItem(IMPERSONATION_SESSION_KEY);
+
+ if (!raw) {
+ // No stored session — likely a cross-workspace tab opened via redirect.
+ // Try closing the tab (works when opened via window.open or target=_blank).
+ window.close();
+ // If window.close() was blocked by the browser, fall back to sign out.
+ await signOut();
+ return;
+ }
+
+ let session: StoredImpersonationSession;
+
+ try {
+ session = JSON.parse(raw);
+ } catch {
+ sessionStorage.removeItem(IMPERSONATION_SESSION_KEY);
+ await signOut();
+ return;
+ }
+
+ sessionStorage.removeItem(IMPERSONATION_SESSION_KEY);
+
+ clearSseClient();
+ await client.clearStore();
+
+ store.set(isAppEffectRedirectEnabledState.atom, false);
+ store.set(tokenPairState.atom, session.tokenPair);
+
+ await loadCurrentUser();
+
+ store.set(isAppEffectRedirectEnabledState.atom, true);
+
+ navigate(session.returnPath);
+ }, [store, client, clearSseClient, loadCurrentUser, signOut, navigate]);
+
+ const hasStoredSession = useCallback(() => {
+ return sessionStorage.getItem(IMPERSONATION_SESSION_KEY) !== null;
+ }, []);
+
+ return { startImpersonating, stopImpersonating, hasStoredSession };
+};
diff --git a/packages/twenty-front/src/modules/information-banner/components/impersonate/InformationBannerIsImpersonating.tsx b/packages/twenty-front/src/modules/information-banner/components/impersonate/InformationBannerIsImpersonating.tsx
index 0e8c6a4b9ce..1fef0fdafdb 100644
--- a/packages/twenty-front/src/modules/information-banner/components/impersonate/InformationBannerIsImpersonating.tsx
+++ b/packages/twenty-front/src/modules/information-banner/components/impersonate/InformationBannerIsImpersonating.tsx
@@ -1,4 +1,4 @@
-import { useAuth } from '@/auth/hooks/useAuth';
+import { useImpersonationSession } from '@/auth/hooks/useImpersonationSession';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { isImpersonatingState } from '@/auth/states/isImpersonatingState';
import { InformationBanner } from '@/information-banner/components/InformationBanner';
@@ -11,7 +11,7 @@ export const InformationBannerIsImpersonating = () => {
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const isImpersonating = useAtomStateValue(isImpersonatingState);
- const { signOut } = useAuth();
+ const { stopImpersonating } = useImpersonationSession();
if (!isDefined(currentWorkspaceMember) || !isImpersonating) {
return null;
@@ -25,7 +25,7 @@ export const InformationBannerIsImpersonating = () => {
message={t`Logged in as ${impersonatedUser}`}
buttonTitle={t`Stop impersonating`}
buttonIcon={IconLogout}
- buttonOnClick={signOut}
+ buttonOnClick={stopImpersonating}
/>
);
};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx b/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx
index 7eaf502052b..7be739943b2 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/ai/components/SettingsAdminAI.tsx
@@ -2,6 +2,8 @@ import { useMemo, useState } from 'react';
import { useMutation, useQuery } from '@apollo/client/react';
import { t } from '@lingui/core/macro';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
import { Tag } from 'twenty-ui/components';
import { H2Title, IconBolt, IconLock, IconRobot } from 'twenty-ui/display';
import { Card, Section } from 'twenty-ui/layout';
@@ -319,6 +321,9 @@ export const SettingsAdminAI = () => {
<TableRow
key={item.key}
gridTemplateColumns={USAGE_TABLE_GRID_TEMPLATE_COLUMNS}
+ to={getSettingsPath(SettingsPath.AdminPanelWorkspaceDetail, {
+ workspaceId: item.key,
+ })}
>
<TableCell color={themeCssVariables.font.color.primary}>
{item.label ?? item.key}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx
new file mode 100644
index 00000000000..f74fc2c0e77
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx
@@ -0,0 +1,127 @@
+import { t } from '@lingui/core/macro';
+import { styled } from '@linaria/react';
+
+import { LazyMarkdownRenderer } from '@/ai/components/LazyMarkdownRenderer';
+import { TableCell } from '@/ui/layout/table/components/TableCell';
+import { TableRow } from '@/ui/layout/table/components/TableRow';
+import { Card } from 'twenty-ui/layout';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+import {
+ AgentMessageRole,
+ type GetAdminChatThreadMessagesQuery,
+} from '~/generated-metadata/graphql';
+
+type ChatMessage = NonNullable<
+ GetAdminChatThreadMessagesQuery['getAdminChatThreadMessages']
+>['messages'][number];
+
+type SettingsAdminChatThreadMessageListProps = {
+ messages: ChatMessage[];
+};
+
+const StyledMessagesContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ gap: ${themeCssVariables.spacing[4]};
+`;
+
+const StyledMessageBubble = styled.div<{ isUser?: boolean }>`
+ align-items: ${({ isUser }) => (isUser ? 'flex-end' : 'flex-start')};
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+`;
+
+const StyledMessageContent = styled.div<{ isUser?: boolean }>`
+ background: ${({ isUser }) =>
+ isUser ? themeCssVariables.background.tertiary : 'transparent'};
+ border-radius: ${themeCssVariables.border.radius.sm};
+ color: ${({ isUser }) =>
+ isUser
+ ? themeCssVariables.font.color.secondary
+ : themeCssVariables.font.color.primary};
+ font-weight: ${({ isUser }) => (isUser ? 500 : 400)};
+ line-height: 1.4em;
+ max-width: 100%;
+ overflow-wrap: break-word;
+ padding: ${({ isUser }) =>
+ isUser ? `0 ${themeCssVariables.spacing[2]}` : '0'};
+ white-space: ${({ isUser }) => (isUser ? 'pre-wrap' : 'normal')};
+ width: ${({ isUser }) => (isUser ? 'fit-content' : '100%')};
+`;
+
+const StyledRoleLabel = styled.span`
+ color: ${themeCssVariables.font.color.light};
+ font-size: ${themeCssVariables.font.size.xs};
+ font-weight: ${themeCssVariables.font.weight.medium};
+ margin-bottom: ${themeCssVariables.spacing[1]};
+ text-transform: capitalize;
+`;
+
+const StyledTimestamp = styled.span`
+ color: ${themeCssVariables.font.color.light};
+ font-size: ${themeCssVariables.font.size.xs};
+ margin-top: ${themeCssVariables.spacing[1]};
+`;
+
+export const SettingsAdminChatThreadMessageList = ({
+ messages,
+}: SettingsAdminChatThreadMessageListProps) => {
+ const visibleMessages = messages.filter(
+ (message) => message.role !== AgentMessageRole.SYSTEM,
+ );
+
+ if (visibleMessages.length === 0) {
+ return (
+ <Card rounded>
+ <TableRow gridTemplateColumns="1fr">
+ <TableCell
+ color={themeCssVariables.font.color.tertiary}
+ align="center"
+ >
+ {t`No messages found.`}
+ </TableCell>
+ </TableRow>
+ </Card>
+ );
+ }
+
+ return (
+ <StyledMessagesContainer>
+ {visibleMessages.map((message) => {
+ const isUser = message.role === AgentMessageRole.USER;
+ const textParts = message.parts
+ .filter((part) => part.type === 'text' && part.textContent !== null)
+ .map((part) => part.textContent)
+ .join('\n');
+
+ const toolParts = message.parts.filter(
+ (part) => part.type === 'tool-call' && part.toolName !== null,
+ );
+
+ if (textParts.length === 0 && toolParts.length === 0) {
+ return null;
+ }
+
+ return (
+ <StyledMessageBubble key={message.id} isUser={isUser}>
+ <StyledRoleLabel>{message.role}</StyledRoleLabel>
+ {textParts.length > 0 && (
+ <StyledMessageContent isUser={isUser}>
+ {isUser ? textParts : <LazyMarkdownRenderer text={textParts} />}
+ </StyledMessageContent>
+ )}
+ {toolParts.map((part, index) => (
+ <StyledMessageContent key={index} isUser={false}>
+ {t`Tool call: ${part.toolName}`}
+ </StyledMessageContent>
+ ))}
+ <StyledTimestamp>
+ {new Date(message.createdAt).toLocaleString()}
+ </StyledTimestamp>
+ </StyledMessageBubble>
+ );
+ })}
+ </StyledMessagesContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminGeneral.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminGeneral.tsx
index 3cc7721be4e..046c0952071 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminGeneral.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminGeneral.tsx
@@ -1,134 +1,74 @@
import { canManageFeatureFlagsState } from '@/client-config/states/canManageFeatureFlagsState';
-import { SettingsAdminWorkspaceContent } from '@/settings/admin-panel/components/SettingsAdminWorkspaceContent';
-import { userLookupResultState } from '@/settings/admin-panel/states/userLookupResultState';
-import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { SettingsAdminVersionContainer } from '@/settings/admin-panel/components/SettingsAdminVersionContainer';
+import { ADMIN_PANEL_RECENT_USERS } from '@/settings/admin-panel/graphql/queries/adminPanelRecentUsers';
+import { ADMIN_PANEL_TOP_WORKSPACES } from '@/settings/admin-panel/graphql/queries/adminPanelTopWorkspaces';
+import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';
import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
-import { TabList } from '@/ui/layout/tab-list/components/TabList';
-import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
+import { Table } from '@/ui/layout/table/components/Table';
+import { TableBody } from '@/ui/layout/table/components/TableBody';
+import { TableCell } from '@/ui/layout/table/components/TableCell';
+import { TableHeader } from '@/ui/layout/table/components/TableHeader';
+import { TableRow } from '@/ui/layout/table/components/TableRow';
+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
-import { isNonEmptyString } from '@sniptt/guards';
-import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { useState } from 'react';
-import { REACT_APP_SERVER_BASE_URL } from '~/config';
-import { useMutation } from '@apollo/client/react';
-import { UserLookupAdminPanelDocument } from '~/generated-metadata/graphql';
+import { useDebounce } from 'use-debounce';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
import { currentUserState } from '@/auth/states/currentUserState';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { SettingsTableCard } from '@/settings/components/SettingsTableCard';
-import { SettingsAdminVersionContainer } from '@/settings/admin-panel/components/SettingsAdminVersionContainer';
-import { SETTINGS_ADMIN_USER_LOOKUP_WORKSPACE_TABS_ID } from '@/settings/admin-panel/constants/SettingsAdminUserLookupWorkspaceTabsId';
-import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
-import { useAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useAtomComponentState';
-import { getImageAbsoluteURI, isDefined } from 'twenty-shared/utils';
-import {
- H2Title,
- IconId,
- IconMail,
- IconSearch,
- IconUser,
-} from 'twenty-ui/display';
-import { Button } from 'twenty-ui/input';
+import { H2Title } from 'twenty-ui/display';
import { Section } from 'twenty-ui/layout';
import { themeCssVariables } from 'twenty-ui/theme-constants';
-const StyledContainer = styled.div`
- align-items: center;
- display: flex;
- flex-direction: row;
- gap: ${themeCssVariables.spacing[2]};
+const StyledEmptyState = styled.div`
+ color: ${themeCssVariables.font.color.tertiary};
+ padding: ${themeCssVariables.spacing[4]} 0;
`;
export const SettingsAdminGeneral = () => {
- const [userIdentifier, setUserIdentifier] = useState('');
- const { enqueueErrorSnackBar } = useSnackBar();
+ const [userSearchTerm, setUserSearchTerm] = useState('');
+ const [debouncedUserSearchTerm] = useDebounce(userSearchTerm, 300);
- const [activeTabId, setActiveTabId] = useAtomComponentState(
- activeTabIdComponentState,
- SETTINGS_ADMIN_USER_LOOKUP_WORKSPACE_TABS_ID,
- );
- const [userLookupResult, setUserLookupResult] = useAtomState(
- userLookupResultState,
- );
- const [isUserLookupLoading, setIsUserLookupLoading] = useState(false);
-
- const [userLookup] = useMutation(UserLookupAdminPanelDocument);
+ const [workspaceSearchTerm, setWorkspaceSearchTerm] = useState('');
+ const [debouncedWorkspaceSearchTerm] = useDebounce(workspaceSearchTerm, 300);
const currentUser = useAtomStateValue(currentUserState);
-
const canAccessFullAdminPanel = currentUser?.canAccessFullAdminPanel;
-
const canImpersonate = currentUser?.canImpersonate;
-
const canManageFeatureFlags = useAtomStateValue(canManageFeatureFlagsState);
- const handleSearch = async () => {
- setActiveTabId('');
- setIsUserLookupLoading(true);
- setUserLookupResult(null);
-
- const response = await userLookup({
- variables: { userIdentifier },
- onCompleted: (data) => {
- setIsUserLookupLoading(false);
- if (isDefined(data?.userLookupAdminPanel)) {
- setUserLookupResult(data.userLookupAdminPanel);
- }
- },
- onError: (error) => {
- setIsUserLookupLoading(false);
- enqueueErrorSnackBar({
- apolloError: error,
- });
- },
- });
-
- const result = response.data?.userLookupAdminPanel;
-
- if (isDefined(result?.workspaces) && result.workspaces.length > 0) {
- setActiveTabId(result.workspaces[0].id);
- }
- };
-
- const activeWorkspace = userLookupResult?.workspaces.find(
- (workspace) => workspace.id === activeTabId,
- );
-
- const tabs =
- userLookupResult?.workspaces.map((workspace) => ({
- id: workspace.id,
- title: workspace.name,
- logo:
- getImageAbsoluteURI({
- imageUrl: isNonEmptyString(workspace.logo)
- ? workspace.logo
- : DEFAULT_WORKSPACE_LOGO,
- baseUrl: REACT_APP_SERVER_BASE_URL,
- }) ?? '',
- })) ?? [];
-
- const userFullName = `${userLookupResult?.user.firstName || ''} ${
- userLookupResult?.user.lastName || ''
- }`.trim();
-
- const userInfoItems = [
- {
- Icon: IconUser,
- label: t`Name`,
- value: userFullName,
- },
- {
- Icon: IconMail,
- label: t`Email`,
- value: userLookupResult?.user.email,
- },
- {
- Icon: IconId,
- label: t`ID`,
- value: userLookupResult?.user.id,
- },
- ];
+ const { data: recentUsersData, loading: isLoadingUsers } = useQuery<{
+ adminPanelRecentUsers: {
+ id: string;
+ email: string;
+ firstName?: string | null;
+ lastName?: string | null;
+ createdAt: string;
+ workspaceName?: string | null;
+ workspaceId?: string | null;
+ }[];
+ }>(ADMIN_PANEL_RECENT_USERS, {
+ variables: { searchTerm: debouncedUserSearchTerm },
+ skip: !canImpersonate,
+ });
+
+ const { data: topWorkspacesData, loading: isLoadingWorkspaces } = useQuery<{
+ adminPanelTopWorkspaces: {
+ id: string;
+ name: string;
+ totalUsers: number;
+ subdomain: string;
+ }[];
+ }>(ADMIN_PANEL_TOP_WORKSPACES, {
+ variables: { searchTerm: debouncedWorkspaceSearchTerm },
+ skip: !canImpersonate,
+ });
+
+ const recentUsers = recentUsersData?.adminPanelRecentUsers ?? [];
+ const topWorkspaces = topWorkspacesData?.adminPanelTopWorkspaces ?? [];
return (
<>
@@ -143,63 +83,105 @@ export const SettingsAdminGeneral = () => {
)}
{canImpersonate && (
- <Section>
- <H2Title
- title={
- canManageFeatureFlags
- ? t`Feature Flags & Impersonation`
- : t`User Impersonation`
- }
- description={
- canManageFeatureFlags
- ? t`Look up users and manage their workspace feature flags or impersonate them.`
- : t`Look up users to impersonate them.`
- }
- />
-
- <StyledContainer>
- <SettingsTextInput
- instanceId="admin-user-lookup"
- value={userIdentifier}
- onChange={setUserIdentifier}
- onInputEnter={handleSearch}
- placeholder={t`Enter user ID or email address`}
- fullWidth
- disabled={isUserLookupLoading}
- />
- <Button
- Icon={IconSearch}
- variant="primary"
- accent="blue"
- title={t`Search`}
- onClick={handleSearch}
- disabled={!userIdentifier.trim() || isUserLookupLoading}
- />
- </StyledContainer>
- </Section>
- )}
-
- {isDefined(userLookupResult) && (
<>
<Section>
- <H2Title title={t`User Info`} description={t`About this user`} />
- <SettingsTableCard
- items={userInfoItems}
- rounded
- gridAutoColumns="1fr 4fr"
+ <H2Title
+ title={t`Recent Users`}
+ description={
+ canManageFeatureFlags
+ ? t`Last 10 users created. Click to manage feature flags or impersonate.`
+ : t`Last 10 users created. Click to impersonate.`
+ }
/>
+ <SettingsTextInput
+ instanceId="admin-panel-user-search"
+ value={userSearchTerm}
+ onChange={setUserSearchTerm}
+ placeholder={t`Search by name, email, or user ID...`}
+ fullWidth
+ />
+ {isLoadingUsers ? (
+ <SettingsSkeletonLoader />
+ ) : recentUsers.length === 0 ? (
+ <StyledEmptyState>
+ {t`No users found matching your search criteria.`}
+ </StyledEmptyState>
+ ) : (
+ <Table>
+ <TableBody>
+ <TableRow gridTemplateColumns="1fr 2fr 1fr">
+ <TableHeader>{t`Name`}</TableHeader>
+ <TableHeader>{t`Email`}</TableHeader>
+ <TableHeader align="right">{t`Workspace`}</TableHeader>
+ </TableRow>
+ {recentUsers.map((user) => (
+ <TableRow
+ key={user.id}
+ gridTemplateColumns="1fr 2fr 1fr"
+ to={getSettingsPath(SettingsPath.AdminPanelUserDetail, {
+ userId: user.id,
+ })}
+ >
+ <TableCell color={themeCssVariables.font.color.primary}>
+ {`${user.firstName || ''} ${user.lastName || ''}`.trim() ||
+ '\u2014'}
+ </TableCell>
+ <TableCell>{user.email}</TableCell>
+ <TableCell align="right">
+ {user.workspaceName || '\u2014'}
+ </TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ )}
</Section>
+
<Section>
<H2Title
- title={t`Workspaces`}
- description={t`All workspaces this user is a member of`}
+ title={t`Top Workspaces`}
+ description={t`Top 10 workspaces by number of users`}
/>
- <TabList
- tabs={tabs}
- behaveAsLinks={false}
- componentInstanceId={SETTINGS_ADMIN_USER_LOOKUP_WORKSPACE_TABS_ID}
+ <SettingsTextInput
+ instanceId="admin-panel-workspace-search"
+ value={workspaceSearchTerm}
+ onChange={setWorkspaceSearchTerm}
+ placeholder={t`Search by workspace name, subdomain, or ID...`}
+ fullWidth
/>
- <SettingsAdminWorkspaceContent activeWorkspace={activeWorkspace} />
+ {isLoadingWorkspaces ? (
+ <SettingsSkeletonLoader />
+ ) : topWorkspaces.length === 0 ? (
+ <StyledEmptyState>
+ {t`No workspaces found matching your search criteria.`}
+ </StyledEmptyState>
+ ) : (
+ <Table>
+ <TableBody>
+ <TableRow gridTemplateColumns="2fr 1fr">
+ <TableHeader>{t`Workspace`}</TableHeader>
+ <TableHeader align="right">{t`Users`}</TableHeader>
+ </TableRow>
+ {topWorkspaces.map((workspace) => (
+ <TableRow
+ key={workspace.id}
+ gridTemplateColumns="2fr 1fr"
+ to={getSettingsPath(
+ SettingsPath.AdminPanelWorkspaceDetail,
+ { workspaceId: workspace.id },
+ )}
+ >
+ <TableCell color={themeCssVariables.font.color.primary}>
+ {workspace.name || '\u2014'}
+ </TableCell>
+ <TableCell align="right">
+ {workspace.totalUsers}
+ </TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ )}
</Section>
</>
)}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceContent.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceContent.tsx
index f68fb195eaf..1354a3f7d85 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceContent.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceContent.tsx
@@ -1,46 +1,29 @@
-import { currentUserState } from '@/auth/states/currentUserState';
-import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
-import { canManageFeatureFlagsState } from '@/client-config/states/canManageFeatureFlagsState';
import { SettingsTableCard } from '@/settings/components/SettingsTableCard';
-import { useFeatureFlagState } from '@/settings/admin-panel/hooks/useFeatureFlagState';
-import { useImpersonationAuth } from '@/settings/admin-panel/hooks/useImpersonationAuth';
-import { useImpersonationRedirect } from '@/settings/admin-panel/hooks/useImpersonationRedirect';
-import { userLookupResultState } from '@/settings/admin-panel/states/userLookupResultState';
import { type WorkspaceInfo } from '@/settings/admin-panel/types/WorkspaceInfo';
import { getWorkspaceSchemaName } from '@/settings/admin-panel/utils/getWorkspaceSchemaName';
-import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
-import { Table } from '@/ui/layout/table/components/Table';
-import { TableBody } from '@/ui/layout/table/components/TableBody';
-import { TableCell } from '@/ui/layout/table/components/TableCell';
-import { TableHeader } from '@/ui/layout/table/components/TableHeader';
-import { TableRow } from '@/ui/layout/table/components/TableRow';
import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
-import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
-import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { useMutation } from '@apollo/client/react';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { isNonEmptyString } from '@sniptt/guards';
-import { useState } from 'react';
-import { getImageAbsoluteURI, isDefined } from 'twenty-shared/utils';
-import { AvatarOrIcon, Chip } from 'twenty-ui/components';
+import { SettingsPath } from 'twenty-shared/types';
+import {
+ getImageAbsoluteURI,
+ getSettingsPath,
+ isDefined,
+} from 'twenty-shared/utils';
+import { AvatarOrIcon, LinkChip } from 'twenty-ui/components';
import {
H2Title,
- IconEyeShare,
+ IconCalendar,
IconHome,
IconId,
IconLink,
+ IconStatusChange,
IconUser,
} from 'twenty-ui/display';
-import { Button, Toggle } from 'twenty-ui/input';
import { Section } from 'twenty-ui/layout';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { REACT_APP_SERVER_BASE_URL } from '~/config';
-import {
- type FeatureFlagKey,
- ImpersonateDocument,
- UpdateWorkspaceFeatureFlagDocument,
-} from '~/generated-metadata/graphql';
type SettingsAdminWorkspaceContentProps = {
activeWorkspace: WorkspaceInfo | undefined;
@@ -53,93 +36,11 @@ const StyledContainer = styled.div`
margin-top: ${themeCssVariables.spacing[6]};
`;
-const StyledButtonContainer = styled.div`
- margin-top: ${themeCssVariables.spacing[3]};
-`;
-
export const SettingsAdminWorkspaceContent = ({
activeWorkspace,
}: SettingsAdminWorkspaceContentProps) => {
- const canManageFeatureFlags = useAtomStateValue(canManageFeatureFlagsState);
- const { enqueueErrorSnackBar } = useSnackBar();
- const [currentUser] = useAtomState(currentUserState);
- const currentWorkspace = useAtomStateValue(currentWorkspaceState);
-
- const [updateFeatureFlag] = useMutation(UpdateWorkspaceFeatureFlagDocument);
- const [isImpersonateLoading, setIsImpersonationLoading] = useState(false);
- const { executeImpersonationAuth } = useImpersonationAuth();
- const { executeImpersonationRedirect } = useImpersonationRedirect();
- const [impersonate] = useMutation(ImpersonateDocument);
-
- const { updateFeatureFlagState } = useFeatureFlagState();
- const userLookupResult = useAtomStateValue(userLookupResultState);
-
const { t } = useLingui();
- const handleImpersonate = async (workspaceId: string) => {
- if (!userLookupResult?.user.id) {
- enqueueErrorSnackBar({ message: t`Please search for a user first` });
- return;
- }
-
- setIsImpersonationLoading(true);
-
- await impersonate({
- variables: { userId: userLookupResult.user.id, workspaceId },
- onCompleted: async (data) => {
- const { loginToken, workspace } = data.impersonate;
- const isCurrentWorkspace = workspace.id === currentWorkspace?.id;
- if (isCurrentWorkspace) {
- await executeImpersonationAuth(loginToken.token);
- return;
- }
-
- return executeImpersonationRedirect(
- workspace.workspaceUrls,
- loginToken.token,
- '_blank',
- );
- },
- onError: (error) => {
- const errorMessage = error.message;
- enqueueErrorSnackBar({
- message: t`Failed to impersonate user. ${errorMessage}`,
- });
- },
- }).finally(() => {
- setIsImpersonationLoading(false);
- });
- };
-
- const handleFeatureFlagUpdate = async (
- workspaceId: string,
- featureFlag: FeatureFlagKey,
- value: boolean,
- ) => {
- const previousValue = userLookupResult?.workspaces
- .find((workspace) => workspace.id === workspaceId)
- ?.featureFlags.find((flag) => flag.key === featureFlag)?.value;
-
- updateFeatureFlagState(workspaceId, featureFlag, value);
- await updateFeatureFlag({
- variables: {
- workspaceId,
- featureFlag,
- value,
- },
-
- onError: (error) => {
- if (isDefined(previousValue)) {
- updateFeatureFlagState(workspaceId, featureFlag, previousValue);
- }
- const errorMessage = error.message;
- enqueueErrorSnackBar({
- message: t`Failed to update feature flag. ${errorMessage}`,
- });
- },
- });
- };
-
const getWorkspaceUrl = (workspaceUrls: WorkspaceInfo['workspaceUrls']) => {
return workspaceUrls.customUrl ?? workspaceUrls.subdomainUrl;
};
@@ -148,10 +49,13 @@ export const SettingsAdminWorkspaceContent = ({
{
Icon: IconHome,
label: t`Name`,
- value: (
- <Chip
+ value: activeWorkspace?.id ? (
+ <LinkChip
label={activeWorkspace?.name ?? ''}
emptyLabel={t`Untitled`}
+ to={getSettingsPath(SettingsPath.AdminPanelWorkspaceDetail, {
+ workspaceId: activeWorkspace.id,
+ })}
leftComponent={
<AvatarOrIcon
avatarUrl={
@@ -165,6 +69,8 @@ export const SettingsAdminWorkspaceContent = ({
/>
}
/>
+ ) : (
+ (activeWorkspace?.name ?? '')
),
},
{
@@ -191,6 +97,18 @@ export const SettingsAdminWorkspaceContent = ({
label: t`Members`,
value: activeWorkspace?.totalUsers,
},
+ {
+ Icon: IconStatusChange,
+ label: t`Status`,
+ value: activeWorkspace?.activationStatus,
+ },
+ {
+ Icon: IconCalendar,
+ label: t`Created`,
+ value: activeWorkspace?.createdAt
+ ? new Date(activeWorkspace.createdAt).toLocaleDateString()
+ : '',
+ },
];
if (!activeWorkspace) return null;
@@ -206,62 +124,7 @@ export const SettingsAdminWorkspaceContent = ({
items={workspaceInfoItems}
gridAutoColumns="1fr 4fr"
/>
- <StyledButtonContainer>
- {currentUser?.canImpersonate && (
- <Button
- Icon={IconEyeShare}
- variant="primary"
- accent="default"
- title={
- activeWorkspace.allowImpersonation === false
- ? t`Impersonation is disabled for this workspace`
- : t`Impersonate`
- }
- onClick={() => handleImpersonate(activeWorkspace.id)}
- disabled={
- isImpersonateLoading ||
- activeWorkspace.allowImpersonation === false
- }
- dataTestId="impersonate-button"
- />
- )}
- </StyledButtonContainer>
</Section>
- {canManageFeatureFlags && (
- <Table>
- <TableBody>
- <TableRow
- gridAutoColumns="1fr 100px"
- mobileGridAutoColumns="1fr 80px"
- >
- <TableHeader>{t`Feature Flag`}</TableHeader>
- <TableHeader align="right">{t`Status`}</TableHeader>
- </TableRow>
-
- {activeWorkspace.featureFlags.map((flag) => (
- <TableRow
- gridAutoColumns="1fr 100px"
- mobileGridAutoColumns="1fr 80px"
- key={flag.key}
- >
- <TableCell>{flag.key}</TableCell>
- <TableCell align="right">
- <Toggle
- value={flag.value}
- onChange={(newValue) =>
- handleFeatureFlagUpdate(
- activeWorkspace.id,
- flag.key,
- newValue,
- )
- }
- />
- </TableCell>
- </TableRow>
- ))}
- </TableBody>
- </Table>
- )}
</StyledContainer>
);
};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/graphql/fragments/userInfoFragment.ts b/packages/twenty-front/src/modules/settings/admin-panel/graphql/fragments/userInfoFragment.ts
new file mode 100644
index 00000000000..d199e1354e5
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/graphql/fragments/userInfoFragment.ts
@@ -0,0 +1,11 @@
+import { gql } from '@apollo/client';
+
+export const USER_INFO_FRAGMENT = gql`
+ fragment UserInfoFragment on UserInfo {
+ id
+ email
+ firstName
+ lastName
+ createdAt
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/adminPanelRecentUsers.ts b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/adminPanelRecentUsers.ts
new file mode 100644
index 00000000000..e7805b26038
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/adminPanelRecentUsers.ts
@@ -0,0 +1,15 @@
+import { gql } from '@apollo/client';
+
+export const ADMIN_PANEL_RECENT_USERS = gql`
+ query AdminPanelRecentUsers($searchTerm: String) {
+ adminPanelRecentUsers(searchTerm: $searchTerm) {
+ id
+ email
+ firstName
+ lastName
+ createdAt
+ workspaceName
+ workspaceId
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/adminPanelTopWorkspaces.ts b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/adminPanelTopWorkspaces.ts
new file mode 100644
index 00000000000..76ca5c9270b
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/adminPanelTopWorkspaces.ts
@@ -0,0 +1,12 @@
+import { gql } from '@apollo/client';
+
+export const ADMIN_PANEL_TOP_WORKSPACES = gql`
+ query AdminPanelTopWorkspaces($searchTerm: String) {
+ adminPanelTopWorkspaces(searchTerm: $searchTerm) {
+ id
+ name
+ totalUsers
+ subdomain
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/getAdminChatThreadMessages.ts b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/getAdminChatThreadMessages.ts
new file mode 100644
index 00000000000..2bbada72877
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/getAdminChatThreadMessages.ts
@@ -0,0 +1,27 @@
+import { gql } from '@apollo/client';
+
+export const GET_ADMIN_CHAT_THREAD_MESSAGES = gql`
+ query GetAdminChatThreadMessages($threadId: UUID!) {
+ getAdminChatThreadMessages(threadId: $threadId) {
+ thread {
+ id
+ title
+ totalInputTokens
+ totalOutputTokens
+ conversationSize
+ createdAt
+ updatedAt
+ }
+ messages {
+ id
+ role
+ parts {
+ type
+ textContent
+ toolName
+ }
+ createdAt
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/getAdminWorkspaceChatThreads.ts b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/getAdminWorkspaceChatThreads.ts
new file mode 100644
index 00000000000..fe8cce8b908
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/getAdminWorkspaceChatThreads.ts
@@ -0,0 +1,15 @@
+import { gql } from '@apollo/client';
+
+export const GET_ADMIN_WORKSPACE_CHAT_THREADS = gql`
+ query GetAdminWorkspaceChatThreads($workspaceId: UUID!) {
+ getAdminWorkspaceChatThreads(workspaceId: $workspaceId) {
+ id
+ title
+ totalInputTokens
+ totalOutputTokens
+ conversationSize
+ createdAt
+ updatedAt
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/graphql/mutations/userLookupAdminPanel.ts b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/userLookupAdminPanel.ts
similarity index 67%
rename from packages/twenty-front/src/modules/settings/admin-panel/graphql/mutations/userLookupAdminPanel.ts
rename to packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/userLookupAdminPanel.ts
index 37824e35128..1c5ca6ccad9 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/graphql/mutations/userLookupAdminPanel.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/userLookupAdminPanel.ts
@@ -1,19 +1,21 @@
import { gql } from '@apollo/client';
+import { USER_INFO_FRAGMENT } from '@/settings/admin-panel/graphql/fragments/userInfoFragment';
+
export const USER_LOOKUP_ADMIN_PANEL = gql`
- mutation UserLookupAdminPanel($userIdentifier: String!) {
+ ${USER_INFO_FRAGMENT}
+ query UserLookupAdminPanel($userIdentifier: String!) {
userLookupAdminPanel(userIdentifier: $userIdentifier) {
user {
- id
- email
- firstName
- lastName
+ ...UserInfoFragment
}
workspaces {
id
name
logo
totalUsers
+ activationStatus
+ createdAt
allowImpersonation
workspaceUrls {
customUrl
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/workspaceLookupAdminPanel.ts b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/workspaceLookupAdminPanel.ts
new file mode 100644
index 00000000000..0433195ab5d
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/graphql/queries/workspaceLookupAdminPanel.ts
@@ -0,0 +1,37 @@
+import { gql } from '@apollo/client';
+
+import { USER_INFO_FRAGMENT } from '@/settings/admin-panel/graphql/fragments/userInfoFragment';
+
+export const WORKSPACE_LOOKUP_ADMIN_PANEL = gql`
+ ${USER_INFO_FRAGMENT}
+ query WorkspaceLookupAdminPanel($workspaceId: UUID!) {
+ workspaceLookupAdminPanel(workspaceId: $workspaceId) {
+ user {
+ ...UserInfoFragment
+ }
+ workspaces {
+ id
+ name
+ allowImpersonation
+ logo
+ totalUsers
+ activationStatus
+ createdAt
+ workspaceUrls {
+ customUrl
+ subdomainUrl
+ }
+ users {
+ id
+ email
+ firstName
+ lastName
+ }
+ featureFlags {
+ key
+ value
+ }
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useFeatureFlagState.ts b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useFeatureFlagState.ts
index 4f5ee582e54..91416a97bf9 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useFeatureFlagState.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useFeatureFlagState.ts
@@ -1,13 +1,9 @@
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
-import { userLookupResultState } from '@/settings/admin-panel/states/userLookupResultState';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
import { isDefined } from 'twenty-shared/utils';
import { type FeatureFlagKey } from '~/generated-metadata/graphql';
export const useFeatureFlagState = () => {
- const [userLookupResult, setUserLookupResult] = useAtomState(
- userLookupResultState,
- );
const [currentWorkspace, setCurrentWorkspace] = useAtomState(
currentWorkspaceState,
);
@@ -17,22 +13,6 @@ export const useFeatureFlagState = () => {
featureFlag: FeatureFlagKey,
value: boolean,
) => {
- if (!isDefined(userLookupResult)) return;
-
- setUserLookupResult({
- ...userLookupResult,
- workspaces: userLookupResult.workspaces.map((workspace) =>
- workspace.id === workspaceId
- ? {
- ...workspace,
- featureFlags: workspace.featureFlags.map((flag) =>
- flag.key === featureFlag ? { ...flag, value } : flag,
- ),
- }
- : workspace,
- ),
- });
-
if (isDefined(currentWorkspace) && currentWorkspace.id === workspaceId) {
setCurrentWorkspace({
...currentWorkspace,
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts
new file mode 100644
index 00000000000..92857e74c7b
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useHandleImpersonate.ts
@@ -0,0 +1,57 @@
+import { useState } from 'react';
+
+import { useMutation } from '@apollo/client/react';
+import { AppPath } from 'twenty-shared/types';
+
+import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
+import { useImpersonationSession } from '@/auth/hooks/useImpersonationSession';
+import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { ImpersonateDocument } from '~/generated-metadata/graphql';
+import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
+
+export const useHandleImpersonate = () => {
+ const currentWorkspace = useAtomStateValue(currentWorkspaceState);
+ const { enqueueErrorSnackBar } = useSnackBar();
+ const { startImpersonating } = useImpersonationSession();
+ const { redirectToWorkspaceDomain } = useRedirectToWorkspaceDomain();
+ const [impersonate] = useMutation(ImpersonateDocument);
+ const [impersonatingUserId, setImpersonatingUserId] = useState<string | null>(
+ null,
+ );
+
+ const handleImpersonate = async (userId: string, workspaceId: string) => {
+ setImpersonatingUserId(userId);
+
+ await impersonate({
+ variables: { userId, workspaceId },
+ onCompleted: async (data) => {
+ const { loginToken, workspace } = data.impersonate;
+ const isCurrentWorkspace = workspace.id === currentWorkspace?.id;
+
+ if (isCurrentWorkspace) {
+ await startImpersonating(loginToken.token);
+
+ return;
+ }
+
+ return redirectToWorkspaceDomain(
+ getWorkspaceUrl(workspace.workspaceUrls),
+ AppPath.Verify,
+ { loginToken: loginToken.token },
+ '_blank',
+ );
+ },
+ onError: (error) => {
+ enqueueErrorSnackBar({
+ message: `Failed to impersonate user. ${error.message}`,
+ });
+ },
+ }).finally(() => {
+ setImpersonatingUserId(null);
+ });
+ };
+
+ return { handleImpersonate, impersonatingUserId };
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationAuth.ts b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationAuth.ts
deleted file mode 100644
index e8e7755a082..00000000000
--- a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationAuth.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { isAppEffectRedirectEnabledState } from '@/app/states/isAppEffectRedirectEnabledState';
-import { useAuth } from '@/auth/hooks/useAuth';
-import { useClearSseClient } from '@/sse-db-event/hooks/useClearSseClient';
-import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
-
-export const useImpersonationAuth = () => {
- const { getAuthTokensFromLoginToken } = useAuth();
- const { clearSseClient } = useClearSseClient();
- const setIsAppEffectRedirectEnabled = useSetAtomState(
- isAppEffectRedirectEnabledState,
- );
-
- const executeImpersonationAuth = async (loginToken: string) => {
- setIsAppEffectRedirectEnabled(false);
- clearSseClient();
- await getAuthTokensFromLoginToken(loginToken);
- setIsAppEffectRedirectEnabled(true);
- };
-
- return { executeImpersonationAuth };
-};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationRedirect.ts b/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationRedirect.ts
deleted file mode 100644
index 52d688a6f85..00000000000
--- a/packages/twenty-front/src/modules/settings/admin-panel/hooks/useImpersonationRedirect.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
-import { AppPath } from 'twenty-shared/types';
-import { type WorkspaceUrls } from '~/generated-metadata/graphql';
-import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
-
-export const useImpersonationRedirect = () => {
- const { redirectToWorkspaceDomain } = useRedirectToWorkspaceDomain();
-
- const executeImpersonationRedirect = async (
- workspaceUrls: WorkspaceUrls,
- loginToken: string,
- target: string = '_self',
- ) => {
- return await redirectToWorkspaceDomain(
- getWorkspaceUrl(workspaceUrls),
- AppPath.Verify,
- { loginToken },
- target,
- );
- };
-
- return { executeImpersonationRedirect };
-};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/states/userLookupResultState.ts b/packages/twenty-front/src/modules/settings/admin-panel/states/userLookupResultState.ts
deleted file mode 100644
index 8a488b92296..00000000000
--- a/packages/twenty-front/src/modules/settings/admin-panel/states/userLookupResultState.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import { type UserLookup } from '@/settings/admin-panel/types/UserLookup';
-
-import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
-
-export const userLookupResultState = createAtomState<UserLookup | null>({
- key: 'userLookupResultState',
- defaultValue: null,
-});
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/types/FeatureFlag.ts b/packages/twenty-front/src/modules/settings/admin-panel/types/FeatureFlag.ts
deleted file mode 100644
index ae4cd365761..00000000000
--- a/packages/twenty-front/src/modules/settings/admin-panel/types/FeatureFlag.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { type FeatureFlagKey } from '~/generated-metadata/graphql';
-
-export type FeatureFlag = {
- key: FeatureFlagKey;
- value: boolean;
-};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/types/UserLookup.ts b/packages/twenty-front/src/modules/settings/admin-panel/types/UserLookup.ts
deleted file mode 100644
index eb854d15616..00000000000
--- a/packages/twenty-front/src/modules/settings/admin-panel/types/UserLookup.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { type WorkspaceInfo } from '@/settings/admin-panel/types/WorkspaceInfo';
-
-export type UserLookup = {
- user: {
- id: string;
- email: string;
- firstName?: string | null;
- lastName?: string | null;
- };
- workspaces: WorkspaceInfo[];
-};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/types/WorkspaceInfo.ts b/packages/twenty-front/src/modules/settings/admin-panel/types/WorkspaceInfo.ts
index 04bbe403e16..3d3afbc911a 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/types/WorkspaceInfo.ts
+++ b/packages/twenty-front/src/modules/settings/admin-panel/types/WorkspaceInfo.ts
@@ -1,18 +1,4 @@
-import { type FeatureFlag } from '@/settings/admin-panel/types/FeatureFlag';
-import { type WorkspaceUrls } from '~/generated-metadata/graphql';
+import { type WorkspaceLookupAdminPanelQuery } from '~/generated-metadata/graphql';
-export type WorkspaceInfo = {
- id: string;
- name: string;
- logo?: string | null;
- totalUsers: number;
- workspaceUrls: WorkspaceUrls;
- users: {
- id: string;
- email: string;
- firstName?: string | null;
- lastName?: string | null;
- }[];
- featureFlags: FeatureFlag[];
- allowImpersonation: boolean;
-};
+export type WorkspaceInfo =
+ WorkspaceLookupAdminPanelQuery['workspaceLookupAdminPanel']['workspaces'][number];
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminUserDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminUserDetail.tsx
new file mode 100644
index 00000000000..b2376203343
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminUserDetail.tsx
@@ -0,0 +1,189 @@
+import { useParams } from 'react-router-dom';
+
+import { useQuery } from '@apollo/client/react';
+import { styled } from '@linaria/react';
+import { t } from '@lingui/core/macro';
+import { isNonEmptyString } from '@sniptt/guards';
+import { SettingsPath } from 'twenty-shared/types';
+import { getImageAbsoluteURI, getSettingsPath } from 'twenty-shared/utils';
+
+import { currentUserState } from '@/auth/states/currentUserState';
+import { SettingsAdminWorkspaceContent } from '@/settings/admin-panel/components/SettingsAdminWorkspaceContent';
+import { SETTINGS_ADMIN_USER_LOOKUP_WORKSPACE_TABS_ID } from '@/settings/admin-panel/constants/SettingsAdminUserLookupWorkspaceTabsId';
+import { useHandleImpersonate } from '@/settings/admin-panel/hooks/useHandleImpersonate';
+import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';
+import { SettingsTableCard } from '@/settings/components/SettingsTableCard';
+import { TabList } from '@/ui/layout/tab-list/components/TabList';
+import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
+import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
+import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
+import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import {
+ H2Title,
+ IconCalendar,
+ IconEyeShare,
+ IconId,
+ IconMail,
+ IconUser,
+} from 'twenty-ui/display';
+import { Button } from 'twenty-ui/input';
+import { Section } from 'twenty-ui/layout';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+import { REACT_APP_SERVER_BASE_URL } from '~/config';
+import {
+ type UserLookupAdminPanelQuery,
+ UserLookupAdminPanelDocument,
+} from '~/generated-metadata/graphql';
+
+const StyledButtonContainer = styled.div`
+ margin-top: ${themeCssVariables.spacing[3]};
+`;
+
+export const SettingsAdminUserDetail = () => {
+ const { userId } = useParams<{ userId: string }>();
+
+ const activeTabId = useAtomComponentStateValue(
+ activeTabIdComponentState,
+ SETTINGS_ADMIN_USER_LOOKUP_WORKSPACE_TABS_ID,
+ );
+
+ const { data: userLookupData, loading: isLoading } =
+ useQuery<UserLookupAdminPanelQuery>(UserLookupAdminPanelDocument, {
+ variables: { userIdentifier: userId },
+ skip: !userId,
+ });
+
+ const userLookupResult = userLookupData?.userLookupAdminPanel;
+
+ const currentUser = useAtomStateValue(currentUserState);
+ const { handleImpersonate, impersonatingUserId } = useHandleImpersonate();
+
+ const effectiveTabId = activeTabId || userLookupResult?.workspaces?.[0]?.id;
+
+ const userFullName = `${userLookupResult?.user.firstName || ''} ${
+ userLookupResult?.user.lastName || ''
+ }`.trim();
+
+ const activeWorkspace = userLookupResult?.workspaces.find(
+ (workspace) => workspace.id === effectiveTabId,
+ );
+
+ const tabs =
+ userLookupResult?.workspaces.map((workspace) => ({
+ id: workspace.id,
+ title: workspace.name,
+ logo:
+ getImageAbsoluteURI({
+ imageUrl: isNonEmptyString(workspace.logo)
+ ? workspace.logo
+ : DEFAULT_WORKSPACE_LOGO,
+ baseUrl: REACT_APP_SERVER_BASE_URL,
+ }) ?? '',
+ })) ?? [];
+
+ const userInfoItems = [
+ {
+ Icon: IconUser,
+ label: t`Name`,
+ value: userFullName,
+ },
+ {
+ Icon: IconMail,
+ label: t`Email`,
+ value: userLookupResult?.user.email,
+ },
+ {
+ Icon: IconId,
+ label: t`ID`,
+ value: userLookupResult?.user.id,
+ },
+ {
+ Icon: IconCalendar,
+ label: t`Created`,
+ value: userLookupResult?.user.createdAt
+ ? new Date(userLookupResult.user.createdAt).toLocaleDateString()
+ : '',
+ },
+ ];
+
+ const displayName = userFullName || userId || '';
+
+ if (isLoading) {
+ return <SettingsSkeletonLoader />;
+ }
+
+ return (
+ <SubMenuTopBarContainer
+ links={[
+ {
+ children: t`Other`,
+ href: getSettingsPath(SettingsPath.AdminPanel),
+ },
+ {
+ children: t`Admin Panel - General`,
+ href: getSettingsPath(SettingsPath.AdminPanel),
+ },
+ {
+ children: displayName,
+ },
+ ]}
+ >
+ <SettingsPageContainer>
+ {userLookupResult && (
+ <>
+ <Section>
+ <H2Title title={t`User Info`} description={t`About this user`} />
+ <SettingsTableCard
+ items={userInfoItems}
+ rounded
+ gridAutoColumns="1fr 4fr"
+ />
+ </Section>
+ <Section>
+ <H2Title
+ title={t`Workspaces`}
+ description={t`All workspaces this user is a member of`}
+ />
+ <TabList
+ tabs={tabs}
+ behaveAsLinks={false}
+ componentInstanceId={
+ SETTINGS_ADMIN_USER_LOOKUP_WORKSPACE_TABS_ID
+ }
+ />
+ <SettingsAdminWorkspaceContent
+ activeWorkspace={activeWorkspace}
+ />
+ {currentUser?.canImpersonate && activeWorkspace && (
+ <StyledButtonContainer>
+ <Button
+ Icon={IconEyeShare}
+ variant="primary"
+ accent="default"
+ title={
+ activeWorkspace.allowImpersonation === false
+ ? t`Impersonation is disabled for this workspace`
+ : t`Impersonate`
+ }
+ onClick={() =>
+ handleImpersonate(
+ userLookupResult.user.id,
+ activeWorkspace.id,
+ )
+ }
+ disabled={
+ impersonatingUserId !== null ||
+ activeWorkspace.allowImpersonation === false
+ }
+ />
+ </StyledButtonContainer>
+ )}
+ </Section>
+ </>
+ )}
+ </SettingsPageContainer>
+ </SubMenuTopBarContainer>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceChatThread.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceChatThread.tsx
new file mode 100644
index 00000000000..b002e522bd7
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceChatThread.tsx
@@ -0,0 +1,73 @@
+import { useParams } from 'react-router-dom';
+
+import { useQuery } from '@apollo/client/react';
+import { t } from '@lingui/core/macro';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
+
+import { AI_ADMIN_PATH } from '@/settings/admin-panel/ai/constants/AiAdminPath';
+import { SettingsAdminChatThreadMessageList } from '@/settings/admin-panel/components/SettingsAdminChatThreadMessageList';
+import { GET_ADMIN_CHAT_THREAD_MESSAGES } from '@/settings/admin-panel/graphql/queries/getAdminChatThreadMessages';
+import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';
+import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
+import { H2Title } from 'twenty-ui/display';
+import { Section } from 'twenty-ui/layout';
+import { type GetAdminChatThreadMessagesQuery } from '~/generated-metadata/graphql';
+
+export const SettingsAdminWorkspaceChatThread = () => {
+ const { workspaceId, threadId } = useParams<{
+ workspaceId: string;
+ threadId: string;
+ }>();
+
+ const { data, loading: isLoading } =
+ useQuery<GetAdminChatThreadMessagesQuery>(GET_ADMIN_CHAT_THREAD_MESSAGES, {
+ variables: { threadId },
+ skip: !threadId,
+ });
+
+ const thread = data?.getAdminChatThreadMessages?.thread;
+ const messages = data?.getAdminChatThreadMessages?.messages ?? [];
+
+ const threadTitle = thread?.title || t`Untitled`;
+
+ if (isLoading) {
+ return <SettingsSkeletonLoader />;
+ }
+
+ return (
+ <SubMenuTopBarContainer
+ links={[
+ {
+ children: t`Other`,
+ href: getSettingsPath(SettingsPath.AdminPanel),
+ },
+ {
+ children: t`Admin Panel`,
+ href: getSettingsPath(SettingsPath.AdminPanel),
+ },
+ {
+ children: t`AI`,
+ href: AI_ADMIN_PATH,
+ },
+ {
+ children: t`Workspace`,
+ href: getSettingsPath(SettingsPath.AdminPanelWorkspaceDetail, {
+ workspaceId: workspaceId ?? '',
+ }),
+ },
+ {
+ children: threadTitle,
+ },
+ ]}
+ >
+ <SettingsPageContainer>
+ <Section>
+ <H2Title title={threadTitle} description={t`Chat conversation`} />
+ <SettingsAdminChatThreadMessageList messages={messages} />
+ </Section>
+ </SettingsPageContainer>
+ </SubMenuTopBarContainer>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
new file mode 100644
index 00000000000..c7ec735e50d
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
@@ -0,0 +1,343 @@
+import { useParams } from 'react-router-dom';
+
+import { useMutation, useQuery } from '@apollo/client/react';
+import { t } from '@lingui/core/macro';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath, isDefined } from 'twenty-shared/utils';
+
+import { currentUserState } from '@/auth/states/currentUserState';
+import { canManageFeatureFlagsState } from '@/client-config/states/canManageFeatureFlagsState';
+import { AI_ADMIN_PATH } from '@/settings/admin-panel/ai/constants/AiAdminPath';
+import { SettingsAdminWorkspaceContent } from '@/settings/admin-panel/components/SettingsAdminWorkspaceContent';
+import { GET_ADMIN_WORKSPACE_CHAT_THREADS } from '@/settings/admin-panel/graphql/queries/getAdminWorkspaceChatThreads';
+import { WORKSPACE_LOOKUP_ADMIN_PANEL } from '@/settings/admin-panel/graphql/queries/workspaceLookupAdminPanel';
+import { useFeatureFlagState } from '@/settings/admin-panel/hooks/useFeatureFlagState';
+import { useHandleImpersonate } from '@/settings/admin-panel/hooks/useHandleImpersonate';
+import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';
+import { Table } from '@/ui/layout/table/components/Table';
+import { TableBody } from '@/ui/layout/table/components/TableBody';
+import { TableCell } from '@/ui/layout/table/components/TableCell';
+import { TableHeader } from '@/ui/layout/table/components/TableHeader';
+import { TableRow } from '@/ui/layout/table/components/TableRow';
+import { TabList } from '@/ui/layout/tab-list/components/TabList';
+import { activeTabIdComponentState } from '@/ui/layout/tab-list/states/activeTabIdComponentState';
+import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
+import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import {
+ H2Title,
+ IconEyeShare,
+ IconFlag,
+ IconMessage,
+ IconSettings2,
+ IconUsers,
+} from 'twenty-ui/display';
+import { Button, Toggle } from 'twenty-ui/input';
+import { Card, Section } from 'twenty-ui/layout';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+import {
+ type FeatureFlagKey,
+ type GetAdminWorkspaceChatThreadsQuery,
+ type WorkspaceLookupAdminPanelQuery,
+ UpdateWorkspaceFeatureFlagDocument,
+} from '~/generated-metadata/graphql';
+
+const WORKSPACE_DETAIL_TABS_ID = 'settings-admin-workspace-detail-tabs';
+
+const WORKSPACE_DETAIL_TAB_IDS = {
+ INFO: 'info',
+ MEMBERS: 'members',
+ FEATURE_FLAGS: 'feature-flags',
+ CHATS: 'chats',
+};
+
+export const SettingsAdminWorkspaceDetail = () => {
+ const { workspaceId } = useParams<{ workspaceId: string }>();
+
+ const activeTabId = useAtomComponentStateValue(
+ activeTabIdComponentState,
+ WORKSPACE_DETAIL_TABS_ID,
+ );
+
+ const currentUser = useAtomStateValue(currentUserState);
+ const canManageFeatureFlags = useAtomStateValue(canManageFeatureFlagsState);
+ const { enqueueErrorSnackBar } = useSnackBar();
+ const { updateFeatureFlagState } = useFeatureFlagState();
+ const { handleImpersonate, impersonatingUserId } = useHandleImpersonate();
+ const [updateFeatureFlag] = useMutation(UpdateWorkspaceFeatureFlagDocument);
+
+ const { data: workspaceData, loading: isLoadingWorkspace } =
+ useQuery<WorkspaceLookupAdminPanelQuery>(WORKSPACE_LOOKUP_ADMIN_PANEL, {
+ variables: { workspaceId },
+ skip: !workspaceId,
+ });
+
+ const workspace = workspaceData?.workspaceLookupAdminPanel?.workspaces?.[0];
+
+ const effectiveTabId = activeTabId || WORKSPACE_DETAIL_TAB_IDS.INFO;
+
+ const { data: threadsData, loading: isLoadingThreads } =
+ useQuery<GetAdminWorkspaceChatThreadsQuery>(
+ GET_ADMIN_WORKSPACE_CHAT_THREADS,
+ {
+ variables: { workspaceId },
+ skip:
+ !workspaceId ||
+ !workspace?.allowImpersonation ||
+ effectiveTabId !== WORKSPACE_DETAIL_TAB_IDS.CHATS,
+ },
+ );
+
+ const threads = threadsData?.getAdminWorkspaceChatThreads ?? [];
+
+ const handleFeatureFlagUpdate = async (
+ featureFlag: FeatureFlagKey,
+ value: boolean,
+ ) => {
+ if (!workspaceId) return;
+
+ const previousValue = workspace?.featureFlags?.find(
+ (flag) => flag.key === featureFlag,
+ )?.value;
+
+ updateFeatureFlagState(workspaceId, featureFlag, value);
+ await updateFeatureFlag({
+ variables: {
+ workspaceId,
+ featureFlag,
+ value,
+ },
+ onError: (error) => {
+ if (isDefined(previousValue)) {
+ updateFeatureFlagState(workspaceId, featureFlag, previousValue);
+ }
+ enqueueErrorSnackBar({
+ message: `Failed to update feature flag. ${error.message}`,
+ });
+ },
+ });
+ };
+
+ const tabs = [
+ {
+ id: WORKSPACE_DETAIL_TAB_IDS.INFO,
+ title: t`Info`,
+ Icon: IconSettings2,
+ },
+ ...(currentUser?.canImpersonate
+ ? [
+ {
+ id: WORKSPACE_DETAIL_TAB_IDS.MEMBERS,
+ title: t`Members`,
+ Icon: IconUsers,
+ },
+ ]
+ : []),
+ ...(canManageFeatureFlags
+ ? [
+ {
+ id: WORKSPACE_DETAIL_TAB_IDS.FEATURE_FLAGS,
+ title: t`Feature Flags`,
+ Icon: IconFlag,
+ },
+ ]
+ : []),
+ ...(workspace?.allowImpersonation
+ ? [
+ {
+ id: WORKSPACE_DETAIL_TAB_IDS.CHATS,
+ title: t`Chats`,
+ Icon: IconMessage,
+ },
+ ]
+ : []),
+ ];
+
+ const workspaceName = workspace?.name || workspaceId || '';
+
+ if (isLoadingWorkspace) {
+ return <SettingsSkeletonLoader />;
+ }
+
+ return (
+ <SubMenuTopBarContainer
+ links={[
+ {
+ children: t`Other`,
+ href: getSettingsPath(SettingsPath.AdminPanel),
+ },
+ {
+ children: t`Admin Panel`,
+ href: getSettingsPath(SettingsPath.AdminPanel),
+ },
+ {
+ children: t`AI`,
+ href: AI_ADMIN_PATH,
+ },
+ {
+ children: workspaceName,
+ },
+ ]}
+ >
+ <SettingsPageContainer>
+ <TabList
+ tabs={tabs}
+ behaveAsLinks={false}
+ componentInstanceId={WORKSPACE_DETAIL_TABS_ID}
+ />
+
+ {effectiveTabId === WORKSPACE_DETAIL_TAB_IDS.INFO && workspace && (
+ <SettingsAdminWorkspaceContent activeWorkspace={workspace} />
+ )}
+
+ {effectiveTabId === WORKSPACE_DETAIL_TAB_IDS.MEMBERS && workspace && (
+ <Section>
+ <H2Title title={t`Members`} description={t`Workspace members`} />
+ <Table>
+ <TableBody>
+ <TableRow gridTemplateColumns="1fr 2fr 100px">
+ <TableHeader>{t`Name`}</TableHeader>
+ <TableHeader>{t`Email`}</TableHeader>
+ <TableHeader align="right">{t`Actions`}</TableHeader>
+ </TableRow>
+ {workspace.users?.map((user) => {
+ const userId = user.id;
+
+ if (!isDefined(userId)) return null;
+
+ return (
+ <TableRow
+ key={userId}
+ gridTemplateColumns="1fr 2fr 100px"
+ to={getSettingsPath(SettingsPath.AdminPanelUserDetail, {
+ userId,
+ })}
+ >
+ <TableCell color={themeCssVariables.font.color.primary}>
+ {`${user.firstName || ''} ${user.lastName || ''}`.trim() ||
+ '\u2014'}
+ </TableCell>
+ <TableCell>{user.email}</TableCell>
+ <TableCell align="right">
+ {workspace.allowImpersonation && (
+ <Button
+ Icon={IconEyeShare}
+ variant="secondary"
+ size="small"
+ title={t`Impersonate`}
+ onClick={(e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ handleImpersonate(userId, workspaceId!);
+ }}
+ disabled={impersonatingUserId === userId}
+ />
+ )}
+ </TableCell>
+ </TableRow>
+ );
+ })}
+ </TableBody>
+ </Table>
+ </Section>
+ )}
+
+ {effectiveTabId === WORKSPACE_DETAIL_TAB_IDS.FEATURE_FLAGS &&
+ workspace && (
+ <Section>
+ <H2Title
+ title={t`Feature Flags`}
+ description={t`Manage feature flags for this workspace`}
+ />
+ <Table>
+ <TableBody>
+ <TableRow
+ gridAutoColumns="1fr 100px"
+ mobileGridAutoColumns="1fr 80px"
+ >
+ <TableHeader>{t`Feature Flag`}</TableHeader>
+ <TableHeader align="right">{t`Status`}</TableHeader>
+ </TableRow>
+ {workspace.featureFlags?.map((flag) => (
+ <TableRow
+ gridAutoColumns="1fr 100px"
+ mobileGridAutoColumns="1fr 80px"
+ key={flag.key}
+ >
+ <TableCell>{flag.key}</TableCell>
+ <TableCell align="right">
+ {isDefined(flag.key) && (
+ <Toggle
+ value={flag.value}
+ onChange={(newValue) =>
+ handleFeatureFlagUpdate(flag.key!, newValue)
+ }
+ />
+ )}
+ </TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ </Section>
+ )}
+
+ {effectiveTabId === WORKSPACE_DETAIL_TAB_IDS.CHATS && (
+ <Section>
+ <H2Title
+ title={t`Chat Sessions`}
+ description={t`AI chat threads for this workspace`}
+ />
+ {isLoadingThreads ? (
+ <SettingsSkeletonLoader />
+ ) : threads.length === 0 ? (
+ <Card rounded>
+ <TableRow gridTemplateColumns="1fr">
+ <TableCell
+ color={themeCssVariables.font.color.tertiary}
+ align="center"
+ >
+ {t`No chat threads found.`}
+ </TableCell>
+ </TableRow>
+ </Card>
+ ) : (
+ <Table>
+ <TableRow gridTemplateColumns="1fr 120px 120px">
+ <TableHeader>{t`Title`}</TableHeader>
+ <TableHeader align="right">{t`Messages`}</TableHeader>
+ <TableHeader align="right">{t`Updated`}</TableHeader>
+ </TableRow>
+ {threads.map((thread) => (
+ <TableRow
+ key={thread.id}
+ gridTemplateColumns="1fr 120px 120px"
+ to={getSettingsPath(
+ SettingsPath.AdminPanelWorkspaceChatThread,
+ {
+ workspaceId: workspaceId ?? '',
+ threadId: thread.id,
+ },
+ )}
+ >
+ <TableCell color={themeCssVariables.font.color.primary}>
+ {thread.title || t`Untitled`}
+ </TableCell>
+ <TableCell align="right">
+ {thread.conversationSize}
+ </TableCell>
+ <TableCell align="right">
+ {new Date(thread.updatedAt).toLocaleDateString()}
+ </TableCell>
+ </TableRow>
+ ))}
+ </Table>
+ )}
+ </Section>
+ )}
+ </SettingsPageContainer>
+ </SubMenuTopBarContainer>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx b/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx
index 776b4e432e0..a977878d43d 100644
--- a/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx
+++ b/packages/twenty-front/src/pages/settings/members/SettingsWorkspaceMember.tsx
@@ -3,7 +3,7 @@ import { useDebouncedCallback } from 'use-debounce';
import { CoreObjectNameSingular, SettingsPath } from 'twenty-shared/types';
import { useFindOneRecord } from '@/object-record/hooks/useFindOneRecord';
-import { useImpersonationAuth } from '@/settings/admin-panel/hooks/useImpersonationAuth';
+import { useImpersonationSession } from '@/auth/hooks/useImpersonationSession';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
import { SettingsRolesQueryEffect } from '@/settings/roles/components/SettingsRolesQueryEffect';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
@@ -50,7 +50,7 @@ export const SettingsWorkspaceMember = () => {
const { enqueueErrorSnackBar, enqueueSuccessSnackBar } = useSnackBar();
const { openModal, closeModal } = useModal();
const currentWorkspace = useAtomStateValue(currentWorkspaceState);
- const { executeImpersonationAuth } = useImpersonationAuth();
+ const { startImpersonating } = useImpersonationSession();
const [impersonate] = useMutation(ImpersonateDocument);
const isImpersonating = useAtomStateValue(isImpersonatingState);
const canImpersonate =
@@ -150,7 +150,7 @@ export const SettingsWorkspaceMember = () => {
},
onCompleted: async (data) => {
const { loginToken } = data.impersonate;
- await executeImpersonationAuth(loginToken.token);
+ await startImpersonating(loginToken.token);
},
onError: () => {
enqueueErrorSnackBar({
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/__tests__/admin-panel.service.spec.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/__tests__/admin-panel.service.spec.ts
index b963d78993b..131a5ba6bbe 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/__tests__/admin-panel.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/__tests__/admin-panel.service.spec.ts
@@ -1,17 +1,10 @@
import { Test, type TestingModule } from '@nestjs/testing';
-import { getRepositoryToken } from '@nestjs/typeorm';
-import { AdminPanelService } from 'src/engine/core-modules/admin-panel/admin-panel.service';
-import { AuditService } from 'src/engine/core-modules/audit/services/audit.service';
-import { LoginTokenService } from 'src/engine/core-modules/auth/token/services/login-token.service';
-import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
-import { FileUrlService } from 'src/engine/core-modules/file/file-url/file-url.service';
+import { AdminPanelConfigService } from 'src/engine/core-modules/admin-panel/services/admin-panel-config.service';
+import { AdminPanelVersionService } from 'src/engine/core-modules/admin-panel/services/admin-panel-version.service';
import { SecureHttpClientService } from 'src/engine/core-modules/secure-http-client/secure-http-client.service';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
-import { UserEntity } from 'src/engine/core-modules/user/user.entity';
-const UserFindOneMock = jest.fn();
-const LoginTokenServiceGenerateLoginTokenMock = jest.fn();
const TwentyConfigServiceGetAllMock = jest.fn();
const TwentyConfigServiceGetVariableWithMetadataMock = jest.fn();
const mockHttpClientGet = jest.fn();
@@ -40,34 +33,13 @@ jest.mock(
}),
);
-describe('AdminPanelService', () => {
- let service: AdminPanelService;
+describe('AdminPanelConfigService', () => {
+ let configService: AdminPanelConfigService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [
- AdminPanelService,
- {
- provide: getRepositoryToken(UserEntity),
- useValue: {
- findOne: UserFindOneMock,
- },
- },
- {
- provide: LoginTokenService,
- useValue: {
- generateLoginToken: LoginTokenServiceGenerateLoginTokenMock,
- },
- },
- {
- provide: WorkspaceDomainsService,
- useValue: {
- getWorkspaceUrls: jest.fn().mockReturnValue({
- customUrl: undefined,
- subdomainUrl: 'https://twenty.twenty.com',
- }),
- },
- },
+ AdminPanelConfigService,
{
provide: TwentyConfigService,
useValue: {
@@ -76,32 +48,16 @@ describe('AdminPanelService', () => {
TwentyConfigServiceGetVariableWithMetadataMock,
},
},
- {
- provide: AuditService,
- useValue: {
- createContext: jest.fn().mockReturnValue({
- insertWorkspaceEvent: jest.fn(),
- }),
- },
- },
- {
- provide: FileUrlService,
- useValue: {},
- },
- {
- provide: SecureHttpClientService,
- useValue: {
- getHttpClient: mockGetHttpClient,
- },
- },
],
}).compile();
- service = module.get<AdminPanelService>(AdminPanelService);
+ configService = module.get<AdminPanelConfigService>(
+ AdminPanelConfigService,
+ );
});
it('should be defined', async () => {
- expect(service).toBeDefined();
+ expect(configService).toBeDefined();
});
describe('getConfigVariablesGrouped', () => {
@@ -150,7 +106,7 @@ describe('AdminPanelService', () => {
},
});
- const result = service.getConfigVariablesGrouped();
+ const result = configService.getConfigVariablesGrouped();
expect(result).toEqual({
groups: [
@@ -226,7 +182,7 @@ describe('AdminPanelService', () => {
it('should handle empty config variables', () => {
TwentyConfigServiceGetAllMock.mockReturnValue({});
- const result = service.getConfigVariablesGrouped();
+ const result = configService.getConfigVariablesGrouped();
expect(result).toEqual({
groups: [],
@@ -246,7 +202,7 @@ describe('AdminPanelService', () => {
},
});
- const result = service.getConfigVariablesGrouped();
+ const result = configService.getConfigVariablesGrouped();
expect(result.groups[0].variables[0]).toEqual({
name: 'TEST_VAR',
@@ -261,13 +217,79 @@ describe('AdminPanelService', () => {
});
});
+ describe('getConfigVariable', () => {
+ it('should return config variable with all fields', () => {
+ TwentyConfigServiceGetVariableWithMetadataMock.mockReturnValue({
+ value: 'test-value',
+ metadata: {
+ group: 'SERVER_CONFIG',
+ description: 'Test description',
+ isSensitive: true,
+ isEnvOnly: true,
+ type: 'string',
+ options: ['option1', 'option2'],
+ },
+ source: 'env',
+ });
+
+ const result = configService.getConfigVariable('SERVER_URL');
+
+ expect(result).toEqual({
+ name: 'SERVER_URL',
+ value: 'test-value',
+ description: 'Test description',
+ isSensitive: true,
+ isEnvOnly: true,
+ type: 'string',
+ options: ['option1', 'option2'],
+ source: 'env',
+ });
+ });
+
+ it('should throw error when variable not found', () => {
+ TwentyConfigServiceGetVariableWithMetadataMock.mockReturnValue(undefined);
+
+ expect(() => configService.getConfigVariable('INVALID_VAR')).toThrow(
+ 'Config variable INVALID_VAR not found',
+ );
+ });
+ });
+});
+
+describe('AdminPanelVersionService', () => {
+ let versionService: AdminPanelVersionService;
+
+ beforeEach(async () => {
+ const module: TestingModule = await Test.createTestingModule({
+ providers: [
+ AdminPanelVersionService,
+ {
+ provide: TwentyConfigService,
+ useValue: {
+ get: jest.fn(),
+ },
+ },
+ {
+ provide: SecureHttpClientService,
+ useValue: {
+ getHttpClient: mockGetHttpClient,
+ },
+ },
+ ],
+ }).compile();
+
+ versionService = module.get<AdminPanelVersionService>(
+ AdminPanelVersionService,
+ );
+ });
+
describe('getVersionInfo', () => {
const mockEnvironmentGet = jest.fn();
beforeEach(() => {
mockEnvironmentGet.mockReset();
mockHttpClientGet.mockReset();
- service['twentyConfigService'].get = mockEnvironmentGet;
+ versionService['twentyConfigService'].get = mockEnvironmentGet;
});
it('should return current and latest version when everything works', async () => {
@@ -283,7 +305,7 @@ describe('AdminPanelService', () => {
},
});
- const result = await service.getVersionInfo();
+ const result = await versionService.getVersionInfo();
expect(result).toEqual({
currentVersion: '1.0.0',
@@ -299,7 +321,7 @@ describe('AdminPanelService', () => {
},
});
- const result = await service.getVersionInfo();
+ const result = await versionService.getVersionInfo();
expect(result).toEqual({
currentVersion: undefined,
@@ -311,7 +333,7 @@ describe('AdminPanelService', () => {
mockEnvironmentGet.mockReturnValue('1.0.0');
mockHttpClientGet.mockRejectedValue(new Error('API Error'));
- const result = await service.getVersionInfo();
+ const result = await versionService.getVersionInfo();
expect(result).toEqual({
currentVersion: '1.0.0',
@@ -327,7 +349,7 @@ describe('AdminPanelService', () => {
},
});
- const result = await service.getVersionInfo();
+ const result = await versionService.getVersionInfo();
expect(result).toEqual({
currentVersion: '1.0.0',
@@ -348,7 +370,7 @@ describe('AdminPanelService', () => {
},
});
- const result = await service.getVersionInfo();
+ const result = await versionService.getVersionInfo();
expect(result).toEqual({
currentVersion: '1.0.0',
@@ -356,42 +378,4 @@ describe('AdminPanelService', () => {
});
});
});
-
- describe('getConfigVariable', () => {
- it('should return config variable with all fields', () => {
- TwentyConfigServiceGetVariableWithMetadataMock.mockReturnValue({
- value: 'test-value',
- metadata: {
- group: 'SERVER_CONFIG',
- description: 'Test description',
- isSensitive: true,
- isEnvOnly: true,
- type: 'string',
- options: ['option1', 'option2'],
- },
- source: 'env',
- });
-
- const result = service.getConfigVariable('SERVER_URL');
-
- expect(result).toEqual({
- name: 'SERVER_URL',
- value: 'test-value',
- description: 'Test description',
- isSensitive: true,
- isEnvOnly: true,
- type: 'string',
- options: ['option1', 'option2'],
- source: 'env',
- });
- });
-
- it('should throw error when variable not found', () => {
- TwentyConfigServiceGetVariableWithMetadataMock.mockReturnValue(undefined);
-
- expect(() => service.getConfigVariable('INVALID_VAR')).toThrow(
- 'Config variable INVALID_VAR not found',
- );
- });
- });
});
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.module.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.module.ts
index 48160e6825c..90ec477220e 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.module.ts
@@ -5,7 +5,11 @@ import { TypeOrmModule } from '@nestjs/typeorm';
import { AdminPanelHealthService } from 'src/engine/core-modules/admin-panel/admin-panel-health.service';
import { AdminPanelQueueService } from 'src/engine/core-modules/admin-panel/admin-panel-queue.service';
import { AdminPanelResolver } from 'src/engine/core-modules/admin-panel/admin-panel.resolver';
-import { AdminPanelService } from 'src/engine/core-modules/admin-panel/admin-panel.service';
+import { AdminPanelChatService } from 'src/engine/core-modules/admin-panel/services/admin-panel-chat.service';
+import { AdminPanelConfigService } from 'src/engine/core-modules/admin-panel/services/admin-panel-config.service';
+import { AdminPanelStatisticsService } from 'src/engine/core-modules/admin-panel/services/admin-panel-statistics.service';
+import { AdminPanelUserLookupService } from 'src/engine/core-modules/admin-panel/services/admin-panel-user-lookup.service';
+import { AdminPanelVersionService } from 'src/engine/core-modules/admin-panel/services/admin-panel-version.service';
import { MaintenanceModeService } from 'src/engine/core-modules/admin-panel/maintenance-mode.service';
import { ApplicationRegistrationModule } from 'src/engine/core-modules/application/application-registration/application-registration.module';
import { AuditModule } from 'src/engine/core-modules/audit/audit.module';
@@ -24,15 +28,26 @@ import { RedisClientModule } from 'src/engine/core-modules/redis-client/redis-cl
import { SecureHttpClientModule } from 'src/engine/core-modules/secure-http-client/secure-http-client.module';
import { TelemetryModule } from 'src/engine/core-modules/telemetry/telemetry.module';
import { UsageModule } from 'src/engine/core-modules/usage/usage.module';
+import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
import { UserEntity } from 'src/engine/core-modules/user/user.entity';
import { UserVarsModule } from 'src/engine/core-modules/user/user-vars/user-vars.module';
+import { UserWorkspaceEntity } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
+import { AgentChatThreadEntity } from 'src/engine/metadata-modules/ai/ai-chat/entities/agent-chat-thread.entity';
+import { AgentMessageEntity } from 'src/engine/metadata-modules/ai/ai-agent-execution/entities/agent-message.entity';
import { KeyValuePairModule } from 'src/engine/core-modules/key-value-pair/key-value-pair.module';
import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permissions.module';
@Module({
imports: [
- TypeOrmModule.forFeature([UserEntity, WorkspaceEntity]),
+ TypeOrmModule.forFeature([
+ UserEntity,
+ WorkspaceEntity,
+ UserWorkspaceEntity,
+ FeatureFlagEntity,
+ AgentChatThreadEntity,
+ AgentMessageEntity,
+ ]),
AuthModule,
FileModule,
WorkspaceDomainsModule,
@@ -52,7 +67,11 @@ import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permi
],
providers: [
AdminPanelResolver,
- AdminPanelService,
+ AdminPanelUserLookupService,
+ AdminPanelStatisticsService,
+ AdminPanelChatService,
+ AdminPanelConfigService,
+ AdminPanelVersionService,
AdminPanelHealthService,
AdminPanelQueueService,
MaintenanceModeService,
@@ -62,6 +81,13 @@ import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permi
ConnectedAccountHealth,
AppHealthIndicator,
],
- exports: [AdminPanelService, MaintenanceModeService],
+ exports: [
+ AdminPanelUserLookupService,
+ AdminPanelStatisticsService,
+ AdminPanelChatService,
+ AdminPanelConfigService,
+ AdminPanelVersionService,
+ MaintenanceModeService,
+ ],
})
export class AdminPanelModule {}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.resolver.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.resolver.ts
index 7c2647a985a..894d8ab2f5a 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.resolver.ts
@@ -7,10 +7,20 @@ import { In, type Repository } from 'typeorm';
import { isDefined } from 'twenty-shared/utils';
import { PermissionFlagType } from 'twenty-shared/constants';
+import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+
import { AdminPanelHealthService } from 'src/engine/core-modules/admin-panel/admin-panel-health.service';
import { AdminPanelQueueService } from 'src/engine/core-modules/admin-panel/admin-panel-queue.service';
-import { AdminPanelService } from 'src/engine/core-modules/admin-panel/admin-panel.service';
+import { AdminPanelChatService } from 'src/engine/core-modules/admin-panel/services/admin-panel-chat.service';
+import { AdminPanelConfigService } from 'src/engine/core-modules/admin-panel/services/admin-panel-config.service';
+import { AdminPanelStatisticsService } from 'src/engine/core-modules/admin-panel/services/admin-panel-statistics.service';
+import { AdminPanelUserLookupService } from 'src/engine/core-modules/admin-panel/services/admin-panel-user-lookup.service';
+import { AdminPanelVersionService } from 'src/engine/core-modules/admin-panel/services/admin-panel-version.service';
import { MaintenanceModeService } from 'src/engine/core-modules/admin-panel/maintenance-mode.service';
+import { AdminPanelRecentUserDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-panel-recent-user.dto';
+import { AdminPanelTopWorkspaceDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-panel-top-workspace.dto';
+import { AdminWorkspaceChatThreadDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-workspace-chat-thread.dto';
+import { AdminChatThreadMessagesDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-chat-thread-messages.dto';
import { ApplicationRegistrationEntity } from 'src/engine/core-modules/application/application-registration/application-registration.entity';
import { ApplicationRegistrationService } from 'src/engine/core-modules/application/application-registration/application-registration.service';
import { AdminAIModelsDTO } from 'src/engine/core-modules/client-config/client-config.entity';
@@ -76,7 +86,11 @@ import { SetMaintenanceModeInput } from './dtos/set-maintenance-mode.input';
)
export class AdminPanelResolver {
constructor(
- private readonly adminService: AdminPanelService,
+ private readonly adminUserLookupService: AdminPanelUserLookupService,
+ private readonly adminStatisticsService: AdminPanelStatisticsService,
+ private readonly adminChatService: AdminPanelChatService,
+ private readonly adminConfigService: AdminPanelConfigService,
+ private readonly adminVersionService: AdminPanelVersionService,
private readonly adminPanelHealthService: AdminPanelHealthService,
private readonly applicationRegistrationService: ApplicationRegistrationService,
private adminPanelQueueService: AdminPanelQueueService,
@@ -91,11 +105,39 @@ export class AdminPanelResolver {
) {}
@UseGuards(ServerLevelImpersonateGuard)
- @Mutation(() => UserLookup)
+ @Query(() => UserLookup)
async userLookupAdminPanel(
@Args() userLookupInput: UserLookupInput,
): Promise<UserLookup> {
- return await this.adminService.userLookup(userLookupInput.userIdentifier);
+ return await this.adminUserLookupService.userLookup(
+ userLookupInput.userIdentifier,
+ );
+ }
+
+ @UseGuards(ServerLevelImpersonateGuard)
+ @Query(() => [AdminPanelRecentUserDTO])
+ async adminPanelRecentUsers(
+ @Args('searchTerm', {
+ type: () => String,
+ nullable: true,
+ defaultValue: '',
+ })
+ searchTerm: string,
+ ): Promise<AdminPanelRecentUserDTO[]> {
+ return this.adminStatisticsService.getRecentUsers(searchTerm);
+ }
+
+ @UseGuards(ServerLevelImpersonateGuard)
+ @Query(() => [AdminPanelTopWorkspaceDTO])
+ async adminPanelTopWorkspaces(
+ @Args('searchTerm', {
+ type: () => String,
+ nullable: true,
+ defaultValue: '',
+ })
+ searchTerm: string,
+ ): Promise<AdminPanelTopWorkspaceDTO[]> {
+ return this.adminStatisticsService.getTopWorkspaces(searchTerm);
}
@UseGuards(AdminPanelGuard)
@@ -123,7 +165,7 @@ export class AdminPanelResolver {
@UseGuards(AdminPanelGuard)
@Query(() => ConfigVariablesDTO)
async getConfigVariablesGrouped(): Promise<ConfigVariablesDTO> {
- return this.adminService.getConfigVariablesGrouped();
+ return this.adminConfigService.getConfigVariablesGrouped();
}
@UseGuards(AdminPanelGuard)
@@ -164,7 +206,7 @@ export class AdminPanelResolver {
@UseGuards(AdminPanelGuard)
@Query(() => VersionInfoDTO)
async versionInfo(): Promise<VersionInfoDTO> {
- return this.adminService.getVersionInfo();
+ return this.adminVersionService.getVersionInfo();
}
@UseGuards(AdminPanelGuard)
@@ -282,7 +324,7 @@ export class AdminPanelResolver {
): Promise<ConfigVariableDTO> {
this.twentyConfigService.validateConfigVariableExists(key as string);
- return this.adminService.getConfigVariable(key);
+ return this.adminConfigService.getConfigVariable(key);
}
@UseGuards(AdminPanelGuard)
@@ -614,4 +656,28 @@ export class AdminPanelResolver {
return true;
}
+
+ @UseGuards(ServerLevelImpersonateGuard)
+ @Query(() => UserLookup)
+ async workspaceLookupAdminPanel(
+ @Args('workspaceId', { type: () => UUIDScalarType }) workspaceId: string,
+ ): Promise<UserLookup> {
+ return this.adminUserLookupService.workspaceLookup(workspaceId);
+ }
+
+ @UseGuards(ServerLevelImpersonateGuard)
+ @Query(() => [AdminWorkspaceChatThreadDTO])
+ async getAdminWorkspaceChatThreads(
+ @Args('workspaceId', { type: () => UUIDScalarType }) workspaceId: string,
+ ): Promise<AdminWorkspaceChatThreadDTO[]> {
+ return this.adminChatService.getWorkspaceChatThreads(workspaceId);
+ }
+
+ @UseGuards(ServerLevelImpersonateGuard)
+ @Query(() => AdminChatThreadMessagesDTO)
+ async getAdminChatThreadMessages(
+ @Args('threadId', { type: () => UUIDScalarType }) threadId: string,
+ ): Promise<AdminChatThreadMessagesDTO> {
+ return this.adminChatService.getChatThreadMessages(threadId);
+ }
}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts
deleted file mode 100644
index dfd383df699..00000000000
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts
+++ /dev/null
@@ -1,226 +0,0 @@
-import { Injectable } from '@nestjs/common';
-import { InjectRepository } from '@nestjs/typeorm';
-
-import { msg } from '@lingui/core/macro';
-import semver from 'semver';
-import { FeatureFlagKey, FileFolder } from 'twenty-shared/types';
-import { isDefined } from 'twenty-shared/utils';
-import { Repository } from 'typeorm';
-import * as z from 'zod';
-
-import { type ConfigVariableDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variable.dto';
-import { type ConfigVariablesGroupDataDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variables-group.dto';
-import { type ConfigVariablesDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variables.dto';
-import { type UserLookup } from 'src/engine/core-modules/admin-panel/dtos/user-lookup.dto';
-import { type VersionInfoDTO } from 'src/engine/core-modules/admin-panel/dtos/version-info.dto';
-import {
- AuthException,
- AuthExceptionCode,
-} from 'src/engine/core-modules/auth/auth.exception';
-import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
-import { type FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
-import { FileUrlService } from 'src/engine/core-modules/file/file-url/file-url.service';
-import { SecureHttpClientService } from 'src/engine/core-modules/secure-http-client/secure-http-client.service';
-import { type ConfigVariables } from 'src/engine/core-modules/twenty-config/config-variables';
-import { CONFIG_VARIABLES_GROUP_METADATA } from 'src/engine/core-modules/twenty-config/constants/config-variables-group-metadata';
-import { type ConfigVariablesGroup } from 'src/engine/core-modules/twenty-config/enums/config-variables-group.enum';
-import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
-import { UserEntity } from 'src/engine/core-modules/user/user.entity';
-import { userValidator } from 'src/engine/core-modules/user/user.validate';
-
-@Injectable()
-export class AdminPanelService {
- constructor(
- private readonly twentyConfigService: TwentyConfigService,
- private readonly workspaceDomainsService: WorkspaceDomainsService,
- private readonly fileUrlService: FileUrlService,
- private readonly secureHttpClientService: SecureHttpClientService,
- @InjectRepository(UserEntity)
- private readonly userRepository: Repository<UserEntity>,
- ) {}
-
- async userLookup(userIdentifier: string): Promise<UserLookup> {
- const isEmail = userIdentifier.includes('@');
- const normalizedIdentifier = isEmail
- ? userIdentifier.toLowerCase()
- : userIdentifier;
-
- const targetUser = await this.userRepository.findOne({
- where: isEmail
- ? { email: normalizedIdentifier }
- : { id: normalizedIdentifier },
- relations: {
- userWorkspaces: {
- workspace: {
- workspaceUsers: {
- user: true,
- },
- featureFlags: true,
- },
- },
- },
- });
-
- userValidator.assertIsDefinedOrThrow(
- targetUser,
- new AuthException('User not found', AuthExceptionCode.INVALID_INPUT, {
- userFriendlyMessage: msg`User not found. Please check the email or ID.`,
- }),
- );
-
- const allFeatureFlagKeys = Object.values(FeatureFlagKey);
-
- return {
- user: {
- id: targetUser.id,
- email: targetUser.email,
- firstName: targetUser.firstName,
- lastName: targetUser.lastName,
- },
- workspaces: targetUser.userWorkspaces.map((userWorkspace) => ({
- id: userWorkspace.workspace.id,
- name: userWorkspace.workspace.displayName ?? '',
- totalUsers: userWorkspace.workspace.workspaceUsers.length,
- logo: isDefined(userWorkspace.workspace.logoFileId)
- ? this.fileUrlService.signFileByIdUrl({
- fileId: userWorkspace.workspace.logoFileId,
- workspaceId: userWorkspace.workspace.id,
- fileFolder: FileFolder.CorePicture,
- })
- : undefined,
- allowImpersonation: userWorkspace.workspace.allowImpersonation,
- workspaceUrls: this.workspaceDomainsService.getWorkspaceUrls({
- subdomain: userWorkspace.workspace.subdomain,
- customDomain: userWorkspace.workspace.customDomain,
- isCustomDomainEnabled: userWorkspace.workspace.isCustomDomainEnabled,
- }),
- users: userWorkspace.workspace.workspaceUsers
- .filter((workspaceUser) => isDefined(workspaceUser.user))
- .map((workspaceUser) => ({
- id: workspaceUser.user.id,
- email: workspaceUser.user.email,
- firstName: workspaceUser.user.firstName,
- lastName: workspaceUser.user.lastName,
- })),
- featureFlags: allFeatureFlagKeys.map((key) => ({
- key,
- value:
- userWorkspace.workspace.featureFlags?.find(
- (flag) => flag.key === key,
- )?.value ?? false,
- })) as FeatureFlagEntity[],
- })),
- };
- }
-
- getConfigVariablesGrouped(): ConfigVariablesDTO {
- const rawEnvVars = this.twentyConfigService.getAll();
- const groupedData = new Map<ConfigVariablesGroup, ConfigVariableDTO[]>();
-
- for (const [varName, { value, metadata, source }] of Object.entries(
- rawEnvVars,
- )) {
- const { group, description } = metadata;
-
- if (metadata.isHiddenInAdminPanel) {
- continue;
- }
-
- const envVar: ConfigVariableDTO = {
- name: varName,
- description,
- value: value ?? null,
- isSensitive: metadata.isSensitive ?? false,
- isEnvOnly: metadata.isEnvOnly ?? false,
- type: metadata.type,
- options: metadata.options,
- source,
- };
-
- if (!groupedData.has(group)) {
- groupedData.set(group, []);
- }
-
- groupedData.get(group)?.push(envVar);
- }
-
- const groups: ConfigVariablesGroupDataDTO[] = Array.from(
- groupedData.entries(),
- )
- .filter(
- ([name]) => !CONFIG_VARIABLES_GROUP_METADATA[name].isHiddenInAdminPanel,
- )
- .sort((a, b) => {
- const positionA = CONFIG_VARIABLES_GROUP_METADATA[a[0]].position;
- const positionB = CONFIG_VARIABLES_GROUP_METADATA[b[0]].position;
-
- return positionA - positionB;
- })
- .map(([name, variables]) => ({
- name,
- description: CONFIG_VARIABLES_GROUP_METADATA[name].description,
- isHiddenOnLoad: CONFIG_VARIABLES_GROUP_METADATA[name].isHiddenOnLoad,
- variables: variables.sort((a, b) => a.name.localeCompare(b.name)),
- }));
-
- return { groups };
- }
-
- getConfigVariable(key: string): ConfigVariableDTO {
- const variableWithMetadata =
- this.twentyConfigService.getVariableWithMetadata(
- key as keyof ConfigVariables,
- );
-
- if (!variableWithMetadata) {
- throw new Error(`Config variable ${key} not found`);
- }
-
- const { value, metadata, source } = variableWithMetadata;
-
- return {
- name: key,
- description: metadata.description ?? '',
- value: value ?? null,
- isSensitive: metadata.isSensitive ?? false,
- isEnvOnly: metadata.isEnvOnly ?? false,
- type: metadata.type,
- options: metadata.options,
- source,
- };
- }
-
- async getVersionInfo(): Promise<VersionInfoDTO> {
- const currentVersion = this.twentyConfigService.get('APP_VERSION');
-
- try {
- const httpClient = this.secureHttpClientService.getHttpClient();
-
- const rawResponse = await httpClient.get<unknown>(
- 'https://hub.docker.com/v2/repositories/twentycrm/twenty/tags?page_size=100',
- );
- const response = z
- .object({
- data: z.object({
- results: z.array(z.object({ name: z.string() })),
- }),
- })
- .parse(rawResponse);
-
- const versions = response.data.results
- .map((tag) => tag.name)
- .filter((name) => name !== 'latest' && semver.valid(name));
-
- if (versions.length === 0) {
- return { currentVersion, latestVersion: 'latest' };
- }
-
- versions.sort((a, b) => semver.compare(b, a));
- const latestVersion = versions[0];
-
- return { currentVersion, latestVersion };
- } catch {
- return { currentVersion, latestVersion: 'latest' };
- }
- }
-}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-chat-message-part.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-chat-message-part.dto.ts
new file mode 100644
index 00000000000..8b1832ffdc0
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-chat-message-part.dto.ts
@@ -0,0 +1,13 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+@ObjectType('AdminChatMessagePart')
+export class AdminChatMessagePartDTO {
+ @Field(() => String)
+ type: string;
+
+ @Field(() => String, { nullable: true })
+ textContent: string | null;
+
+ @Field(() => String, { nullable: true })
+ toolName: string | null;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-chat-message.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-chat-message.dto.ts
new file mode 100644
index 00000000000..1c46f23da41
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-chat-message.dto.ts
@@ -0,0 +1,23 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+import { AdminChatMessagePartDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-chat-message-part.dto';
+import { AgentMessageRole } from 'src/engine/metadata-modules/ai/ai-agent-execution/entities/agent-message.entity';
+
+// Ensure the enum is registered with GraphQL
+import 'src/engine/core-modules/admin-panel/enums/agent-message-role.enum';
+
+@ObjectType('AdminChatMessage')
+export class AdminChatMessageDTO {
+ @Field(() => UUIDScalarType)
+ id: string;
+
+ @Field(() => AgentMessageRole)
+ role: AgentMessageRole;
+
+ @Field(() => [AdminChatMessagePartDTO])
+ parts: AdminChatMessagePartDTO[];
+
+ @Field(() => Date)
+ createdAt: Date;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-chat-thread-messages.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-chat-thread-messages.dto.ts
new file mode 100644
index 00000000000..b1d57bac7ba
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-chat-thread-messages.dto.ts
@@ -0,0 +1,13 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+import { AdminChatMessageDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-chat-message.dto';
+import { AdminWorkspaceChatThreadDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-workspace-chat-thread.dto';
+
+@ObjectType('AdminChatThreadMessages')
+export class AdminChatThreadMessagesDTO {
+ @Field(() => AdminWorkspaceChatThreadDTO)
+ thread: AdminWorkspaceChatThreadDTO;
+
+ @Field(() => [AdminChatMessageDTO])
+ messages: AdminChatMessageDTO[];
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-recent-user.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-recent-user.dto.ts
new file mode 100644
index 00000000000..2fc39a30f94
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-recent-user.dto.ts
@@ -0,0 +1,13 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+import { UserInfoDTO } from 'src/engine/core-modules/admin-panel/dtos/user-lookup.dto';
+
+@ObjectType('AdminPanelRecentUser')
+export class AdminPanelRecentUserDTO extends UserInfoDTO {
+ @Field(() => String, { nullable: true })
+ workspaceName?: string | null;
+
+ @Field(() => UUIDScalarType, { nullable: true })
+ workspaceId?: string | null;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-top-workspace.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-top-workspace.dto.ts
new file mode 100644
index 00000000000..33f9ff5c577
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-top-workspace.dto.ts
@@ -0,0 +1,18 @@
+import { Field, Int, ObjectType } from '@nestjs/graphql';
+
+import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+
+@ObjectType('AdminPanelTopWorkspace')
+export class AdminPanelTopWorkspaceDTO {
+ @Field(() => UUIDScalarType)
+ id: string;
+
+ @Field(() => String)
+ name: string;
+
+ @Field(() => Int)
+ totalUsers: number;
+
+ @Field(() => String)
+ subdomain: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-workspace-chat-thread.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-workspace-chat-thread.dto.ts
new file mode 100644
index 00000000000..1701108c6dc
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-workspace-chat-thread.dto.ts
@@ -0,0 +1,27 @@
+import { Field, Int, ObjectType } from '@nestjs/graphql';
+
+import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+
+@ObjectType('AdminWorkspaceChatThread')
+export class AdminWorkspaceChatThreadDTO {
+ @Field(() => UUIDScalarType)
+ id: string;
+
+ @Field(() => String, { nullable: true })
+ title: string | null;
+
+ @Field(() => Int)
+ totalInputTokens: number;
+
+ @Field(() => Int)
+ totalOutputTokens: number;
+
+ @Field(() => Int)
+ conversationSize: number;
+
+ @Field(() => Date)
+ createdAt: Date;
+
+ @Field(() => Date)
+ updatedAt: Date;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.dto.ts
index 8dd2b2ad39c..efc5557f4ad 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.dto.ts
@@ -1,11 +1,13 @@
import { Field, ObjectType } from '@nestjs/graphql';
+import { WorkspaceActivationStatus } from 'twenty-shared/workspace';
+
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { FeatureFlagDTO } from 'src/engine/core-modules/feature-flag/dtos/feature-flag.dto';
import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
@ObjectType('UserInfo')
-class UserInfoDTO {
+export class UserInfoDTO {
@Field(() => UUIDScalarType)
id: string;
@@ -17,6 +19,9 @@ class UserInfoDTO {
@Field(() => String, { nullable: true })
lastName?: string;
+
+ @Field(() => Date)
+ createdAt: Date;
}
@ObjectType('WorkspaceInfo')
@@ -36,6 +41,12 @@ class WorkspaceInfoDTO {
@Field(() => Number)
totalUsers: number;
+ @Field(() => WorkspaceActivationStatus)
+ activationStatus: WorkspaceActivationStatus;
+
+ @Field(() => Date)
+ createdAt: Date;
+
@Field(() => WorkspaceUrlsDTO)
workspaceUrls: WorkspaceUrlsDTO;
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/enums/agent-message-role.enum.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/enums/agent-message-role.enum.ts
new file mode 100644
index 00000000000..2c7a925edf4
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/enums/agent-message-role.enum.ts
@@ -0,0 +1,8 @@
+import { registerEnumType } from '@nestjs/graphql';
+
+import { AgentMessageRole } from 'src/engine/metadata-modules/ai/ai-agent-execution/entities/agent-message.entity';
+
+registerEnumType(AgentMessageRole, {
+ name: 'AgentMessageRole',
+ description: 'Role of a message in a chat thread',
+});
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-chat.service.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-chat.service.ts
new file mode 100644
index 00000000000..46ee9bc5b69
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-chat.service.ts
@@ -0,0 +1,107 @@
+import { Injectable } from '@nestjs/common';
+import { InjectRepository } from '@nestjs/typeorm';
+
+import { Repository } from 'typeorm';
+
+import { type AdminChatMessageDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-chat-message.dto';
+import { type AdminWorkspaceChatThreadDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-workspace-chat-thread.dto';
+import { UserInputError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
+import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
+import { AgentChatThreadEntity } from 'src/engine/metadata-modules/ai/ai-chat/entities/agent-chat-thread.entity';
+import { AgentMessageEntity } from 'src/engine/metadata-modules/ai/ai-agent-execution/entities/agent-message.entity';
+
+@Injectable()
+export class AdminPanelChatService {
+ constructor(
+ @InjectRepository(WorkspaceEntity)
+ private readonly workspaceRepository: Repository<WorkspaceEntity>,
+ @InjectRepository(AgentChatThreadEntity)
+ private readonly agentChatThreadRepository: Repository<AgentChatThreadEntity>,
+ @InjectRepository(AgentMessageEntity)
+ private readonly agentMessageRepository: Repository<AgentMessageEntity>,
+ ) {}
+
+ private async assertWorkspaceAllowsImpersonation(
+ workspaceId: string,
+ ): Promise<void> {
+ const workspace = await this.workspaceRepository.findOne({
+ where: { id: workspaceId },
+ select: { id: true, allowImpersonation: true },
+ });
+
+ if (!workspace) {
+ throw new UserInputError('Workspace not found');
+ }
+
+ if (!workspace.allowImpersonation) {
+ throw new UserInputError('This workspace has not enabled support access');
+ }
+ }
+
+ async getWorkspaceChatThreads(
+ workspaceId: string,
+ ): Promise<AdminWorkspaceChatThreadDTO[]> {
+ await this.assertWorkspaceAllowsImpersonation(workspaceId);
+
+ const threads = await this.agentChatThreadRepository.find({
+ where: { workspaceId },
+ order: { updatedAt: 'DESC' },
+ take: 100,
+ });
+
+ return threads.map((thread) => ({
+ id: thread.id,
+ title: thread.title,
+ totalInputTokens: thread.totalInputTokens,
+ totalOutputTokens: thread.totalOutputTokens,
+ conversationSize: thread.conversationSize,
+ createdAt: thread.createdAt,
+ updatedAt: thread.updatedAt,
+ }));
+ }
+
+ async getChatThreadMessages(threadId: string): Promise<{
+ thread: AdminWorkspaceChatThreadDTO;
+ messages: AdminChatMessageDTO[];
+ }> {
+ const thread = await this.agentChatThreadRepository.findOne({
+ where: { id: threadId },
+ });
+
+ if (!thread) {
+ throw new UserInputError('Thread not found');
+ }
+
+ await this.assertWorkspaceAllowsImpersonation(thread.workspaceId);
+
+ const messages = await this.agentMessageRepository.find({
+ where: { threadId },
+ relations: { parts: true },
+ order: { createdAt: 'ASC' },
+ });
+
+ return {
+ thread: {
+ id: thread.id,
+ title: thread.title,
+ totalInputTokens: thread.totalInputTokens,
+ totalOutputTokens: thread.totalOutputTokens,
+ conversationSize: thread.conversationSize,
+ createdAt: thread.createdAt,
+ updatedAt: thread.updatedAt,
+ },
+ messages: messages.map((message) => ({
+ id: message.id,
+ role: message.role,
+ parts: (message.parts ?? [])
+ .sort((a, b) => a.orderIndex - b.orderIndex)
+ .map((part) => ({
+ type: part.type,
+ textContent: part.textContent,
+ toolName: part.toolName,
+ })),
+ createdAt: message.createdAt,
+ })),
+ };
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-config.service.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-config.service.ts
new file mode 100644
index 00000000000..ea0a626250e
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-config.service.ts
@@ -0,0 +1,91 @@
+import { Injectable } from '@nestjs/common';
+
+import { type ConfigVariableDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variable.dto';
+import { type ConfigVariablesGroupDataDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variables-group.dto';
+import { type ConfigVariablesDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variables.dto';
+import { type ConfigVariables } from 'src/engine/core-modules/twenty-config/config-variables';
+import { CONFIG_VARIABLES_GROUP_METADATA } from 'src/engine/core-modules/twenty-config/constants/config-variables-group-metadata';
+import { type ConfigVariablesGroup } from 'src/engine/core-modules/twenty-config/enums/config-variables-group.enum';
+import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
+
+@Injectable()
+export class AdminPanelConfigService {
+ constructor(private readonly twentyConfigService: TwentyConfigService) {}
+
+ getConfigVariablesGrouped(): ConfigVariablesDTO {
+ const rawEnvVars = this.twentyConfigService.getAll();
+ const groupedData = new Map<ConfigVariablesGroup, ConfigVariableDTO[]>();
+
+ for (const [varName, { value, metadata, source }] of Object.entries(
+ rawEnvVars,
+ )) {
+ const { group, description } = metadata;
+
+ if (metadata.isHiddenInAdminPanel) {
+ continue;
+ }
+
+ const envVar: ConfigVariableDTO = {
+ name: varName,
+ description,
+ value: value ?? null,
+ isSensitive: metadata.isSensitive ?? false,
+ isEnvOnly: metadata.isEnvOnly ?? false,
+ type: metadata.type,
+ options: metadata.options,
+ source,
+ };
+
+ if (!groupedData.has(group)) {
+ groupedData.set(group, []);
+ }
+
+ groupedData.get(group)?.push(envVar);
+ }
+
+ const groups: ConfigVariablesGroupDataDTO[] = Array.from(
+ groupedData.entries(),
+ )
+ .filter(
+ ([name]) => !CONFIG_VARIABLES_GROUP_METADATA[name].isHiddenInAdminPanel,
+ )
+ .sort((a, b) => {
+ const positionA = CONFIG_VARIABLES_GROUP_METADATA[a[0]].position;
+ const positionB = CONFIG_VARIABLES_GROUP_METADATA[b[0]].position;
+
+ return positionA - positionB;
+ })
+ .map(([name, variables]) => ({
+ name,
+ description: CONFIG_VARIABLES_GROUP_METADATA[name].description,
+ isHiddenOnLoad: CONFIG_VARIABLES_GROUP_METADATA[name].isHiddenOnLoad,
+ variables: variables.sort((a, b) => a.name.localeCompare(b.name)),
+ }));
+
+ return { groups };
+ }
+
+ getConfigVariable(key: string): ConfigVariableDTO {
+ const variableWithMetadata =
+ this.twentyConfigService.getVariableWithMetadata(
+ key as keyof ConfigVariables,
+ );
+
+ if (!variableWithMetadata) {
+ throw new Error(`Config variable ${key} not found`);
+ }
+
+ const { value, metadata, source } = variableWithMetadata;
+
+ return {
+ name: key,
+ description: metadata.description ?? '',
+ value: value ?? null,
+ isSensitive: metadata.isSensitive ?? false,
+ isEnvOnly: metadata.isEnvOnly ?? false,
+ type: metadata.type,
+ options: metadata.options,
+ source,
+ };
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-statistics.service.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-statistics.service.ts
new file mode 100644
index 00000000000..cfb7e3b19cd
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-statistics.service.ts
@@ -0,0 +1,107 @@
+import { Injectable } from '@nestjs/common';
+import { InjectRepository } from '@nestjs/typeorm';
+
+import { Repository } from 'typeorm';
+
+import { type AdminPanelRecentUserDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-panel-recent-user.dto';
+import { type AdminPanelTopWorkspaceDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-panel-top-workspace.dto';
+import { UserEntity } from 'src/engine/core-modules/user/user.entity';
+import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
+
+@Injectable()
+export class AdminPanelStatisticsService {
+ constructor(
+ @InjectRepository(UserEntity)
+ private readonly userRepository: Repository<UserEntity>,
+ @InjectRepository(WorkspaceEntity)
+ private readonly workspaceRepository: Repository<WorkspaceEntity>,
+ ) {}
+
+ async getRecentUsers(
+ searchTerm?: string,
+ ): Promise<AdminPanelRecentUserDTO[]> {
+ let whereClause = 'u."deletedAt" IS NULL';
+ const params: unknown[] = [];
+
+ if (searchTerm && searchTerm.trim().length > 0) {
+ const term = `%${searchTerm.trim()}%`;
+
+ whereClause += ` AND (u.email ILIKE $1 OR CONCAT(u."firstName", ' ', u."lastName") ILIKE $1 OR u.id::text ILIKE $1)`;
+ params.push(term);
+ }
+
+ const results = await this.userRepository.manager.query(
+ `SELECT * FROM (
+ SELECT DISTINCT ON (u.id) u.id, u.email, u."firstName", u."lastName", u."createdAt",
+ w."displayName" AS "workspaceName", w.id AS "workspaceId"
+ FROM core."user" u
+ LEFT JOIN core."userWorkspace" uw ON uw."userId" = u.id AND uw."deletedAt" IS NULL
+ LEFT JOIN core.workspace w ON w.id = uw."workspaceId" AND w."deletedAt" IS NULL
+ WHERE ${whereClause}
+ ORDER BY u.id, u."createdAt" DESC
+ ) sub
+ ORDER BY sub."createdAt" DESC
+ LIMIT 10`,
+ params,
+ );
+
+ return results.map(
+ (row: {
+ id: string;
+ email: string;
+ firstName: string | null;
+ lastName: string | null;
+ createdAt: Date;
+ workspaceName: string | null;
+ workspaceId: string | null;
+ }) => ({
+ id: row.id,
+ email: row.email,
+ firstName: row.firstName || null,
+ lastName: row.lastName || null,
+ createdAt: row.createdAt,
+ workspaceName: row.workspaceName ?? null,
+ workspaceId: row.workspaceId ?? null,
+ }),
+ );
+ }
+
+ async getTopWorkspaces(
+ searchTerm?: string,
+ ): Promise<AdminPanelTopWorkspaceDTO[]> {
+ let whereClause = 'w."deletedAt" IS NULL';
+ const params: unknown[] = [];
+
+ if (searchTerm && searchTerm.trim().length > 0) {
+ const term = `%${searchTerm.trim()}%`;
+
+ whereClause += ` AND (w."displayName" ILIKE $1 OR w.subdomain ILIKE $1 OR w.id::text ILIKE $1)`;
+ params.push(term);
+ }
+
+ const results = await this.workspaceRepository.manager.query(
+ `SELECT w.id, w."displayName" AS name, w.subdomain, COUNT(uw.id)::int AS "totalUsers"
+ FROM core.workspace w
+ LEFT JOIN core."userWorkspace" uw ON uw."workspaceId" = w.id AND uw."deletedAt" IS NULL
+ WHERE ${whereClause}
+ GROUP BY w.id
+ ORDER BY "totalUsers" DESC
+ LIMIT 10`,
+ params,
+ );
+
+ return results.map(
+ (row: {
+ id: string;
+ name: string;
+ subdomain: string;
+ totalUsers: number;
+ }) => ({
+ id: row.id,
+ name: row.name ?? '',
+ subdomain: row.subdomain ?? '',
+ totalUsers: row.totalUsers,
+ }),
+ );
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-user-lookup.service.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-user-lookup.service.ts
new file mode 100644
index 00000000000..5b88c581fdb
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-user-lookup.service.ts
@@ -0,0 +1,189 @@
+import { Injectable } from '@nestjs/common';
+import { InjectRepository } from '@nestjs/typeorm';
+
+import { msg } from '@lingui/core/macro';
+import { FeatureFlagKey, FileFolder } from 'twenty-shared/types';
+import { isDefined } from 'twenty-shared/utils';
+import { Repository } from 'typeorm';
+
+import { type UserLookup } from 'src/engine/core-modules/admin-panel/dtos/user-lookup.dto';
+import {
+ AuthException,
+ AuthExceptionCode,
+} from 'src/engine/core-modules/auth/auth.exception';
+import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
+import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
+import { FileUrlService } from 'src/engine/core-modules/file/file-url/file-url.service';
+import { UserEntity } from 'src/engine/core-modules/user/user.entity';
+import { UserWorkspaceEntity } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
+import { userValidator } from 'src/engine/core-modules/user/user.validate';
+import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
+
+@Injectable()
+export class AdminPanelUserLookupService {
+ constructor(
+ private readonly workspaceDomainsService: WorkspaceDomainsService,
+ private readonly fileUrlService: FileUrlService,
+ @InjectRepository(UserEntity)
+ private readonly userRepository: Repository<UserEntity>,
+ @InjectRepository(WorkspaceEntity)
+ private readonly workspaceRepository: Repository<WorkspaceEntity>,
+ @InjectRepository(UserWorkspaceEntity)
+ private readonly userWorkspaceRepository: Repository<UserWorkspaceEntity>,
+ @InjectRepository(FeatureFlagEntity)
+ private readonly featureFlagRepository: Repository<FeatureFlagEntity>,
+ ) {}
+
+ async userLookup(userIdentifier: string): Promise<UserLookup> {
+ const isEmail = userIdentifier.includes('@');
+ const normalizedIdentifier = isEmail
+ ? userIdentifier.toLowerCase()
+ : userIdentifier;
+
+ const targetUser = await this.userRepository.findOne({
+ where: isEmail
+ ? { email: normalizedIdentifier }
+ : { id: normalizedIdentifier },
+ relations: {
+ userWorkspaces: {
+ workspace: {
+ workspaceUsers: {
+ user: true,
+ },
+ featureFlags: true,
+ },
+ },
+ },
+ });
+
+ userValidator.assertIsDefinedOrThrow(
+ targetUser,
+ new AuthException('User not found', AuthExceptionCode.INVALID_INPUT, {
+ userFriendlyMessage: msg`User not found. Please check the email or ID.`,
+ }),
+ );
+
+ const allFeatureFlagKeys = Object.values(FeatureFlagKey);
+
+ return {
+ user: {
+ id: targetUser.id,
+ email: targetUser.email,
+ firstName: targetUser.firstName,
+ lastName: targetUser.lastName,
+ createdAt: targetUser.createdAt,
+ },
+ workspaces: targetUser.userWorkspaces.map((userWorkspace) => ({
+ id: userWorkspace.workspace.id,
+ name: userWorkspace.workspace.displayName ?? '',
+ totalUsers: userWorkspace.workspace.workspaceUsers.length,
+ activationStatus: userWorkspace.workspace.activationStatus,
+ createdAt: userWorkspace.workspace.createdAt,
+ logo: isDefined(userWorkspace.workspace.logoFileId)
+ ? this.fileUrlService.signFileByIdUrl({
+ fileId: userWorkspace.workspace.logoFileId,
+ workspaceId: userWorkspace.workspace.id,
+ fileFolder: FileFolder.CorePicture,
+ })
+ : undefined,
+ allowImpersonation: userWorkspace.workspace.allowImpersonation,
+ workspaceUrls: this.workspaceDomainsService.getWorkspaceUrls({
+ subdomain: userWorkspace.workspace.subdomain,
+ customDomain: userWorkspace.workspace.customDomain,
+ isCustomDomainEnabled: userWorkspace.workspace.isCustomDomainEnabled,
+ }),
+ users: userWorkspace.workspace.workspaceUsers
+ .filter((workspaceUser) => isDefined(workspaceUser.user))
+ .map((workspaceUser) => ({
+ id: workspaceUser.user.id,
+ email: workspaceUser.user.email,
+ firstName: workspaceUser.user.firstName,
+ lastName: workspaceUser.user.lastName,
+ createdAt: workspaceUser.user.createdAt,
+ })),
+ featureFlags: allFeatureFlagKeys.map((key) => ({
+ key,
+ value:
+ userWorkspace.workspace.featureFlags?.find(
+ (flag) => flag.key === key,
+ )?.value ?? false,
+ })),
+ })),
+ };
+ }
+
+ async workspaceLookup(workspaceId: string): Promise<UserLookup> {
+ const workspace = await this.workspaceRepository.findOne({
+ where: { id: workspaceId },
+ });
+
+ if (!workspace) {
+ throw new AuthException(
+ 'Workspace not found',
+ AuthExceptionCode.INVALID_INPUT,
+ {
+ userFriendlyMessage: msg`Workspace not found. Please check the ID.`,
+ },
+ );
+ }
+
+ const [workspaceUsers, featureFlags] = await Promise.all([
+ this.userWorkspaceRepository.find({
+ where: { workspaceId },
+ relations: { user: true },
+ }),
+ this.featureFlagRepository.find({
+ where: { workspaceId },
+ }),
+ ]);
+
+ const allFeatureFlagKeys = Object.values(FeatureFlagKey);
+
+ const workspaceInfo = {
+ id: workspace.id,
+ name: workspace.displayName ?? '',
+ totalUsers: workspaceUsers.length,
+ activationStatus: workspace.activationStatus,
+ createdAt: workspace.createdAt,
+ logo: isDefined(workspace.logoFileId)
+ ? this.fileUrlService.signFileByIdUrl({
+ fileId: workspace.logoFileId,
+ workspaceId: workspace.id,
+ fileFolder: FileFolder.CorePicture,
+ })
+ : undefined,
+ allowImpersonation: workspace.allowImpersonation,
+ workspaceUrls: this.workspaceDomainsService.getWorkspaceUrls({
+ subdomain: workspace.subdomain,
+ customDomain: workspace.customDomain,
+ isCustomDomainEnabled: workspace.isCustomDomainEnabled,
+ }),
+ users: workspaceUsers
+ .filter((wu) => isDefined(wu.user))
+ .map((wu) => ({
+ id: wu.user.id,
+ email: wu.user.email,
+ firstName: wu.user.firstName,
+ lastName: wu.user.lastName,
+ createdAt: wu.user.createdAt,
+ })),
+ featureFlags: allFeatureFlagKeys.map((key) => ({
+ key,
+ value: featureFlags.find((flag) => flag.key === key)?.value ?? false,
+ })),
+ };
+
+ const firstUser = workspaceUsers.find((wu) => isDefined(wu.user))?.user;
+
+ return {
+ user: {
+ id: firstUser?.id ?? '',
+ email: firstUser?.email ?? '',
+ firstName: firstUser?.firstName,
+ lastName: firstUser?.lastName,
+ createdAt: firstUser?.createdAt ?? new Date(),
+ },
+ workspaces: [workspaceInfo],
+ };
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-version.service.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-version.service.ts
new file mode 100644
index 00000000000..9e3857dbec6
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/services/admin-panel-version.service.ts
@@ -0,0 +1,50 @@
+import { Injectable } from '@nestjs/common';
+
+import semver from 'semver';
+import * as z from 'zod';
+
+import { type VersionInfoDTO } from 'src/engine/core-modules/admin-panel/dtos/version-info.dto';
+import { SecureHttpClientService } from 'src/engine/core-modules/secure-http-client/secure-http-client.service';
+import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
+
+@Injectable()
+export class AdminPanelVersionService {
+ constructor(
+ private readonly twentyConfigService: TwentyConfigService,
+ private readonly secureHttpClientService: SecureHttpClientService,
+ ) {}
+
+ async getVersionInfo(): Promise<VersionInfoDTO> {
+ const currentVersion = this.twentyConfigService.get('APP_VERSION');
+
+ try {
+ const httpClient = this.secureHttpClientService.getHttpClient();
+
+ const rawResponse = await httpClient.get<unknown>(
+ 'https://hub.docker.com/v2/repositories/twentycrm/twenty/tags?page_size=100',
+ );
+ const response = z
+ .object({
+ data: z.object({
+ results: z.array(z.object({ name: z.string() })),
+ }),
+ })
+ .parse(rawResponse);
+
+ const versions = response.data.results
+ .map((tag) => tag.name)
+ .filter((name) => name !== 'latest' && semver.valid(name));
+
+ if (versions.length === 0) {
+ return { currentVersion, latestVersion: 'latest' };
+ }
+
+ versions.sort((a, b) => semver.compare(b, a));
+ const latestVersion = versions[0];
+
+ return { currentVersion, latestVersion };
+ } catch {
+ return { currentVersion, latestVersion: 'latest' };
+ }
+ }
+}
diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/agent-chat.service.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/agent-chat.service.ts
index d45f665ad9c..678efa303ca 100644
--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/agent-chat.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-chat/services/agent-chat.service.ts
@@ -3,6 +3,7 @@ import { InjectRepository } from '@nestjs/typeorm';
import { ExtendedUIMessage } from 'twenty-shared/ai';
import { In, Repository } from 'typeorm';
+import type { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity';
import type { UIDataTypes, UIMessagePart, UITools } from 'ai';
@@ -122,18 +123,16 @@ export class AgentChatService {
let actualTurnId = turnId;
if (!actualTurnId) {
- const turn = this.turnRepository.create({
+ const turnInsertResult = await this.turnRepository.insert({
threadId,
agentId: agentId ?? null,
workspaceId,
});
- const savedTurn = await this.turnRepository.save(turn);
-
- actualTurnId = savedTurn.id;
+ actualTurnId = turnInsertResult.identifiers[0].id as string;
}
- const message = this.messageRepository.create({
+ const messageValues = {
...(id ? { id } : {}),
threadId,
turnId: actualTurnId,
@@ -141,21 +140,33 @@ export class AgentChatService {
agentId: agentId ?? null,
processedAt: new Date(),
workspaceId,
- });
+ };
- const savedMessage = await this.messageRepository.save(message);
+ const insertResult = await this.messageRepository.insert(messageValues);
+
+ const savedMessageId = (id ?? insertResult.identifiers[0].id) as string;
if (uiMessage.parts && uiMessage.parts.length > 0) {
const dbParts = mapUIMessagePartsToDBParts(
uiMessage.parts,
- savedMessage.id,
+ savedMessageId,
workspaceId,
);
- await this.messagePartRepository.save(dbParts);
+ await this.messagePartRepository.insert(
+ dbParts as QueryDeepPartialEntity<AgentMessagePartEntity>[],
+ );
}
- return savedMessage;
+ return {
+ id: savedMessageId,
+ threadId,
+ turnId: actualTurnId,
+ role: uiMessage.role as AgentMessageRole,
+ agentId: agentId ?? null,
+ processedAt: new Date(),
+ workspaceId,
+ } as AgentMessageEntity;
}
async getMessagesForThread(threadId: string, userWorkspaceId: string) {
@@ -193,7 +204,7 @@ export class AgentChatService {
fileIds?: string[];
workspaceId: string;
}): Promise<AgentMessageEntity> {
- const message = this.messageRepository.create({
+ const messageValues = {
...(id ? { id } : {}),
threadId,
turnId: null,
@@ -201,9 +212,11 @@ export class AgentChatService {
agentId: null,
status: AgentMessageStatus.QUEUED,
workspaceId,
- });
+ };
+
+ const insertResult = await this.messageRepository.insert(messageValues);
- const savedMessage = await this.messageRepository.save(message);
+ const savedMessageId = (id ?? insertResult.identifiers[0].id) as string;
const files =
fileIds && fileIds.length > 0
@@ -213,28 +226,29 @@ export class AgentChatService {
: [];
const parts = [
- this.messagePartRepository.create({
- messageId: savedMessage.id,
+ {
+ messageId: savedMessageId,
orderIndex: 0,
type: 'text',
textContent: text,
workspaceId,
- }),
- ...files.map((file, index) =>
- this.messagePartRepository.create({
- messageId: savedMessage.id,
- orderIndex: index + 1,
- type: 'file',
- fileId: file.id,
- fileFilename: file.path.split('/').pop() ?? null,
- workspaceId,
- }),
- ),
+ },
+ ...files.map((file, index) => ({
+ messageId: savedMessageId,
+ orderIndex: index + 1,
+ type: 'file',
+ fileId: file.id,
+ fileFilename: file.path.split('/').pop() ?? null,
+ workspaceId,
+ })),
];
- await this.messagePartRepository.save(parts);
+ await this.messagePartRepository.insert(parts);
- return savedMessage;
+ return {
+ id: savedMessageId,
+ ...messageValues,
+ } as AgentMessageEntity;
}
async getQueuedMessages(threadId: string): Promise<AgentMessageEntity[]> {
@@ -270,30 +284,30 @@ export class AgentChatService {
threadId: string,
workspaceId: string,
): Promise<string | null> {
- const turn = this.turnRepository.create({
+ const turnInsertResult = await this.turnRepository.insert({
threadId,
agentId: null,
workspaceId,
});
- const savedTurn = await this.turnRepository.save(turn);
+ const savedTurnId = turnInsertResult.identifiers[0].id as string;
const result = await this.messageRepository.update(
{ id: messageId, threadId, status: AgentMessageStatus.QUEUED },
{
status: AgentMessageStatus.SENT,
processedAt: new Date(),
- turnId: savedTurn.id,
+ turnId: savedTurnId,
},
);
if ((result.affected ?? 0) === 0) {
- await this.turnRepository.delete(savedTurn.id);
+ await this.turnRepository.delete(savedTurnId);
return null;
}
- return savedTurn.id;
+ return savedTurnId;
}
async generateTitleIfNeeded({
diff --git a/packages/twenty-shared/src/types/SettingsPath.ts b/packages/twenty-shared/src/types/SettingsPath.ts
index 87dde9c23b1..f17ef41ccce 100644
--- a/packages/twenty-shared/src/types/SettingsPath.ts
+++ b/packages/twenty-shared/src/types/SettingsPath.ts
@@ -69,6 +69,9 @@ export enum SettingsPath {
AdminPanelNewAiProvider = 'admin-panel/ai/new-provider',
AdminPanelAiProviderDetail = 'admin-panel/ai/providers/:providerName',
AdminPanelNewAiModel = 'admin-panel/ai/providers/:providerName/new-model',
+ AdminPanelUserDetail = 'admin-panel/users/:userId',
+ AdminPanelWorkspaceDetail = 'admin-panel/workspaces/:workspaceId',
+ AdminPanelWorkspaceChatThread = 'admin-panel/workspaces/:workspaceId/threads/:threadId',
Roles = 'roles',
RoleCreate = 'roles/create',