Skip to content

The open alternative to Salesforce, designed for AI.

Add queue management dashboard (#15202)

Félix Malfaitf7421c5fc0f9
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index ef076f26172..7d9f284adb8 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -115,8 +115,8 @@ export type AgentChatThread = {
updatedAt: Scalars['DateTime'];
};
-export type AgentHandoffDto = {
- __typename?: 'AgentHandoffDTO';
+export type AgentHandoff = {
+ __typename?: 'AgentHandoff';
description?: Maybe<Scalars['String']>;
id: Scalars['UUID'];
toAgent: Agent;
@@ -261,8 +261,8 @@ export type AuthorizeApp = {
redirectUrl: Scalars['String'];
};
-export type AutocompleteResultDto = {
- __typename?: 'AutocompleteResultDto';
+export type AutocompleteResult = {
+ __typename?: 'AutocompleteResult';
placeId: Scalars['String'];
text: Scalars['String'];
};
@@ -331,7 +331,7 @@ export type Billing = {
__typename?: 'Billing';
billingUrl?: Maybe<Scalars['String']>;
isBillingEnabled: Scalars['Boolean'];
- trialPeriods: Array<BillingTrialPeriodDto>;
+ trialPeriods: Array<BillingTrialPeriod>;
};
export type BillingEndTrialPeriodOutput = {
@@ -348,7 +348,7 @@ export type BillingLicensedProduct = BillingProductDto & {
images?: Maybe<Array<Scalars['String']>>;
metadata: BillingProductMetadata;
name: Scalars['String'];
- prices?: Maybe<Array<BillingPriceLicensedDto>>;
+ prices?: Maybe<Array<BillingPriceLicensed>>;
};
export type BillingMeteredProduct = BillingProductDto & {
@@ -357,7 +357,7 @@ export type BillingMeteredProduct = BillingProductDto & {
images?: Maybe<Array<Scalars['String']>>;
metadata: BillingProductMetadata;
name: Scalars['String'];
- prices?: Maybe<Array<BillingPriceMeteredDto>>;
+ prices?: Maybe<Array<BillingPriceMetered>>;
};
export type BillingMeteredProductUsageOutput = {
@@ -383,24 +383,24 @@ export type BillingPlanOutput = {
planKey: BillingPlanKey;
};
-export type BillingPriceLicensedDto = {
- __typename?: 'BillingPriceLicensedDTO';
+export type BillingPriceLicensed = {
+ __typename?: 'BillingPriceLicensed';
priceUsageType: BillingUsageType;
recurringInterval: SubscriptionInterval;
stripePriceId: Scalars['String'];
unitAmount: Scalars['Float'];
};
-export type BillingPriceMeteredDto = {
- __typename?: 'BillingPriceMeteredDTO';
+export type BillingPriceMetered = {
+ __typename?: 'BillingPriceMetered';
priceUsageType: BillingUsageType;
recurringInterval: SubscriptionInterval;
stripePriceId: Scalars['String'];
- tiers: Array<BillingPriceTierDto>;
+ tiers: Array<BillingPriceTier>;
};
-export type BillingPriceTierDto = {
- __typename?: 'BillingPriceTierDTO';
+export type BillingPriceTier = {
+ __typename?: 'BillingPriceTier';
flatAmount?: Maybe<Scalars['Float']>;
unitAmount?: Maybe<Scalars['Float']>;
upTo?: Maybe<Scalars['Float']>;
@@ -472,8 +472,8 @@ export type BillingSubscriptionSchedulePhaseItem = {
quantity?: Maybe<Scalars['Float']>;
};
-export type BillingTrialPeriodDto = {
- __typename?: 'BillingTrialPeriodDTO';
+export type BillingTrialPeriod = {
+ __typename?: 'BillingTrialPeriod';
duration: Scalars['Float'];
isCreditCardRequired: Scalars['Boolean'];
};
@@ -568,27 +568,27 @@ export enum ConfigVariableType {
}
export enum ConfigVariablesGroup {
- AnalyticsConfig = 'AnalyticsConfig',
- AwsSesSettings = 'AwsSesSettings',
- BillingConfig = 'BillingConfig',
- CaptchaConfig = 'CaptchaConfig',
- CloudflareConfig = 'CloudflareConfig',
- EmailSettings = 'EmailSettings',
- ExceptionHandler = 'ExceptionHandler',
- GoogleAuth = 'GoogleAuth',
+ ANALYTICS_CONFIG = 'ANALYTICS_CONFIG',
+ AWS_SES_SETTINGS = 'AWS_SES_SETTINGS',
+ BILLING_CONFIG = 'BILLING_CONFIG',
+ CAPTCHA_CONFIG = 'CAPTCHA_CONFIG',
+ CLOUDFLARE_CONFIG = 'CLOUDFLARE_CONFIG',
+ EMAIL_SETTINGS = 'EMAIL_SETTINGS',
+ EXCEPTION_HANDLER = 'EXCEPTION_HANDLER',
+ GOOGLE_AUTH = 'GOOGLE_AUTH',
LLM = 'LLM',
- Logging = 'Logging',
- Metering = 'Metering',
- MicrosoftAuth = 'MicrosoftAuth',
- Other = 'Other',
- RateLimiting = 'RateLimiting',
+ LOGGING = 'LOGGING',
+ METERING = 'METERING',
+ MICROSOFT_AUTH = 'MICROSOFT_AUTH',
+ OTHER = 'OTHER',
+ RATE_LIMITING = 'RATE_LIMITING',
+ SERVERLESS_CONFIG = 'SERVERLESS_CONFIG',
+ SERVER_CONFIG = 'SERVER_CONFIG',
SSL = 'SSL',
- ServerConfig = 'ServerConfig',
- ServerlessConfig = 'ServerlessConfig',
- StorageConfig = 'StorageConfig',
- SupportChatConfig = 'SupportChatConfig',
- TokensDuration = 'TokensDuration',
- TwoFactorAuthentication = 'TwoFactorAuthentication'
+ STORAGE_CONFIG = 'STORAGE_CONFIG',
+ SUPPORT_CHAT_CONFIG = 'SUPPORT_CHAT_CONFIG',
+ TOKENS_DURATION = 'TOKENS_DURATION',
+ TWO_FACTOR_AUTHENTICATION = 'TWO_FACTOR_AUTHENTICATION'
}
export type ConfigVariablesGroupData = {
@@ -1050,6 +1050,12 @@ export type DeleteApprovedAccessDomainInput = {
id: Scalars['UUID'];
};
+export type DeleteJobsResponse = {
+ __typename?: 'DeleteJobsResponse';
+ deletedCount: Scalars['Int'];
+ results: Array<JobOperationResult>;
+};
+
export type DeleteOneFieldInput = {
/** The id of the field to delete. */
id: Scalars['UUID'];
@@ -1644,6 +1650,24 @@ export type InvalidatePassword = {
success: Scalars['Boolean'];
};
+export type JobOperationResult = {
+ __typename?: 'JobOperationResult';
+ error?: Maybe<Scalars['String']>;
+ jobId: Scalars['String'];
+ success: Scalars['Boolean'];
+};
+
+/** Job state in the queue */
+export enum JobState {
+ ACTIVE = 'ACTIVE',
+ COMPLETED = 'COMPLETED',
+ DELAYED = 'DELAYED',
+ FAILED = 'FAILED',
+ PRIORITIZED = 'PRIORITIZED',
+ WAITING = 'WAITING',
+ WAITING_CHILDREN = 'WAITING_CHILDREN'
+}
+
export type LineChartConfiguration = {
__typename?: 'LineChartConfiguration';
aggregateFieldMetadataId: Scalars['UUID'];
@@ -1678,8 +1702,8 @@ export type LinksMetadata = {
secondaryLinks?: Maybe<Array<LinkMetadata>>;
};
-export type LocationDto = {
- __typename?: 'LocationDto';
+export type Location = {
+ __typename?: 'Location';
lat?: Maybe<Scalars['Float']>;
lng?: Maybe<Scalars['Float']>;
};
@@ -1765,6 +1789,7 @@ export type Mutation = {
deleteDatabaseConfigVariable: Scalars['Boolean'];
deleteEmailingDomain: Scalars['Boolean'];
deleteFile: File;
+ deleteJobs: DeleteJobsResponse;
deleteOneAgent: Agent;
deleteOneCronTrigger: CronTrigger;
deleteOneDatabaseEventTrigger: DatabaseEventTrigger;
@@ -1821,6 +1846,7 @@ export type Mutation = {
restorePageLayout: PageLayout;
restorePageLayoutTab: PageLayoutTab;
restorePageLayoutWidget: PageLayoutWidget;
+ retryJobs: RetryJobsResponse;
revokeApiKey?: Maybe<ApiKey>;
runWorkflowVersion: WorkflowRun;
saveImapSmtpCaldavAccount: ImapSmtpCaldavConnectionSuccess;
@@ -1872,10 +1898,10 @@ export type Mutation = {
updateWorkspace: Workspace;
updateWorkspaceFeatureFlag: Scalars['Boolean'];
updateWorkspaceMemberRole: WorkspaceMember;
- uploadFile: SignedFileDto;
- uploadImage: SignedFileDto;
- uploadProfilePicture: SignedFileDto;
- uploadWorkspaceLogo: SignedFileDto;
+ uploadFile: SignedFile;
+ uploadImage: SignedFile;
+ uploadProfilePicture: SignedFile;
+ uploadWorkspaceLogo: SignedFile;
upsertFieldPermissions: Array<FieldPermission>;
upsertObjectPermissions: Array<ObjectPermission>;
upsertPermissionFlags: Array<PermissionFlag>;
@@ -2174,6 +2200,12 @@ export type MutationDeleteFileArgs = {
};
+export type MutationDeleteJobsArgs = {
+ jobIds: Array<Scalars['String']>;
+ queueName: Scalars['String'];
+};
+
+
export type MutationDeleteOneAgentArgs = {
input: AgentIdInput;
};
@@ -2443,6 +2475,12 @@ export type MutationRestorePageLayoutWidgetArgs = {
};
+export type MutationRetryJobsArgs = {
+ jobIds: Array<Scalars['String']>;
+ queueName: Scalars['String'];
+};
+
+
export type MutationRevokeApiKeyArgs = {
input: RevokeApiKeyDto;
};
@@ -2907,8 +2945,8 @@ export type ObjectStandardOverrides = {
translations?: Maybe<Scalars['JSON']>;
};
-export type OnDbEventDto = {
- __typename?: 'OnDbEventDTO';
+export type OnDbEvent = {
+ __typename?: 'OnDbEvent';
action: DatabaseEventAction;
eventDate: Scalars['DateTime'];
objectNameSingular: Scalars['String'];
@@ -3031,11 +3069,11 @@ export type PieChartConfiguration = {
orderBy?: Maybe<GraphOrderBy>;
};
-export type PlaceDetailsResultDto = {
- __typename?: 'PlaceDetailsResultDto';
+export type PlaceDetailsResult = {
+ __typename?: 'PlaceDetailsResult';
city?: Maybe<Scalars['String']>;
country?: Maybe<Scalars['String']>;
- location?: Maybe<LocationDto>;
+ location?: Maybe<Location>;
postcode?: Maybe<Scalars['String']>;
state?: Maybe<Scalars['String']>;
};
@@ -3098,7 +3136,7 @@ export type Query = {
field: Field;
fields: FieldConnection;
findAgentHandoffTargets: Array<Agent>;
- findAgentHandoffs: Array<AgentHandoffDto>;
+ findAgentHandoffs: Array<AgentHandoff>;
findDistantTablesWithStatus: Array<RemoteTable>;
findManyAgents: Array<Agent>;
findManyApplications: Array<Application>;
@@ -3117,9 +3155,9 @@ export type Query = {
findOneServerlessFunction: ServerlessFunction;
findWorkspaceFromInviteHash: Workspace;
findWorkspaceInvitations: Array<WorkspaceInvitation>;
- getAddressDetails: PlaceDetailsResultDto;
+ getAddressDetails: PlaceDetailsResult;
getApprovedAccessDomains: Array<ApprovedAccessDomain>;
- getAutoCompleteAddress: Array<AutocompleteResultDto>;
+ getAutoCompleteAddress: Array<AutocompleteResult>;
getAvailablePackages: Scalars['JSON'];
getConfigVariablesGrouped: ConfigVariablesOutput;
getConnectedImapSmtpCaldavAccount: ConnectedImapSmtpCaldavAccount;
@@ -3147,6 +3185,7 @@ export type Query = {
getPageLayouts: Array<PageLayout>;
getPostgresCredentials?: Maybe<PostgresCredentials>;
getPublicWorkspaceDataByDomain: PublicWorkspaceDataOutput;
+ getQueueJobs: QueueJobsResponse;
getQueueMetrics: QueueMetricsData;
getRoles: Array<Role>;
getSSOIdentityProviders: Array<FindAvailableSsoidpOutput>;
@@ -3407,6 +3446,14 @@ export type QueryGetPublicWorkspaceDataByDomainArgs = {
};
+export type QueryGetQueueJobsArgs = {
+ limit?: InputMaybe<Scalars['Int']>;
+ offset?: InputMaybe<Scalars['Int']>;
+ queueName: Scalars['String'];
+ state: JobState;
+};
+
+
export type QueryGetQueueMetricsArgs = {
queueName: Scalars['String'];
timeRange?: InputMaybe<QueueMetricsTimeRange>;
@@ -3501,6 +3548,31 @@ export type QueryWebhookArgs = {
input: GetWebhookDto;
};
+export type QueueJob = {
+ __typename?: 'QueueJob';
+ attemptsMade: Scalars['Float'];
+ data?: Maybe<Scalars['JSON']>;
+ failedReason?: Maybe<Scalars['String']>;
+ finishedOn?: Maybe<Scalars['Float']>;
+ id: Scalars['String'];
+ logs?: Maybe<Array<Scalars['String']>>;
+ name: Scalars['String'];
+ processedOn?: Maybe<Scalars['Float']>;
+ returnValue?: Maybe<Scalars['JSON']>;
+ stackTrace?: Maybe<Array<Scalars['String']>>;
+ state: JobState;
+ timestamp?: Maybe<Scalars['Float']>;
+};
+
+export type QueueJobsResponse = {
+ __typename?: 'QueueJobsResponse';
+ count: Scalars['Float'];
+ hasMore: Scalars['Boolean'];
+ jobs: Array<QueueJob>;
+ retentionConfig: QueueRetentionConfig;
+ totalCount: Scalars['Float'];
+};
+
export type QueueMetricsData = {
__typename?: 'QueueMetricsData';
data: Array<QueueMetricsSeries>;
@@ -3530,6 +3602,14 @@ export enum QueueMetricsTimeRange {
TwelveHours = 'TwelveHours'
}
+export type QueueRetentionConfig = {
+ __typename?: 'QueueRetentionConfig';
+ completedMaxAge: Scalars['Float'];
+ completedMaxCount: Scalars['Float'];
+ failedMaxAge: Scalars['Float'];
+ failedMaxCount: Scalars['Float'];
+};
+
export type Relation = {
__typename?: 'Relation';
sourceFieldMetadata: Field;
@@ -3597,6 +3677,12 @@ export type ResendEmailVerificationTokenOutput = {
success: Scalars['Boolean'];
};
+export type RetryJobsResponse = {
+ __typename?: 'RetryJobsResponse';
+ results: Array<JobOperationResult>;
+ retriedCount: Scalars['Int'];
+};
+
export type RevokeApiKeyDto = {
id: Scalars['UUID'];
};
@@ -3797,8 +3883,8 @@ export type SignUpOutput = {
workspace: WorkspaceUrlsAndId;
};
-export type SignedFileDto = {
- __typename?: 'SignedFileDTO';
+export type SignedFile = {
+ __typename?: 'SignedFile';
path: Scalars['String'];
token: Scalars['String'];
};
@@ -3822,7 +3908,7 @@ export type SubmitFormStepInput = {
export type Subscription = {
__typename?: 'Subscription';
- onDbEvent: OnDbEventDto;
+ onDbEvent: OnDbEvent;
};
@@ -4780,7 +4866,7 @@ export type FindAgentHandoffsQueryVariables = Exact<{
}>;
-export type FindAgentHandoffsQuery = { __typename?: 'Query', findAgentHandoffs: Array<{ __typename?: 'AgentHandoffDTO', id: string, description?: string | null, toAgent: { __typename?: 'Agent', id: string, name: string, label: string, description?: string | null, icon?: string | null, modelId: string, prompt: string, isCustom: boolean, createdAt: string, updatedAt: string } }> };
+export type FindAgentHandoffsQuery = { __typename?: 'Query', findAgentHandoffs: Array<{ __typename?: 'AgentHandoff', id: string, description?: string | null, toAgent: { __typename?: 'Agent', id: string, name: string, label: string, description?: string | null, icon?: string | null, modelId: string, prompt: string, isCustom: boolean, createdAt: string, updatedAt: string } }> };
export type FindManyAgentsQueryVariables = Exact<{ [key: string]: never; }>;
@@ -4847,7 +4933,7 @@ export type UploadFileMutationVariables = Exact<{
}>;
-export type UploadFileMutation = { __typename?: 'Mutation', uploadFile: { __typename?: 'SignedFileDTO', path: string, token: string } };
+export type UploadFileMutation = { __typename?: 'Mutation', uploadFile: { __typename?: 'SignedFile', path: string, token: string } };
export type UploadImageMutationVariables = Exact<{
file: Scalars['Upload'];
@@ -4855,7 +4941,7 @@ export type UploadImageMutationVariables = Exact<{
}>;
-export type UploadImageMutation = { __typename?: 'Mutation', uploadImage: { __typename?: 'SignedFileDTO', path: string, token: string } };
+export type UploadImageMutation = { __typename?: 'Mutation', uploadImage: { __typename?: 'SignedFile', path: string, token: string } };
export type AuthTokenFragmentFragment = { __typename?: 'AuthToken', token: string, expiresAt: string };
@@ -5063,9 +5149,9 @@ export type ValidatePasswordResetTokenQueryVariables = Exact<{
export type ValidatePasswordResetTokenQuery = { __typename?: 'Query', validatePasswordResetToken: { __typename?: 'ValidatePasswordResetToken', id: string, email: string } };
-export type BillingPriceLicensedFragmentFragment = { __typename?: 'BillingPriceLicensedDTO', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType };
+export type BillingPriceLicensedFragmentFragment = { __typename?: 'BillingPriceLicensed', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType };
-export type BillingPriceMeteredFragmentFragment = { __typename?: 'BillingPriceMeteredDTO', priceUsageType: BillingUsageType, recurringInterval: SubscriptionInterval, stripePriceId: string, tiers: Array<{ __typename?: 'BillingPriceTierDTO', flatAmount?: number | null, unitAmount?: number | null, upTo?: number | null }> };
+export type BillingPriceMeteredFragmentFragment = { __typename?: 'BillingPriceMetered', priceUsageType: BillingUsageType, recurringInterval: SubscriptionInterval, stripePriceId: string, tiers: Array<{ __typename?: 'BillingPriceTier', flatAmount?: number | null, unitAmount?: number | null, upTo?: number | null }> };
export type BillingSubscriptionSchedulePhaseFragmentFragment = { __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> };
@@ -5133,7 +5219,7 @@ export type GetMeteredProductsUsageQuery = { __typename?: 'Query', getMeteredPro
export type ListPlansQueryVariables = Exact<{ [key: string]: never; }>;
-export type ListPlansQuery = { __typename?: 'Query', listPlans: Array<{ __typename?: 'BillingPlanOutput', planKey: BillingPlanKey, licensedProducts: Array<{ __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceLicensedDTO', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }>, meteredProducts: Array<{ __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceMeteredDTO', priceUsageType: BillingUsageType, recurringInterval: SubscriptionInterval, stripePriceId: string, tiers: Array<{ __typename?: 'BillingPriceTierDTO', flatAmount?: number | null, unitAmount?: number | null, upTo?: number | null }> }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }> }> };
+export type ListPlansQuery = { __typename?: 'Query', listPlans: Array<{ __typename?: 'BillingPlanOutput', planKey: BillingPlanKey, licensedProducts: Array<{ __typename?: 'BillingLicensedProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceLicensed', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }>, meteredProducts: Array<{ __typename?: 'BillingMeteredProduct', name: string, description: string, images?: Array<string> | null, prices?: Array<{ __typename?: 'BillingPriceMetered', priceUsageType: BillingUsageType, recurringInterval: SubscriptionInterval, stripePriceId: string, tiers: Array<{ __typename?: 'BillingPriceTier', flatAmount?: number | null, unitAmount?: number | null, upTo?: number | null }> }> | null, metadata: { __typename?: 'BillingProductMetadata', productKey: BillingProductKey, planKey: BillingPlanKey, priceUsageBased: BillingUsageType } }> }> };
export type RemoteServerFieldsFragment = { __typename?: 'RemoteServer', id: string, createdAt: string, foreignDataWrapperId: string, foreignDataWrapperOptions?: any | null, foreignDataWrapperType: string, updatedAt: string, schema?: string | null, label: string, userMappingOptions?: { __typename?: 'UserMappingOptionsUser', user?: string | null } | null };
@@ -5357,6 +5443,22 @@ export type GetVersionInfoQueryVariables = Exact<{ [key: string]: never; }>;
export type GetVersionInfoQuery = { __typename?: 'Query', versionInfo: { __typename?: 'VersionInfo', currentVersion?: string | null, latestVersion: string } };
+export type DeleteJobsMutationVariables = Exact<{
+ queueName: Scalars['String'];
+ jobIds: Array<Scalars['String']> | Scalars['String'];
+}>;
+
+
+export type DeleteJobsMutation = { __typename?: 'Mutation', deleteJobs: { __typename?: 'DeleteJobsResponse', deletedCount: number, results: Array<{ __typename?: 'JobOperationResult', jobId: string, success: boolean, error?: string | null }> } };
+
+export type RetryJobsMutationVariables = Exact<{
+ queueName: Scalars['String'];
+ jobIds: Array<Scalars['String']> | Scalars['String'];
+}>;
+
+
+export type RetryJobsMutation = { __typename?: 'Mutation', retryJobs: { __typename?: 'RetryJobsResponse', retriedCount: number, results: Array<{ __typename?: 'JobOperationResult', jobId: string, success: boolean, error?: string | null }> } };
+
export type GetIndicatorHealthStatusQueryVariables = Exact<{
indicatorId: HealthIndicatorId;
}>;
@@ -5364,6 +5466,16 @@ export type GetIndicatorHealthStatusQueryVariables = Exact<{
export type GetIndicatorHealthStatusQuery = { __typename?: 'Query', getIndicatorHealthStatus: { __typename?: 'AdminPanelHealthServiceData', id: HealthIndicatorId, label: string, description: string, status: AdminPanelHealthServiceStatus, errorMessage?: string | null, details?: string | null, queues?: Array<{ __typename?: 'AdminPanelWorkerQueueHealth', id: string, queueName: string, status: AdminPanelHealthServiceStatus }> | null } };
+export type GetQueueJobsQueryVariables = Exact<{
+ queueName: Scalars['String'];
+ state: JobState;
+ limit?: InputMaybe<Scalars['Int']>;
+ offset?: InputMaybe<Scalars['Int']>;
+}>;
+
+
+export type GetQueueJobsQuery = { __typename?: 'Query', getQueueJobs: { __typename?: 'QueueJobsResponse', count: number, totalCount: number, hasMore: boolean, jobs: Array<{ __typename?: 'QueueJob', id: string, name: string, data?: any | null, state: JobState, timestamp?: number | null, failedReason?: string | null, processedOn?: number | null, finishedOn?: number | null, attemptsMade: number, returnValue?: any | null, logs?: Array<string> | null, stackTrace?: Array<string> | null }>, retentionConfig: { __typename?: 'QueueRetentionConfig', completedMaxAge: number, completedMaxCount: number, failedMaxAge: number, failedMaxCount: number } } };
+
export type GetQueueMetricsQueryVariables = Exact<{
queueName: Scalars['String'];
timeRange?: InputMaybe<QueueMetricsTimeRange>;
@@ -5727,7 +5839,7 @@ export type UploadProfilePictureMutationVariables = Exact<{
}>;
-export type UploadProfilePictureMutation = { __typename?: 'Mutation', uploadProfilePicture: { __typename?: 'SignedFileDTO', path: string, token: string } };
+export type UploadProfilePictureMutation = { __typename?: 'Mutation', uploadProfilePicture: { __typename?: 'SignedFile', path: string, token: string } };
export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>;
@@ -6162,7 +6274,7 @@ export type UploadWorkspaceLogoMutationVariables = Exact<{
}>;
-export type UploadWorkspaceLogoMutation = { __typename?: 'Mutation', uploadWorkspaceLogo: { __typename?: 'SignedFileDTO', path: string, token: string } };
+export type UploadWorkspaceLogoMutation = { __typename?: 'Mutation', uploadWorkspaceLogo: { __typename?: 'SignedFile', path: string, token: string } };
export type CheckCustomDomainValidRecordsMutationVariables = Exact<{ [key: string]: never; }>;
@@ -6386,7 +6498,7 @@ export const AvailableSsoIdentityProvidersFragmentFragmentDoc = gql`
}
`;
export const BillingPriceLicensedFragmentFragmentDoc = gql`
- fragment BillingPriceLicensedFragment on BillingPriceLicensedDTO {
+ fragment BillingPriceLicensedFragment on BillingPriceLicensed {
stripePriceId
unitAmount
recurringInterval
@@ -6394,7 +6506,7 @@ export const BillingPriceLicensedFragmentFragmentDoc = gql`
}
`;
export const BillingPriceMeteredFragmentFragmentDoc = gql`
- fragment BillingPriceMeteredFragment on BillingPriceMeteredDTO {
+ fragment BillingPriceMeteredFragment on BillingPriceMetered {
priceUsageType
recurringInterval
stripePriceId
@@ -10183,6 +10295,84 @@ export function useGetVersionInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOpt
export type GetVersionInfoQueryHookResult = ReturnType<typeof useGetVersionInfoQuery>;
export type GetVersionInfoLazyQueryHookResult = ReturnType<typeof useGetVersionInfoLazyQuery>;
export type GetVersionInfoQueryResult = Apollo.QueryResult<GetVersionInfoQuery, GetVersionInfoQueryVariables>;
+export const DeleteJobsDocument = gql`
+ mutation DeleteJobs($queueName: String!, $jobIds: [String!]!) {
+ deleteJobs(queueName: $queueName, jobIds: $jobIds) {
+ deletedCount
+ results {
+ jobId
+ success
+ error
+ }
+ }
+}
+ `;
+export type DeleteJobsMutationFn = Apollo.MutationFunction<DeleteJobsMutation, DeleteJobsMutationVariables>;
+
+/**
+ * __useDeleteJobsMutation__
+ *
+ * To run a mutation, you first call `useDeleteJobsMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useDeleteJobsMutation` returns a tuple that includes:
+ * - A mutate function that you can call at any time to execute the mutation
+ * - An object with fields that represent the current status of the mutation's execution
+ *
+ * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
+ *
+ * @example
+ * const [deleteJobsMutation, { data, loading, error }] = useDeleteJobsMutation({
+ * variables: {
+ * queueName: // value for 'queueName'
+ * jobIds: // value for 'jobIds'
+ * },
+ * });
+ */
+export function useDeleteJobsMutation(baseOptions?: Apollo.MutationHookOptions<DeleteJobsMutation, DeleteJobsMutationVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useMutation<DeleteJobsMutation, DeleteJobsMutationVariables>(DeleteJobsDocument, options);
+ }
+export type DeleteJobsMutationHookResult = ReturnType<typeof useDeleteJobsMutation>;
+export type DeleteJobsMutationResult = Apollo.MutationResult<DeleteJobsMutation>;
+export type DeleteJobsMutationOptions = Apollo.BaseMutationOptions<DeleteJobsMutation, DeleteJobsMutationVariables>;
+export const RetryJobsDocument = gql`
+ mutation RetryJobs($queueName: String!, $jobIds: [String!]!) {
+ retryJobs(queueName: $queueName, jobIds: $jobIds) {
+ retriedCount
+ results {
+ jobId
+ success
+ error
+ }
+ }
+}
+ `;
+export type RetryJobsMutationFn = Apollo.MutationFunction<RetryJobsMutation, RetryJobsMutationVariables>;
+
+/**
+ * __useRetryJobsMutation__
+ *
+ * To run a mutation, you first call `useRetryJobsMutation` within a React component and pass it any options that fit your needs.
+ * When your component renders, `useRetryJobsMutation` returns a tuple that includes:
+ * - A mutate function that you can call at any time to execute the mutation
+ * - An object with fields that represent the current status of the mutation's execution
+ *
+ * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
+ *
+ * @example
+ * const [retryJobsMutation, { data, loading, error }] = useRetryJobsMutation({
+ * variables: {
+ * queueName: // value for 'queueName'
+ * jobIds: // value for 'jobIds'
+ * },
+ * });
+ */
+export function useRetryJobsMutation(baseOptions?: Apollo.MutationHookOptions<RetryJobsMutation, RetryJobsMutationVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useMutation<RetryJobsMutation, RetryJobsMutationVariables>(RetryJobsDocument, options);
+ }
+export type RetryJobsMutationHookResult = ReturnType<typeof useRetryJobsMutation>;
+export type RetryJobsMutationResult = Apollo.MutationResult<RetryJobsMutation>;
+export type RetryJobsMutationOptions = Apollo.BaseMutationOptions<RetryJobsMutation, RetryJobsMutationVariables>;
export const GetIndicatorHealthStatusDocument = gql`
query GetIndicatorHealthStatus($indicatorId: HealthIndicatorId!) {
getIndicatorHealthStatus(indicatorId: $indicatorId) {
@@ -10228,6 +10418,71 @@ export function useGetIndicatorHealthStatusLazyQuery(baseOptions?: Apollo.LazyQu
export type GetIndicatorHealthStatusQueryHookResult = ReturnType<typeof useGetIndicatorHealthStatusQuery>;
export type GetIndicatorHealthStatusLazyQueryHookResult = ReturnType<typeof useGetIndicatorHealthStatusLazyQuery>;
export type GetIndicatorHealthStatusQueryResult = Apollo.QueryResult<GetIndicatorHealthStatusQuery, GetIndicatorHealthStatusQueryVariables>;
+export const GetQueueJobsDocument = gql`
+ query GetQueueJobs($queueName: String!, $state: JobState!, $limit: Int, $offset: Int) {
+ getQueueJobs(
+ queueName: $queueName
+ state: $state
+ limit: $limit
+ offset: $offset
+ ) {
+ jobs {
+ id
+ name
+ data
+ state
+ timestamp
+ failedReason
+ processedOn
+ finishedOn
+ attemptsMade
+ returnValue
+ logs
+ stackTrace
+ }
+ count
+ totalCount
+ hasMore
+ retentionConfig {
+ completedMaxAge
+ completedMaxCount
+ failedMaxAge
+ failedMaxCount
+ }
+ }
+}
+ `;
+
+/**
+ * __useGetQueueJobsQuery__
+ *
+ * To run a query within a React component, call `useGetQueueJobsQuery` and pass it any options that fit your needs.
+ * When your component renders, `useGetQueueJobsQuery` returns an object from Apollo Client that contains loading, error, and data properties
+ * you can use to render your UI.
+ *
+ * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
+ *
+ * @example
+ * const { data, loading, error } = useGetQueueJobsQuery({
+ * variables: {
+ * queueName: // value for 'queueName'
+ * state: // value for 'state'
+ * limit: // value for 'limit'
+ * offset: // value for 'offset'
+ * },
+ * });
+ */
+export function useGetQueueJobsQuery(baseOptions: Apollo.QueryHookOptions<GetQueueJobsQuery, GetQueueJobsQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useQuery<GetQueueJobsQuery, GetQueueJobsQueryVariables>(GetQueueJobsDocument, options);
+ }
+export function useGetQueueJobsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetQueueJobsQuery, GetQueueJobsQueryVariables>) {
+ const options = {...defaultOptions, ...baseOptions}
+ return Apollo.useLazyQuery<GetQueueJobsQuery, GetQueueJobsQueryVariables>(GetQueueJobsDocument, options);
+ }
+export type GetQueueJobsQueryHookResult = ReturnType<typeof useGetQueueJobsQuery>;
+export type GetQueueJobsLazyQueryHookResult = ReturnType<typeof useGetQueueJobsLazyQuery>;
+export type GetQueueJobsQueryResult = Apollo.QueryResult<GetQueueJobsQuery, GetQueueJobsQueryVariables>;
export const GetQueueMetricsDocument = gql`
query GetQueueMetrics($queueName: String!, $timeRange: QueueMetricsTimeRange) {
getQueueMetrics(queueName: $queueName, timeRange: $timeRange) {
diff --git a/packages/twenty-front/src/generated/graphql.ts b/packages/twenty-front/src/generated/graphql.ts
index 6e0a4a84d20..0cd5591a018 100644
--- a/packages/twenty-front/src/generated/graphql.ts
+++ b/packages/twenty-front/src/generated/graphql.ts
@@ -115,8 +115,8 @@ export type AgentChatThread = {
updatedAt: Scalars['DateTime'];
};
-export type AgentHandoffDto = {
- __typename?: 'AgentHandoffDTO';
+export type AgentHandoff = {
+ __typename?: 'AgentHandoff';
description?: Maybe<Scalars['String']>;
id: Scalars['UUID'];
toAgent: Agent;
@@ -261,8 +261,8 @@ export type AuthorizeApp = {
redirectUrl: Scalars['String'];
};
-export type AutocompleteResultDto = {
- __typename?: 'AutocompleteResultDto';
+export type AutocompleteResult = {
+ __typename?: 'AutocompleteResult';
placeId: Scalars['String'];
text: Scalars['String'];
};
@@ -331,7 +331,7 @@ export type Billing = {
__typename?: 'Billing';
billingUrl?: Maybe<Scalars['String']>;
isBillingEnabled: Scalars['Boolean'];
- trialPeriods: Array<BillingTrialPeriodDto>;
+ trialPeriods: Array<BillingTrialPeriod>;
};
export type BillingEndTrialPeriodOutput = {
@@ -348,7 +348,7 @@ export type BillingLicensedProduct = BillingProductDto & {
images?: Maybe<Array<Scalars['String']>>;
metadata: BillingProductMetadata;
name: Scalars['String'];
- prices?: Maybe<Array<BillingPriceLicensedDto>>;
+ prices?: Maybe<Array<BillingPriceLicensed>>;
};
export type BillingMeteredProduct = BillingProductDto & {
@@ -357,7 +357,7 @@ export type BillingMeteredProduct = BillingProductDto & {
images?: Maybe<Array<Scalars['String']>>;
metadata: BillingProductMetadata;
name: Scalars['String'];
- prices?: Maybe<Array<BillingPriceMeteredDto>>;
+ prices?: Maybe<Array<BillingPriceMetered>>;
};
export type BillingMeteredProductUsageOutput = {
@@ -383,24 +383,24 @@ export type BillingPlanOutput = {
planKey: BillingPlanKey;
};
-export type BillingPriceLicensedDto = {
- __typename?: 'BillingPriceLicensedDTO';
+export type BillingPriceLicensed = {
+ __typename?: 'BillingPriceLicensed';
priceUsageType: BillingUsageType;
recurringInterval: SubscriptionInterval;
stripePriceId: Scalars['String'];
unitAmount: Scalars['Float'];
};
-export type BillingPriceMeteredDto = {
- __typename?: 'BillingPriceMeteredDTO';
+export type BillingPriceMetered = {
+ __typename?: 'BillingPriceMetered';
priceUsageType: BillingUsageType;
recurringInterval: SubscriptionInterval;
stripePriceId: Scalars['String'];
- tiers: Array<BillingPriceTierDto>;
+ tiers: Array<BillingPriceTier>;
};
-export type BillingPriceTierDto = {
- __typename?: 'BillingPriceTierDTO';
+export type BillingPriceTier = {
+ __typename?: 'BillingPriceTier';
flatAmount?: Maybe<Scalars['Float']>;
unitAmount?: Maybe<Scalars['Float']>;
upTo?: Maybe<Scalars['Float']>;
@@ -472,8 +472,8 @@ export type BillingSubscriptionSchedulePhaseItem = {
quantity?: Maybe<Scalars['Float']>;
};
-export type BillingTrialPeriodDto = {
- __typename?: 'BillingTrialPeriodDTO';
+export type BillingTrialPeriod = {
+ __typename?: 'BillingTrialPeriod';
duration: Scalars['Float'];
isCreditCardRequired: Scalars['Boolean'];
};
@@ -568,27 +568,27 @@ export enum ConfigVariableType {
}
export enum ConfigVariablesGroup {
- AnalyticsConfig = 'AnalyticsConfig',
- AwsSesSettings = 'AwsSesSettings',
- BillingConfig = 'BillingConfig',
- CaptchaConfig = 'CaptchaConfig',
- CloudflareConfig = 'CloudflareConfig',
- EmailSettings = 'EmailSettings',
- ExceptionHandler = 'ExceptionHandler',
- GoogleAuth = 'GoogleAuth',
+ ANALYTICS_CONFIG = 'ANALYTICS_CONFIG',
+ AWS_SES_SETTINGS = 'AWS_SES_SETTINGS',
+ BILLING_CONFIG = 'BILLING_CONFIG',
+ CAPTCHA_CONFIG = 'CAPTCHA_CONFIG',
+ CLOUDFLARE_CONFIG = 'CLOUDFLARE_CONFIG',
+ EMAIL_SETTINGS = 'EMAIL_SETTINGS',
+ EXCEPTION_HANDLER = 'EXCEPTION_HANDLER',
+ GOOGLE_AUTH = 'GOOGLE_AUTH',
LLM = 'LLM',
- Logging = 'Logging',
- Metering = 'Metering',
- MicrosoftAuth = 'MicrosoftAuth',
- Other = 'Other',
- RateLimiting = 'RateLimiting',
+ LOGGING = 'LOGGING',
+ METERING = 'METERING',
+ MICROSOFT_AUTH = 'MICROSOFT_AUTH',
+ OTHER = 'OTHER',
+ RATE_LIMITING = 'RATE_LIMITING',
+ SERVERLESS_CONFIG = 'SERVERLESS_CONFIG',
+ SERVER_CONFIG = 'SERVER_CONFIG',
SSL = 'SSL',
- ServerConfig = 'ServerConfig',
- ServerlessConfig = 'ServerlessConfig',
- StorageConfig = 'StorageConfig',
- SupportChatConfig = 'SupportChatConfig',
- TokensDuration = 'TokensDuration',
- TwoFactorAuthentication = 'TwoFactorAuthentication'
+ STORAGE_CONFIG = 'STORAGE_CONFIG',
+ SUPPORT_CHAT_CONFIG = 'SUPPORT_CHAT_CONFIG',
+ TOKENS_DURATION = 'TOKENS_DURATION',
+ TWO_FACTOR_AUTHENTICATION = 'TWO_FACTOR_AUTHENTICATION'
}
export type ConfigVariablesGroupData = {
@@ -1014,6 +1014,12 @@ export type DeleteApprovedAccessDomainInput = {
id: Scalars['UUID'];
};
+export type DeleteJobsResponse = {
+ __typename?: 'DeleteJobsResponse';
+ deletedCount: Scalars['Int'];
+ results: Array<JobOperationResult>;
+};
+
export type DeleteOneFieldInput = {
/** The id of the field to delete. */
id: Scalars['UUID'];
@@ -1601,6 +1607,24 @@ export type InvalidatePassword = {
success: Scalars['Boolean'];
};
+export type JobOperationResult = {
+ __typename?: 'JobOperationResult';
+ error?: Maybe<Scalars['String']>;
+ jobId: Scalars['String'];
+ success: Scalars['Boolean'];
+};
+
+/** Job state in the queue */
+export enum JobState {
+ ACTIVE = 'ACTIVE',
+ COMPLETED = 'COMPLETED',
+ DELAYED = 'DELAYED',
+ FAILED = 'FAILED',
+ PRIORITIZED = 'PRIORITIZED',
+ WAITING = 'WAITING',
+ WAITING_CHILDREN = 'WAITING_CHILDREN'
+}
+
export type LineChartConfiguration = {
__typename?: 'LineChartConfiguration';
aggregateFieldMetadataId: Scalars['UUID'];
@@ -1635,8 +1659,8 @@ export type LinksMetadata = {
secondaryLinks?: Maybe<Array<LinkMetadata>>;
};
-export type LocationDto = {
- __typename?: 'LocationDto';
+export type Location = {
+ __typename?: 'Location';
lat?: Maybe<Scalars['Float']>;
lng?: Maybe<Scalars['Float']>;
};
@@ -1721,6 +1745,7 @@ export type Mutation = {
deleteDatabaseConfigVariable: Scalars['Boolean'];
deleteEmailingDomain: Scalars['Boolean'];
deleteFile: File;
+ deleteJobs: DeleteJobsResponse;
deleteOneAgent: Agent;
deleteOneCronTrigger: CronTrigger;
deleteOneDatabaseEventTrigger: DatabaseEventTrigger;
@@ -1776,6 +1801,7 @@ export type Mutation = {
restorePageLayout: PageLayout;
restorePageLayoutTab: PageLayoutTab;
restorePageLayoutWidget: PageLayoutWidget;
+ retryJobs: RetryJobsResponse;
revokeApiKey?: Maybe<ApiKey>;
runWorkflowVersion: WorkflowRun;
saveImapSmtpCaldavAccount: ImapSmtpCaldavConnectionSuccess;
@@ -1823,10 +1849,10 @@ export type Mutation = {
updateWorkspace: Workspace;
updateWorkspaceFeatureFlag: Scalars['Boolean'];
updateWorkspaceMemberRole: WorkspaceMember;
- uploadFile: SignedFileDto;
- uploadImage: SignedFileDto;
- uploadProfilePicture: SignedFileDto;
- uploadWorkspaceLogo: SignedFileDto;
+ uploadFile: SignedFile;
+ uploadImage: SignedFile;
+ uploadProfilePicture: SignedFile;
+ uploadWorkspaceLogo: SignedFile;
upsertFieldPermissions: Array<FieldPermission>;
upsertObjectPermissions: Array<ObjectPermission>;
upsertPermissionFlags: Array<PermissionFlag>;
@@ -2110,6 +2136,12 @@ export type MutationDeleteFileArgs = {
};
+export type MutationDeleteJobsArgs = {
+ jobIds: Array<Scalars['String']>;
+ queueName: Scalars['String'];
+};
+
+
export type MutationDeleteOneAgentArgs = {
input: AgentIdInput;
};
@@ -2374,6 +2406,12 @@ export type MutationRestorePageLayoutWidgetArgs = {
};
+export type MutationRetryJobsArgs = {
+ jobIds: Array<Scalars['String']>;
+ queueName: Scalars['String'];
+};
+
+
export type MutationRevokeApiKeyArgs = {
input: RevokeApiKeyDto;
};
@@ -2818,8 +2856,8 @@ export type ObjectStandardOverrides = {
translations?: Maybe<Scalars['JSON']>;
};
-export type OnDbEventDto = {
- __typename?: 'OnDbEventDTO';
+export type OnDbEvent = {
+ __typename?: 'OnDbEvent';
action: DatabaseEventAction;
eventDate: Scalars['DateTime'];
objectNameSingular: Scalars['String'];
@@ -2942,11 +2980,11 @@ export type PieChartConfiguration = {
orderBy?: Maybe<GraphOrderBy>;
};
-export type PlaceDetailsResultDto = {
- __typename?: 'PlaceDetailsResultDto';
+export type PlaceDetailsResult = {
+ __typename?: 'PlaceDetailsResult';
city?: Maybe<Scalars['String']>;
country?: Maybe<Scalars['String']>;
- location?: Maybe<LocationDto>;
+ location?: Maybe<Location>;
postcode?: Maybe<Scalars['String']>;
state?: Maybe<Scalars['String']>;
};
@@ -3009,7 +3047,7 @@ export type Query = {
field: Field;
fields: FieldConnection;
findAgentHandoffTargets: Array<Agent>;
- findAgentHandoffs: Array<AgentHandoffDto>;
+ findAgentHandoffs: Array<AgentHandoff>;
findManyAgents: Array<Agent>;
findManyApplications: Array<Application>;
findManyCronTriggers: Array<CronTrigger>;
@@ -3025,9 +3063,9 @@ export type Query = {
findOneServerlessFunction: ServerlessFunction;
findWorkspaceFromInviteHash: Workspace;
findWorkspaceInvitations: Array<WorkspaceInvitation>;
- getAddressDetails: PlaceDetailsResultDto;
+ getAddressDetails: PlaceDetailsResult;
getApprovedAccessDomains: Array<ApprovedAccessDomain>;
- getAutoCompleteAddress: Array<AutocompleteResultDto>;
+ getAutoCompleteAddress: Array<AutocompleteResult>;
getAvailablePackages: Scalars['JSON'];
getConfigVariablesGrouped: ConfigVariablesOutput;
getConnectedImapSmtpCaldavAccount: ConnectedImapSmtpCaldavAccount;
@@ -3055,6 +3093,7 @@ export type Query = {
getPageLayouts: Array<PageLayout>;
getPostgresCredentials?: Maybe<PostgresCredentials>;
getPublicWorkspaceDataByDomain: PublicWorkspaceDataOutput;
+ getQueueJobs: QueueJobsResponse;
getQueueMetrics: QueueMetricsData;
getRoles: Array<Role>;
getSSOIdentityProviders: Array<FindAvailableSsoidpOutput>;
@@ -3289,6 +3328,14 @@ export type QueryGetPublicWorkspaceDataByDomainArgs = {
};
+export type QueryGetQueueJobsArgs = {
+ limit?: InputMaybe<Scalars['Int']>;
+ offset?: InputMaybe<Scalars['Int']>;
+ queueName: Scalars['String'];
+ state: JobState;
+};
+
+
export type QueryGetQueueMetricsArgs = {
queueName: Scalars['String'];
timeRange?: InputMaybe<QueueMetricsTimeRange>;
@@ -3361,6 +3408,31 @@ export type QueryWebhookArgs = {
input: GetWebhookDto;
};
+export type QueueJob = {
+ __typename?: 'QueueJob';
+ attemptsMade: Scalars['Float'];
+ data?: Maybe<Scalars['JSON']>;
+ failedReason?: Maybe<Scalars['String']>;
+ finishedOn?: Maybe<Scalars['Float']>;
+ id: Scalars['String'];
+ logs?: Maybe<Array<Scalars['String']>>;
+ name: Scalars['String'];
+ processedOn?: Maybe<Scalars['Float']>;
+ returnValue?: Maybe<Scalars['JSON']>;
+ stackTrace?: Maybe<Array<Scalars['String']>>;
+ state: JobState;
+ timestamp?: Maybe<Scalars['Float']>;
+};
+
+export type QueueJobsResponse = {
+ __typename?: 'QueueJobsResponse';
+ count: Scalars['Float'];
+ hasMore: Scalars['Boolean'];
+ jobs: Array<QueueJob>;
+ retentionConfig: QueueRetentionConfig;
+ totalCount: Scalars['Float'];
+};
+
export type QueueMetricsData = {
__typename?: 'QueueMetricsData';
data: Array<QueueMetricsSeries>;
@@ -3390,6 +3462,14 @@ export enum QueueMetricsTimeRange {
TwelveHours = 'TwelveHours'
}
+export type QueueRetentionConfig = {
+ __typename?: 'QueueRetentionConfig';
+ completedMaxAge: Scalars['Float'];
+ completedMaxCount: Scalars['Float'];
+ failedMaxAge: Scalars['Float'];
+ failedMaxCount: Scalars['Float'];
+};
+
export type Relation = {
__typename?: 'Relation';
sourceFieldMetadata: Field;
@@ -3443,6 +3523,12 @@ export type ResendEmailVerificationTokenOutput = {
success: Scalars['Boolean'];
};
+export type RetryJobsResponse = {
+ __typename?: 'RetryJobsResponse';
+ results: Array<JobOperationResult>;
+ retriedCount: Scalars['Int'];
+};
+
export type RevokeApiKeyDto = {
id: Scalars['UUID'];
};
@@ -3643,8 +3729,8 @@ export type SignUpOutput = {
workspace: WorkspaceUrlsAndId;
};
-export type SignedFileDto = {
- __typename?: 'SignedFileDTO';
+export type SignedFile = {
+ __typename?: 'SignedFile';
path: Scalars['String'];
token: Scalars['String'];
};
@@ -3668,7 +3754,7 @@ export type SubmitFormStepInput = {
export type Subscription = {
__typename?: 'Subscription';
- onDbEvent: OnDbEventDto;
+ onDbEvent: OnDbEvent;
};
@@ -4564,7 +4650,7 @@ export type OnDbEventSubscriptionVariables = Exact<{
}>;
-export type OnDbEventSubscription = { __typename?: 'Subscription', onDbEvent: { __typename?: 'OnDbEventDTO', eventDate: string, action: DatabaseEventAction, objectNameSingular: string, updatedFields?: Array<string> | null, record: any } };
+export type OnDbEventSubscription = { __typename?: 'Subscription', onDbEvent: { __typename?: 'OnDbEvent', eventDate: string, action: DatabaseEventAction, objectNameSingular: string, updatedFields?: Array<string> | null, record: any } };
export type ViewFieldFragmentFragment = { __typename?: 'CoreViewField', id: any, fieldMetadataId: any, viewId: any, isVisible: boolean, position: number, size: number, aggregateOperation?: AggregateOperations | null, createdAt: string, updatedAt: string, deletedAt?: string | null };
diff --git a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
index 76e6bfb8bd0..c6ed80bae26 100644
--- a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
+++ b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
@@ -350,6 +350,14 @@ const SettingsAdminIndicatorHealthStatus = lazy(() =>
})),
);
+const SettingsAdminQueueDetail = lazy(() =>
+ import('~/pages/settings/admin-panel/SettingsAdminQueueDetail').then(
+ (module) => ({
+ default: module.SettingsAdminQueueDetail,
+ }),
+ ),
+);
+
const SettingsAdminConfigVariableDetails = lazy(() =>
import(
'~/pages/settings/admin-panel/SettingsAdminConfigVariableDetails'
@@ -636,6 +644,10 @@ export const SettingsRoutes = ({ isAdminPageEnabled }: SettingsRoutesProps) => (
path={SettingsPath.AdminPanelIndicatorHealthStatus}
element={<SettingsAdminIndicatorHealthStatus />}
/>
+ <Route
+ path={SettingsPath.AdminPanelQueueDetail}
+ element={<SettingsAdminQueueDetail />}
+ />
<Route
path={SettingsPath.AdminPanelConfigVariableDetails}
diff --git a/packages/twenty-front/src/modules/billing/graphql/fragments/billingPriceLicensedFragment.ts b/packages/twenty-front/src/modules/billing/graphql/fragments/billingPriceLicensedFragment.ts
index 4a06ad4d4bb..85b4ea3d65a 100644
--- a/packages/twenty-front/src/modules/billing/graphql/fragments/billingPriceLicensedFragment.ts
+++ b/packages/twenty-front/src/modules/billing/graphql/fragments/billingPriceLicensedFragment.ts
@@ -1,7 +1,7 @@
import { gql } from '@apollo/client';
export const BILLING_PRICE_LICENSED_FRAGMENT = gql`
- fragment BillingPriceLicensedFragment on BillingPriceLicensedDTO {
+ fragment BillingPriceLicensedFragment on BillingPriceLicensed {
stripePriceId
unitAmount
recurringInterval
diff --git a/packages/twenty-front/src/modules/billing/graphql/fragments/billingPriceMeteredFragment.ts b/packages/twenty-front/src/modules/billing/graphql/fragments/billingPriceMeteredFragment.ts
index ba81fd52fae..8905122b011 100644
--- a/packages/twenty-front/src/modules/billing/graphql/fragments/billingPriceMeteredFragment.ts
+++ b/packages/twenty-front/src/modules/billing/graphql/fragments/billingPriceMeteredFragment.ts
@@ -1,7 +1,7 @@
import { gql } from '@apollo/client';
export const BILLING_PRICE_METERED_FRAGMENT = gql`
- fragment BillingPriceMeteredFragment on BillingPriceMeteredDTO {
+ fragment BillingPriceMeteredFragment on BillingPriceMetered {
priceUsageType
recurringInterval
stripePriceId
diff --git a/packages/twenty-front/src/modules/billing/hooks/useAllBillingPrices.ts b/packages/twenty-front/src/modules/billing/hooks/useAllBillingPrices.ts
index a4eeb1273f7..11c189c16dd 100644
--- a/packages/twenty-front/src/modules/billing/hooks/useAllBillingPrices.ts
+++ b/packages/twenty-front/src/modules/billing/hooks/useAllBillingPrices.ts
@@ -1,8 +1,8 @@
+import { usePlans } from '@/billing/hooks/usePlans';
import {
- type BillingPriceLicensedDto,
- type BillingPriceMeteredDto,
+ type BillingPriceLicensed,
+ type BillingPriceMetered,
} from '~/generated/graphql';
-import { usePlans } from '@/billing/hooks/usePlans';
export const useAllBillingPrices = () => {
const { listPlans } = usePlans();
@@ -13,7 +13,7 @@ export const useAllBillingPrices = () => {
({ prices }) => prices,
);
})
- .flat(2) as Array<BillingPriceLicensedDto | BillingPriceMeteredDto>;
+ .flat(2) as Array<BillingPriceLicensed | BillingPriceMetered>;
return { allBillingPrices };
};
diff --git a/packages/twenty-front/src/modules/billing/hooks/usePriceAndBillingUsageByPriceId.ts b/packages/twenty-front/src/modules/billing/hooks/usePriceAndBillingUsageByPriceId.ts
index 3ec8b286d0f..90b64dfc191 100644
--- a/packages/twenty-front/src/modules/billing/hooks/usePriceAndBillingUsageByPriceId.ts
+++ b/packages/twenty-front/src/modules/billing/hooks/usePriceAndBillingUsageByPriceId.ts
@@ -1,9 +1,9 @@
+import { isDefined } from 'twenty-shared/utils';
import {
- type BillingPriceLicensedDto,
- type BillingPriceMeteredDto,
+ type BillingPriceLicensed,
+ type BillingPriceMetered,
BillingUsageType,
} from '~/generated/graphql';
-import { isDefined } from 'twenty-shared/utils';
import { useAllBillingPrices } from './useAllBillingPrices';
export const usePriceAndBillingUsageByPriceId = () => {
@@ -13,18 +13,18 @@ export const usePriceAndBillingUsageByPriceId = () => {
priceId: string,
):
| {
- price: BillingPriceLicensedDto;
+ price: BillingPriceLicensed;
billingUsage: BillingUsageType.LICENSED;
}
| {
- price: BillingPriceMeteredDto;
+ price: BillingPriceMetered;
billingUsage: BillingUsageType.METERED;
} => {
const licensed = allBillingPrices.find(
(p) =>
p.priceUsageType === BillingUsageType.LICENSED &&
p.stripePriceId === priceId,
- ) as BillingPriceLicensedDto | undefined;
+ ) as BillingPriceLicensed | undefined;
if (isDefined(licensed))
return { price: licensed, billingUsage: BillingUsageType.LICENSED };
@@ -33,7 +33,7 @@ export const usePriceAndBillingUsageByPriceId = () => {
(p) =>
p.priceUsageType === BillingUsageType.METERED &&
p.stripePriceId === priceId,
- ) as BillingPriceMeteredDto | undefined;
+ ) as BillingPriceMetered | undefined;
if (isDefined(metered))
return { price: metered, billingUsage: BillingUsageType.METERED };
diff --git a/packages/twenty-front/src/modules/billing/hooks/useSplitPhaseItemsInPrices.ts b/packages/twenty-front/src/modules/billing/hooks/useSplitPhaseItemsInPrices.ts
index fb466f2ad0f..f8ff7f1ef57 100644
--- a/packages/twenty-front/src/modules/billing/hooks/useSplitPhaseItemsInPrices.ts
+++ b/packages/twenty-front/src/modules/billing/hooks/useSplitPhaseItemsInPrices.ts
@@ -1,10 +1,10 @@
+import { useNextBillingPhase } from '@/billing/hooks/useNextBillingPhase';
+import { usePriceAndBillingUsageByPriceId } from '@/billing/hooks/usePriceAndBillingUsageByPriceId';
+import { type MeteredBillingPrice } from '@/billing/types/billing-price-tiers.type';
import {
- type BillingPriceLicensedDto,
+ type BillingPriceLicensed,
BillingUsageType,
} from '~/generated/graphql';
-import { type MeteredBillingPrice } from '@/billing/types/billing-price-tiers.type';
-import { usePriceAndBillingUsageByPriceId } from '@/billing/hooks/usePriceAndBillingUsageByPriceId';
-import { useNextBillingPhase } from '@/billing/hooks/useNextBillingPhase';
export const useSplitPhaseItemsInPrices = () => {
const { nextBillingPhase } = useNextBillingPhase();
@@ -26,7 +26,7 @@ export const useSplitPhaseItemsInPrices = () => {
},
{} as {
nextMereredPrice: MeteredBillingPrice | undefined;
- nextLicensedPrice: BillingPriceLicensedDto | undefined;
+ nextLicensedPrice: BillingPriceLicensed | undefined;
},
);
diff --git a/packages/twenty-front/src/modules/billing/types/billing-price-tiers.type.ts b/packages/twenty-front/src/modules/billing/types/billing-price-tiers.type.ts
index 555bd56bfb1..64cbd7d0fbb 100644
--- a/packages/twenty-front/src/modules/billing/types/billing-price-tiers.type.ts
+++ b/packages/twenty-front/src/modules/billing/types/billing-price-tiers.type.ts
@@ -1,4 +1,4 @@
-import type { BillingPriceMeteredDto } from '~/generated/graphql';
+import type { BillingPriceMetered } from '~/generated/graphql';
export type BillingPriceTiers = [
{
@@ -14,6 +14,6 @@ export type BillingPriceTiers = [
];
// graphql does not support tuple so we need to create a new type
-export type MeteredBillingPrice = Omit<BillingPriceMeteredDto, 'tiers'> & {
+export type MeteredBillingPrice = Omit<BillingPriceMetered, 'tiers'> & {
tiers: BillingPriceTiers;
};
diff --git a/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx b/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx
index 24b5d862c59..ec6e2319f68 100644
--- a/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx
+++ b/packages/twenty-front/src/modules/favorites/components/PageFavoriteButton.tsx
@@ -1,5 +1,6 @@
-import { Button } from 'twenty-ui/input';
+import { t } from '@lingui/core/macro';
import { IconHeart, IconHeartOff } from 'twenty-ui/display';
+import { Button } from 'twenty-ui/input';
type PageFavoriteButtonProps = {
isFavorite: boolean;
@@ -10,7 +11,7 @@ export const PageFavoriteButton = ({
isFavorite,
onClick,
}: PageFavoriteButtonProps) => {
- const title = isFavorite ? 'Remove from favorites' : 'Add to favorites';
+ const title = isFavorite ? t`Remove from favorites` : t`Add to favorites`;
return (
<Button
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay.tsx
index d845c13fd1f..1d7358a665f 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/PageLayoutWidgetForbiddenDisplay.tsx
@@ -1,6 +1,6 @@
-import { type WidgetAccessDenialInfo } from '@/page-layout/widgets/types/WidgetAccessDenialInfo';
import { ForbiddenFieldDisplay } from '@/object-record/record-field/ui/meta-types/display/components/ForbiddenFieldDisplay';
-import { t } from '@lingui/core/macro';
+import { type WidgetAccessDenialInfo } from '@/page-layout/widgets/types/WidgetAccessDenialInfo';
+import { plural, t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { AppTooltip } from 'twenty-ui/display';
@@ -27,9 +27,10 @@ export const PageLayoutWidgetForbiddenDisplay = ({
restriction.fieldNames.length > 0
) {
const fieldsList = restriction.fieldNames.join(', ');
- const fieldWord =
- restriction.fieldNames.length === 1 ? 'field' : 'fields';
- return t`You do not have permission to access the ${fieldsList} ${fieldWord}`;
+ return plural(restriction.fieldNames.length, {
+ one: `You do not have permission to access the ${fieldsList} field`,
+ other: `You do not have permission to access the ${fieldsList} fields`,
+ });
}
return t`You do not have permission to view this widget`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/ConnectedAccountHealthStatus.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminConnectedAccountHealthStatus.tsx
similarity index 75%
rename from packages/twenty-front/src/modules/settings/admin-panel/health-status/components/ConnectedAccountHealthStatus.tsx
rename to packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminConnectedAccountHealthStatus.tsx
index ebb46574174..ea2180c35f4 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/ConnectedAccountHealthStatus.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminConnectedAccountHealthStatus.tsx
@@ -16,7 +16,7 @@ const StyledContainer = styled.div`
gap: ${({ theme }) => theme.spacing(8)};
`;
-export const ConnectedAccountHealthStatus = () => {
+export const SettingsAdminConnectedAccountHealthStatus = () => {
const { indicatorHealth } = useContext(SettingsAdminIndicatorHealthContext);
const details = indicatorHealth.details;
if (!details) {
@@ -32,21 +32,24 @@ export const ConnectedAccountHealthStatus = () => {
serviceDetails.calendarSync?.status ===
AdminPanelHealthServiceStatus.OUTAGE;
- const errorMessages = [];
- if (isMessageSyncDown) {
- errorMessages.push('Message Sync');
- }
- if (isCalendarSyncDown) {
- errorMessages.push('Calendar Sync');
- }
+ const getErrorMessage = () => {
+ if (isMessageSyncDown && isCalendarSyncDown) {
+ return t`Message Sync and Calendar Sync are not available because the service is down`;
+ }
+ if (isMessageSyncDown) {
+ return t`Message Sync is not available because the service is down`;
+ }
+ if (isCalendarSyncDown) {
+ return t`Calendar Sync is not available because the service is down`;
+ }
+ return null;
+ };
+
+ const errorMessage = getErrorMessage();
return (
<StyledContainer>
- {errorMessages.length > 0 && (
- <StyledErrorMessage>
- {`${errorMessages.join(' and ')} ${errorMessages.length > 1 ? 'are' : 'is'} not available because the service is down`}
- </StyledErrorMessage>
- )}
+ {errorMessage && <StyledErrorMessage>{errorMessage}</StyledErrorMessage>}
{!isMessageSyncDown && serviceDetails.messageSync?.details && (
<SettingsAdminHealthAccountSyncCountersTable
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminDeleteJobsConfirmationModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminDeleteJobsConfirmationModal.tsx
new file mode 100644
index 00000000000..dadb58cc664
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminDeleteJobsConfirmationModal.tsx
@@ -0,0 +1,38 @@
+import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
+import { plural, t } from '@lingui/core/macro';
+
+type SettingsAdminDeleteJobsConfirmationModalProps = {
+ modalId: string;
+ jobCount: number;
+ onConfirm: () => void;
+ onClose?: () => void;
+};
+
+export const SettingsAdminDeleteJobsConfirmationModal = ({
+ modalId,
+ jobCount,
+ onConfirm,
+ onClose,
+}: SettingsAdminDeleteJobsConfirmationModalProps) => {
+ const title = plural(jobCount, {
+ one: `Delete ${jobCount} Job`,
+ other: `Delete ${jobCount} Jobs`,
+ });
+
+ const subtitle = plural(jobCount, {
+ one: `This will permanently remove it from the queue. This action cannot be undone.`,
+ other: `This will permanently remove them from the queue. This action cannot be undone.`,
+ });
+
+ return (
+ <ConfirmationModal
+ modalId={modalId}
+ title={title}
+ subtitle={subtitle}
+ onConfirmClick={onConfirm}
+ onClose={onClose}
+ confirmButtonText={t`Delete`}
+ confirmButtonAccent="danger"
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatus.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatus.tsx
index 2928bafa06d..e5f0d2448bd 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatus.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatus.tsx
@@ -1,5 +1,5 @@
import { SettingsAdminTabSkeletonLoader } from '@/settings/admin-panel/components/SettingsAdminTabSkeletonLoader';
-import { SettingsHealthStatusListCard } from '@/settings/admin-panel/health-status/components/SettingsHealthStatusListCard';
+import { SettingsAdminHealthStatusListCard } from '@/settings/admin-panel/health-status/components/SettingsAdminHealthStatusListCard';
import { t } from '@lingui/core/macro';
import { H2Title } from 'twenty-ui/display';
import { Section } from 'twenty-ui/layout';
@@ -23,7 +23,7 @@ export const SettingsAdminHealthStatus = () => {
title={t`Health Status`}
description={t`How your system is doing`}
/>
- <SettingsHealthStatusListCard
+ <SettingsAdminHealthStatusListCard
services={services}
loading={loadingHealthStatus}
/>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsHealthStatusListCard.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatusListCard.tsx
similarity index 96%
rename from packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsHealthStatusListCard.tsx
rename to packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatusListCard.tsx
index a4c429c8102..e8ebf36a07d 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsHealthStatusListCard.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminHealthStatusListCard.tsx
@@ -25,7 +25,7 @@ const HealthStatusIcons: { [k in HealthIndicatorId]: IconComponent } = {
[HealthIndicatorId.app]: IconAppWindow,
};
-export const SettingsHealthStatusListCard = ({
+export const SettingsAdminHealthStatusListCard = ({
services,
loading,
}: {
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminIndicatorHealthStatusContent.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminIndicatorHealthStatusContent.tsx
index 48a73bd04ef..4a25e536351 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminIndicatorHealthStatusContent.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminIndicatorHealthStatusContent.tsx
@@ -1,6 +1,6 @@
-import { ConnectedAccountHealthStatus } from '@/settings/admin-panel/health-status/components/ConnectedAccountHealthStatus';
-import { JsonDataIndicatorHealthStatus } from '@/settings/admin-panel/health-status/components/JsonDataIndicatorHealthStatus';
-import { WorkerHealthStatus } from '@/settings/admin-panel/health-status/components/WorkerHealthStatus';
+import { SettingsAdminConnectedAccountHealthStatus } from '@/settings/admin-panel/health-status/components/SettingsAdminConnectedAccountHealthStatus';
+import { SettingsAdminJsonDataIndicatorHealthStatus } from '@/settings/admin-panel/health-status/components/SettingsAdminJsonDataIndicatorHealthStatus';
+import { SettingsAdminWorkerHealthStatus } from '@/settings/admin-panel/health-status/components/SettingsAdminWorkerHealthStatus';
import { useParams } from 'react-router-dom';
import { HealthIndicatorId } from '~/generated/graphql';
@@ -11,11 +11,11 @@ export const SettingsAdminIndicatorHealthStatusContent = () => {
case HealthIndicatorId.database:
case HealthIndicatorId.redis:
case HealthIndicatorId.app:
- return <JsonDataIndicatorHealthStatus />;
+ return <SettingsAdminJsonDataIndicatorHealthStatus />;
case HealthIndicatorId.worker:
- return <WorkerHealthStatus />;
+ return <SettingsAdminWorkerHealthStatus />;
case HealthIndicatorId.connectedAccount:
- return <ConnectedAccountHealthStatus />;
+ return <SettingsAdminConnectedAccountHealthStatus />;
default:
return null;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
new file mode 100644
index 00000000000..5ed6d536f97
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
@@ -0,0 +1,140 @@
+import styled from '@emotion/styled';
+import { t } from '@lingui/core/macro';
+import { JsonTree } from 'twenty-ui/json-visualizer';
+import { AnimatedExpandableContainer } from 'twenty-ui/layout';
+import { type QueueJob } from '~/generated-metadata/graphql';
+import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
+
+type SettingsAdminJobDetailsExpandableProps = {
+ job: QueueJob;
+ isExpanded: boolean;
+};
+
+const StyledDetailsContainer = styled.div`
+ background-color: ${({ theme }) => theme.background.secondary};
+ border-top: 1px solid ${({ theme }) => theme.border.color.medium};
+ padding: ${({ theme }) => theme.spacing(4)};
+`;
+
+const StyledSection = styled.div`
+ margin-bottom: ${({ theme }) => theme.spacing(4)};
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+`;
+
+const StyledSectionTitle = styled.div`
+ color: ${({ theme }) => theme.font.color.secondary};
+ font-size: ${({ theme }) => theme.font.size.sm};
+ font-weight: ${({ theme }) => theme.font.weight.medium};
+ margin-bottom: ${({ theme }) => theme.spacing(2)};
+`;
+
+const StyledPreformattedText = styled.pre`
+ background-color: ${({ theme }) => theme.background.primary};
+ border: 1px solid ${({ theme }) => theme.border.color.medium};
+ border-radius: ${({ theme }) => theme.border.radius.sm};
+ color: ${({ theme }) => theme.font.color.danger};
+ font-family: ${({ theme }) => theme.font.family};
+ font-size: ${({ theme }) => theme.font.size.sm};
+ margin: 0;
+ max-height: 300px;
+ overflow: auto;
+ padding: ${({ theme }) => theme.spacing(2)};
+ white-space: pre-wrap;
+ word-break: break-word;
+`;
+
+const StyledLogEntry = styled.div`
+ background-color: ${({ theme }) => theme.background.primary};
+ border: 1px solid ${({ theme }) => theme.border.color.medium};
+ border-radius: ${({ theme }) => theme.border.radius.sm};
+ font-family: ${({ theme }) => theme.font.family};
+ font-size: ${({ theme }) => theme.font.size.sm};
+ margin-bottom: ${({ theme }) => theme.spacing(1)};
+ padding: ${({ theme }) => theme.spacing(2)};
+`;
+
+export const SettingsAdminJobDetailsExpandable = ({
+ job,
+ isExpanded,
+}: SettingsAdminJobDetailsExpandableProps) => {
+ const { copyToClipboard } = useCopyToClipboard();
+
+ const hasData = job.data && Object.keys(job.data).length > 0;
+ const hasReturnValue =
+ job.returnValue && Object.keys(job.returnValue).length > 0;
+ const hasLogs = job.logs && job.logs.length > 0;
+ const hasStacktrace = job.stackTrace && job.stackTrace.length > 0;
+ const hasFailedReason = job.failedReason;
+
+ const isAnyNode = () => true;
+
+ return (
+ <AnimatedExpandableContainer
+ isExpanded={isExpanded}
+ dimension="height"
+ mode="scroll-height"
+ >
+ <StyledDetailsContainer>
+ {hasFailedReason && (
+ <StyledSection>
+ <StyledSectionTitle>{t`Error Message`}</StyledSectionTitle>
+ <StyledPreformattedText>{job.failedReason}</StyledPreformattedText>
+ </StyledSection>
+ )}
+
+ {hasStacktrace && job.stackTrace && (
+ <StyledSection>
+ <StyledSectionTitle>{t`Stack Trace`}</StyledSectionTitle>
+ <StyledPreformattedText>
+ {job.stackTrace.join('\n')}
+ </StyledPreformattedText>
+ </StyledSection>
+ )}
+
+ {hasReturnValue && (
+ <StyledSection>
+ <StyledSectionTitle>{t`Return Value`}</StyledSectionTitle>
+ <JsonTree
+ value={job.returnValue}
+ shouldExpandNodeInitially={isAnyNode}
+ emptyArrayLabel={t`Empty Array`}
+ emptyObjectLabel={t`Empty Object`}
+ emptyStringLabel={t`[empty string]`}
+ arrowButtonCollapsedLabel={t`Expand`}
+ arrowButtonExpandedLabel={t`Collapse`}
+ onNodeValueClick={copyToClipboard}
+ />
+ </StyledSection>
+ )}
+
+ {hasData && (
+ <StyledSection>
+ <StyledSectionTitle>{t`Job Data`}</StyledSectionTitle>
+ <JsonTree
+ value={job.data}
+ shouldExpandNodeInitially={isAnyNode}
+ emptyArrayLabel={t`Empty Array`}
+ emptyObjectLabel={t`Empty Object`}
+ emptyStringLabel={t`[empty string]`}
+ arrowButtonCollapsedLabel={t`Expand`}
+ arrowButtonExpandedLabel={t`Collapse`}
+ onNodeValueClick={copyToClipboard}
+ />
+ </StyledSection>
+ )}
+
+ {hasLogs && (
+ <StyledSection>
+ <StyledSectionTitle>{t`Logs`}</StyledSectionTitle>
+ {job.logs?.map((log, index) => (
+ <StyledLogEntry key={index}>{log}</StyledLogEntry>
+ ))}
+ </StyledSection>
+ )}
+ </StyledDetailsContainer>
+ </AnimatedExpandableContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobStateBadge.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobStateBadge.tsx
new file mode 100644
index 00000000000..5395bbb2640
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJobStateBadge.tsx
@@ -0,0 +1,52 @@
+import styled from '@emotion/styled';
+import { Tag, type TagColor } from 'twenty-ui/components';
+import { JobState } from '~/generated-metadata/graphql';
+
+type SettingsAdminJobStateBadgeProps = {
+ state: JobState;
+ attemptsMade?: number;
+};
+
+const JOB_STATE_COLORS: Record<JobState, TagColor> = {
+ [JobState.COMPLETED]: 'green',
+ [JobState.FAILED]: 'red',
+ [JobState.ACTIVE]: 'blue',
+ [JobState.WAITING]: 'gray',
+ [JobState.DELAYED]: 'orange',
+ [JobState.PRIORITIZED]: 'blue',
+ [JobState.WAITING_CHILDREN]: 'gray',
+};
+
+const StyledContainer = styled.div`
+ align-items: center;
+ display: flex;
+ gap: ${({ theme }) => theme.spacing(2)};
+`;
+
+const StyledAttemptBadge = styled.span`
+ background-color: ${({ theme }) => theme.background.danger};
+ border: 1px solid ${({ theme }) => theme.border.color.danger};
+ border-radius: ${({ theme }) => theme.border.radius.sm};
+ color: ${({ theme }) => theme.font.color.danger};
+ font-size: ${({ theme }) => theme.font.size.xs};
+ font-weight: ${({ theme }) => theme.font.weight.medium};
+ padding: ${({ theme }) => `${theme.spacing(0.5)} ${theme.spacing(1)}`};
+ white-space: nowrap;
+`;
+
+export const SettingsAdminJobStateBadge = ({
+ state,
+ attemptsMade = 1,
+}: SettingsAdminJobStateBadgeProps) => {
+ const color = JOB_STATE_COLORS[state] || 'gray';
+ const showAttempts = attemptsMade > 1;
+
+ return (
+ <StyledContainer>
+ <Tag color={color} text={state} />
+ {showAttempts && (
+ <StyledAttemptBadge>{attemptsMade} attempts</StyledAttemptBadge>
+ )}
+ </StyledContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/JsonDataIndicatorHealthStatus.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJsonDataIndicatorHealthStatus.tsx
similarity index 97%
rename from packages/twenty-front/src/modules/settings/admin-panel/health-status/components/JsonDataIndicatorHealthStatus.tsx
rename to packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJsonDataIndicatorHealthStatus.tsx
index fbaf6a8136d..41363fde995 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/JsonDataIndicatorHealthStatus.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminJsonDataIndicatorHealthStatus.tsx
@@ -22,7 +22,7 @@ const StyledErrorMessage = styled.div`
margin-bottom: ${({ theme }) => theme.spacing(4)};
`;
-export const JsonDataIndicatorHealthStatus = () => {
+export const SettingsAdminJsonDataIndicatorHealthStatus = () => {
const { t } = useLingui();
const { copyToClipboard } = useCopyToClipboard();
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
new file mode 100644
index 00000000000..bbce03148f9
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
@@ -0,0 +1,69 @@
+import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
+import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
+import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
+import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
+import { t } from '@lingui/core/macro';
+import { IconDotsVertical, IconRefresh, IconTrash } from 'twenty-ui/display';
+import { LightIconButton } from 'twenty-ui/input';
+import { MenuItem } from 'twenty-ui/navigation';
+import { JobState } from '~/generated-metadata/graphql';
+
+type SettingsAdminQueueJobRowDropdownMenuProps = {
+ jobId: string;
+ jobState: JobState;
+ onRetry?: () => void;
+ onDelete: () => void;
+};
+
+export const SettingsAdminQueueJobRowDropdownMenu = ({
+ jobId,
+ jobState,
+ onRetry,
+ onDelete,
+}: SettingsAdminQueueJobRowDropdownMenuProps) => {
+ const dropdownId = `queue-job-row-${jobId}`;
+ const { closeDropdown } = useCloseDropdown();
+
+ const handleRetry = () => {
+ onRetry?.();
+ closeDropdown(dropdownId);
+ };
+
+ const handleDelete = () => {
+ onDelete();
+ closeDropdown(dropdownId);
+ };
+
+ return (
+ <Dropdown
+ dropdownId={dropdownId}
+ dropdownPlacement="right-start"
+ clickableComponent={
+ <LightIconButton
+ aria-label="Job Actions"
+ Icon={IconDotsVertical}
+ accent="tertiary"
+ />
+ }
+ dropdownComponents={
+ <DropdownContent>
+ <DropdownMenuItemsContainer>
+ {jobState === JobState.FAILED && onRetry && (
+ <MenuItem
+ text={t`Retry`}
+ LeftIcon={IconRefresh}
+ onClick={handleRetry}
+ />
+ )}
+ <MenuItem
+ accent="danger"
+ text={t`Delete`}
+ LeftIcon={IconTrash}
+ onClick={handleDelete}
+ />
+ </DropdownMenuItemsContainer>
+ </DropdownContent>
+ }
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx
new file mode 100644
index 00000000000..811aa043446
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx
@@ -0,0 +1,412 @@
+import { SettingsAdminDeleteJobsConfirmationModal } from '@/settings/admin-panel/health-status/components/SettingsAdminDeleteJobsConfirmationModal';
+import { SettingsAdminJobDetailsExpandable } from '@/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable';
+import { SettingsAdminJobStateBadge } from '@/settings/admin-panel/health-status/components/SettingsAdminJobStateBadge';
+import { SettingsAdminQueueJobRowDropdownMenu } from '@/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu';
+import { SettingsAdminRetryJobsConfirmationModal } from '@/settings/admin-panel/health-status/components/SettingsAdminRetryJobsConfirmationModal';
+import { useDeleteJobs } from '@/settings/admin-panel/health-status/hooks/useDeleteJobs';
+import { useRetryJobs } from '@/settings/admin-panel/health-status/hooks/useRetryJobs';
+import { Select } from '@/ui/input/components/Select';
+import { useModal } from '@/ui/layout/modal/hooks/useModal';
+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 styled from '@emotion/styled';
+import { plural, t } from '@lingui/core/macro';
+import { useState } from 'react';
+import { IconRefresh, IconTrash } from 'twenty-ui/display';
+import { Button, Checkbox } from 'twenty-ui/input';
+import {
+ JobState,
+ type QueueJob,
+ useGetQueueJobsQuery,
+} from '~/generated-metadata/graphql';
+import { beautifyPastDateRelativeToNow } from '~/utils/date-utils';
+
+type SettingsAdminQueueJobsTableProps = {
+ queueName: string;
+ onRetentionConfigLoaded?: (config: {
+ completedMaxAge: number;
+ completedMaxCount: number;
+ failedMaxAge: number;
+ failedMaxCount: number;
+ }) => void;
+};
+
+const StyledContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ gap: ${({ theme }) => theme.spacing(4)};
+`;
+
+const StyledControlsContainer = styled.div`
+ align-items: center;
+ display: flex;
+ gap: ${({ theme }) => theme.spacing(2)};
+ justify-content: space-between;
+`;
+
+const StyledEmptyState = styled.div`
+ color: ${({ theme }) => theme.font.color.tertiary};
+ padding: ${({ theme }) => theme.spacing(8)};
+ text-align: center;
+`;
+
+const StyledPaginationContainer = styled.div`
+ align-items: center;
+ display: flex;
+ justify-content: space-between;
+ padding: ${({ theme }) => theme.spacing(2)};
+`;
+
+const StyledTableCell = styled(TableCell)`
+ max-width: 200px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+`;
+
+const StyledExpandableTableRow = styled(TableRow)<{ isExpanded: boolean }>`
+ cursor: pointer;
+ background-color: ${({ theme, isExpanded }) =>
+ isExpanded ? theme.background.transparent.light : 'transparent'};
+
+ &:hover {
+ background-color: ${({ theme }) => theme.background.transparent.light};
+ }
+`;
+
+const StyledJobRowWrapper = styled.div`
+ display: contents;
+`;
+
+const StyledCheckboxCell = styled(TableCell)`
+ justify-content: center;
+ padding: 0;
+ padding-left: ${({ theme }) => theme.spacing(1)};
+`;
+
+const StyledHeaderCheckboxCell = styled(TableHeader)`
+ align-items: center;
+ display: flex;
+ justify-content: center;
+ padding-right: ${({ theme }) => theme.spacing(1)};
+`;
+
+const StyledButtonGroup = styled.div`
+ display: flex;
+ gap: ${({ theme }) => theme.spacing(2)};
+`;
+
+const RETRY_MODAL_ID = 'retry-jobs-modal';
+const DELETE_MODAL_ID = 'delete-jobs-modal';
+const LIMIT = 50;
+
+export const SettingsAdminQueueJobsTable = ({
+ queueName,
+ onRetentionConfigLoaded,
+}: SettingsAdminQueueJobsTableProps) => {
+ const [page, setPage] = useState(0);
+ const [stateFilter, setStateFilter] = useState<JobState>(JobState.COMPLETED);
+ const [expandedJobId, setExpandedJobId] = useState<string | null>(null);
+ const [selectedJobIds, setSelectedJobIds] = useState<Set<string>>(new Set());
+ const { openModal } = useModal();
+
+ const jobStateOptions: { value: JobState; label: string }[] = [
+ { value: JobState.COMPLETED, label: t`Completed` },
+ { value: JobState.FAILED, label: t`Failed` },
+ { value: JobState.ACTIVE, label: t`Active` },
+ { value: JobState.WAITING, label: t`Waiting` },
+ { value: JobState.DELAYED, label: t`Delayed` },
+ { value: JobState.PRIORITIZED, label: t`Prioritized` },
+ { value: JobState.WAITING_CHILDREN, label: t`Waiting Children` },
+ ];
+
+ const offset = page * LIMIT;
+
+ const { data, loading, refetch } = useGetQueueJobsQuery({
+ variables: {
+ queueName,
+ state: stateFilter,
+ limit: LIMIT,
+ offset,
+ },
+ fetchPolicy: 'network-only',
+ });
+
+ const { retryJobs, isRetrying } = useRetryJobs(queueName, () => {
+ refetch();
+ setSelectedJobIds(new Set());
+ });
+
+ const { deleteJobs, isDeleting } = useDeleteJobs(queueName, () => {
+ refetch();
+ setSelectedJobIds(new Set());
+ });
+
+ const jobs = data?.getQueueJobs?.jobs || [];
+ const hasMore = data?.getQueueJobs?.hasMore || false;
+ const totalCount = data?.getQueueJobs?.totalCount || 0;
+ const failedJobs = jobs.filter((job) => job.state === JobState.FAILED);
+
+ // Pass retention config to parent when data loads
+ const shouldPassConfig =
+ data?.getQueueJobs?.retentionConfig !== undefined &&
+ onRetentionConfigLoaded !== undefined;
+
+ if (shouldPassConfig) {
+ onRetentionConfigLoaded(data.getQueueJobs.retentionConfig);
+ }
+
+ const selectedCount = selectedJobIds.size;
+ const allJobsSelected =
+ jobs.length > 0 && jobs.every((job) => selectedJobIds.has(job.id));
+ const someJobsSelected =
+ jobs.some((job) => selectedJobIds.has(job.id)) && !allJobsSelected;
+
+ // Check if all selected jobs are failed (for showing retry button)
+ const selectedJobs = jobs.filter((job) => selectedJobIds.has(job.id));
+ const allSelectedAreFailed =
+ selectedJobs.length > 0 &&
+ selectedJobs.every((job) => job.state === JobState.FAILED);
+
+ const handleToggleAll = () => {
+ const shouldClearSelection = allJobsSelected === true;
+
+ if (shouldClearSelection) {
+ setSelectedJobIds(new Set());
+ } else {
+ setSelectedJobIds(new Set(jobs.map((job) => job.id)));
+ }
+ };
+
+ const handleToggleJob = (event: React.MouseEvent, jobId: string) => {
+ event.stopPropagation();
+ const newSelected = new Set(selectedJobIds);
+
+ if (newSelected.has(jobId)) {
+ newSelected.delete(jobId);
+ } else {
+ newSelected.add(jobId);
+ }
+ setSelectedJobIds(newSelected);
+ };
+
+ const handleRetrySelected = () => {
+ openModal(RETRY_MODAL_ID);
+ };
+
+ const confirmRetrySelected = async () => {
+ const jobIdsToRetry = selectedCount > 0 ? Array.from(selectedJobIds) : [];
+
+ await retryJobs(jobIdsToRetry);
+ };
+
+ const handleDeleteSelected = () => {
+ openModal(DELETE_MODAL_ID);
+ };
+
+ const confirmDeleteSelected = async () => {
+ await deleteJobs(Array.from(selectedJobIds));
+ };
+
+ const handleRetryOne = async (jobId: string) => {
+ await retryJobs([jobId]);
+ };
+
+ const handleDeleteOne = async (jobId: string) => {
+ await deleteJobs([jobId]);
+ };
+
+ const handleRowClick = (jobId: string) => {
+ setExpandedJobId(expandedJobId === jobId ? null : jobId);
+ };
+
+ const formatTimestampRelative = (timestamp?: number | null) => {
+ if (!timestamp) return '-';
+
+ return beautifyPastDateRelativeToNow(timestamp);
+ };
+
+ const formatTimestampFull = (timestamp?: number | null) => {
+ if (!timestamp) return '';
+
+ return new Date(timestamp).toLocaleString();
+ };
+
+ return (
+ <StyledContainer>
+ <StyledControlsContainer>
+ <Select
+ dropdownId="job-state-filter"
+ value={stateFilter}
+ options={jobStateOptions}
+ onChange={(value) => {
+ setStateFilter(value as JobState);
+ setPage(0);
+ setSelectedJobIds(new Set());
+ }}
+ selectSizeVariant="small"
+ />
+ <StyledButtonGroup>
+ {selectedCount > 0 && (
+ <Button
+ Icon={IconTrash}
+ title={plural(selectedCount, {
+ one: `Delete ${selectedCount} Job`,
+ other: `Delete ${selectedCount} Jobs`,
+ })}
+ onClick={handleDeleteSelected}
+ disabled={isDeleting || loading}
+ size="small"
+ variant="secondary"
+ accent="danger"
+ />
+ )}
+ {allSelectedAreFailed && (
+ <Button
+ Icon={IconRefresh}
+ title={plural(selectedCount, {
+ one: `Retry ${selectedCount} Job`,
+ other: `Retry ${selectedCount} Jobs`,
+ })}
+ onClick={handleRetrySelected}
+ disabled={isRetrying || loading}
+ size="small"
+ variant="secondary"
+ />
+ )}
+ {failedJobs.length > 0 && selectedCount === 0 && (
+ <Button
+ Icon={IconRefresh}
+ title={t`Retry All Failed`}
+ onClick={handleRetrySelected}
+ disabled={isRetrying || loading}
+ size="small"
+ variant="secondary"
+ />
+ )}
+ </StyledButtonGroup>
+ </StyledControlsContainer>
+
+ {loading && jobs.length === 0 ? (
+ <StyledEmptyState>{t`Loading jobs...`}</StyledEmptyState>
+ ) : jobs.length === 0 ? (
+ <StyledEmptyState>{t`No jobs found`}</StyledEmptyState>
+ ) : (
+ <>
+ <Table>
+ <TableRow gridAutoColumns="32px 2fr 1fr 2fr 32px">
+ <StyledHeaderCheckboxCell>
+ {jobs.length > 0 && (
+ <Checkbox
+ checked={allJobsSelected}
+ indeterminate={someJobsSelected}
+ onChange={handleToggleAll}
+ />
+ )}
+ </StyledHeaderCheckboxCell>
+ <TableHeader>{t`Job Name`}</TableHeader>
+ <TableHeader>{t`State`}</TableHeader>
+ <TableHeader align="right">{t`Timestamp`}</TableHeader>
+ <TableHeader></TableHeader>
+ </TableRow>
+ <TableBody>
+ {jobs.map((job: QueueJob) => {
+ const isExpanded = expandedJobId === job.id;
+ const isSelected = selectedJobIds.has(job.id);
+
+ return (
+ <StyledJobRowWrapper key={job.id}>
+ <StyledExpandableTableRow
+ gridAutoColumns="32px 2fr 1fr 2fr 32px"
+ onClick={() => handleRowClick(job.id)}
+ isExpanded={isExpanded}
+ >
+ <StyledCheckboxCell
+ onClick={(e) => {
+ e.stopPropagation();
+ handleToggleJob(e, job.id);
+ }}
+ >
+ <Checkbox checked={isSelected} />
+ </StyledCheckboxCell>
+ <StyledTableCell title={job.name}>
+ {job.name}
+ </StyledTableCell>
+ <TableCell>
+ <SettingsAdminJobStateBadge
+ state={job.state}
+ attemptsMade={job.attemptsMade}
+ />
+ </TableCell>
+ <TableCell
+ align="right"
+ title={formatTimestampFull(
+ job.finishedOn || job.processedOn || job.timestamp,
+ )}
+ >
+ {formatTimestampRelative(
+ job.finishedOn || job.processedOn || job.timestamp,
+ )}
+ </TableCell>
+ <TableCell onClick={(e) => e.stopPropagation()}>
+ <SettingsAdminQueueJobRowDropdownMenu
+ jobId={job.id}
+ jobState={job.state}
+ onRetry={
+ job.state === JobState.FAILED
+ ? () => handleRetryOne(job.id)
+ : undefined
+ }
+ onDelete={() => handleDeleteOne(job.id)}
+ />
+ </TableCell>
+ </StyledExpandableTableRow>
+ <SettingsAdminJobDetailsExpandable
+ job={job}
+ isExpanded={isExpanded}
+ />
+ </StyledJobRowWrapper>
+ );
+ })}
+ </TableBody>
+ </Table>
+
+ <StyledPaginationContainer>
+ <Button
+ title={t`Previous`}
+ onClick={() => setPage((p) => Math.max(0, p - 1))}
+ disabled={page === 0 || loading}
+ size="small"
+ variant="secondary"
+ />
+ <div>
+ {t`Page`} {page + 1} {totalCount > 0 ? t`of` : ''}{' '}
+ {totalCount > 0 ? Math.max(1, Math.ceil(totalCount / LIMIT)) : ''}
+ </div>
+ <Button
+ title={t`Next`}
+ onClick={() => setPage((p) => p + 1)}
+ disabled={!hasMore || loading}
+ size="small"
+ variant="secondary"
+ />
+ </StyledPaginationContainer>
+ </>
+ )}
+
+ <SettingsAdminRetryJobsConfirmationModal
+ modalId={RETRY_MODAL_ID}
+ jobCount={selectedCount > 0 ? selectedCount : failedJobs.length}
+ onConfirm={confirmRetrySelected}
+ />
+ <SettingsAdminDeleteJobsConfirmationModal
+ modalId={DELETE_MODAL_ID}
+ jobCount={selectedCount}
+ onConfirm={confirmDeleteSelected}
+ />
+ </StyledContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminRetryJobsConfirmationModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminRetryJobsConfirmationModal.tsx
new file mode 100644
index 00000000000..d0c895f0acd
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminRetryJobsConfirmationModal.tsx
@@ -0,0 +1,38 @@
+import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
+import { plural, t } from '@lingui/core/macro';
+
+type SettingsAdminRetryJobsConfirmationModalProps = {
+ modalId: string;
+ jobCount: number;
+ onConfirm: () => void;
+ onClose?: () => void;
+};
+
+export const SettingsAdminRetryJobsConfirmationModal = ({
+ modalId,
+ jobCount,
+ onConfirm,
+ onClose,
+}: SettingsAdminRetryJobsConfirmationModalProps) => {
+ const title = plural(jobCount, {
+ one: `Retry ${jobCount} Job`,
+ other: `Retry ${jobCount} Jobs`,
+ });
+
+ const subtitle = plural(jobCount, {
+ one: `This will retry the selected job. It will be re-executed from the beginning.`,
+ other: `This will retry the selected jobs. They will be re-executed from the beginning.`,
+ });
+
+ return (
+ <ConfirmationModal
+ modalId={modalId}
+ title={title}
+ subtitle={subtitle}
+ onConfirmClick={onConfirm}
+ onClose={onClose}
+ confirmButtonText={t`Retry`}
+ confirmButtonAccent="blue"
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerHealthStatus.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerHealthStatus.tsx
similarity index 73%
rename from packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerHealthStatus.tsx
rename to packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerHealthStatus.tsx
index c6be22dbc53..677caa0fd1e 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerHealthStatus.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerHealthStatus.tsx
@@ -1,4 +1,4 @@
-import { WorkerQueueMetricsSection } from '@/settings/admin-panel/health-status/components/WorkerQueueMetricsSection';
+import { SettingsAdminWorkerQueueMetricsSection } from '@/settings/admin-panel/health-status/components/SettingsAdminWorkerQueueMetricsSection';
import styled from '@emotion/styled';
import { t } from '@lingui/core/macro';
import { useContext } from 'react';
@@ -10,7 +10,7 @@ const StyledErrorMessage = styled.div`
margin-top: ${({ theme }) => theme.spacing(2)};
`;
-export const WorkerHealthStatus = () => {
+export const SettingsAdminWorkerHealthStatus = () => {
const { indicatorHealth } = useContext(SettingsAdminIndicatorHealthContext);
const isWorkerDown =
@@ -25,7 +25,10 @@ export const WorkerHealthStatus = () => {
</StyledErrorMessage>
) : (
(indicatorHealth.queues ?? []).map((queue) => (
- <WorkerQueueMetricsSection key={queue.queueName} queue={queue} />
+ <SettingsAdminWorkerQueueMetricsSection
+ key={queue.queueName}
+ queue={queue}
+ />
))
)}
</>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerMetricsGraph.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx
similarity index 94%
rename from packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerMetricsGraph.tsx
rename to packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx
index a09e90e8414..46f45d415b7 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerMetricsGraph.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsGraph.tsx
@@ -1,5 +1,5 @@
import { SettingsAdminTableCard } from '@/settings/admin-panel/components/SettingsAdminTableCard';
-import { WorkerMetricsTooltip } from '@/settings/admin-panel/health-status/components/WorkerMetricsTooltip';
+import { SettingsAdminWorkerMetricsTooltip } from '@/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsTooltip';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
@@ -33,16 +33,16 @@ const StyledSettingsAdminTableCard = styled(SettingsAdminTableCard)`
padding-right: ${({ theme }) => theme.spacing(2)};
`;
-type WorkerMetricsGraphProps = {
+type SettingsAdminWorkerMetricsGraphProps = {
queueName: string;
timeRange: QueueMetricsTimeRange;
onTimeRangeChange: (range: QueueMetricsTimeRange) => void;
};
-export const WorkerMetricsGraph = ({
+export const SettingsAdminWorkerMetricsGraph = ({
queueName,
timeRange,
-}: WorkerMetricsGraphProps) => {
+}: SettingsAdminWorkerMetricsGraphProps) => {
const theme = useTheme();
const { enqueueErrorSnackBar } = useSnackBar();
@@ -172,7 +172,9 @@ export const WorkerMetricsGraph = ({
gridYValues={4}
pointSize={0}
enableSlices="x"
- sliceTooltip={({ slice }) => <WorkerMetricsTooltip slice={slice} />}
+ sliceTooltip={({ slice }) => (
+ <SettingsAdminWorkerMetricsTooltip slice={slice} />
+ )}
useMesh={true}
legends={[
{
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerMetricsTooltip.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsTooltip.tsx
similarity index 89%
rename from packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerMetricsTooltip.tsx
rename to packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsTooltip.tsx
index 726b9791be3..e303ad7b8b6 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerMetricsTooltip.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerMetricsTooltip.tsx
@@ -1,5 +1,5 @@
import styled from '@emotion/styled';
-import type { Point, LineSeries } from '@nivo/line';
+import type { LineSeries, Point } from '@nivo/line';
import { type ReactElement } from 'react';
const StyledTooltipContainer = styled.div`
@@ -43,15 +43,15 @@ const StyledTooltipValue = styled.span`
font-weight: ${({ theme }) => theme.font.weight.medium};
`;
-type WorkerMetricsTooltipProps = {
+type SettingsAdminWorkerMetricsTooltipProps = {
slice: {
points: readonly Point<LineSeries>[];
};
};
-export const WorkerMetricsTooltip = ({
+export const SettingsAdminWorkerMetricsTooltip = ({
slice,
-}: WorkerMetricsTooltipProps): ReactElement => {
+}: SettingsAdminWorkerMetricsTooltipProps): ReactElement => {
return (
<StyledTooltipContainer>
{slice.points.map((point) => (
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerQueueMetricsSection.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerQueueMetricsSection.tsx
new file mode 100644
index 00000000000..4f6d675e7ad
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminWorkerQueueMetricsSection.tsx
@@ -0,0 +1,88 @@
+import { ChartSkeletonLoader } from '@/page-layout/widgets/graph/components/ChartSkeletonLoader';
+import { WORKER_QUEUE_METRICS_SELECT_OPTIONS } from '@/settings/admin-panel/health-status/constants/WorkerQueueMetricsSelectOptions';
+import { Select } from '@/ui/input/components/Select';
+import styled from '@emotion/styled';
+import { t } from '@lingui/core/macro';
+import { lazy, Suspense, useState } from 'react';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
+import { H2Title, IconList } from 'twenty-ui/display';
+import { Button } from 'twenty-ui/input';
+import { Section } from 'twenty-ui/layout';
+import {
+ type AdminPanelWorkerQueueHealth,
+ QueueMetricsTimeRange,
+} from '~/generated-metadata/graphql';
+
+const SettingsAdminWorkerMetricsGraph = lazy(() =>
+ import('./SettingsAdminWorkerMetricsGraph').then((module) => ({
+ default: module.SettingsAdminWorkerMetricsGraph,
+ })),
+);
+
+type SettingsAdminWorkerQueueMetricsSectionProps = {
+ queue: AdminPanelWorkerQueueHealth;
+};
+
+const StyledControlsContainer = styled.div`
+ align-items: flex-start;
+ display: flex;
+ justify-content: space-between;
+`;
+
+const StyledRightControls = styled.div`
+ align-items: center;
+ display: flex;
+ gap: ${({ theme }) => theme.spacing(2)};
+`;
+
+const StyledContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ margin-bottom: ${({ theme }) => theme.spacing(8)};
+`;
+
+export const SettingsAdminWorkerQueueMetricsSection = ({
+ queue,
+}: SettingsAdminWorkerQueueMetricsSectionProps) => {
+ const [timeRange, setTimeRange] = useState(QueueMetricsTimeRange.OneHour);
+
+ return (
+ <StyledContainer>
+ <Section>
+ <StyledControlsContainer>
+ <H2Title title={queue.queueName} description={t`Queue performance`} />
+ <StyledRightControls>
+ <Button
+ Icon={IconList}
+ title={t`View Jobs`}
+ size="small"
+ variant="secondary"
+ to={getSettingsPath(SettingsPath.AdminPanelQueueDetail, {
+ queueName: queue.queueName,
+ })}
+ />
+ <Select
+ dropdownId={`timerange-${queue.queueName}`}
+ value={timeRange}
+ options={WORKER_QUEUE_METRICS_SELECT_OPTIONS.map((option) => ({
+ ...option,
+ label: t(option.label),
+ }))}
+ onChange={setTimeRange}
+ needIconCheck
+ selectSizeVariant="small"
+ />
+ </StyledRightControls>
+ </StyledControlsContainer>
+ </Section>
+ <Suspense fallback={<ChartSkeletonLoader />}>
+ <SettingsAdminWorkerMetricsGraph
+ queueName={queue.queueName}
+ timeRange={timeRange}
+ onTimeRangeChange={setTimeRange}
+ />
+ </Suspense>
+ </StyledContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerQueueMetricsSection.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerQueueMetricsSection.tsx
deleted file mode 100644
index 96ee97f84ba..00000000000
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/WorkerQueueMetricsSection.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { ChartSkeletonLoader } from '@/page-layout/widgets/graph/components/ChartSkeletonLoader';
-import { WORKER_QUEUE_METRICS_SELECT_OPTIONS } from '@/settings/admin-panel/health-status/constants/WorkerQueueMetricsSelectOptions';
-import { Select } from '@/ui/input/components/Select';
-import styled from '@emotion/styled';
-import { t } from '@lingui/core/macro';
-import { lazy, Suspense, useState } from 'react';
-import { H2Title } from 'twenty-ui/display';
-import { Section } from 'twenty-ui/layout';
-import {
- type AdminPanelWorkerQueueHealth,
- QueueMetricsTimeRange,
-} from '~/generated-metadata/graphql';
-
-const WorkerMetricsGraph = lazy(() =>
- import('./WorkerMetricsGraph').then((module) => ({
- default: module.WorkerMetricsGraph,
- })),
-);
-
-type WorkerQueueMetricsSectionProps = {
- queue: AdminPanelWorkerQueueHealth;
-};
-
-const StyledControlsContainer = styled.div`
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
-`;
-
-const StyledContainer = styled.div`
- display: flex;
- flex-direction: column;
- margin-bottom: ${({ theme }) => theme.spacing(8)};
-`;
-
-export const WorkerQueueMetricsSection = ({
- queue,
-}: WorkerQueueMetricsSectionProps) => {
- const [timeRange, setTimeRange] = useState(QueueMetricsTimeRange.OneHour);
-
- return (
- <StyledContainer>
- <Section>
- <StyledControlsContainer>
- <H2Title title={queue.queueName} description={t`Queue performance`} />
- <Select
- dropdownId={`timerange-${queue.queueName}`}
- value={timeRange}
- options={WORKER_QUEUE_METRICS_SELECT_OPTIONS.map((option) => ({
- ...option,
- label: t(option.label),
- }))}
- onChange={setTimeRange}
- needIconCheck
- selectSizeVariant="small"
- />
- </StyledControlsContainer>
- </Section>
- <Suspense fallback={<ChartSkeletonLoader />}>
- <WorkerMetricsGraph
- queueName={queue.queueName}
- timeRange={timeRange}
- onTimeRangeChange={setTimeRange}
- />
- </Suspense>
- </StyledContainer>
- );
-};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/graphql/mutations/deleteJobs.ts b/packages/twenty-front/src/modules/settings/admin-panel/health-status/graphql/mutations/deleteJobs.ts
new file mode 100644
index 00000000000..1e8b2e2ebf8
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/graphql/mutations/deleteJobs.ts
@@ -0,0 +1,14 @@
+import { gql } from '@apollo/client';
+
+export const DELETE_JOBS = gql`
+ mutation DeleteJobs($queueName: String!, $jobIds: [String!]!) {
+ deleteJobs(queueName: $queueName, jobIds: $jobIds) {
+ deletedCount
+ results {
+ jobId
+ success
+ error
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/graphql/mutations/retryJobs.ts b/packages/twenty-front/src/modules/settings/admin-panel/health-status/graphql/mutations/retryJobs.ts
new file mode 100644
index 00000000000..24a48307ac2
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/graphql/mutations/retryJobs.ts
@@ -0,0 +1,14 @@
+import { gql } from '@apollo/client';
+
+export const RETRY_JOBS = gql`
+ mutation RetryJobs($queueName: String!, $jobIds: [String!]!) {
+ retryJobs(queueName: $queueName, jobIds: $jobIds) {
+ retriedCount
+ results {
+ jobId
+ success
+ error
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/graphql/queries/getQueueJobs.ts b/packages/twenty-front/src/modules/settings/admin-panel/health-status/graphql/queries/getQueueJobs.ts
new file mode 100644
index 00000000000..690c6c3c7e5
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/graphql/queries/getQueueJobs.ts
@@ -0,0 +1,41 @@
+import { gql } from '@apollo/client';
+
+export const GET_QUEUE_JOBS = gql`
+ query GetQueueJobs(
+ $queueName: String!
+ $state: JobState!
+ $limit: Int
+ $offset: Int
+ ) {
+ getQueueJobs(
+ queueName: $queueName
+ state: $state
+ limit: $limit
+ offset: $offset
+ ) {
+ jobs {
+ id
+ name
+ data
+ state
+ timestamp
+ failedReason
+ processedOn
+ finishedOn
+ attemptsMade
+ returnValue
+ logs
+ stackTrace
+ }
+ count
+ totalCount
+ hasMore
+ retentionConfig {
+ completedMaxAge
+ completedMaxCount
+ failedMaxAge
+ failedMaxCount
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts
new file mode 100644
index 00000000000..5c65bc425f2
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts
@@ -0,0 +1,83 @@
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { ApolloError } from '@apollo/client';
+import { plural, t } from '@lingui/core/macro';
+import { useState } from 'react';
+import { isDefined } from 'twenty-shared/utils';
+import { useDeleteJobsMutation } from '~/generated-metadata/graphql';
+import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';
+
+export const useDeleteJobs = (queueName: string, onSuccess?: () => void) => {
+ const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
+ const [isDeleting, setIsDeleting] = useState(false);
+ const [deleteJobsMutation] = useDeleteJobsMutation();
+
+ const deleteJobs = async (jobIds: string[]) => {
+ setIsDeleting(true);
+
+ try {
+ const result = await deleteJobsMutation({
+ variables: {
+ queueName,
+ jobIds,
+ },
+ });
+
+ const response = result.data?.deleteJobs;
+
+ if (isDefined(response)) {
+ const { deletedCount, results } = response;
+ const failedResults = results.filter((r) => !r.success);
+
+ if (deletedCount > 0) {
+ if (failedResults.length > 0) {
+ enqueueSuccessSnackBar({
+ message: plural(deletedCount, {
+ one: `Successfully deleted ${deletedCount} job`,
+ other: `Successfully deleted ${deletedCount} jobs`,
+ }),
+ });
+ enqueueErrorSnackBar({
+ message: plural(failedResults.length, {
+ one: `${failedResults.length} job could not be deleted`,
+ other: `${failedResults.length} jobs could not be deleted`,
+ }),
+ });
+ } else {
+ enqueueSuccessSnackBar({
+ message: plural(deletedCount, {
+ one: `Successfully deleted ${deletedCount} job`,
+ other: `Successfully deleted ${deletedCount} jobs`,
+ }),
+ });
+ }
+
+ onSuccess?.();
+ } else {
+ const errorMessages = failedResults
+ .map((r) => r.error)
+ .filter(Boolean);
+ const errorDetails =
+ errorMessages.length > 0 ? `: ${errorMessages[0]}` : '';
+
+ enqueueErrorSnackBar({
+ message: t`No jobs were deleted${errorDetails}`,
+ });
+ }
+ }
+ } catch (error) {
+ enqueueErrorSnackBar({
+ message:
+ error instanceof ApolloError
+ ? getErrorMessageFromApolloError(error)
+ : t`Failed to delete jobs. Please try again later.`,
+ });
+ } finally {
+ setIsDeleting(false);
+ }
+ };
+
+ return {
+ deleteJobs,
+ isDeleting,
+ };
+};
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
new file mode 100644
index 00000000000..462215184fc
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
@@ -0,0 +1,87 @@
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { ApolloError } from '@apollo/client';
+import { plural, t } from '@lingui/core/macro';
+import { useState } from 'react';
+import { isDefined } from 'twenty-shared/utils';
+import { useRetryJobsMutation } from '~/generated-metadata/graphql';
+import { getErrorMessageFromApolloError } from '~/utils/get-error-message-from-apollo-error.util';
+
+export const useRetryJobs = (queueName: string, onSuccess?: () => void) => {
+ const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
+ const [isRetrying, setIsRetrying] = useState(false);
+ const [retryJobsMutation] = useRetryJobsMutation();
+
+ const retryJobs = async (jobIds: string[]) => {
+ setIsRetrying(true);
+
+ try {
+ const result = await retryJobsMutation({
+ variables: {
+ queueName,
+ jobIds,
+ },
+ });
+
+ const response = result.data?.retryJobs;
+
+ if (isDefined(response)) {
+ const { retriedCount, results } = response;
+ const failedResults = results.filter((r) => !r.success);
+
+ if (retriedCount === -1) {
+ enqueueSuccessSnackBar({
+ message: t`All failed jobs have been retried`,
+ });
+ } else if (retriedCount > 0) {
+ if (failedResults.length > 0) {
+ enqueueSuccessSnackBar({
+ message: plural(retriedCount, {
+ one: `Successfully retried ${retriedCount} job`,
+ other: `Successfully retried ${retriedCount} jobs`,
+ }),
+ });
+ enqueueErrorSnackBar({
+ message: plural(failedResults.length, {
+ one: `${failedResults.length} job could not be retried`,
+ other: `${failedResults.length} jobs could not be retried`,
+ }),
+ });
+ } else {
+ enqueueSuccessSnackBar({
+ message: plural(retriedCount, {
+ one: `Successfully retried ${retriedCount} job`,
+ other: `Successfully retried ${retriedCount} jobs`,
+ }),
+ });
+ }
+ } else {
+ const errorMessages = failedResults
+ .map((r) => r.error)
+ .filter(Boolean);
+ const errorDetails =
+ errorMessages.length > 0 ? `: ${errorMessages[0]}` : '';
+
+ enqueueErrorSnackBar({
+ message: t`No jobs were retried${errorDetails}`,
+ });
+ }
+
+ onSuccess?.();
+ }
+ } catch (error) {
+ enqueueErrorSnackBar({
+ message:
+ error instanceof ApolloError
+ ? getErrorMessageFromApolloError(error)
+ : t`Failed to retry jobs. Please try again later.`,
+ });
+ } finally {
+ setIsRetrying(false);
+ }
+ };
+
+ return {
+ retryJobs,
+ isRetrying,
+ };
+};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx b/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
index 911f9d58e23..9358c5961dc 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
@@ -1,4 +1,5 @@
import styled from '@emotion/styled';
+import { plural } from '@lingui/core/macro';
import { useMemo, useRef, useState, type MouseEvent } from 'react';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
@@ -166,7 +167,14 @@ export const SettingsMorphRelationMultiSelect = ({
<MultiSelectControl
selectedOptions={selectedOptions}
fixedIcon={selectedOptions.length < 2 ? undefined : IconBox}
- fixedText={selectedOptions.length < 2 ? undefined : 'Object'}
+ fixedText={
+ selectedOptions.length < 2
+ ? undefined
+ : plural(selectedOptions.length, {
+ one: `# Object`,
+ other: `# Objects`,
+ })
+ }
isDisabled={isDisabled}
selectSizeVariant={selectSizeVariant}
hasRightElement={hasRightElement}
@@ -181,7 +189,14 @@ export const SettingsMorphRelationMultiSelect = ({
<MultiSelectControl
selectedOptions={selectedOptions}
fixedIcon={selectedOptions.length < 2 ? undefined : IconBox}
- fixedText={selectedOptions.length < 2 ? undefined : 'Object'}
+ fixedText={
+ selectedOptions.length < 2
+ ? undefined
+ : plural(selectedOptions.length, {
+ one: `# Object`,
+ other: `# Objects`,
+ })
+ }
isDisabled={isDisabled}
selectSizeVariant={selectSizeVariant}
hasRightElement={hasRightElement}
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberForm.tsx
index aa16fb7b1d0..b7f288ea6fd 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberForm.tsx
@@ -8,6 +8,7 @@ import { SettingsOptionCardContentCounter } from '@/settings/components/Settings
import { SettingsOptionCardContentSelect } from '@/settings/components/SettingsOptions/SettingsOptionCardContentSelect';
import { NUMBER_DATA_MODEL_SELECT_OPTIONS } from '@/settings/data-model/fields/forms/number/constants/NumberDataModelSelectOptions';
import { Select } from '@/ui/input/components/Select';
+import { plural } from '@lingui/core/macro';
import { useLingui } from '@lingui/react/macro';
import { IconDecimal, IconEye } from 'twenty-ui/display';
import { DEFAULT_DECIMAL_VALUE } from '~/utils/format/formatNumber';
@@ -81,7 +82,10 @@ export const SettingsDataModelFieldNumberForm = ({
<SettingsOptionCardContentCounter
Icon={IconDecimal}
title={t`Number of decimals`}
- description={`E.g. ${(type === 'percentage' ? 99 : 1000).toFixed(count)}${type === 'percentage' ? '%' : ''} for ${count} decimal${count > 1 ? 's' : ''}`}
+ description={plural(count, {
+ one: `E.g. ${(type === 'percentage' ? 99 : 1000).toFixed(count)}${type === 'percentage' ? '%' : ''} for ${count} decimal`,
+ other: `E.g. ${(type === 'percentage' ? 99 : 1000).toFixed(count)}${type === 'percentage' ? '%' : ''} for ${count} decimals`,
+ })}
value={count}
onChange={(value) => onChange({ type: type, decimals: value })}
disabled={disabled}
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableRow.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableRow.tsx
index f636c60d6ba..bb572e8d887 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableRow.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableRow.tsx
@@ -4,8 +4,7 @@ import { type SettingsRolePermissionsObjectPermission } from '@/settings/roles/r
import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableRow } from '@/ui/layout/table/components/TableRow';
import styled from '@emotion/styled';
-import { t } from '@lingui/core/macro';
-import pluralize from 'pluralize';
+import { plural } from '@lingui/core/macro';
import { Checkbox, CheckboxAccent } from 'twenty-ui/input';
const StyledPermissionCell = styled(TableCell)`
@@ -59,8 +58,6 @@ export const SettingsRolePermissionsObjectsTableRow = ({
const isRevoked =
revokedBy !== undefined && revokedBy !== null && revokedBy > 0;
const label = permission.label;
- const pluralizedRevokedObject = pluralize('object', revokedBy);
- const pluralizedGrantedObject = pluralize('object', grantedBy);
const isDisabled = !isEditable;
const handleRowClick = () => {
@@ -83,12 +80,18 @@ export const SettingsRolePermissionsObjectsTableRow = ({
{isRevoked && revokedBy > 0 ? (
<>
{' · '}
- {t`Revoked for ${revokedBy} ${pluralizedRevokedObject}`}
+ {plural(revokedBy, {
+ one: `Revoked for ${revokedBy} object`,
+ other: `Revoked for ${revokedBy} objects`,
+ })}
</>
) : grantedBy && grantedBy > 0 ? (
<>
{' · '}
- {t`Granted for ${grantedBy} ${pluralizedGrantedObject}`}
+ {plural(grantedBy, {
+ one: `Granted for ${grantedBy} object`,
+ other: `Granted for ${grantedBy} objects`,
+ })}
</>
) : null}
</StyledOverrideInfo>
diff --git a/packages/twenty-front/src/modules/ui/input/components/MultiSelectControl.tsx b/packages/twenty-front/src/modules/ui/input/components/MultiSelectControl.tsx
index 2442374b80f..183b12c8444 100644
--- a/packages/twenty-front/src/modules/ui/input/components/MultiSelectControl.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/MultiSelectControl.tsx
@@ -4,7 +4,6 @@ import {
StyledSelectControlIconChevronDown,
} from '@/ui/input/components/SelectControl';
import { useTheme } from '@emotion/react';
-import pluralize from 'pluralize';
import React from 'react';
import { isDefined } from 'twenty-shared/utils';
import {
@@ -39,7 +38,6 @@ export const MultiSelectControl = ({
}
const firstSelectedOption = selectedOptions[0];
- const selectedOptionsCount = selectedOptions.length;
return (
<StyledControlContainer
disabled={isDisabled}
@@ -62,11 +60,7 @@ export const MultiSelectControl = ({
/>
) : null}
{isDefined(fixedText) ? (
- <OverflowingTextWithTooltip
- text={`${selectedOptionsCount} ${
- selectedOptionsCount <= 1 ? fixedText : pluralize(fixedText)
- }`}
- />
+ <OverflowingTextWithTooltip text={fixedText} />
) : (
<OverflowingTextWithTooltip text={firstSelectedOption.label} />
)}
diff --git a/packages/twenty-front/src/modules/views/components/AdvancedFilterChip.tsx b/packages/twenty-front/src/modules/views/components/AdvancedFilterChip.tsx
index f2dc78fbc89..a882f8c99cc 100644
--- a/packages/twenty-front/src/modules/views/components/AdvancedFilterChip.tsx
+++ b/packages/twenty-front/src/modules/views/components/AdvancedFilterChip.tsx
@@ -13,7 +13,7 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { useRecoilComponentValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValue';
import { SortOrFilterChip } from '@/views/components/SortOrFilterChip';
import { ADVANCED_FILTER_DROPDOWN_ID } from '@/views/constants/AdvancedFilterDropdownId';
-import { plural } from 'pluralize';
+import { plural } from '@lingui/core/macro';
import { useMemo } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconFilter } from 'twenty-ui/display';
@@ -68,8 +68,10 @@ export const AdvancedFilterChip = () => {
const advancedFilterCount = childRecordFiltersAndRecordFilterGroups.length;
- const labelText = 'advanced rule';
- const chipLabel = `${advancedFilterCount} ${advancedFilterCount === 1 ? labelText : plural(labelText)}`;
+ const chipLabel = plural(advancedFilterCount, {
+ one: `${advancedFilterCount} advanced rule`,
+ other: `${advancedFilterCount} advanced rules`,
+ });
const { objectMetadataItems } = useObjectMetadataItems();
diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminQueueDetail.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminQueueDetail.tsx
new file mode 100644
index 00000000000..dffa44181de
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminQueueDetail.tsx
@@ -0,0 +1,88 @@
+import { SettingsAdminQueueJobsTable } from '@/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable';
+import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
+import { plural, t } from '@lingui/core/macro';
+import { useState } from 'react';
+import { useParams } from 'react-router-dom';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
+import { H2Title } from 'twenty-ui/display';
+import { Section } from 'twenty-ui/layout';
+
+export const SettingsAdminQueueDetail = () => {
+ const { queueName } = useParams<{ queueName: string }>();
+ const [retentionConfig, setRetentionConfig] = useState<{
+ completedMaxAge: number;
+ completedMaxCount: number;
+ failedMaxAge: number;
+ failedMaxCount: number;
+ } | null>(null);
+
+ if (!queueName) {
+ return null;
+ }
+
+ const formatDuration = (seconds: number) => {
+ const hours = Math.floor(seconds / 3600);
+ const days = Math.floor(seconds / 86400);
+
+ if (days >= 1) {
+ return plural(days, {
+ one: `${days} day`,
+ other: `${days} days`,
+ });
+ }
+
+ return plural(hours, {
+ one: `${hours} hour`,
+ other: `${hours} hours`,
+ });
+ };
+
+ const completedDuration = retentionConfig
+ ? formatDuration(retentionConfig.completedMaxAge)
+ : '';
+ const failedDuration = retentionConfig
+ ? formatDuration(retentionConfig.failedMaxAge)
+ : '';
+ const maxCount = retentionConfig ? retentionConfig.completedMaxCount : 0;
+
+ const queueDescription = retentionConfig
+ ? t`Completed jobs kept for ${completedDuration}, failed jobs kept for ${failedDuration} (max ${maxCount} each)`
+ : t`Loading retention configuration...`;
+
+ return (
+ <SubMenuTopBarContainer
+ title={t`Queue: ${queueName}`}
+ links={[
+ {
+ children: t`Admin Panel`,
+ href: getSettingsPath(SettingsPath.AdminPanel),
+ },
+ {
+ children: t`Health Status`,
+ href: getSettingsPath(SettingsPath.AdminPanelHealthStatus),
+ },
+ {
+ children: t`Worker`,
+ href: getSettingsPath(SettingsPath.AdminPanelIndicatorHealthStatus, {
+ indicatorId: 'worker',
+ }),
+ },
+ {
+ children: queueName,
+ },
+ ]}
+ >
+ <SettingsPageContainer>
+ <Section>
+ <H2Title title={t`Jobs`} description={queueDescription} />
+ <SettingsAdminQueueJobsTable
+ queueName={queueName}
+ onRetentionConfigLoaded={setRetentionConfig}
+ />
+ </Section>
+ </SettingsPageContainer>
+ </SubMenuTopBarContainer>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentHandoffTable.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentHandoffTable.tsx
index 7e0538ce1aa..8b3a39b0534 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentHandoffTable.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentHandoffTable.tsx
@@ -17,7 +17,7 @@ import {
} from 'twenty-ui/display';
import { IconButton } from 'twenty-ui/input';
import { useRemoveAgentHandoffMutation } from '~/generated-metadata/graphql';
-import { type AgentHandoffDto } from '~/generated/graphql';
+import { type AgentHandoff } from '~/generated/graphql';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
const AGENT_HANDOFF_DELETION_MODAL_ID = 'agent-handoff-deletion-modal';
@@ -51,7 +51,7 @@ const StyledTableCell = styled(TableCell)`
type SettingsAgentHandoffTableProps = {
agentId: string;
- handoffTargets: AgentHandoffDto[];
+ handoffTargets: AgentHandoff[];
onHandoffRemoved: () => void;
};
diff --git a/packages/twenty-front/src/testing/mock-data/billing-plans.ts b/packages/twenty-front/src/testing/mock-data/billing-plans.ts
index e72f7436420..64aa36b688f 100644
--- a/packages/twenty-front/src/testing/mock-data/billing-plans.ts
+++ b/packages/twenty-front/src/testing/mock-data/billing-plans.ts
@@ -19,14 +19,14 @@ export const mockBillingPlans = {
},
prices: [
{
- __typename: 'BillingPriceLicensedDTO',
+ __typename: 'BillingPriceLicensed',
stripePriceId: 'price_1RyF4BQh1LFc4XrXvt7DwNjS',
unitAmount: 1200,
recurringInterval: 'Month',
priceUsageType: 'LICENSED',
},
{
- __typename: 'BillingPriceLicensedDTO',
+ __typename: 'BillingPriceLicensed',
stripePriceId: 'price_1RyF4BQh1LFc4XrXK0QSeC7f',
unitAmount: 10800,
recurringInterval: 'Year',
@@ -49,19 +49,19 @@ export const mockBillingPlans = {
},
prices: [
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S5247Qh1LFc4XrXz7p0wdAc',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 999000,
unitAmount: null,
upTo: 7500000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -69,19 +69,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S5246Qh1LFc4XrX2SdtgqXV',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 399000,
unitAmount: null,
upTo: 2600000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -89,19 +89,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S5246Qh1LFc4XrXs78BMPQ9',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 199000,
unitAmount: null,
upTo: 1200000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -109,19 +109,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S5246Qh1LFc4XrXyMEu78zC',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 99000,
unitAmount: null,
upTo: 540000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -129,19 +129,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S5245Qh1LFc4XrXcNX3ZHn2',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 29000,
unitAmount: null,
upTo: 130000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -149,19 +149,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S5245Qh1LFc4XrXBSZDK2pI',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 0,
unitAmount: null,
upTo: 50000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -169,19 +169,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S5245Qh1LFc4XrXPCSjYIq0',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 99900,
unitAmount: null,
upTo: 700000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -189,19 +189,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S5244Qh1LFc4XrXswQAQfQh',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 39900,
unitAmount: null,
upTo: 240000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -209,19 +209,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S5244Qh1LFc4XrXB8yPMpce',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 19900,
unitAmount: null,
upTo: 110000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -229,19 +229,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S5244Qh1LFc4XrXa5wYhu1M',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 9900,
unitAmount: null,
upTo: 50000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -249,19 +249,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S5243Qh1LFc4XrX1rtoEZD3',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 2900,
unitAmount: null,
upTo: 10000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -269,19 +269,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S5243Qh1LFc4XrXaeDkjNQq',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 0,
unitAmount: null,
upTo: 5000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -309,14 +309,14 @@ export const mockBillingPlans = {
},
prices: [
{
- __typename: 'BillingPriceLicensedDTO',
+ __typename: 'BillingPriceLicensed',
stripePriceId: 'price_1RyF49Qh1LFc4XrX2W6yGRpc',
unitAmount: 2500,
recurringInterval: 'Month',
priceUsageType: 'LICENSED',
},
{
- __typename: 'BillingPriceLicensedDTO',
+ __typename: 'BillingPriceLicensed',
stripePriceId: 'price_1RyF48Qh1LFc4XrXw5Tr704k',
unitAmount: 22800,
recurringInterval: 'Year',
@@ -339,19 +339,19 @@ export const mockBillingPlans = {
},
prices: [
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S4GiuQh1LFc4XrX9IZ68tqy',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 999000,
unitAmount: null,
upTo: 7500000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -359,19 +359,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S4GirQh1LFc4XrXJxV0yJEX',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 399000,
unitAmount: null,
upTo: 2600000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -379,19 +379,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S4GirQh1LFc4XrX6fK2qrQm',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 199000,
unitAmount: null,
upTo: 1200000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -399,19 +399,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S4GipQh1LFc4XrXeamfdifM',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 99000,
unitAmount: null,
upTo: 540000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -419,19 +419,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S4GipQh1LFc4XrXKxrUDfnE',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 29000,
unitAmount: null,
upTo: 130000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -439,19 +439,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Year',
stripePriceId: 'price_1S4GioQh1LFc4XrXMTbLurFo',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 0,
unitAmount: null,
upTo: 50000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -459,19 +459,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S4GinQh1LFc4XrXP3sgt8Cn',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 99900,
unitAmount: null,
upTo: 700000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -479,19 +479,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S4GigQh1LFc4XrXGsuGslfk',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 39900,
unitAmount: null,
upTo: 240000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -499,19 +499,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S4GifQh1LFc4XrXCsT2PvH2',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 19900,
unitAmount: null,
upTo: 110000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -519,19 +519,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S4GifQh1LFc4XrXZ0ZIrjeM',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 9900,
unitAmount: null,
upTo: 50000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -539,19 +539,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S4GieQh1LFc4XrX8njwswjQ',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 2900,
unitAmount: null,
upTo: 10000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
@@ -559,19 +559,19 @@ export const mockBillingPlans = {
],
},
{
- __typename: 'BillingPriceMeteredDTO',
+ __typename: 'BillingPriceMetered',
priceUsageType: 'METERED',
recurringInterval: 'Month',
stripePriceId: 'price_1S4GieQh1LFc4XrXDpVbLuuE',
tiers: [
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: 0,
unitAmount: null,
upTo: 5000000,
},
{
- __typename: 'BillingPriceTierDTO',
+ __typename: 'BillingPriceTier',
flatAmount: null,
unitAmount: null,
upTo: null,
diff --git a/packages/twenty-server/src/database/clickHouse/clickHouse.service.spec.ts b/packages/twenty-server/src/database/clickHouse/clickHouse.service.spec.ts
index ba433a64911..4298e2095fb 100644
--- a/packages/twenty-server/src/database/clickHouse/clickHouse.service.spec.ts
+++ b/packages/twenty-server/src/database/clickHouse/clickHouse.service.spec.ts
@@ -23,6 +23,7 @@ describe('ClickHouseService', () => {
let service: ClickHouseService;
let twentyConfigService: TwentyConfigService;
let mockClickHouseClient: jest.Mocked<ClickHouseClient>;
+ let loggerErrorSpy: jest.SpyInstance;
beforeEach(async () => {
jest.clearAllMocks();
@@ -56,6 +57,11 @@ describe('ClickHouseService', () => {
service = module.get<ClickHouseService>(ClickHouseService);
twentyConfigService = module.get<TwentyConfigService>(TwentyConfigService);
+ // Mock logger error method to avoid polluting test output
+ loggerErrorSpy = jest
+ .spyOn((service as any).logger, 'error')
+ .mockImplementation();
+
// Set the mock client
(service as any).mainClient = mockClickHouseClient;
});
@@ -119,8 +125,10 @@ describe('ClickHouseService', () => {
const result = await service.insert('test_table', testData);
expect(result).toEqual({ success: false });
- // Since the service uses logger.error instead of exceptionHandlerService.captureExceptions,
- // we don't need to assert on exceptionHandlerService
+ expect(loggerErrorSpy).toHaveBeenCalledWith(
+ 'Error inserting data into ClickHouse',
+ testError,
+ );
});
});
@@ -161,8 +169,10 @@ describe('ClickHouseService', () => {
const result = await service.select(query);
expect(result).toEqual([]);
- // Since the service uses logger.error instead of exceptionHandlerService.captureExceptions,
- // we don't need to assert on exceptionHandlerService
+ expect(loggerErrorSpy).toHaveBeenCalledWith(
+ 'Error executing select query in ClickHouse',
+ testError,
+ );
});
});
diff --git a/packages/twenty-server/src/engine/api/common/common-query-runners/common-create-many-query-runner/common-create-many-query-runner.service.ts b/packages/twenty-server/src/engine/api/common/common-query-runners/common-create-many-query-runner/common-create-many-query-runner.service.ts
index e6573b8b4be..cb8d5f50733 100644
--- a/packages/twenty-server/src/engine/api/common/common-query-runners/common-create-many-query-runner/common-create-many-query-runner.service.ts
+++ b/packages/twenty-server/src/engine/api/common/common-query-runners/common-create-many-query-runner/common-create-many-query-runner.service.ts
@@ -129,7 +129,7 @@ export class CommonCreateManyQueryRunnerService extends CommonBaseQueryRunnerSer
(await this.workspaceQueryHookService.executePreQueryHooks(
authContext,
objectMetadataItemWithFieldMaps.nameSingular,
- CommonQueryNames.createMany,
+ CommonQueryNames.CREATE_MANY,
args,
//TODO : Refacto-common - To fix when updating workspaceQueryHookService, removing gql typing dependency
)) as CreateManyQueryArgs;
diff --git a/packages/twenty-server/src/engine/api/common/common-query-runners/common-find-many-query-runner.service.ts b/packages/twenty-server/src/engine/api/common/common-query-runners/common-find-many-query-runner.service.ts
index 18e3274f1ef..fbed5f64908 100644
--- a/packages/twenty-server/src/engine/api/common/common-query-runners/common-find-many-query-runner.service.ts
+++ b/packages/twenty-server/src/engine/api/common/common-query-runners/common-find-many-query-runner.service.ts
@@ -205,7 +205,7 @@ export class CommonFindManyQueryRunnerService extends CommonBaseQueryRunnerServi
const enrichedRecords = await this.enrichResultsWithGettersAndHooks({
results: objectRecords,
- operationName: CommonQueryNames.findMany,
+ operationName: CommonQueryNames.FIND_MANY,
authContext,
objectMetadataItemWithFieldMaps,
objectMetadataMaps,
@@ -272,7 +272,7 @@ export class CommonFindManyQueryRunnerService extends CommonBaseQueryRunnerServi
(await this.workspaceQueryHookService.executePreQueryHooks(
authContext,
objectMetadataItemWithFieldMaps.nameSingular,
- CommonQueryNames.findMany,
+ CommonQueryNames.FIND_MANY,
args,
//TODO : Refacto-common - To fix when updating workspaceQueryHookService, removing gql typing dependency
)) as FindManyQueryArgs;
diff --git a/packages/twenty-server/src/engine/api/common/common-query-runners/common-find-one-query-runner.service.ts b/packages/twenty-server/src/engine/api/common/common-query-runners/common-find-one-query-runner.service.ts
index 0a57755a489..9768e3eddfc 100644
--- a/packages/twenty-server/src/engine/api/common/common-query-runners/common-find-one-query-runner.service.ts
+++ b/packages/twenty-server/src/engine/api/common/common-query-runners/common-find-one-query-runner.service.ts
@@ -138,7 +138,7 @@ export class CommonFindOneQueryRunnerService extends CommonBaseQueryRunnerServic
authContext,
objectMetadataItemWithFieldMaps,
objectMetadataMaps,
- operationName: CommonQueryNames.findOne,
+ operationName: CommonQueryNames.FIND_ONE,
});
return enrichedResults[0];
@@ -157,7 +157,7 @@ export class CommonFindOneQueryRunnerService extends CommonBaseQueryRunnerServic
(await this.workspaceQueryHookService.executePreQueryHooks(
authContext,
objectMetadataItemWithFieldMaps.nameSingular,
- CommonQueryNames.findOne,
+ CommonQueryNames.FIND_ONE,
args,
//TODO : Refacto-common - To fix when updating workspaceQueryHookService, removing gql typing dependency
)) as FindOneQueryArgs;
diff --git a/packages/twenty-server/src/engine/api/common/common-query-runners/common-group-by-query-runner.service.ts b/packages/twenty-server/src/engine/api/common/common-query-runners/common-group-by-query-runner.service.ts
index 4215f04260c..c478dfcdf2f 100644
--- a/packages/twenty-server/src/engine/api/common/common-query-runners/common-group-by-query-runner.service.ts
+++ b/packages/twenty-server/src/engine/api/common/common-query-runners/common-group-by-query-runner.service.ts
@@ -311,7 +311,7 @@ export class CommonGroupByQueryRunnerService extends CommonBaseQueryRunnerServic
(await this.workspaceQueryHookService.executePreQueryHooks(
authContext,
objectMetadataItemWithFieldMaps.nameSingular,
- CommonQueryNames.groupBy,
+ CommonQueryNames.GROUP_BY,
args,
//TODO : Refacto-common - To fix when updating workspaceQueryHookService, removing gql typing dependency
)) as GroupByQueryArgs;
diff --git a/packages/twenty-server/src/engine/api/common/types/common-query-args.type.ts b/packages/twenty-server/src/engine/api/common/types/common-query-args.type.ts
index ee1090b31c9..b3013753970 100644
--- a/packages/twenty-server/src/engine/api/common/types/common-query-args.type.ts
+++ b/packages/twenty-server/src/engine/api/common/types/common-query-args.type.ts
@@ -12,10 +12,10 @@ import {
import { type CommonSelectedFields } from 'src/engine/api/common/types/common-selected-fields-result.type';
export enum CommonQueryNames {
- findOne = 'findOne',
- findMany = 'findMany',
- createMany = 'createMany',
- groupBy = 'groupBy',
+ FIND_ONE = 'findOne',
+ FIND_MANY = 'findMany',
+ CREATE_MANY = 'createMany',
+ GROUP_BY = 'groupBy',
}
export interface FindOneQueryArgs {
diff --git a/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/interfaces/base-resolver-service.ts b/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/interfaces/base-resolver-service.ts
index 53d094f3f14..f4afaf162a0 100644
--- a/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/interfaces/base-resolver-service.ts
+++ b/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/interfaces/base-resolver-service.ts
@@ -2,11 +2,7 @@ import { Inject, Injectable } from '@nestjs/common';
import graphqlFields from 'graphql-fields';
import { type ObjectRecord } from 'twenty-shared/types';
-import {
- assertIsDefinedOrThrow,
- capitalize,
- isDefined,
-} from 'twenty-shared/utils';
+import { assertIsDefinedOrThrow, isDefined } from 'twenty-shared/utils';
import { type ObjectLiteral } from 'typeorm';
import { type IConnection } from 'src/engine/api/graphql/workspace-query-runner/interfaces/connection.interface';
@@ -14,7 +10,6 @@ import { type IEdge } from 'src/engine/api/graphql/workspace-query-runner/interf
import { type WorkspaceQueryRunnerOptions } from 'src/engine/api/graphql/workspace-query-runner/interfaces/query-runner-option.interface';
import {
type ResolverArgs,
- ResolverArgsType,
type WorkspaceResolverBuilderMethodNames,
} from 'src/engine/api/graphql/workspace-resolver-builder/interfaces/workspace-resolvers-builder.interface';
@@ -115,8 +110,7 @@ export abstract class GraphqlQueryBaseResolverService<
const computedArgs = (await this.queryRunnerArgsFactory.create(
hookedArgs,
options,
- // @ts-expect-error legacy noImplicitAny
- ResolverArgsType[capitalize(operationName)],
+ operationName,
)) as Input;
let roleId: string | undefined;
diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/factories/__tests__/query-runner-args.factory.spec.ts b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/factories/__tests__/query-runner-args.factory.spec.ts
index 82accf2da9c..465e8137654 100644
--- a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/factories/__tests__/query-runner-args.factory.spec.ts
+++ b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/factories/__tests__/query-runner-args.factory.spec.ts
@@ -89,7 +89,7 @@ describe('QueryRunnerArgsFactory', () => {
const result = await factory.create(
args,
options,
- ResolverArgsType.CreateMany,
+ ResolverArgsType.CREATE_MANY,
);
expect(result).toEqual(args);
@@ -104,7 +104,7 @@ describe('QueryRunnerArgsFactory', () => {
const result = await factory.create(
args,
options,
- ResolverArgsType.CreateMany,
+ ResolverArgsType.CREATE_MANY,
);
const expectedArgs = {
@@ -140,7 +140,7 @@ describe('QueryRunnerArgsFactory', () => {
const result = await factory.create(
args,
options,
- ResolverArgsType.CreateMany,
+ ResolverArgsType.CREATE_MANY,
);
const expectedArgs = {
@@ -176,7 +176,7 @@ describe('QueryRunnerArgsFactory', () => {
const result = await factory.create(
args,
options,
- ResolverArgsType.FindMany,
+ ResolverArgsType.FIND_MANY,
);
expect(result).toEqual({
@@ -194,7 +194,7 @@ describe('QueryRunnerArgsFactory', () => {
const result = await factory.create(
args,
options,
- ResolverArgsType.FindOne,
+ ResolverArgsType.FIND_ONE,
);
expect(result).toEqual({
@@ -212,7 +212,7 @@ describe('QueryRunnerArgsFactory', () => {
const result = await factory.create(
args,
options,
- ResolverArgsType.FindDuplicates,
+ ResolverArgsType.FIND_DUPLICATES,
);
expect(result).toEqual({
diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/factories/query-runner-args.factory.ts b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/factories/query-runner-args.factory.ts
index 65464a7485e..122886ed38c 100644
--- a/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/factories/query-runner-args.factory.ts
+++ b/packages/twenty-server/src/engine/api/graphql/workspace-query-runner/factories/query-runner-args.factory.ts
@@ -17,6 +17,7 @@ import {
ResolverArgsType,
type UpdateManyResolverArgs,
type UpdateOneResolverArgs,
+ type WorkspaceResolverBuilderMethodNames,
} from 'src/engine/api/graphql/workspace-resolver-builder/interfaces/workspace-resolvers-builder.interface';
import { AuthContext } from 'src/engine/core-modules/auth/types/auth-context.type';
@@ -36,7 +37,7 @@ export class QueryRunnerArgsFactory {
async create(
args: ResolverArgs,
options: WorkspaceQueryRunnerOptions,
- resolverArgsType: ResolverArgsType,
+ resolverArgsType: WorkspaceResolverBuilderMethodNames,
) {
const fieldMetadataMapByNameByName =
options.objectMetadataItemWithFieldMaps.fieldsById;
@@ -44,7 +45,7 @@ export class QueryRunnerArgsFactory {
const { objectMetadataItemWithFieldMaps, authContext } = options;
switch (resolverArgsType) {
- case ResolverArgsType.CreateOne:
+ case ResolverArgsType.CREATE_ONE:
return {
...args,
data: (
@@ -55,7 +56,7 @@ export class QueryRunnerArgsFactory {
})
)[0],
} satisfies CreateOneResolverArgs;
- case ResolverArgsType.CreateMany:
+ case ResolverArgsType.CREATE_MANY:
return {
...args,
data: await this.overrideDataByFieldMetadata({
@@ -64,7 +65,7 @@ export class QueryRunnerArgsFactory {
objectMetadataItemWithFieldMaps,
}),
} satisfies CreateManyResolverArgs;
- case ResolverArgsType.UpdateOne:
+ case ResolverArgsType.UPDATE_ONE:
return {
...args,
id: (args as UpdateOneResolverArgs).id,
@@ -77,7 +78,7 @@ export class QueryRunnerArgsFactory {
})
)[0],
} satisfies UpdateOneResolverArgs;
- case ResolverArgsType.UpdateMany:
+ case ResolverArgsType.UPDATE_MANY:
return {
...args,
filter: this.overrideFilterByFieldMetadata(
@@ -93,7 +94,7 @@ export class QueryRunnerArgsFactory {
})
)[0],
} satisfies UpdateManyResolverArgs;
- case ResolverArgsType.FindOne:
+ case ResolverArgsType.FIND_ONE:
return {
...args,
filter: this.overrideFilterByFieldMetadata(
@@ -101,7 +102,7 @@ export class QueryRunnerArgsFactory {
options.objectMetadataItemWithFieldMaps,
),
};
- case ResolverArgsType.FindMany:
+ case ResolverArgsType.FIND_MANY:
return {
...args,
filter: this.overrideFilterByFieldMetadata(
@@ -109,7 +110,7 @@ export class QueryRunnerArgsFactory {
options.objectMetadataItemWithFieldMaps,
),
};
- case ResolverArgsType.FindDuplicates:
+ case ResolverArgsType.FIND_DUPLICATES:
return {
...args,
ids: (await Promise.all(
@@ -129,7 +130,7 @@ export class QueryRunnerArgsFactory {
shouldBackfillPositionIfUndefined: false,
}),
} satisfies FindDuplicatesResolverArgs;
- case ResolverArgsType.MergeMany:
+ case ResolverArgsType.MERGE_MANY:
return {
...args,
ids: (await Promise.all(
@@ -146,7 +147,7 @@ export class QueryRunnerArgsFactory {
.conflictPriorityIndex,
dryRun: (args as MergeManyResolverArgs).dryRun,
} satisfies MergeManyResolverArgs;
- case ResolverArgsType.GroupBy:
+ case ResolverArgsType.GROUP_BY:
return {
...args,
filter: this.overrideFilterByFieldMetadata(
diff --git a/packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/interfaces/workspace-resolvers-builder.interface.ts b/packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/interfaces/workspace-resolvers-builder.interface.ts
index 97bff3424d1..956ba8ba419 100644
--- a/packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/interfaces/workspace-resolvers-builder.interface.ts
+++ b/packages/twenty-server/src/engine/api/graphql/workspace-resolver-builder/interfaces/workspace-resolvers-builder.interface.ts
@@ -10,27 +10,15 @@ import {
type ObjectRecordOrderBy,
} from 'src/engine/api/graphql/workspace-query-builder/interfaces/object-record.interface';
+import { RESOLVER_METHOD_NAMES } from 'src/engine/api/graphql/workspace-resolver-builder/constants/resolver-method-names';
import { type workspaceResolverBuilderMethodNames } from 'src/engine/api/graphql/workspace-resolver-builder/factories/factories';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Resolver<Args = any> = GraphQLFieldResolver<any, any, Args>;
-export enum ResolverArgsType {
- FindMany = 'FindMany',
- FindOne = 'FindOne',
- FindDuplicates = 'FindDuplicates',
- CreateOne = 'CreateOne',
- CreateMany = 'CreateMany',
- UpdateOne = 'UpdateOne',
- UpdateMany = 'UpdateMany',
- DeleteOne = 'DeleteOne',
- DeleteMany = 'DeleteMany',
- RestoreMany = 'RestoreMany',
- DestroyMany = 'DestroyMany',
- DestroyOne = 'DestroyOne',
- MergeMany = 'MergeMany',
- GroupBy = 'GroupBy',
-}
+// Use RESOLVER_METHOD_NAMES as the single source of truth for operation names
+// This avoids duplication and ensures consistency across the codebase
+export const ResolverArgsType = RESOLVER_METHOD_NAMES;
export interface FindManyResolverArgs<
Filter extends ObjectRecordFilter = ObjectRecordFilter,
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/__tests__/admin-panel-health.service.spec.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/__tests__/admin-panel-health.service.spec.ts
index 140d591b3d9..f4e8f70aac5 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/__tests__/admin-panel-health.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/__tests__/admin-panel-health.service.spec.ts
@@ -5,7 +5,7 @@ import { type Redis } from 'ioredis';
import { AdminPanelHealthService } from 'src/engine/core-modules/admin-panel/admin-panel-health.service';
import { HEALTH_INDICATORS } from 'src/engine/core-modules/admin-panel/constants/health-indicators.constants';
-import { type SystemHealth } from 'src/engine/core-modules/admin-panel/dtos/system-health.dto';
+import { type SystemHealthDTO } from 'src/engine/core-modules/admin-panel/dtos/system-health.dto';
import { AdminPanelHealthServiceStatus } from 'src/engine/core-modules/admin-panel/enums/admin-panel-health-service-status.enum';
import { QueueMetricsTimeRange } from 'src/engine/core-modules/admin-panel/enums/queue-metrics-time-range.enum';
import { HEALTH_ERROR_MESSAGES } from 'src/engine/core-modules/health/constants/health-error-messages.constants';
@@ -40,6 +40,7 @@ describe('AdminPanelHealthService', () => {
appHealth = { isHealthy: jest.fn() } as any;
redisClient = {
getClient: jest.fn().mockReturnValue({} as Redis),
+ getQueueClient: jest.fn().mockReturnValue({} as Redis),
} as any;
twentyConfigService = { get: jest.fn() } as any;
@@ -150,7 +151,7 @@ describe('AdminPanelHealthService', () => {
const result = await service.getSystemHealthStatus();
- const expected: SystemHealth = {
+ const expected: SystemHealthDTO = {
services: [
{
...HEALTH_INDICATORS[HealthIndicatorId.database],
@@ -372,6 +373,7 @@ describe('AdminPanelHealthService', () => {
beforeEach(() => {
jest.clearAllMocks();
redisClient.getClient.mockReturnValue({} as Redis);
+ redisClient.getQueueClient.mockReturnValue({} as Redis);
(Queue as unknown as jest.Mock).mockImplementation(() => mockQueue);
});
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel-health.service.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel-health.service.ts
index 1a6e4424bba..1c971b0409e 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel-health.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel-health.service.ts
@@ -7,9 +7,9 @@ import {
import { Queue } from 'bullmq';
import { HEALTH_INDICATORS } from 'src/engine/core-modules/admin-panel/constants/health-indicators.constants';
-import { type AdminPanelHealthServiceData } from 'src/engine/core-modules/admin-panel/dtos/admin-panel-health-service-data.dto';
-import { type QueueMetricsData } from 'src/engine/core-modules/admin-panel/dtos/queue-metrics-data.dto';
-import { type SystemHealth } from 'src/engine/core-modules/admin-panel/dtos/system-health.dto';
+import { type AdminPanelHealthServiceDataDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-panel-health-service-data.dto';
+import { type QueueMetricsDataDTO } from 'src/engine/core-modules/admin-panel/dtos/queue-metrics-data.dto';
+import { type SystemHealthDTO } from 'src/engine/core-modules/admin-panel/dtos/system-health.dto';
import { AdminPanelHealthServiceStatus } from 'src/engine/core-modules/admin-panel/enums/admin-panel-health-service-status.enum';
import { QueueMetricsTimeRange } from 'src/engine/core-modules/admin-panel/enums/queue-metrics-time-range.enum';
import { HealthIndicatorId } from 'src/engine/core-modules/health/enums/health-indicator-id.enum';
@@ -117,7 +117,7 @@ export class AdminPanelHealthService {
async getIndicatorHealthStatus(
indicatorId: HealthIndicatorId,
- ): Promise<AdminPanelHealthServiceData> {
+ ): Promise<AdminPanelHealthServiceDataDTO> {
const healthIndicator = this.healthIndicators[indicatorId];
if (!healthIndicator) {
@@ -145,7 +145,7 @@ export class AdminPanelHealthService {
return indicatorStatus;
}
- async getSystemHealthStatus(): Promise<SystemHealth> {
+ async getSystemHealthStatus(): Promise<SystemHealthDTO> {
const [
databaseResult,
redisResult,
@@ -198,8 +198,8 @@ export class AdminPanelHealthService {
async getQueueMetrics(
queueName: MessageQueue,
timeRange: QueueMetricsTimeRange = QueueMetricsTimeRange.OneDay,
- ): Promise<QueueMetricsData> {
- const redis = this.redisClient.getClient();
+ ): Promise<QueueMetricsDataDTO> {
+ const redis = this.redisClient.getQueueClient();
const queue = new Queue(queueName, { connection: redis });
try {
@@ -325,7 +325,7 @@ export class AdminPanelHealthService {
timeRange: QueueMetricsTimeRange,
queueName: MessageQueue,
queueDetails: WorkerQueueHealth | null,
- ): QueueMetricsData {
+ ): QueueMetricsDataDTO {
try {
return {
queueName,
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel-queue.service.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel-queue.service.ts
new file mode 100644
index 00000000000..619dcb451f4
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel-queue.service.ts
@@ -0,0 +1,246 @@
+import { Injectable } from '@nestjs/common';
+
+import { msg } from '@lingui/core/macro';
+import { Queue } from 'bullmq';
+import { type JobState as BullMQJobState } from 'bullmq/dist/esm/types';
+
+import {
+ bullMQToJobStateEnum,
+ JobStateEnum,
+ jobStateEnumToBullMQ,
+} from 'src/engine/core-modules/admin-panel/enums/job-state.enum';
+import { InternalServerError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
+import { QUEUE_RETENTION } from 'src/engine/core-modules/message-queue/constants/queue-retention.constants';
+import { type MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
+import { RedisClientService } from 'src/engine/core-modules/redis-client/redis-client.service';
+
+type JobOperationResult = {
+ jobId: string;
+ success: boolean;
+ error?: string;
+};
+
+@Injectable()
+export class AdminPanelQueueService {
+ constructor(private readonly redisClient: RedisClientService) {}
+
+ async getQueueJobs(
+ queueName: MessageQueue,
+ state: JobStateEnum,
+ limit = 50,
+ offset = 0,
+ ) {
+ const redis = this.redisClient.getQueueClient();
+ const queue = new Queue(queueName, { connection: redis });
+
+ try {
+ const validLimit = Math.min(Math.max(1, limit), 200);
+ const validOffset = Math.max(0, offset);
+
+ const start = validOffset;
+ const end = validOffset + validLimit - 1;
+
+ // Convert GraphQL enum to BullMQ state
+ const bullMQState = jobStateEnumToBullMQ[state];
+ const jobs = await queue.getJobs([bullMQState], start, end, false);
+
+ const transformedJobs = await Promise.all(
+ jobs.map(async (job) => {
+ const jobBullMQState = (await job.getState()) as BullMQJobState;
+
+ return {
+ id: job.id!,
+ name: job.name,
+ data: job.data,
+ state: bullMQToJobStateEnum[jobBullMQState],
+ timestamp: job.timestamp,
+ failedReason: job.failedReason,
+ processedOn: job.processedOn,
+ finishedOn: job.finishedOn,
+ attemptsMade: job.attemptsMade,
+ returnValue: job.returnValue,
+ logs: undefined,
+ stackTrace: job.stackTrace,
+ };
+ }),
+ );
+
+ const hasMore = jobs.length === validLimit;
+
+ const jobCounts = await queue.getJobCounts(
+ 'completed',
+ 'failed',
+ 'active',
+ 'waiting',
+ 'delayed',
+ 'prioritized',
+ 'waiting-children',
+ );
+
+ const totalCountForState = (() => {
+ switch (state) {
+ case JobStateEnum.COMPLETED:
+ return jobCounts.completed ?? 0;
+ case JobStateEnum.FAILED:
+ return jobCounts.failed ?? 0;
+ case JobStateEnum.ACTIVE:
+ return jobCounts.active ?? 0;
+ case JobStateEnum.WAITING:
+ return jobCounts.waiting ?? 0;
+ case JobStateEnum.DELAYED:
+ return jobCounts.delayed ?? 0;
+ case JobStateEnum.PRIORITIZED:
+ return jobCounts.prioritized ?? 0;
+ case JobStateEnum.WAITING_CHILDREN:
+ return jobCounts['waiting-children'] ?? 0;
+ default:
+ return jobs.length;
+ }
+ })();
+
+ return {
+ jobs: transformedJobs,
+ count: jobs.length,
+ totalCount: totalCountForState,
+ hasMore,
+ retentionConfig: { ...QUEUE_RETENTION },
+ };
+ } catch (error) {
+ throw new InternalServerError(
+ `Failed to fetch jobs from queue ${queueName}: ${error instanceof Error ? error.message : String(error)}`,
+ {
+ userFriendlyMessage: msg`Failed to load queue jobs. Please try again later.`,
+ },
+ );
+ } finally {
+ await queue.close();
+ }
+ }
+
+ async retryJobs(
+ queueName: MessageQueue,
+ jobIds: string[],
+ ): Promise<{
+ retriedCount: number;
+ results: JobOperationResult[];
+ }> {
+ const redis = this.redisClient.getQueueClient();
+ const queue = new Queue(queueName, { connection: redis });
+
+ try {
+ if (jobIds.length === 0) {
+ await queue.retryJobs({ state: 'failed' });
+
+ return { retriedCount: -1, results: [] };
+ }
+
+ const results: JobOperationResult[] = [];
+ let retriedCount = 0;
+
+ for (const jobId of jobIds) {
+ const job = await queue.getJob(jobId);
+
+ if (!job) {
+ results.push({
+ jobId,
+ success: false,
+ error: 'Job not found',
+ });
+ continue;
+ }
+
+ const state = await job.getState();
+
+ if (state !== 'failed') {
+ results.push({
+ jobId,
+ success: false,
+ error: `Job is not in failed state (current state: ${state})`,
+ });
+ continue;
+ }
+
+ try {
+ await job.retry();
+ retriedCount++;
+ results.push({
+ jobId,
+ success: true,
+ });
+ } catch (error) {
+ results.push({
+ jobId,
+ success: false,
+ error: error instanceof Error ? error.message : String(error),
+ });
+ }
+ }
+
+ return { retriedCount, results };
+ } catch (error) {
+ throw new InternalServerError(
+ `Failed to retry jobs in queue ${queueName}: ${error instanceof Error ? error.message : String(error)}`,
+ {
+ userFriendlyMessage: msg`Failed to retry jobs. Please try again later.`,
+ },
+ );
+ } finally {
+ await queue.close();
+ }
+ }
+
+ async deleteJobs(
+ queueName: MessageQueue,
+ jobIds: string[],
+ ): Promise<{
+ deletedCount: number;
+ results: JobOperationResult[];
+ }> {
+ const redis = this.redisClient.getQueueClient();
+ const queue = new Queue(queueName, { connection: redis });
+
+ try {
+ const results: JobOperationResult[] = [];
+ let deletedCount = 0;
+
+ for (const jobId of jobIds) {
+ const job = await queue.getJob(jobId);
+
+ if (!job) {
+ results.push({
+ jobId,
+ success: false,
+ error: 'Job not found',
+ });
+ continue;
+ }
+
+ try {
+ await job.remove();
+ deletedCount++;
+ results.push({
+ jobId,
+ success: true,
+ });
+ } catch (error) {
+ results.push({
+ jobId,
+ success: false,
+ error: error instanceof Error ? error.message : String(error),
+ });
+ }
+ }
+
+ return { deletedCount, results };
+ } catch (error) {
+ throw new InternalServerError(
+ `Failed to delete jobs in queue ${queueName}: ${error instanceof Error ? error.message : String(error)}`,
+ {
+ userFriendlyMessage: msg`Failed to delete jobs. Please try again later.`,
+ },
+ );
+ } finally {
+ await queue.close();
+ }
+ }
+}
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 1cb8e38a007..dc3ad9d375c 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
@@ -3,6 +3,7 @@ import { TerminusModule } from '@nestjs/terminus';
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 { AuditModule } from 'src/engine/core-modules/audit/audit.module';
@@ -32,7 +33,12 @@ import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permi
ImpersonationModule,
PermissionsModule,
],
- providers: [AdminPanelResolver, AdminPanelService, AdminPanelHealthService],
+ providers: [
+ AdminPanelResolver,
+ AdminPanelService,
+ AdminPanelHealthService,
+ AdminPanelQueueService,
+ ],
exports: [AdminPanelService],
})
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 3206f0f1a62..440e7e1f634 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
@@ -1,17 +1,22 @@
import { UseFilters, UseGuards, UsePipes } from '@nestjs/common';
-import { Args, Mutation, Query, Resolver } from '@nestjs/graphql';
+import { Args, Int, Mutation, Query, Resolver } from '@nestjs/graphql';
import GraphQLJSON from 'graphql-type-json';
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 { ConfigVariable } from 'src/engine/core-modules/admin-panel/dtos/config-variable.dto';
+import { ConfigVariableDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variable.dto';
import { ConfigVariablesOutput } from 'src/engine/core-modules/admin-panel/dtos/config-variables.output';
-import { SystemHealth } from 'src/engine/core-modules/admin-panel/dtos/system-health.dto';
+import { DeleteJobsResponseDTO } from 'src/engine/core-modules/admin-panel/dtos/delete-jobs-response.dto';
+import { QueueJobsResponseDTO } from 'src/engine/core-modules/admin-panel/dtos/queue-jobs-response.dto';
+import { RetryJobsResponseDTO } from 'src/engine/core-modules/admin-panel/dtos/retry-jobs-response.dto';
+import { SystemHealthDTO } from 'src/engine/core-modules/admin-panel/dtos/system-health.dto';
import { UpdateWorkspaceFeatureFlagInput } from 'src/engine/core-modules/admin-panel/dtos/update-workspace-feature-flag.input';
import { UserLookup } from 'src/engine/core-modules/admin-panel/dtos/user-lookup.entity';
import { UserLookupInput } from 'src/engine/core-modules/admin-panel/dtos/user-lookup.input';
-import { VersionInfo } from 'src/engine/core-modules/admin-panel/dtos/version-info.dto';
+import { VersionInfoDTO } from 'src/engine/core-modules/admin-panel/dtos/version-info.dto';
+import { JobStateEnum } from 'src/engine/core-modules/admin-panel/enums/job-state.enum';
import { QueueMetricsTimeRange } from 'src/engine/core-modules/admin-panel/enums/queue-metrics-time-range.enum';
import { AuthGraphqlApiExceptionFilter } from 'src/engine/core-modules/auth/filters/auth-graphql-api-exception.filter';
import { FeatureFlagException } from 'src/engine/core-modules/feature-flag/feature-flag.exception';
@@ -29,8 +34,8 @@ import { ServerLevelImpersonateGuard } from 'src/engine/guards/server-level-impe
import { UserAuthGuard } from 'src/engine/guards/user-auth.guard';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
-import { AdminPanelHealthServiceData } from './dtos/admin-panel-health-service-data.dto';
-import { QueueMetricsData } from './dtos/queue-metrics-data.dto';
+import { AdminPanelHealthServiceDataDTO } from './dtos/admin-panel-health-service-data.dto';
+import { QueueMetricsDataDTO } from './dtos/queue-metrics-data.dto';
@UsePipes(ResolverValidationPipe)
@Resolver()
@@ -43,6 +48,7 @@ export class AdminPanelResolver {
constructor(
private adminService: AdminPanelService,
private adminPanelHealthService: AdminPanelHealthService,
+ private adminPanelQueueService: AdminPanelQueueService,
private featureFlagService: FeatureFlagService,
private readonly twentyConfigService: TwentyConfigService,
) {}
@@ -84,34 +90,34 @@ export class AdminPanelResolver {
}
@UseGuards(WorkspaceAuthGuard, UserAuthGuard, AdminPanelGuard)
- @Query(() => SystemHealth)
- async getSystemHealthStatus(): Promise<SystemHealth> {
+ @Query(() => SystemHealthDTO)
+ async getSystemHealthStatus(): Promise<SystemHealthDTO> {
return this.adminPanelHealthService.getSystemHealthStatus();
}
@UseGuards(WorkspaceAuthGuard, UserAuthGuard, AdminPanelGuard)
- @Query(() => AdminPanelHealthServiceData)
+ @Query(() => AdminPanelHealthServiceDataDTO)
async getIndicatorHealthStatus(
@Args('indicatorId', {
type: () => HealthIndicatorId,
})
indicatorId: HealthIndicatorId,
- ): Promise<AdminPanelHealthServiceData> {
+ ): Promise<AdminPanelHealthServiceDataDTO> {
return this.adminPanelHealthService.getIndicatorHealthStatus(indicatorId);
}
@UseGuards(WorkspaceAuthGuard, UserAuthGuard, AdminPanelGuard)
- @Query(() => QueueMetricsData)
+ @Query(() => QueueMetricsDataDTO)
async getQueueMetrics(
@Args('queueName', { type: () => String })
queueName: string,
@Args('timeRange', {
nullable: true,
- defaultValue: QueueMetricsTimeRange.OneDay,
+ defaultValue: QueueMetricsTimeRange.OneHour,
type: () => QueueMetricsTimeRange,
})
timeRange: QueueMetricsTimeRange = QueueMetricsTimeRange.OneHour,
- ): Promise<QueueMetricsData> {
+ ): Promise<QueueMetricsDataDTO> {
return await this.adminPanelHealthService.getQueueMetrics(
queueName as MessageQueue,
timeRange,
@@ -119,16 +125,16 @@ export class AdminPanelResolver {
}
@UseGuards(WorkspaceAuthGuard, UserAuthGuard, AdminPanelGuard)
- @Query(() => VersionInfo)
- async versionInfo(): Promise<VersionInfo> {
+ @Query(() => VersionInfoDTO)
+ async versionInfo(): Promise<VersionInfoDTO> {
return this.adminService.getVersionInfo();
}
@UseGuards(WorkspaceAuthGuard, UserAuthGuard, AdminPanelGuard)
- @Query(() => ConfigVariable)
+ @Query(() => ConfigVariableDTO)
async getDatabaseConfigVariable(
@Args('key', { type: () => String }) key: keyof ConfigVariables,
- ): Promise<ConfigVariable> {
+ ): Promise<ConfigVariableDTO> {
this.twentyConfigService.validateConfigVariableExists(key as string);
return this.adminService.getConfigVariable(key);
@@ -167,4 +173,52 @@ export class AdminPanelResolver {
return true;
}
+
+ @UseGuards(WorkspaceAuthGuard, UserAuthGuard, AdminPanelGuard)
+ @Query(() => QueueJobsResponseDTO)
+ async getQueueJobs(
+ @Args('queueName', { type: () => String })
+ queueName: string,
+ @Args('state', { type: () => JobStateEnum })
+ state: JobStateEnum,
+ @Args('limit', { type: () => Int, nullable: true, defaultValue: 50 })
+ limit?: number,
+ @Args('offset', { type: () => Int, nullable: true, defaultValue: 0 })
+ offset?: number,
+ ): Promise<QueueJobsResponseDTO> {
+ return await this.adminPanelQueueService.getQueueJobs(
+ queueName as MessageQueue,
+ state,
+ limit,
+ offset,
+ );
+ }
+
+ @UseGuards(WorkspaceAuthGuard, UserAuthGuard, AdminPanelGuard)
+ @Mutation(() => RetryJobsResponseDTO)
+ async retryJobs(
+ @Args('queueName', { type: () => String })
+ queueName: string,
+ @Args('jobIds', { type: () => [String] })
+ jobIds: string[],
+ ): Promise<RetryJobsResponseDTO> {
+ return await this.adminPanelQueueService.retryJobs(
+ queueName as MessageQueue,
+ jobIds,
+ );
+ }
+
+ @UseGuards(WorkspaceAuthGuard, UserAuthGuard, AdminPanelGuard)
+ @Mutation(() => DeleteJobsResponseDTO)
+ async deleteJobs(
+ @Args('queueName', { type: () => String })
+ queueName: string,
+ @Args('jobIds', { type: () => [String] })
+ jobIds: string[],
+ ): Promise<DeleteJobsResponseDTO> {
+ return await this.adminPanelQueueService.deleteJobs(
+ queueName as MessageQueue,
+ jobIds,
+ );
+ }
}
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
index ed3f41e8a4f..413cd7c2776 100644
--- 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
@@ -7,11 +7,11 @@ import semver from 'semver';
import { Repository } from 'typeorm';
import * as z from 'zod';
-import { type ConfigVariable } from 'src/engine/core-modules/admin-panel/dtos/config-variable.dto';
-import { type ConfigVariablesGroupData } from 'src/engine/core-modules/admin-panel/dtos/config-variables-group.dto';
+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 ConfigVariablesOutput } from 'src/engine/core-modules/admin-panel/dtos/config-variables.output';
import { type UserLookup } from 'src/engine/core-modules/admin-panel/dtos/user-lookup.entity';
-import { type VersionInfo } from 'src/engine/core-modules/admin-panel/dtos/version-info.dto';
+import { type VersionInfoDTO } from 'src/engine/core-modules/admin-panel/dtos/version-info.dto';
import { AuditService } from 'src/engine/core-modules/audit/services/audit.service';
import {
AuthException,
@@ -114,14 +114,14 @@ export class AdminPanelService {
getConfigVariablesGrouped(): ConfigVariablesOutput {
const rawEnvVars = this.twentyConfigService.getAll();
- const groupedData = new Map<ConfigVariablesGroup, ConfigVariable[]>();
+ const groupedData = new Map<ConfigVariablesGroup, ConfigVariableDTO[]>();
for (const [varName, { value, metadata, source }] of Object.entries(
rawEnvVars,
)) {
const { group, description } = metadata;
- const envVar: ConfigVariable = {
+ const envVar: ConfigVariableDTO = {
name: varName,
description,
value: value ?? null,
@@ -139,7 +139,9 @@ export class AdminPanelService {
groupedData.get(group)?.push(envVar);
}
- const groups: ConfigVariablesGroupData[] = Array.from(groupedData.entries())
+ const groups: ConfigVariablesGroupDataDTO[] = Array.from(
+ groupedData.entries(),
+ )
.sort((a, b) => {
const positionA = CONFIG_VARIABLES_GROUP_METADATA[a[0]].position;
const positionB = CONFIG_VARIABLES_GROUP_METADATA[b[0]].position;
@@ -156,7 +158,7 @@ export class AdminPanelService {
return { groups };
}
- getConfigVariable(key: string): ConfigVariable {
+ getConfigVariable(key: string): ConfigVariableDTO {
const variableWithMetadata =
this.twentyConfigService.getVariableWithMetadata(
key as keyof ConfigVariables,
@@ -180,7 +182,7 @@ export class AdminPanelService {
};
}
- async getVersionInfo(): Promise<VersionInfo> {
+ async getVersionInfo(): Promise<VersionInfoDTO> {
const currentVersion = this.twentyConfigService.get('APP_VERSION');
try {
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-health-service-data.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-health-service-data.dto.ts
index f4ff7669fab..29641800e9e 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-health-service-data.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-health-service-data.dto.ts
@@ -1,11 +1,11 @@
import { Field, ObjectType } from '@nestjs/graphql';
-import { AdminPanelWorkerQueueHealth } from 'src/engine/core-modules/admin-panel/dtos/admin-panel-worker-queue-health.dto';
+import { AdminPanelWorkerQueueHealthDTO } from 'src/engine/core-modules/admin-panel/dtos/admin-panel-worker-queue-health.dto';
import { AdminPanelHealthServiceStatus } from 'src/engine/core-modules/admin-panel/enums/admin-panel-health-service-status.enum';
import { HealthIndicatorId } from 'src/engine/core-modules/health/enums/health-indicator-id.enum';
-@ObjectType()
-export class AdminPanelHealthServiceData {
+@ObjectType('AdminPanelHealthServiceData')
+export class AdminPanelHealthServiceDataDTO {
@Field(() => HealthIndicatorId)
id: HealthIndicatorId;
@@ -23,6 +23,6 @@ export class AdminPanelHealthServiceData {
@Field(() => String, { nullable: true })
details?: string;
- @Field(() => [AdminPanelWorkerQueueHealth], { nullable: true })
- queues?: AdminPanelWorkerQueueHealth[];
+ @Field(() => [AdminPanelWorkerQueueHealthDTO], { nullable: true })
+ queues?: AdminPanelWorkerQueueHealthDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-worker-queue-health.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-worker-queue-health.dto.ts
index 10933959307..3bf2ce76348 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-worker-queue-health.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/admin-panel-worker-queue-health.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { AdminPanelHealthServiceStatus } from 'src/engine/core-modules/admin-panel/enums/admin-panel-health-service-status.enum';
-@ObjectType()
-export class AdminPanelWorkerQueueHealth {
+@ObjectType('AdminPanelWorkerQueueHealth')
+export class AdminPanelWorkerQueueHealthDTO {
@Field(() => String)
id: string;
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variable.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variable.dto.ts
index e3a851c1303..1b5a2b58dfe 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variable.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variable.dto.ts
@@ -15,8 +15,8 @@ registerEnumType(ConfigVariableType, {
name: 'ConfigVariableType',
});
-@ObjectType()
-export class ConfigVariable {
+@ObjectType('ConfigVariable')
+export class ConfigVariableDTO {
@Field()
name: string;
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables-group.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables-group.dto.ts
index b2a7f9f84e9..9bb3c6788cd 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables-group.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables-group.dto.ts
@@ -1,16 +1,16 @@
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
-import { ConfigVariable } from 'src/engine/core-modules/admin-panel/dtos/config-variable.dto';
+import { ConfigVariableDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variable.dto';
import { ConfigVariablesGroup } from 'src/engine/core-modules/twenty-config/enums/config-variables-group.enum';
registerEnumType(ConfigVariablesGroup, {
name: 'ConfigVariablesGroup',
});
-@ObjectType()
-export class ConfigVariablesGroupData {
- @Field(() => [ConfigVariable])
- variables: ConfigVariable[];
+@ObjectType('ConfigVariablesGroupData')
+export class ConfigVariablesGroupDataDTO {
+ @Field(() => [ConfigVariableDTO])
+ variables: ConfigVariableDTO[];
@Field(() => ConfigVariablesGroup)
name: ConfigVariablesGroup;
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.output.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.output.ts
index 8df5acc6068..7977181bc55 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/config-variables.output.ts
@@ -1,9 +1,9 @@
import { Field, ObjectType } from '@nestjs/graphql';
-import { ConfigVariablesGroupData } from 'src/engine/core-modules/admin-panel/dtos/config-variables-group.dto';
+import { ConfigVariablesGroupDataDTO } from 'src/engine/core-modules/admin-panel/dtos/config-variables-group.dto';
-@ObjectType()
+@ObjectType('ConfigVariablesOutput')
export class ConfigVariablesOutput {
- @Field(() => [ConfigVariablesGroupData])
- groups: ConfigVariablesGroupData[];
+ @Field(() => [ConfigVariablesGroupDataDTO])
+ groups: ConfigVariablesGroupDataDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/delete-jobs-response.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/delete-jobs-response.dto.ts
new file mode 100644
index 00000000000..1b209cdbef0
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/delete-jobs-response.dto.ts
@@ -0,0 +1,12 @@
+import { Field, Int, ObjectType } from '@nestjs/graphql';
+
+import { JobOperationResultDTO } from 'src/engine/core-modules/admin-panel/dtos/job-operation-result.dto';
+
+@ObjectType('DeleteJobsResponse')
+export class DeleteJobsResponseDTO {
+ @Field(() => Int)
+ deletedCount: number;
+
+ @Field(() => [JobOperationResultDTO])
+ results: JobOperationResultDTO[];
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.output.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.output.ts
index ee07abbea8a..a42cfafe688 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/impersonate.output.ts
@@ -1,13 +1,13 @@
import { Field, ObjectType } from '@nestjs/graphql';
import { AuthToken } from 'src/engine/core-modules/auth/dto/token.entity';
-import { WorkspaceUrlsAndId } from 'src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto';
+import { WorkspaceUrlsAndIdDTO } from 'src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto';
-@ObjectType()
+@ObjectType('ImpersonateOutput')
export class ImpersonateOutput {
@Field(() => AuthToken)
loginToken: AuthToken;
- @Field(() => WorkspaceUrlsAndId)
- workspace: WorkspaceUrlsAndId;
+ @Field(() => WorkspaceUrlsAndIdDTO)
+ workspace: WorkspaceUrlsAndIdDTO;
}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/job-operation-result.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/job-operation-result.dto.ts
new file mode 100644
index 00000000000..10bd6882558
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/job-operation-result.dto.ts
@@ -0,0 +1,13 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+@ObjectType('JobOperationResult')
+export class JobOperationResultDTO {
+ @Field(() => String)
+ jobId: string;
+
+ @Field(() => Boolean)
+ success: boolean;
+
+ @Field(() => String, { nullable: true })
+ error?: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-job.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-job.dto.ts
new file mode 100644
index 00000000000..1d01e03eac3
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-job.dto.ts
@@ -0,0 +1,44 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+import GraphQLJSON from 'graphql-type-json';
+
+import { JobStateEnum } from 'src/engine/core-modules/admin-panel/enums/job-state.enum';
+
+@ObjectType('QueueJob')
+export class QueueJobDTO {
+ @Field(() => String)
+ id: string;
+
+ @Field(() => String)
+ name: string;
+
+ @Field(() => GraphQLJSON, { nullable: true })
+ data?: object;
+
+ @Field(() => JobStateEnum)
+ state: JobStateEnum;
+
+ @Field(() => Number, { nullable: true })
+ timestamp?: number;
+
+ @Field(() => String, { nullable: true })
+ failedReason?: string;
+
+ @Field(() => Number, { nullable: true })
+ processedOn?: number;
+
+ @Field(() => Number, { nullable: true })
+ finishedOn?: number;
+
+ @Field(() => Number)
+ attemptsMade: number;
+
+ @Field(() => GraphQLJSON, { nullable: true })
+ returnValue?: object;
+
+ @Field(() => [String], { nullable: true })
+ logs?: string[];
+
+ @Field(() => [String], { nullable: true })
+ stackTrace?: string[];
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-jobs-response.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-jobs-response.dto.ts
new file mode 100644
index 00000000000..273554c070f
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-jobs-response.dto.ts
@@ -0,0 +1,22 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+import { QueueJobDTO } from 'src/engine/core-modules/admin-panel/dtos/queue-job.dto';
+import { QueueRetentionConfigDTO } from 'src/engine/core-modules/admin-panel/dtos/queue-retention-config.dto';
+
+@ObjectType('QueueJobsResponse')
+export class QueueJobsResponseDTO {
+ @Field(() => [QueueJobDTO])
+ jobs: QueueJobDTO[];
+
+ @Field(() => Number)
+ count: number;
+
+ @Field(() => Number)
+ totalCount: number;
+
+ @Field(() => Boolean)
+ hasMore: boolean;
+
+ @Field(() => QueueRetentionConfigDTO)
+ retentionConfig: QueueRetentionConfigDTO;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-data-point.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-data-point.dto.ts
index 2dc9ef3a664..7c8b43c2d6d 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-data-point.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-data-point.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class QueueMetricsDataPoint {
+@ObjectType('QueueMetricsDataPoint')
+export class QueueMetricsDataPointDTO {
@Field(() => Number)
x: number;
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-data.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-data.dto.ts
index 879969851e6..c28681b30fd 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-data.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-data.dto.ts
@@ -1,11 +1,11 @@
import { Field, ObjectType } from '@nestjs/graphql';
-import { QueueMetricsSeries } from 'src/engine/core-modules/admin-panel/dtos/queue-metrics-series.dto';
+import { QueueMetricsSeriesDTO } from 'src/engine/core-modules/admin-panel/dtos/queue-metrics-series.dto';
import { QueueMetricsTimeRange } from 'src/engine/core-modules/admin-panel/enums/queue-metrics-time-range.enum';
import { WorkerQueueMetrics } from 'src/engine/core-modules/health/types/worker-queue-metrics.type';
-@ObjectType()
-export class QueueMetricsData {
+@ObjectType('QueueMetricsData')
+export class QueueMetricsDataDTO {
@Field(() => String)
queueName: string;
@@ -18,6 +18,6 @@ export class QueueMetricsData {
@Field(() => WorkerQueueMetrics, { nullable: true })
details: WorkerQueueMetrics | null;
- @Field(() => [QueueMetricsSeries])
- data: QueueMetricsSeries[];
+ @Field(() => [QueueMetricsSeriesDTO])
+ data: QueueMetricsSeriesDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-series.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-series.dto.ts
index 742bbc4cf2d..be651f1f48d 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-series.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-metrics-series.dto.ts
@@ -1,12 +1,12 @@
import { Field, ObjectType } from '@nestjs/graphql';
-import { QueueMetricsDataPoint } from 'src/engine/core-modules/admin-panel/dtos/queue-metrics-data-point.dto';
+import { QueueMetricsDataPointDTO } from 'src/engine/core-modules/admin-panel/dtos/queue-metrics-data-point.dto';
-@ObjectType()
-export class QueueMetricsSeries {
+@ObjectType('QueueMetricsSeries')
+export class QueueMetricsSeriesDTO {
@Field(() => String)
id: string;
- @Field(() => [QueueMetricsDataPoint])
- data: QueueMetricsDataPoint[];
+ @Field(() => [QueueMetricsDataPointDTO])
+ data: QueueMetricsDataPointDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-retention-config.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-retention-config.dto.ts
new file mode 100644
index 00000000000..76e9a28bbad
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/queue-retention-config.dto.ts
@@ -0,0 +1,16 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+@ObjectType('QueueRetentionConfig')
+export class QueueRetentionConfigDTO {
+ @Field(() => Number)
+ completedMaxAge: number;
+
+ @Field(() => Number)
+ completedMaxCount: number;
+
+ @Field(() => Number)
+ failedMaxAge: number;
+
+ @Field(() => Number)
+ failedMaxCount: number;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/retry-jobs-response.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/retry-jobs-response.dto.ts
new file mode 100644
index 00000000000..8ac1c90763b
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/retry-jobs-response.dto.ts
@@ -0,0 +1,12 @@
+import { Field, Int, ObjectType } from '@nestjs/graphql';
+
+import { JobOperationResultDTO } from 'src/engine/core-modules/admin-panel/dtos/job-operation-result.dto';
+
+@ObjectType('RetryJobsResponse')
+export class RetryJobsResponseDTO {
+ @Field(() => Int)
+ retriedCount: number;
+
+ @Field(() => [JobOperationResultDTO])
+ results: JobOperationResultDTO[];
+}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/system-health.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/system-health.dto.ts
index 13808a3c608..0106bf4043d 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/system-health.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/system-health.dto.ts
@@ -3,8 +3,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { AdminPanelHealthServiceStatus } from 'src/engine/core-modules/admin-panel/enums/admin-panel-health-service-status.enum';
import { HealthIndicatorId } from 'src/engine/core-modules/health/enums/health-indicator-id.enum';
-@ObjectType()
-export class SystemHealthService {
+@ObjectType('SystemHealthService')
+export class SystemHealthServiceDTO {
@Field(() => HealthIndicatorId)
id: HealthIndicatorId;
@@ -15,8 +15,8 @@ export class SystemHealthService {
status: AdminPanelHealthServiceStatus;
}
-@ObjectType()
-export class SystemHealth {
- @Field(() => [SystemHealthService])
- services: SystemHealthService[];
+@ObjectType('SystemHealth')
+export class SystemHealthDTO {
+ @Field(() => [SystemHealthServiceDTO])
+ services: SystemHealthServiceDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.entity.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.entity.ts
index a6f09949e6f..85ca1f579e2 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/user-lookup.entity.ts
@@ -2,10 +2,10 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
-import { WorkspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
+import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
-@ObjectType()
-class UserInfo {
+@ObjectType('UserInfo')
+class UserInfoDTO {
@Field(() => UUIDScalarType)
id: string;
@@ -19,8 +19,8 @@ class UserInfo {
lastName?: string;
}
-@ObjectType()
-class WorkspaceInfo {
+@ObjectType('WorkspaceInfo')
+class WorkspaceInfoDTO {
@Field(() => UUIDScalarType)
id: string;
@@ -36,21 +36,21 @@ class WorkspaceInfo {
@Field(() => Number)
totalUsers: number;
- @Field(() => WorkspaceUrls)
- workspaceUrls: WorkspaceUrls;
+ @Field(() => WorkspaceUrlsDTO)
+ workspaceUrls: WorkspaceUrlsDTO;
- @Field(() => [UserInfo])
- users: UserInfo[];
+ @Field(() => [UserInfoDTO])
+ users: UserInfoDTO[];
@Field(() => [FeatureFlag])
featureFlags: FeatureFlag[];
}
-@ObjectType()
+@ObjectType('UserLookup')
export class UserLookup {
- @Field(() => UserInfo)
- user: UserInfo;
+ @Field(() => UserInfoDTO)
+ user: UserInfoDTO;
- @Field(() => [WorkspaceInfo])
- workspaces: WorkspaceInfo[];
+ @Field(() => [WorkspaceInfoDTO])
+ workspaces: WorkspaceInfoDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/version-info.dto.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/version-info.dto.ts
index e616b12b51e..210e6fb0120 100644
--- a/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/version-info.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/dtos/version-info.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class VersionInfo {
+@ObjectType('VersionInfo')
+export class VersionInfoDTO {
@Field(() => String, { nullable: true })
currentVersion?: string;
diff --git a/packages/twenty-server/src/engine/core-modules/admin-panel/enums/job-state.enum.ts b/packages/twenty-server/src/engine/core-modules/admin-panel/enums/job-state.enum.ts
new file mode 100644
index 00000000000..6429e6acbf3
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/admin-panel/enums/job-state.enum.ts
@@ -0,0 +1,40 @@
+import { registerEnumType } from '@nestjs/graphql';
+
+import { type JobState as BullMQJobState } from 'bullmq/dist/esm/types';
+
+export enum JobStateEnum {
+ COMPLETED = 'COMPLETED',
+ FAILED = 'FAILED',
+ ACTIVE = 'ACTIVE',
+ WAITING = 'WAITING',
+ DELAYED = 'DELAYED',
+ PRIORITIZED = 'PRIORITIZED',
+ WAITING_CHILDREN = 'WAITING_CHILDREN',
+}
+
+registerEnumType(JobStateEnum, {
+ name: 'JobState',
+ description: 'Job state in the queue',
+});
+
+// Mapping from GraphQL enum to BullMQ state values
+export const jobStateEnumToBullMQ: Record<JobStateEnum, BullMQJobState> = {
+ [JobStateEnum.COMPLETED]: 'completed',
+ [JobStateEnum.FAILED]: 'failed',
+ [JobStateEnum.ACTIVE]: 'active',
+ [JobStateEnum.WAITING]: 'waiting',
+ [JobStateEnum.DELAYED]: 'delayed',
+ [JobStateEnum.PRIORITIZED]: 'prioritized',
+ [JobStateEnum.WAITING_CHILDREN]: 'waiting-children',
+};
+
+// Mapping from BullMQ state values to GraphQL enum
+export const bullMQToJobStateEnum: Record<BullMQJobState, JobStateEnum> = {
+ completed: JobStateEnum.COMPLETED,
+ failed: JobStateEnum.FAILED,
+ active: JobStateEnum.ACTIVE,
+ waiting: JobStateEnum.WAITING,
+ delayed: JobStateEnum.DELAYED,
+ prioritized: JobStateEnum.PRIORITIZED,
+ 'waiting-children': JobStateEnum.WAITING_CHILDREN,
+};
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces.output.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces.output.ts
index c4000616b24..641de6bf441 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/available-workspaces.output.ts
@@ -8,10 +8,10 @@ import {
IdentityProviderType,
SSOIdentityProviderStatus,
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
-import { WorkspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
+import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
-@ObjectType()
-class SSOConnection {
+@ObjectType('SSOConnection')
+class SSOConnectionDTO {
@Field(() => IdentityProviderType)
type: SSOConfiguration['type'];
@@ -28,7 +28,7 @@ class SSOConnection {
status: SSOConfiguration['status'];
}
-@ObjectType()
+@ObjectType('AvailableWorkspace')
export class AvailableWorkspace {
@Field(() => UUIDScalarType)
id: string;
@@ -45,17 +45,17 @@ export class AvailableWorkspace {
@Field(() => String, { nullable: true })
inviteHash?: string;
- @Field(() => WorkspaceUrls)
- workspaceUrls: WorkspaceUrls;
+ @Field(() => WorkspaceUrlsDTO)
+ workspaceUrls: WorkspaceUrlsDTO;
@Field(() => String, { nullable: true })
logo?: string;
- @Field(() => [SSOConnection])
- sso: SSOConnection[];
+ @Field(() => [SSOConnectionDTO])
+ sso: SSOConnectionDTO[];
}
-@ObjectType()
+@ObjectType('AvailableWorkspaces')
export class AvailableWorkspaces {
@Field(() => [AvailableWorkspace])
availableWorkspacesForSignIn: Array<AvailableWorkspace>;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/get-login-token-from-email-verification-token.output.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/get-login-token-from-email-verification-token.output.ts
index d597f41169a..5b0a9b5004c 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/get-login-token-from-email-verification-token.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/get-login-token-from-email-verification-token.output.ts
@@ -1,14 +1,14 @@
import { Field, ObjectType } from '@nestjs/graphql';
-import { WorkspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
+import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
import { AuthToken } from './token.entity';
-@ObjectType()
+@ObjectType('GetLoginTokenFromEmailVerificationTokenOutput')
export class GetLoginTokenFromEmailVerificationTokenOutput {
@Field(() => AuthToken)
loginToken: AuthToken;
- @Field(() => WorkspaceUrls)
- workspaceUrls: WorkspaceUrls;
+ @Field(() => WorkspaceUrlsDTO)
+ workspaceUrls: WorkspaceUrlsDTO;
}
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.output.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.output.ts
index 07b292e31a5..851f0d89257 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.output.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up.output.ts
@@ -1,14 +1,14 @@
import { Field, ObjectType } from '@nestjs/graphql';
-import { WorkspaceUrlsAndId } from 'src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto';
+import { WorkspaceUrlsAndIdDTO } from 'src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto';
import { AuthToken } from './token.entity';
-@ObjectType()
+@ObjectType('SignUpOutput')
export class SignUpOutput {
@Field(() => AuthToken)
loginToken: AuthToken;
- @Field(() => WorkspaceUrlsAndId)
- workspace: WorkspaceUrlsAndId;
+ @Field(() => WorkspaceUrlsAndIdDTO)
+ workspace: WorkspaceUrlsAndIdDTO;
}
diff --git a/packages/twenty-server/src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-schedule-event-to-database-subscription-phase.util.ts b/packages/twenty-server/src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-schedule-event-to-database-subscription-phase.util.ts
index 016d2ec0c85..07221bb8514 100644
--- a/packages/twenty-server/src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-schedule-event-to-database-subscription-phase.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-schedule-event-to-database-subscription-phase.util.ts
@@ -4,11 +4,11 @@ import { isDefined } from 'twenty-shared/utils';
import type Stripe from 'stripe';
-import { type BillingSubscriptionSchedulePhase } from 'src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto';
+import { type BillingSubscriptionSchedulePhaseDTO } from 'src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto';
export function transformStripeSubscriptionScheduleEventToDatabaseSubscriptionPhase(
schedule: Stripe.SubscriptionSchedule,
-): Array<BillingSubscriptionSchedulePhase> {
+): Array<BillingSubscriptionSchedulePhaseDTO> {
return schedule.phases.slice(-2).map((phase) => ({
start_date: phase.start_date,
end_date: phase.end_date,
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-licensed.dto.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-licensed.dto.ts
index 345585bfbc1..8a8ae469f66 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-licensed.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-licensed.dto.ts
@@ -5,7 +5,7 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
import { BillingUsageType } from 'src/engine/core-modules/billing/enums/billing-usage-type.enum';
-@ObjectType()
+@ObjectType('BillingPriceLicensed')
export class BillingPriceLicensedDTO {
@Field(() => SubscriptionInterval)
recurringInterval: SubscriptionInterval;
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-metered.dto.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-metered.dto.ts
index 7dd8b8ffa9a..f4ae7ba0479 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-metered.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-metered.dto.ts
@@ -6,7 +6,7 @@ import { BillingPriceTierDTO } from 'src/engine/core-modules/billing/dtos/billin
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
import { BillingUsageType } from 'src/engine/core-modules/billing/enums/billing-usage-type.enum';
-@ObjectType()
+@ObjectType('BillingPriceMetered')
export class BillingPriceMeteredDTO {
@Field(() => [BillingPriceTierDTO])
tiers: BillingPriceTierDTO[];
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-tier.dto.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-tier.dto.ts
index a3422411d74..647a7d6a0be 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-tier.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-price-tier.dto.ts
@@ -2,7 +2,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
+@ObjectType('BillingPriceTier')
export class BillingPriceTierDTO {
@Field(() => Number, { nullable: true })
upTo: number | null;
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto.ts
index 7f8ab8767ed..79a152dc0ee 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class BillingSubscriptionSchedulePhaseItem {
+@ObjectType('BillingSubscriptionSchedulePhaseItem')
+export class BillingSubscriptionSchedulePhaseItemDTO {
@Field(() => String)
price: string;
@@ -9,14 +9,14 @@ export class BillingSubscriptionSchedulePhaseItem {
quantity?: number;
}
-@ObjectType()
-export class BillingSubscriptionSchedulePhase {
+@ObjectType('BillingSubscriptionSchedulePhase')
+export class BillingSubscriptionSchedulePhaseDTO {
@Field(() => Number)
start_date: number;
@Field(() => Number)
end_date: number;
- @Field(() => [BillingSubscriptionSchedulePhaseItem])
- items: Array<BillingSubscriptionSchedulePhaseItem>;
+ @Field(() => [BillingSubscriptionSchedulePhaseItemDTO])
+ items: Array<BillingSubscriptionSchedulePhaseItemDTO>;
}
diff --git a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-trial-period.dto.ts b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-trial-period.dto.ts
index 2f1dad688a8..43e3b495b93 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-trial-period.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/dtos/billing-trial-period.dto.ts
@@ -4,7 +4,7 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { Min } from 'class-validator';
-@ObjectType()
+@ObjectType('BillingTrialPeriod')
export class BillingTrialPeriodDTO {
@Field(() => Number)
@Min(0)
diff --git a/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts b/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts
index 01419bb9a9c..be10cd8ebc4 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/entities/billing-subscription.entity.ts
@@ -3,6 +3,7 @@
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
import { IDField } from '@ptc-org/nestjs-query-graphql';
+import graphqlTypeJson from 'graphql-type-json';
import Stripe from 'stripe';
import {
Column,
@@ -16,16 +17,15 @@ import {
Relation,
UpdateDateColumn,
} from 'typeorm';
-import graphqlTypeJson from 'graphql-type-json';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+import { BillingSubscriptionSchedulePhaseDTO } from 'src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto';
import { BillingSubscriptionItemDTO } from 'src/engine/core-modules/billing/dtos/outputs/billing-subscription-item.output';
import { BillingCustomer } from 'src/engine/core-modules/billing/entities/billing-customer.entity';
import { BillingSubscriptionItem } from 'src/engine/core-modules/billing/entities/billing-subscription-item.entity';
import { BillingSubscriptionCollectionMethod } from 'src/engine/core-modules/billing/enums/billing-subscription-collection-method.enum';
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';
-import { BillingSubscriptionSchedulePhase } from 'src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto';
registerEnumType(SubscriptionStatus, { name: 'SubscriptionStatus' });
registerEnumType(SubscriptionInterval, { name: 'SubscriptionInterval' });
@@ -122,9 +122,9 @@ export class BillingSubscription {
@Column({ nullable: false, type: 'jsonb', default: {} })
metadata: Stripe.Metadata;
- @Field(() => [BillingSubscriptionSchedulePhase])
+ @Field(() => [BillingSubscriptionSchedulePhaseDTO])
@Column({ nullable: false, type: 'jsonb', default: [] })
- phases: Array<BillingSubscriptionSchedulePhase>;
+ phases: Array<BillingSubscriptionSchedulePhaseDTO>;
@Column({ nullable: true, type: 'timestamptz' })
cancelAt: Date | null;
diff --git a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription-phase.service.ts b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription-phase.service.ts
index 71fed2bd72a..6bd447edc1f 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription-phase.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription-phase.service.ts
@@ -3,21 +3,21 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
+import Stripe from 'stripe';
import {
assertIsDefinedOrThrow,
findOrThrow,
isDefined,
} from 'twenty-shared/utils';
import { Repository } from 'typeorm';
-import Stripe from 'stripe';
-import { BillingSubscriptionSchedulePhase } from 'src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto';
+import { BillingSubscriptionSchedulePhaseDTO } from 'src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto';
import { BillingPrice } from 'src/engine/core-modules/billing/entities/billing-price.entity';
-import { BillingPlanService } from 'src/engine/core-modules/billing/services/billing-plan.service';
-import { normalizePriceRef } from 'src/engine/core-modules/billing/utils/normalize-price-ref.utils';
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
+import { BillingPlanService } from 'src/engine/core-modules/billing/services/billing-plan.service';
import { BillingPriceService } from 'src/engine/core-modules/billing/services/billing-price.service';
+import { normalizePriceRef } from 'src/engine/core-modules/billing/utils/normalize-price-ref.utils';
@Injectable()
export class BillingSubscriptionPhaseService {
@@ -28,7 +28,7 @@ export class BillingSubscriptionPhaseService {
private readonly billingPriceService: BillingPriceService,
) {}
- async getDetailsFromPhase(phase: BillingSubscriptionSchedulePhase) {
+ async getDetailsFromPhase(phase: BillingSubscriptionSchedulePhaseDTO) {
const meteredPrice = await this.billingPriceRepository.findOneOrFail({
where: {
stripePriceId: findOrThrow(
diff --git a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts
index 70e766a0f1d..1daf46ff6d4 100644
--- a/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/billing/services/billing-subscription.service.ts
@@ -3,56 +3,56 @@
import { Injectable, Logger } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
-import { Not, Repository } from 'typeorm';
+import { differenceInDays } from 'date-fns';
import {
assertIsDefinedOrThrow,
findOrThrow,
isDefined,
} from 'twenty-shared/utils';
-import { differenceInDays } from 'date-fns';
+import { Not, Repository } from 'typeorm';
import type Stripe from 'stripe';
+import { transformStripeSubscriptionEventToDatabaseCustomer } from 'src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-event-to-database-customer.util';
+import { transformStripeSubscriptionEventToDatabaseSubscriptionItem } from 'src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-event-to-database-subscription-item.util';
+import {
+ getSubscriptionStatus,
+ transformStripeSubscriptionEventToDatabaseSubscription,
+} from 'src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-event-to-database-subscription.util';
import {
BillingException,
BillingExceptionCode,
} from 'src/engine/core-modules/billing/billing.exception';
+import { billingValidator } from 'src/engine/core-modules/billing/billing.validate';
+import { BillingSubscriptionSchedulePhaseDTO } from 'src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto';
+import { BillingCustomer } from 'src/engine/core-modules/billing/entities/billing-customer.entity';
import { BillingEntitlement } from 'src/engine/core-modules/billing/entities/billing-entitlement.entity';
import { BillingPrice } from 'src/engine/core-modules/billing/entities/billing-price.entity';
import { BillingSubscriptionItem } from 'src/engine/core-modules/billing/entities/billing-subscription-item.entity';
import { BillingSubscription } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
import { type BillingEntitlementKey } from 'src/engine/core-modules/billing/enums/billing-entitlement-key.enum';
import { BillingPlanKey } from 'src/engine/core-modules/billing/enums/billing-plan-key.enum';
+import { BillingProductKey } from 'src/engine/core-modules/billing/enums/billing-product-key.enum';
import { SubscriptionInterval } from 'src/engine/core-modules/billing/enums/billing-subscription-interval.enum';
import { SubscriptionStatus } from 'src/engine/core-modules/billing/enums/billing-subscription-status.enum';
+import { BillingUsageType } from 'src/engine/core-modules/billing/enums/billing-usage-type.enum';
import { BillingPlanService } from 'src/engine/core-modules/billing/services/billing-plan.service';
+import { BillingPriceService } from 'src/engine/core-modules/billing/services/billing-price.service';
import { BillingProductService } from 'src/engine/core-modules/billing/services/billing-product.service';
+import { BillingSubscriptionPhaseService } from 'src/engine/core-modules/billing/services/billing-subscription-phase.service';
import { StripeCustomerService } from 'src/engine/core-modules/billing/stripe/services/stripe-customer.service';
-import { StripeSubscriptionService } from 'src/engine/core-modules/billing/stripe/services/stripe-subscription.service';
import { StripeSubscriptionScheduleService } from 'src/engine/core-modules/billing/stripe/services/stripe-subscription-schedule.service';
-import { getPlanKeyFromSubscription } from 'src/engine/core-modules/billing/utils/get-plan-key-from-subscription.util';
-import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
-import { BillingUsageType } from 'src/engine/core-modules/billing/enums/billing-usage-type.enum';
-import { LicensedBillingSubscriptionItem } from 'src/engine/core-modules/billing/types/billing-subscription-item.type';
-import { BillingSubscriptionPhaseService } from 'src/engine/core-modules/billing/services/billing-subscription-phase.service';
-import { BillingSubscriptionSchedulePhase } from 'src/engine/core-modules/billing/dtos/billing-subscription-schedule-phase.dto';
-import { getOppositeInterval } from 'src/engine/core-modules/billing/utils/get-opposite-interval';
-import { billingValidator } from 'src/engine/core-modules/billing/billing.validate';
-import { MeterBillingPriceTiers } from 'src/engine/core-modules/billing/types/meter-billing-price-tier.type';
+import { StripeSubscriptionService } from 'src/engine/core-modules/billing/stripe/services/stripe-subscription.service';
import { BillingMeterPrice } from 'src/engine/core-modules/billing/types/billing-meter-price.type';
-import { BillingProductKey } from 'src/engine/core-modules/billing/enums/billing-product-key.enum';
-import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
-import { getOppositePlan } from 'src/engine/core-modules/billing/utils/get-opposite-plan';
-import {
- getSubscriptionStatus,
- transformStripeSubscriptionEventToDatabaseSubscription,
-} from 'src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-event-to-database-subscription.util';
-import { transformStripeSubscriptionEventToDatabaseSubscriptionItem } from 'src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-event-to-database-subscription-item.util';
-import { transformStripeSubscriptionEventToDatabaseCustomer } from 'src/engine/core-modules/billing-webhook/utils/transform-stripe-subscription-event-to-database-customer.util';
-import { BillingCustomer } from 'src/engine/core-modules/billing/entities/billing-customer.entity';
+import { LicensedBillingSubscriptionItem } from 'src/engine/core-modules/billing/types/billing-subscription-item.type';
import { SubscriptionWithSchedule } from 'src/engine/core-modules/billing/types/billing-subscription-with-schedule.type';
+import { MeterBillingPriceTiers } from 'src/engine/core-modules/billing/types/meter-billing-price-tier.type';
import { ensureFutureStartDate } from 'src/engine/core-modules/billing/utils/ensure-future-start-date.util';
-import { BillingPriceService } from 'src/engine/core-modules/billing/services/billing-price.service';
+import { getOppositeInterval } from 'src/engine/core-modules/billing/utils/get-opposite-interval';
+import { getOppositePlan } from 'src/engine/core-modules/billing/utils/get-opposite-plan';
+import { getPlanKeyFromSubscription } from 'src/engine/core-modules/billing/utils/get-plan-key-from-subscription.util';
+import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
+import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
@Injectable()
export class BillingSubscriptionService {
@@ -287,7 +287,7 @@ export class BillingSubscriptionService {
const currentPhaseDetails =
await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- currentEditable as BillingSubscriptionSchedulePhase,
+ currentEditable as BillingSubscriptionSchedulePhaseDTO,
);
await this.changeMeteredPrice(
@@ -634,12 +634,12 @@ export class BillingSubscriptionService {
}
const currentPhaseDetails =
await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- currentEditable as BillingSubscriptionSchedulePhase,
+ currentEditable as BillingSubscriptionSchedulePhaseDTO,
);
const hasNextInitially = !!nextEditable;
const nextPhaseDetailsInitial = hasNextInitially
? await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- nextEditable as BillingSubscriptionSchedulePhase,
+ nextEditable as BillingSubscriptionSchedulePhaseDTO,
)
: undefined;
const currentCap = (currentPhaseDetails.meteredPrice as BillingMeterPrice)
@@ -734,7 +734,7 @@ export class BillingSubscriptionService {
const hasNext = !!nextEditable;
const nextPhaseDetails = hasNext
? await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- nextEditable as BillingSubscriptionSchedulePhase,
+ nextEditable as BillingSubscriptionSchedulePhaseDTO,
)
: undefined;
const currentLicensedId = currentSnap
@@ -906,7 +906,7 @@ export class BillingSubscriptionService {
const currentDetails =
await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- currentEditable as BillingSubscriptionSchedulePhase,
+ currentEditable as BillingSubscriptionSchedulePhaseDTO,
);
const { nextEditable } = await this.loadScheduleEditable(
billingSubscription.stripeSubscriptionId,
@@ -925,7 +925,7 @@ export class BillingSubscriptionService {
const nextDetails =
await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- nextEditable as BillingSubscriptionSchedulePhase,
+ nextEditable as BillingSubscriptionSchedulePhaseDTO,
);
if (nextDetails.interval !== targetInterval) {
@@ -1000,7 +1000,7 @@ export class BillingSubscriptionService {
if (nextEditable && currentEditable) {
const reloadedNextDetails =
await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- nextEditable as BillingSubscriptionSchedulePhase,
+ nextEditable as BillingSubscriptionSchedulePhaseDTO,
);
const mappedNext = await this.resolvePrices({
@@ -1048,7 +1048,7 @@ export class BillingSubscriptionService {
const nextDetails = hasNext
? await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- nextEditable as BillingSubscriptionSchedulePhase,
+ nextEditable as BillingSubscriptionSchedulePhaseDTO,
)
: undefined;
@@ -1099,7 +1099,7 @@ export class BillingSubscriptionService {
const currentDetails =
await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- currentEditable as BillingSubscriptionSchedulePhase,
+ currentEditable as BillingSubscriptionSchedulePhaseDTO,
);
const currentPlan = currentDetails.plan.planKey;
@@ -1115,7 +1115,7 @@ export class BillingSubscriptionService {
const nextDetails =
await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- nextEditable as BillingSubscriptionSchedulePhase,
+ nextEditable as BillingSubscriptionSchedulePhaseDTO,
);
if (nextDetails.plan.planKey !== targetPlanKey) {
@@ -1181,7 +1181,7 @@ export class BillingSubscriptionService {
if (nextEditable && currentEditable) {
const nextDetails =
await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- nextEditable as BillingSubscriptionSchedulePhase,
+ nextEditable as BillingSubscriptionSchedulePhaseDTO,
);
const preservedNextInterval = nextDetails?.interval ?? interval;
@@ -1233,7 +1233,7 @@ export class BillingSubscriptionService {
const nextDetails = hasNext
? await this.billingSubscriptionPhaseService.getDetailsFromPhase(
- nextEditable as BillingSubscriptionSchedulePhase,
+ nextEditable as BillingSubscriptionSchedulePhaseDTO,
)
: undefined;
diff --git a/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto.ts b/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto.ts
index 7fab107d243..1447c48d6b1 100644
--- a/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-@ObjectType()
-export class TimelineCalendarEventParticipant {
+@ObjectType('TimelineCalendarEventParticipant')
+export class TimelineCalendarEventParticipantDTO {
@Field(() => UUIDScalarType, { nullable: true })
personId: string | null;
diff --git a/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-event.dto.ts b/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-event.dto.ts
index edd067f46d2..a0b1efe7d44 100644
--- a/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-event.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-event.dto.ts
@@ -1,11 +1,11 @@
import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { TimelineCalendarEventParticipant } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto';
+import { TimelineCalendarEventParticipantDTO } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto';
import { CalendarChannelVisibility } from 'src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity';
-@ObjectType()
-class LinkMetadata {
+@ObjectType('LinkMetadata')
+class LinkMetadataDTO {
@Field()
label: string;
@@ -13,20 +13,20 @@ class LinkMetadata {
url: string;
}
-@ObjectType()
-export class LinksMetadata {
+@ObjectType('LinksMetadata')
+export class LinksMetadataDTO {
@Field()
primaryLinkLabel: string;
@Field()
primaryLinkUrl: string;
- @Field(() => [LinkMetadata], { nullable: true })
- secondaryLinks: LinkMetadata[] | null;
+ @Field(() => [LinkMetadataDTO], { nullable: true })
+ secondaryLinks: LinkMetadataDTO[] | null;
}
-@ObjectType()
-export class TimelineCalendarEvent {
+@ObjectType('TimelineCalendarEvent')
+export class TimelineCalendarEventDTO {
@Field(() => UUIDScalarType)
id: string;
@@ -54,11 +54,11 @@ export class TimelineCalendarEvent {
@Field()
conferenceSolution: string;
- @Field(() => LinksMetadata)
- conferenceLink: LinksMetadata;
+ @Field(() => LinksMetadataDTO)
+ conferenceLink: LinksMetadataDTO;
- @Field(() => [TimelineCalendarEventParticipant])
- participants: TimelineCalendarEventParticipant[];
+ @Field(() => [TimelineCalendarEventParticipantDTO])
+ participants: TimelineCalendarEventParticipantDTO[];
@Field(() => CalendarChannelVisibility)
visibility: CalendarChannelVisibility;
diff --git a/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto.ts b/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto.ts
index d177082e599..d83e5a3a147 100644
--- a/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto.ts
@@ -1,12 +1,12 @@
import { Field, Int, ObjectType } from '@nestjs/graphql';
-import { TimelineCalendarEvent } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event.dto';
+import { TimelineCalendarEventDTO } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event.dto';
-@ObjectType()
-export class TimelineCalendarEventsWithTotal {
+@ObjectType('TimelineCalendarEventsWithTotal')
+export class TimelineCalendarEventsWithTotalDTO {
@Field(() => Int)
totalNumberOfCalendarEvents: number;
- @Field(() => [TimelineCalendarEvent])
- timelineCalendarEvents: TimelineCalendarEvent[];
+ @Field(() => [TimelineCalendarEventDTO])
+ timelineCalendarEvents: TimelineCalendarEventDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.resolver.ts b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.resolver.ts
index 4a4a3d09dab..9e3fb69e914 100644
--- a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.resolver.ts
@@ -5,7 +5,7 @@ import { Max } from 'class-validator';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { TIMELINE_CALENDAR_EVENTS_MAX_PAGE_SIZE } from 'src/engine/core-modules/calendar/constants/calendar.constants';
-import { TimelineCalendarEventsWithTotal } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto';
+import { TimelineCalendarEventsWithTotalDTO } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto';
import { TimelineCalendarEventService } from 'src/engine/core-modules/calendar/timeline-calendar-event.service';
import { AuthWorkspaceMemberId } from 'src/engine/decorators/auth/auth-workspace-member-id.decorator';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
@@ -50,13 +50,13 @@ class GetTimelineCalendarEventsFromOpportunityIdArgs {
}
@UseGuards(WorkspaceAuthGuard)
-@Resolver(() => TimelineCalendarEventsWithTotal)
+@Resolver(() => TimelineCalendarEventsWithTotalDTO)
export class TimelineCalendarEventResolver {
constructor(
private readonly timelineCalendarEventService: TimelineCalendarEventService,
) {}
- @Query(() => TimelineCalendarEventsWithTotal)
+ @Query(() => TimelineCalendarEventsWithTotalDTO)
async getTimelineCalendarEventsFromPersonId(
@Args()
{ personId, page, pageSize }: GetTimelineCalendarEventsFromPersonIdArgs,
@@ -73,7 +73,7 @@ export class TimelineCalendarEventResolver {
return timelineCalendarEvents;
}
- @Query(() => TimelineCalendarEventsWithTotal)
+ @Query(() => TimelineCalendarEventsWithTotalDTO)
async getTimelineCalendarEventsFromCompanyId(
@Args()
{ companyId, page, pageSize }: GetTimelineCalendarEventsFromCompanyIdArgs,
@@ -90,7 +90,7 @@ export class TimelineCalendarEventResolver {
return timelineCalendarEvents;
}
- @Query(() => TimelineCalendarEventsWithTotal)
+ @Query(() => TimelineCalendarEventsWithTotalDTO)
async getTimelineCalendarEventsFromOpportunityId(
@Args()
{
diff --git a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts
index fff572013a3..c976148d9b0 100644
--- a/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/calendar/timeline-calendar-event.service.ts
@@ -5,7 +5,7 @@ import { FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED } from 'twenty-shared/
import { Any } from 'typeorm';
import { TIMELINE_CALENDAR_EVENTS_DEFAULT_PAGE_SIZE } from 'src/engine/core-modules/calendar/constants/calendar.constants';
-import { type TimelineCalendarEventsWithTotal } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto';
+import { type TimelineCalendarEventsWithTotalDTO } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-events-with-total.dto';
import { TwentyORMManager } from 'src/engine/twenty-orm/twenty-orm.manager';
import { CalendarChannelVisibility } from 'src/modules/calendar/common/standard-objects/calendar-channel.workspace-entity';
import { type CalendarEventWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event.workspace-entity';
@@ -27,7 +27,7 @@ export class TimelineCalendarEventService {
personIds: string[];
page: number;
pageSize: number;
- }): Promise<TimelineCalendarEventsWithTotal> {
+ }): Promise<TimelineCalendarEventsWithTotalDTO> {
const offset = (page - 1) * pageSize;
const calendarEventRepository =
@@ -167,7 +167,7 @@ export class TimelineCalendarEventService {
companyId: string;
page: number;
pageSize: number;
- }): Promise<TimelineCalendarEventsWithTotal> {
+ }): Promise<TimelineCalendarEventsWithTotalDTO> {
const personRepository =
await this.twentyORMManager.getRepository<PersonWorkspaceEntity>(
'person',
@@ -211,7 +211,7 @@ export class TimelineCalendarEventService {
opportunityId: string;
page: number;
pageSize: number;
- }): Promise<TimelineCalendarEventsWithTotal> {
+ }): Promise<TimelineCalendarEventsWithTotalDTO> {
const opportunityRepository =
await this.twentyORMManager.getRepository<OpportunityWorkspaceEntity>(
'opportunity',
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
index fd7567e4c53..67f8573a516 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
@@ -9,7 +9,7 @@ import {
import { BillingTrialPeriodDTO } from 'src/engine/core-modules/billing/dtos/billing-trial-period.dto';
import { CaptchaDriverType } from 'src/engine/core-modules/captcha/interfaces';
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
-import { AuthProviders } from 'src/engine/core-modules/workspace/dtos/public-workspace-data-output';
+import { AuthProvidersDTO } from 'src/engine/core-modules/workspace/dtos/public-workspace-data-output';
registerEnumType(FeatureFlagKey, {
name: 'FeatureFlagKey',
@@ -123,8 +123,8 @@ export class ClientConfig {
@Field(() => String, { nullable: true })
appVersion?: string;
- @Field(() => AuthProviders, { nullable: false })
- authProviders: AuthProviders;
+ @Field(() => AuthProvidersDTO, { nullable: false })
+ authProviders: AuthProvidersDTO;
@Field(() => Billing, { nullable: false })
billing: Billing;
diff --git a/packages/twenty-server/src/engine/core-modules/email/email-driver.factory.ts b/packages/twenty-server/src/engine/core-modules/email/email-driver.factory.ts
index aa80a91147d..47736527735 100644
--- a/packages/twenty-server/src/engine/core-modules/email/email-driver.factory.ts
+++ b/packages/twenty-server/src/engine/core-modules/email/email-driver.factory.ts
@@ -24,7 +24,7 @@ export class EmailDriverFactory extends DriverFactoryBase<EmailDriverInterface>
if (driver === EmailDriver.SMTP) {
const emailConfigHash = this.getConfigGroupHash(
- ConfigVariablesGroup.EmailSettings,
+ ConfigVariablesGroup.EMAIL_SETTINGS,
);
return `smtp|${emailConfigHash}`;
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-driver.service.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-driver.service.ts
index ecc23b455a2..2cdc97da587 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-driver.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-driver.service.ts
@@ -19,7 +19,7 @@ import {
import { type AwsSesClientProvider } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/providers/aws-ses-client.provider';
import { type AwsSesHandleErrorService } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-handle-error.service';
import { EmailingDomainStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain';
-import { type VerificationRecord } from 'src/engine/core-modules/emailing-domain/dtos/verification-record.dto';
+import { type VerificationRecordDTO } from 'src/engine/core-modules/emailing-domain/dtos/verification-record.dto';
export class AwsSesDriver implements EmailingDomainDriverInterface {
private readonly logger = new Logger(AwsSesDriver.name);
@@ -127,7 +127,7 @@ export class AwsSesDriver implements EmailingDomainDriverInterface {
tenantName: string,
): Promise<{
isVerified: boolean;
- verificationRecords: VerificationRecord[];
+ verificationRecords: VerificationRecordDTO[];
}> {
const sesClient = this.awsSesClientProvider.getSESClient();
@@ -161,7 +161,7 @@ export class AwsSesDriver implements EmailingDomainDriverInterface {
tenantName: string,
): Promise<{
isVerified: boolean;
- verificationRecords: VerificationRecord[];
+ verificationRecords: VerificationRecordDTO[];
}> {
const sesClient = this.awsSesClientProvider.getSESClient();
@@ -227,7 +227,7 @@ export class AwsSesDriver implements EmailingDomainDriverInterface {
private buildVerificationRecords(
domain: string,
dkimTokens: string[],
- ): VerificationRecord[] {
+ ): VerificationRecordDTO[] {
return dkimTokens.map((token) => ({
type: 'CNAME' as const,
key: `${token}._domainkey.${domain}`,
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/emailing-domain-driver.factory.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/emailing-domain-driver.factory.ts
index 31d244b982b..f9cc036a266 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/emailing-domain-driver.factory.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/emailing-domain-driver.factory.ts
@@ -26,7 +26,7 @@ export class EmailingDomainDriverFactory extends DriverFactoryBase<EmailingDomai
if (driver === EmailingDomainDriver.AWS_SES) {
const awsConfigHash = this.getConfigGroupHash(
- ConfigVariablesGroup.AwsSesSettings,
+ ConfigVariablesGroup.AWS_SES_SETTINGS,
);
return `aws-ses|${awsConfigHash}`;
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto.ts
index 7f0e3927d32..5e47f61772d 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto.ts
@@ -7,7 +7,7 @@ import {
EmailingDomainDriver,
EmailingDomainStatus,
} from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain';
-import { VerificationRecord } from 'src/engine/core-modules/emailing-domain/dtos/verification-record.dto';
+import { VerificationRecordDTO } from 'src/engine/core-modules/emailing-domain/dtos/verification-record.dto';
registerEnumType(EmailingDomainDriver, {
name: 'EmailingDomainDriver',
@@ -37,8 +37,8 @@ export class EmailingDomainDto {
@Field(() => EmailingDomainStatus)
status: EmailingDomainStatus;
- @Field(() => [VerificationRecord], { nullable: true })
- verificationRecords: VerificationRecord[] | null;
+ @Field(() => [VerificationRecordDTO], { nullable: true })
+ verificationRecords: VerificationRecordDTO[] | null;
@Field(() => Date, { nullable: true })
verifiedAt: Date | null;
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/verification-record.dto.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/verification-record.dto.ts
index 292e878f9ab..572f4fb002a 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/verification-record.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/verification-record.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class VerificationRecord {
+@ObjectType('VerificationRecord')
+export class VerificationRecordDTO {
@Field(() => String)
type: 'TXT' | 'CNAME' | 'MX';
diff --git a/packages/twenty-server/src/engine/core-modules/file-storage/file-storage-driver.factory.ts b/packages/twenty-server/src/engine/core-modules/file-storage/file-storage-driver.factory.ts
index a4783554475..743a883730a 100644
--- a/packages/twenty-server/src/engine/core-modules/file-storage/file-storage-driver.factory.ts
+++ b/packages/twenty-server/src/engine/core-modules/file-storage/file-storage-driver.factory.ts
@@ -29,7 +29,7 @@ export class FileStorageDriverFactory extends DriverFactoryBase<StorageDriver> {
if (storageType === StorageDriverType.S_3) {
const storageConfigHash = this.getConfigGroupHash(
- ConfigVariablesGroup.StorageConfig,
+ ConfigVariablesGroup.STORAGE_CONFIG,
);
return `s3|${storageConfigHash}`;
diff --git a/packages/twenty-server/src/engine/core-modules/file/file-upload/dtos/signed-file.dto.ts b/packages/twenty-server/src/engine/core-modules/file/file-upload/dtos/signed-file.dto.ts
index 5ca6c98dd3c..8e9a4a617a4 100644
--- a/packages/twenty-server/src/engine/core-modules/file/file-upload/dtos/signed-file.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/file/file-upload/dtos/signed-file.dto.ts
@@ -1,6 +1,6 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
+@ObjectType('SignedFile')
export class SignedFileDTO {
@Field(() => String)
path: string;
diff --git a/packages/twenty-server/src/engine/core-modules/geo-map/dtos/autocomplete-result.dto.ts b/packages/twenty-server/src/engine/core-modules/geo-map/dtos/autocomplete-result.dto.ts
index 7f124078e5d..ba90b09ae3a 100644
--- a/packages/twenty-server/src/engine/core-modules/geo-map/dtos/autocomplete-result.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/geo-map/dtos/autocomplete-result.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class AutocompleteResultDto {
+@ObjectType('AutocompleteResult')
+export class AutocompleteResultDTO {
@Field()
text: string;
diff --git a/packages/twenty-server/src/engine/core-modules/geo-map/dtos/place-details-result.dto.ts b/packages/twenty-server/src/engine/core-modules/geo-map/dtos/place-details-result.dto.ts
index 21c2ac9b55f..a23918df6a3 100644
--- a/packages/twenty-server/src/engine/core-modules/geo-map/dtos/place-details-result.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/geo-map/dtos/place-details-result.dto.ts
@@ -1,7 +1,7 @@
import { Field, Float, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class LocationDto {
+@ObjectType('Location')
+export class LocationDTO {
@Field(() => Float, { nullable: true })
lat?: number;
@@ -9,8 +9,8 @@ export class LocationDto {
lng?: number;
}
-@ObjectType()
-export class PlaceDetailsResultDto {
+@ObjectType('PlaceDetailsResult')
+export class PlaceDetailsResultDTO {
@Field({ nullable: true })
state?: string;
@@ -23,6 +23,6 @@ export class PlaceDetailsResultDto {
@Field({ nullable: true })
country?: string;
- @Field(() => LocationDto, { nullable: true })
- location?: LocationDto;
+ @Field(() => LocationDTO, { nullable: true })
+ location?: LocationDTO;
}
diff --git a/packages/twenty-server/src/engine/core-modules/geo-map/resolver/geo-map.resolver.ts b/packages/twenty-server/src/engine/core-modules/geo-map/resolver/geo-map.resolver.ts
index 1e8c9276d0e..77ffc0df583 100644
--- a/packages/twenty-server/src/engine/core-modules/geo-map/resolver/geo-map.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/geo-map/resolver/geo-map.resolver.ts
@@ -1,8 +1,8 @@
import { UseGuards } from '@nestjs/common';
import { Args, Query, Resolver } from '@nestjs/graphql';
-import { AutocompleteResultDto } from 'src/engine/core-modules/geo-map/dtos/autocomplete-result.dto';
-import { PlaceDetailsResultDto } from 'src/engine/core-modules/geo-map/dtos/place-details-result.dto';
+import { AutocompleteResultDTO } from 'src/engine/core-modules/geo-map/dtos/autocomplete-result.dto';
+import { PlaceDetailsResultDTO } from 'src/engine/core-modules/geo-map/dtos/place-details-result.dto';
import { GeoMapService } from 'src/engine/core-modules/geo-map/services/geo-map.service';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
@@ -11,7 +11,7 @@ import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
export class GeoMapResolver {
constructor(private readonly geoMapService: GeoMapService) {}
- @Query(() => [AutocompleteResultDto])
+ @Query(() => [AutocompleteResultDTO])
async getAutoCompleteAddress(
@Args('address') address: string,
@Args('token') token: string,
@@ -26,7 +26,7 @@ export class GeoMapResolver {
);
}
- @Query(() => PlaceDetailsResultDto)
+ @Query(() => PlaceDetailsResultDTO)
async getAddressDetails(
@Args('placeId') placeId: string,
@Args('token') token: string,
diff --git a/packages/twenty-server/src/engine/core-modules/graphql/utils/graphql-errors.util.ts b/packages/twenty-server/src/engine/core-modules/graphql/utils/graphql-errors.util.ts
index f108abee9eb..e12d5b96b7a 100644
--- a/packages/twenty-server/src/engine/core-modules/graphql/utils/graphql-errors.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/graphql/utils/graphql-errors.util.ts
@@ -13,7 +13,7 @@ declare module 'graphql' {
export interface GraphQLErrorExtensions {
exception?: {
code?: string;
- stacktrace?: ReadonlyArray<string>;
+ stackTrace?: ReadonlyArray<string>;
};
}
}
diff --git a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connected-account.dto.ts b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connected-account.dto.ts
index ae2292e007d..c50f3335eb1 100644
--- a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connected-account.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connected-account.dto.ts
@@ -3,10 +3,10 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { ConnectedAccountProvider } from 'twenty-shared/types';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { ImapSmtpCaldavConnectionParameters } from 'src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto';
+import { ImapSmtpCaldavConnectionParametersDTO } from 'src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto';
-@ObjectType()
-export class ConnectedImapSmtpCaldavAccount {
+@ObjectType('ConnectedImapSmtpCaldavAccount')
+export class ConnectedImapSmtpCaldavAccountDTO {
@Field(() => UUIDScalarType)
id: string;
@@ -19,6 +19,6 @@ export class ConnectedImapSmtpCaldavAccount {
@Field(() => UUIDScalarType)
accountOwnerId: string;
- @Field(() => ImapSmtpCaldavConnectionParameters, { nullable: true })
- connectionParameters: ImapSmtpCaldavConnectionParameters | null;
+ @Field(() => ImapSmtpCaldavConnectionParametersDTO, { nullable: true })
+ connectionParameters: ImapSmtpCaldavConnectionParametersDTO | null;
}
diff --git a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection-success.dto.ts b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection-success.dto.ts
index 284d2b8b086..09b281a0876 100644
--- a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection-success.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection-success.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class ImapSmtpCaldavConnectionSuccess {
+@ObjectType('ImapSmtpCaldavConnectionSuccess')
+export class ImapSmtpCaldavConnectionSuccessDTO {
@Field(() => Boolean)
success: boolean;
diff --git a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto.ts b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto.ts
index b221257d467..c8186595013 100644
--- a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto.ts
@@ -41,8 +41,8 @@ export class EmailAccountConnectionParameters {
CALDAV?: ConnectionParameters;
}
-@ObjectType()
-export class ConnectionParametersOutput {
+@ObjectType('ConnectionParametersOutput')
+export class ConnectionParametersOutputDTO {
@Field(() => String)
host: string;
@@ -59,14 +59,14 @@ export class ConnectionParametersOutput {
secure?: boolean;
}
-@ObjectType()
-export class ImapSmtpCaldavConnectionParameters {
- @Field(() => ConnectionParametersOutput, { nullable: true })
- IMAP?: ConnectionParametersOutput;
+@ObjectType('ImapSmtpCaldavConnectionParameters')
+export class ImapSmtpCaldavConnectionParametersDTO {
+ @Field(() => ConnectionParametersOutputDTO, { nullable: true })
+ IMAP?: ConnectionParametersOutputDTO;
- @Field(() => ConnectionParametersOutput, { nullable: true })
- SMTP?: ConnectionParametersOutput;
+ @Field(() => ConnectionParametersOutputDTO, { nullable: true })
+ SMTP?: ConnectionParametersOutputDTO;
- @Field(() => ConnectionParametersOutput, { nullable: true })
- CALDAV?: ConnectionParametersOutput;
+ @Field(() => ConnectionParametersOutputDTO, { nullable: true })
+ CALDAV?: ConnectionParametersOutputDTO;
}
diff --git a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/imap-smtp-caldav-connection.resolver.ts b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/imap-smtp-caldav-connection.resolver.ts
index 3aef8e9fdbd..9816244bd21 100644
--- a/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/imap-smtp-caldav-connection.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/imap-smtp-caldav-connection/imap-smtp-caldav-connection.resolver.ts
@@ -15,8 +15,8 @@ import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/featu
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
import { UserInputError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
-import { ConnectedImapSmtpCaldavAccount } from 'src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connected-account.dto';
-import { ImapSmtpCaldavConnectionSuccess } from 'src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection-success.dto';
+import { ConnectedImapSmtpCaldavAccountDTO } from 'src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connected-account.dto';
+import { ImapSmtpCaldavConnectionSuccessDTO } from 'src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection-success.dto';
import { EmailAccountConnectionParameters } from 'src/engine/core-modules/imap-smtp-caldav-connection/dtos/imap-smtp-caldav-connection.dto';
import { ImapSmtpCaldavValidatorService } from 'src/engine/core-modules/imap-smtp-caldav-connection/services/imap-smtp-caldav-connection-validator.service';
import { ImapSmtpCaldavService } from 'src/engine/core-modules/imap-smtp-caldav-connection/services/imap-smtp-caldav-connection.service';
@@ -43,12 +43,12 @@ export class ImapSmtpCaldavResolver {
private readonly mailConnectionValidatorService: ImapSmtpCaldavValidatorService,
) {}
- @Query(() => ConnectedImapSmtpCaldavAccount)
+ @Query(() => ConnectedImapSmtpCaldavAccountDTO)
@UseGuards(WorkspaceAuthGuard)
async getConnectedImapSmtpCaldavAccount(
@Args('id', { type: () => UUIDScalarType }) id: string,
@AuthWorkspace() workspace: Workspace,
- ): Promise<ConnectedImapSmtpCaldavAccount> {
+ ): Promise<ConnectedImapSmtpCaldavAccountDTO> {
const connectedAccountRepository =
await this.twentyORMGlobalManager.getRepositoryForWorkspace<ConnectedAccountWorkspaceEntity>(
workspace.id,
@@ -74,7 +74,7 @@ export class ImapSmtpCaldavResolver {
};
}
- @Mutation(() => ImapSmtpCaldavConnectionSuccess)
+ @Mutation(() => ImapSmtpCaldavConnectionSuccessDTO)
@UseGuards(WorkspaceAuthGuard)
async saveImapSmtpCaldavAccount(
@Args('accountOwnerId', { type: () => UUIDScalarType })
@@ -84,7 +84,7 @@ export class ImapSmtpCaldavResolver {
connectionParameters: EmailAccountConnectionParameters,
@AuthWorkspace() workspace: Workspace,
@Args('id', { type: () => UUIDScalarType, nullable: true }) id?: string,
- ): Promise<ImapSmtpCaldavConnectionSuccess> {
+ ): Promise<ImapSmtpCaldavConnectionSuccessDTO> {
const isImapSmtpCaldavFeatureFlagEnabled =
await this.featureFlagService.isFeatureEnabled(
FeatureFlagKey.IS_IMAP_SMTP_CALDAV_ENABLED,
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/constants/queue-retention.constants.ts b/packages/twenty-server/src/engine/core-modules/message-queue/constants/queue-retention.constants.ts
new file mode 100644
index 00000000000..1c06a91f7f5
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/constants/queue-retention.constants.ts
@@ -0,0 +1,6 @@
+export const QUEUE_RETENTION = {
+ completedMaxAge: 14400, // 4 hours (4*3600s)
+ completedMaxCount: 1000,
+ failedMaxAge: 604800, // 7 days (7*24*3600s)
+ failedMaxCount: 1000,
+};
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/drivers/bullmq.driver.ts b/packages/twenty-server/src/engine/core-modules/message-queue/drivers/bullmq.driver.ts
index f4cb2d2f786..b0a3023572f 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/drivers/bullmq.driver.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/drivers/bullmq.driver.ts
@@ -18,6 +18,7 @@ import { type MessageQueueDriver } from 'src/engine/core-modules/message-queue/d
import { type MessageQueueJob } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
import { type MessageQueueWorkerOptions } from 'src/engine/core-modules/message-queue/interfaces/message-queue-worker-options.interface';
+import { QUEUE_RETENTION } from 'src/engine/core-modules/message-queue/constants/queue-retention.constants';
import { type MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
import { getJobKey } from 'src/engine/core-modules/message-queue/utils/get-job-key.util';
import { MESSAGE_QUEUE_PRIORITY } from 'src/engine/core-modules/message-queue/message-queue-priority.constant';
@@ -112,8 +113,14 @@ export class BullMQDriver implements MessageQueueDriver, OnModuleDestroy {
const queueOptions: JobsOptions = {
priority: options?.priority,
repeat: options?.repeat,
- removeOnComplete: true,
- removeOnFail: 100,
+ removeOnComplete: {
+ age: QUEUE_RETENTION.completedMaxAge,
+ count: QUEUE_RETENTION.completedMaxCount,
+ },
+ removeOnFail: {
+ age: QUEUE_RETENTION.failedMaxAge,
+ count: QUEUE_RETENTION.failedMaxCount,
+ },
};
await this.queueMap[queueName].upsertJobScheduler(
@@ -170,8 +177,14 @@ export class BullMQDriver implements MessageQueueDriver, OnModuleDestroy {
jobId: options?.id ? `${options.id}-${v4()}` : undefined, // We add V4() to id to make sure ids are uniques so we can add a waiting job when a job related with the same option.id is running
priority: options?.priority ?? MESSAGE_QUEUE_PRIORITY[queueName],
attempts: 1 + (options?.retryLimit || 0),
- removeOnComplete: true,
- removeOnFail: 100,
+ removeOnComplete: {
+ age: QUEUE_RETENTION.completedMaxAge,
+ count: QUEUE_RETENTION.completedMaxCount,
+ },
+ removeOnFail: {
+ age: QUEUE_RETENTION.failedMaxAge,
+ count: QUEUE_RETENTION.failedMaxCount,
+ },
delay: options?.delay,
};
diff --git a/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto.ts b/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto.ts
index 5263e9baf3e..5e06208b528 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto.ts
@@ -2,8 +2,8 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-@ObjectType()
-export class TimelineThreadParticipant {
+@ObjectType('TimelineThreadParticipant')
+export class TimelineThreadParticipantDTO {
@Field(() => UUIDScalarType, { nullable: true })
personId: string | null;
diff --git a/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-thread.dto.ts b/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-thread.dto.ts
index a862d55cce0..72dafca778d 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-thread.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-thread.dto.ts
@@ -1,11 +1,11 @@
import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { TimelineThreadParticipant } from 'src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto';
+import { TimelineThreadParticipantDTO } from 'src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto';
import { MessageChannelVisibility } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity';
-@ObjectType()
-export class TimelineThread {
+@ObjectType('TimelineThread')
+export class TimelineThreadDTO {
@Field(() => UUIDScalarType)
id: string;
@@ -16,10 +16,10 @@ export class TimelineThread {
visibility: MessageChannelVisibility;
@Field()
- firstParticipant: TimelineThreadParticipant;
+ firstParticipant: TimelineThreadParticipantDTO;
- @Field(() => [TimelineThreadParticipant])
- lastTwoParticipants: TimelineThreadParticipant[];
+ @Field(() => [TimelineThreadParticipantDTO])
+ lastTwoParticipants: TimelineThreadParticipantDTO[];
@Field()
lastMessageReceivedAt: Date;
diff --git a/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-threads-with-total.dto.ts b/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-threads-with-total.dto.ts
index 1d75bc23aae..a036bcf8c67 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-threads-with-total.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/messaging/dtos/timeline-threads-with-total.dto.ts
@@ -1,12 +1,12 @@
import { Field, Int, ObjectType } from '@nestjs/graphql';
-import { TimelineThread } from 'src/engine/core-modules/messaging/dtos/timeline-thread.dto';
+import { TimelineThreadDTO } from 'src/engine/core-modules/messaging/dtos/timeline-thread.dto';
-@ObjectType()
-export class TimelineThreadsWithTotal {
+@ObjectType('TimelineThreadsWithTotal')
+export class TimelineThreadsWithTotalDTO {
@Field(() => Int)
totalNumberOfThreads: number;
- @Field(() => [TimelineThread])
- timelineThreads: TimelineThread[];
+ @Field(() => [TimelineThreadDTO])
+ timelineThreads: TimelineThreadDTO[];
}
diff --git a/packages/twenty-server/src/engine/core-modules/messaging/services/get-messages.service.ts b/packages/twenty-server/src/engine/core-modules/messaging/services/get-messages.service.ts
index 702310e8f96..d5cd241d853 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging/services/get-messages.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/messaging/services/get-messages.service.ts
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { TIMELINE_THREADS_DEFAULT_PAGE_SIZE } from 'src/engine/core-modules/messaging/constants/messaging.constants';
-import { type TimelineThreadsWithTotal } from 'src/engine/core-modules/messaging/dtos/timeline-threads-with-total.dto';
+import { type TimelineThreadsWithTotalDTO } from 'src/engine/core-modules/messaging/dtos/timeline-threads-with-total.dto';
import { TimelineMessagingService } from 'src/engine/core-modules/messaging/services/timeline-messaging.service';
import { formatThreads } from 'src/engine/core-modules/messaging/utils/format-threads.util';
import { TwentyORMManager } from 'src/engine/twenty-orm/twenty-orm.manager';
@@ -20,7 +20,7 @@ export class GetMessagesService {
personIds: string[],
page = 1,
pageSize: number = TIMELINE_THREADS_DEFAULT_PAGE_SIZE,
- ): Promise<TimelineThreadsWithTotal> {
+ ): Promise<TimelineThreadsWithTotalDTO> {
const offset = (page - 1) * pageSize;
const { messageThreads, totalNumberOfThreads } =
@@ -67,7 +67,7 @@ export class GetMessagesService {
companyId: string,
page = 1,
pageSize: number = TIMELINE_THREADS_DEFAULT_PAGE_SIZE,
- ): Promise<TimelineThreadsWithTotal> {
+ ): Promise<TimelineThreadsWithTotalDTO> {
const personRepository =
await this.twentyORMManager.getRepository<PersonWorkspaceEntity>(
'person',
@@ -105,7 +105,7 @@ export class GetMessagesService {
opportunityId: string,
page = 1,
pageSize: number = TIMELINE_THREADS_DEFAULT_PAGE_SIZE,
- ): Promise<TimelineThreadsWithTotal> {
+ ): Promise<TimelineThreadsWithTotalDTO> {
const opportunityRepository =
await this.twentyORMManager.getRepository<OpportunityWorkspaceEntity>(
'opportunity',
diff --git a/packages/twenty-server/src/engine/core-modules/messaging/services/timeline-messaging.service.ts b/packages/twenty-server/src/engine/core-modules/messaging/services/timeline-messaging.service.ts
index 4e68d3c1ccd..cffd6ac27ff 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging/services/timeline-messaging.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/messaging/services/timeline-messaging.service.ts
@@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { In } from 'typeorm';
-import { type TimelineThread } from 'src/engine/core-modules/messaging/dtos/timeline-thread.dto';
+import { type TimelineThreadDTO } from 'src/engine/core-modules/messaging/dtos/timeline-thread.dto';
import { TwentyORMManager } from 'src/engine/twenty-orm/twenty-orm.manager';
import { MessageChannelVisibility } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity';
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
@@ -18,7 +18,7 @@ export class TimelineMessagingService {
pageSize: number,
): Promise<{
messageThreads: Omit<
- TimelineThread,
+ TimelineThreadDTO,
| 'firstParticipant'
| 'lastTwoParticipants'
| 'participantCount'
diff --git a/packages/twenty-server/src/engine/core-modules/messaging/timeline-messaging.resolver.ts b/packages/twenty-server/src/engine/core-modules/messaging/timeline-messaging.resolver.ts
index f0e4722c5c8..104345774c0 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging/timeline-messaging.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/messaging/timeline-messaging.resolver.ts
@@ -5,7 +5,7 @@ import { Max } from 'class-validator';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { TIMELINE_THREADS_MAX_PAGE_SIZE } from 'src/engine/core-modules/messaging/constants/messaging.constants';
-import { TimelineThreadsWithTotal } from 'src/engine/core-modules/messaging/dtos/timeline-threads-with-total.dto';
+import { TimelineThreadsWithTotalDTO } from 'src/engine/core-modules/messaging/dtos/timeline-threads-with-total.dto';
import { GetMessagesService } from 'src/engine/core-modules/messaging/services/get-messages.service';
import { UserService } from 'src/engine/core-modules/user/services/user.service';
import { User } from 'src/engine/core-modules/user/user.entity';
@@ -55,14 +55,14 @@ class GetTimelineThreadsFromOpportunityIdArgs {
}
@UseGuards(WorkspaceAuthGuard, UserAuthGuard)
-@Resolver(() => TimelineThreadsWithTotal)
+@Resolver(() => TimelineThreadsWithTotalDTO)
export class TimelineMessagingResolver {
constructor(
private readonly getMessagesFromPersonIdsService: GetMessagesService,
private readonly userService: UserService,
) {}
- @Query(() => TimelineThreadsWithTotal)
+ @Query(() => TimelineThreadsWithTotalDTO)
async getTimelineThreadsFromPersonId(
@AuthUser() user: User,
@AuthWorkspace() workspace: Workspace,
@@ -88,7 +88,7 @@ export class TimelineMessagingResolver {
return timelineThreads;
}
- @Query(() => TimelineThreadsWithTotal)
+ @Query(() => TimelineThreadsWithTotalDTO)
async getTimelineThreadsFromCompanyId(
@AuthUser() user: User,
@AuthWorkspace() workspace: Workspace,
@@ -114,7 +114,7 @@ export class TimelineMessagingResolver {
return timelineThreads;
}
- @Query(() => TimelineThreadsWithTotal)
+ @Query(() => TimelineThreadsWithTotalDTO)
async getTimelineThreadsFromOpportunityId(
@AuthUser() user: User,
@AuthWorkspace() workspace: Workspace,
diff --git a/packages/twenty-server/src/engine/core-modules/messaging/utils/extract-participant-summary.util.ts b/packages/twenty-server/src/engine/core-modules/messaging/utils/extract-participant-summary.util.ts
index 85e22dcc0ad..74e43453cb0 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging/utils/extract-participant-summary.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/messaging/utils/extract-participant-summary.util.ts
@@ -1,4 +1,4 @@
-import { type TimelineThreadParticipant } from 'src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto';
+import { type TimelineThreadParticipantDTO } from 'src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto';
import { filterActiveParticipants } from 'src/engine/core-modules/messaging/utils/filter-active-participants.util';
import { formatThreadParticipant } from 'src/engine/core-modules/messaging/utils/format-thread-participant.util';
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
@@ -6,8 +6,8 @@ import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/co
export const extractParticipantSummary = (
messageParticipants: MessageParticipantWorkspaceEntity[],
): {
- firstParticipant: TimelineThreadParticipant;
- lastTwoParticipants: TimelineThreadParticipant[];
+ firstParticipant: TimelineThreadParticipantDTO;
+ lastTwoParticipants: TimelineThreadParticipantDTO[];
participantCount: number;
} => {
const activeMessageParticipants =
@@ -23,7 +23,7 @@ export const extractParticipantSummary = (
threadParticipant.handle !== firstParticipant.handle,
);
- const lastTwoParticipants: TimelineThreadParticipant[] = [];
+ const lastTwoParticipants: TimelineThreadParticipantDTO[] = [];
const lastParticipant =
activeMessageParticipantsWithoutFirstParticipant.slice(-1)[0];
diff --git a/packages/twenty-server/src/engine/core-modules/messaging/utils/format-thread-participant.util.ts b/packages/twenty-server/src/engine/core-modules/messaging/utils/format-thread-participant.util.ts
index 383c41e5495..bdfccd8fcbe 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging/utils/format-thread-participant.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/messaging/utils/format-thread-participant.util.ts
@@ -1,9 +1,9 @@
-import { type TimelineThreadParticipant } from 'src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto';
+import { type TimelineThreadParticipantDTO } from 'src/engine/core-modules/messaging/dtos/timeline-thread-participant.dto';
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
export const formatThreadParticipant = (
threadParticipant: MessageParticipantWorkspaceEntity,
-): TimelineThreadParticipant => ({
+): TimelineThreadParticipantDTO => ({
personId: threadParticipant.personId,
workspaceMemberId: threadParticipant.workspaceMemberId,
firstName:
diff --git a/packages/twenty-server/src/engine/core-modules/messaging/utils/format-threads.util.ts b/packages/twenty-server/src/engine/core-modules/messaging/utils/format-threads.util.ts
index b6557ef00da..8885f6be120 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging/utils/format-threads.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/messaging/utils/format-threads.util.ts
@@ -1,13 +1,13 @@
import { FIELD_RESTRICTED_ADDITIONAL_PERMISSIONS_REQUIRED } from 'twenty-shared/constants';
-import { type TimelineThread } from 'src/engine/core-modules/messaging/dtos/timeline-thread.dto';
+import { type TimelineThreadDTO } from 'src/engine/core-modules/messaging/dtos/timeline-thread.dto';
import { extractParticipantSummary } from 'src/engine/core-modules/messaging/utils/extract-participant-summary.util';
import { MessageChannelVisibility } from 'src/modules/messaging/common/standard-objects/message-channel.workspace-entity';
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
export const formatThreads = (
threads: Omit<
- TimelineThread,
+ TimelineThreadDTO,
| 'firstParticipant'
| 'lastTwoParticipants'
| 'participantCount'
@@ -20,7 +20,7 @@ export const formatThreads = (
threadVisibilityByThreadId: {
[key: string]: MessageChannelVisibility;
},
-): TimelineThread[] => {
+): TimelineThreadDTO[] => {
return threads.map((thread) => {
const visibility = threadVisibilityByThreadId[thread.id];
diff --git a/packages/twenty-server/src/engine/core-modules/onboarding/dtos/onboarding-step-success.dto.ts b/packages/twenty-server/src/engine/core-modules/onboarding/dtos/onboarding-step-success.dto.ts
index 58d7b489635..9fd6f1ca8ac 100644
--- a/packages/twenty-server/src/engine/core-modules/onboarding/dtos/onboarding-step-success.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/onboarding/dtos/onboarding-step-success.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class OnboardingStepSuccess {
+@ObjectType('OnboardingStepSuccess')
+export class OnboardingStepSuccessDTO {
@Field(() => Boolean, {
description: 'Boolean that confirms query was dispatched',
})
diff --git a/packages/twenty-server/src/engine/core-modules/onboarding/onboarding.resolver.ts b/packages/twenty-server/src/engine/core-modules/onboarding/onboarding.resolver.ts
index 3fa32f41e5a..6d6e8c4e31f 100644
--- a/packages/twenty-server/src/engine/core-modules/onboarding/onboarding.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/onboarding/onboarding.resolver.ts
@@ -3,7 +3,7 @@ import { Mutation, Resolver } from '@nestjs/graphql';
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
-import { OnboardingStepSuccess } from 'src/engine/core-modules/onboarding/dtos/onboarding-step-success.dto';
+import { OnboardingStepSuccessDTO } from 'src/engine/core-modules/onboarding/dtos/onboarding-step-success.dto';
import { OnboardingService } from 'src/engine/core-modules/onboarding/onboarding.service';
import { User } from 'src/engine/core-modules/user/user.entity';
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
@@ -19,11 +19,11 @@ import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
export class OnboardingResolver {
constructor(private readonly onboardingService: OnboardingService) {}
- @Mutation(() => OnboardingStepSuccess)
+ @Mutation(() => OnboardingStepSuccessDTO)
async skipSyncEmailOnboardingStep(
@AuthUser() user: User,
@AuthWorkspace() workspace: Workspace,
- ): Promise<OnboardingStepSuccess> {
+ ): Promise<OnboardingStepSuccessDTO> {
await this.onboardingService.setOnboardingConnectAccountPending({
userId: user.id,
workspaceId: workspace.id,
@@ -33,10 +33,10 @@ export class OnboardingResolver {
return { success: true };
}
- @Mutation(() => OnboardingStepSuccess)
+ @Mutation(() => OnboardingStepSuccessDTO)
async skipBookOnboardingStep(
@AuthWorkspace() workspace: Workspace,
- ): Promise<OnboardingStepSuccess> {
+ ): Promise<OnboardingStepSuccessDTO> {
await this.onboardingService.setOnboardingBookOnboardingPending({
workspaceId: workspace.id,
value: false,
diff --git a/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts b/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts
index f288817ee69..a3436443dcb 100644
--- a/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts
+++ b/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts
@@ -41,7 +41,7 @@ import {
export class ConfigVariables {
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Enable or disable password authentication for users',
type: ConfigVariableType.BOOLEAN,
})
@@ -49,7 +49,7 @@ export class ConfigVariables {
AUTH_PASSWORD_ENABLED = true;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description:
'Prefills [email protected] in the login form, used in local development for quicker sign-in',
type: ConfigVariableType.BOOLEAN,
@@ -59,7 +59,7 @@ export class ConfigVariables {
SIGN_IN_PREFILLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Require email verification for user accounts',
type: ConfigVariableType.BOOLEAN,
})
@@ -67,7 +67,7 @@ export class ConfigVariables {
IS_EMAIL_VERIFICATION_REQUIRED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Duration for which the email verification token is valid',
type: ConfigVariableType.STRING,
})
@@ -76,7 +76,7 @@ export class ConfigVariables {
EMAIL_VERIFICATION_TOKEN_EXPIRES_IN = '1h';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Duration for which the password reset token is valid',
type: ConfigVariableType.STRING,
})
@@ -85,14 +85,14 @@ export class ConfigVariables {
PASSWORD_RESET_TOKEN_EXPIRES_IN = '5m';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.GoogleAuth,
+ group: ConfigVariablesGroup.GOOGLE_AUTH,
description: 'Enable or disable the Google Calendar integration',
type: ConfigVariableType.BOOLEAN,
})
CALENDAR_PROVIDER_GOOGLE_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.GoogleAuth,
+ group: ConfigVariablesGroup.GOOGLE_AUTH,
description: 'Callback URL for Google Auth APIs',
type: ConfigVariableType.STRING,
isSensitive: false,
@@ -100,7 +100,7 @@ export class ConfigVariables {
AUTH_GOOGLE_APIS_CALLBACK_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.GoogleAuth,
+ group: ConfigVariablesGroup.GOOGLE_AUTH,
description: 'Enable or disable Google Single Sign-On (SSO)',
type: ConfigVariableType.BOOLEAN,
})
@@ -108,7 +108,7 @@ export class ConfigVariables {
AUTH_GOOGLE_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.GoogleAuth,
+ group: ConfigVariablesGroup.GOOGLE_AUTH,
isSensitive: false,
description: 'Client ID for Google authentication',
type: ConfigVariableType.STRING,
@@ -117,7 +117,7 @@ export class ConfigVariables {
AUTH_GOOGLE_CLIENT_ID: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.GoogleAuth,
+ group: ConfigVariablesGroup.GOOGLE_AUTH,
isSensitive: true,
description: 'Client secret for Google authentication',
type: ConfigVariableType.STRING,
@@ -126,7 +126,7 @@ export class ConfigVariables {
AUTH_GOOGLE_CLIENT_SECRET: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.GoogleAuth,
+ group: ConfigVariablesGroup.GOOGLE_AUTH,
isSensitive: false,
description: 'Callback URL for Google authentication',
type: ConfigVariableType.STRING,
@@ -136,21 +136,21 @@ export class ConfigVariables {
AUTH_GOOGLE_CALLBACK_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.GoogleAuth,
+ group: ConfigVariablesGroup.GOOGLE_AUTH,
description: 'Enable or disable the Gmail messaging integration',
type: ConfigVariableType.BOOLEAN,
})
MESSAGING_PROVIDER_GMAIL_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Enable or disable the IMAP messaging integration',
type: ConfigVariableType.BOOLEAN,
})
IS_IMAP_SMTP_CALDAV_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.MicrosoftAuth,
+ group: ConfigVariablesGroup.MICROSOFT_AUTH,
description: 'Enable or disable Microsoft authentication',
type: ConfigVariableType.BOOLEAN,
})
@@ -158,7 +158,7 @@ export class ConfigVariables {
AUTH_MICROSOFT_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.MicrosoftAuth,
+ group: ConfigVariablesGroup.MICROSOFT_AUTH,
isSensitive: false,
description: 'Client ID for Microsoft authentication',
type: ConfigVariableType.STRING,
@@ -167,7 +167,7 @@ export class ConfigVariables {
AUTH_MICROSOFT_CLIENT_ID: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.MicrosoftAuth,
+ group: ConfigVariablesGroup.MICROSOFT_AUTH,
isSensitive: true,
description: 'Client secret for Microsoft authentication',
type: ConfigVariableType.STRING,
@@ -176,7 +176,7 @@ export class ConfigVariables {
AUTH_MICROSOFT_CLIENT_SECRET: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.MicrosoftAuth,
+ group: ConfigVariablesGroup.MICROSOFT_AUTH,
isSensitive: false,
description: 'Callback URL for Microsoft authentication',
type: ConfigVariableType.STRING,
@@ -186,7 +186,7 @@ export class ConfigVariables {
AUTH_MICROSOFT_CALLBACK_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.MicrosoftAuth,
+ group: ConfigVariablesGroup.MICROSOFT_AUTH,
isSensitive: false,
description: 'Callback URL for Microsoft APIs',
type: ConfigVariableType.STRING,
@@ -196,21 +196,21 @@ export class ConfigVariables {
AUTH_MICROSOFT_APIS_CALLBACK_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.MicrosoftAuth,
+ group: ConfigVariablesGroup.MICROSOFT_AUTH,
description: 'Enable or disable the Microsoft messaging integration',
type: ConfigVariableType.BOOLEAN,
})
MESSAGING_PROVIDER_MICROSOFT_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.MicrosoftAuth,
+ group: ConfigVariablesGroup.MICROSOFT_AUTH,
description: 'Enable or disable the Microsoft Calendar integration',
type: ConfigVariableType.BOOLEAN,
})
CALENDAR_PROVIDER_MICROSOFT_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
isSensitive: true,
description:
'Legacy variable to be deprecated when all API Keys expire. Replaced by APP_KEY',
@@ -221,7 +221,7 @@ export class ConfigVariables {
ACCESS_TOKEN_SECRET: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Duration for which the access token is valid',
type: ConfigVariableType.STRING,
})
@@ -230,7 +230,7 @@ export class ConfigVariables {
ACCESS_TOKEN_EXPIRES_IN = '30m';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Duration for which the workspace agnostic token is valid',
type: ConfigVariableType.STRING,
})
@@ -239,7 +239,7 @@ export class ConfigVariables {
WORKSPACE_AGNOSTIC_TOKEN_EXPIRES_IN = '30m';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Duration for which the refresh token is valid',
type: ConfigVariableType.STRING,
})
@@ -247,7 +247,7 @@ export class ConfigVariables {
REFRESH_TOKEN_EXPIRES_IN = '60d';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Cooldown period for refreshing tokens',
type: ConfigVariableType.STRING,
})
@@ -256,7 +256,7 @@ export class ConfigVariables {
REFRESH_TOKEN_COOL_DOWN = '1m';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Duration for which the login token is valid',
type: ConfigVariableType.STRING,
})
@@ -265,7 +265,7 @@ export class ConfigVariables {
LOGIN_TOKEN_EXPIRES_IN = '15m';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Duration for which the file token is valid',
type: ConfigVariableType.STRING,
})
@@ -274,7 +274,7 @@ export class ConfigVariables {
FILE_TOKEN_EXPIRES_IN = '1d';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Duration for which the invitation token is valid',
type: ConfigVariableType.STRING,
})
@@ -283,35 +283,35 @@ export class ConfigVariables {
INVITATION_TOKEN_EXPIRES_IN = '30d';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Duration for which the short-term token is valid',
type: ConfigVariableType.STRING,
})
SHORT_TERM_TOKEN_EXPIRES_IN = '5m';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.EmailSettings,
+ group: ConfigVariablesGroup.EMAIL_SETTINGS,
description: 'Email address used as the sender for outgoing emails',
type: ConfigVariableType.STRING,
})
EMAIL_FROM_ADDRESS = '[email protected]';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.EmailSettings,
+ group: ConfigVariablesGroup.EMAIL_SETTINGS,
description: 'Email address used for system notifications',
type: ConfigVariableType.STRING,
})
EMAIL_SYSTEM_ADDRESS = '[email protected]';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.EmailSettings,
+ group: ConfigVariablesGroup.EMAIL_SETTINGS,
description: 'Name used in the From header for outgoing emails',
type: ConfigVariableType.STRING,
})
EMAIL_FROM_NAME = 'Felix from Twenty';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.EmailSettings,
+ group: ConfigVariablesGroup.EMAIL_SETTINGS,
description: 'Email driver to use for sending emails',
type: ConfigVariableType.ENUM,
options: Object.values(EmailDriver),
@@ -320,14 +320,14 @@ export class ConfigVariables {
EMAIL_DRIVER: EmailDriver = EmailDriver.LOGGER;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.EmailSettings,
+ group: ConfigVariablesGroup.EMAIL_SETTINGS,
description: 'SMTP host for sending emails',
type: ConfigVariableType.STRING,
})
EMAIL_SMTP_HOST: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.EmailSettings,
+ group: ConfigVariablesGroup.EMAIL_SETTINGS,
description: 'Use unsecure connection for SMTP',
type: ConfigVariableType.BOOLEAN,
})
@@ -335,7 +335,7 @@ export class ConfigVariables {
EMAIL_SMTP_NO_TLS = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.EmailSettings,
+ group: ConfigVariablesGroup.EMAIL_SETTINGS,
description: 'SMTP port for sending emails',
type: ConfigVariableType.NUMBER,
})
@@ -343,7 +343,7 @@ export class ConfigVariables {
EMAIL_SMTP_PORT = 587;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.EmailSettings,
+ group: ConfigVariablesGroup.EMAIL_SETTINGS,
description: 'SMTP user for authentication',
type: ConfigVariableType.STRING,
isSensitive: true,
@@ -351,7 +351,7 @@ export class ConfigVariables {
EMAIL_SMTP_USER: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.EmailSettings,
+ group: ConfigVariablesGroup.EMAIL_SETTINGS,
isSensitive: true,
description: 'SMTP password for authentication',
type: ConfigVariableType.STRING,
@@ -359,7 +359,7 @@ export class ConfigVariables {
EMAIL_SMTP_PASSWORD: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description:
'When enabled, only server admins can create new workspaces. Ignored during initial setup when no workspace exists.',
type: ConfigVariableType.BOOLEAN,
@@ -368,7 +368,7 @@ export class ConfigVariables {
IS_WORKSPACE_CREATION_LIMITED_TO_SERVER_ADMINS = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.StorageConfig,
+ group: ConfigVariablesGroup.STORAGE_CONFIG,
description: 'Type of storage to use (local or S3)',
type: ConfigVariableType.ENUM,
options: Object.values(StorageDriverType),
@@ -378,7 +378,7 @@ export class ConfigVariables {
STORAGE_TYPE: StorageDriverType = StorageDriverType.LOCAL;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.StorageConfig,
+ group: ConfigVariablesGroup.STORAGE_CONFIG,
description: 'Local path for storage when using local storage type',
type: ConfigVariableType.STRING,
})
@@ -386,7 +386,7 @@ export class ConfigVariables {
STORAGE_LOCAL_PATH = '.local-storage';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.StorageConfig,
+ group: ConfigVariablesGroup.STORAGE_CONFIG,
description: 'S3 region for storage when using S3 storage type',
type: ConfigVariableType.STRING,
})
@@ -395,7 +395,7 @@ export class ConfigVariables {
STORAGE_S3_REGION: AwsRegion;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.StorageConfig,
+ group: ConfigVariablesGroup.STORAGE_CONFIG,
description: 'S3 bucket name for storage when using S3 storage type',
type: ConfigVariableType.STRING,
})
@@ -403,7 +403,7 @@ export class ConfigVariables {
STORAGE_S3_NAME: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.StorageConfig,
+ group: ConfigVariablesGroup.STORAGE_CONFIG,
description: 'S3 endpoint for storage when using S3 storage type',
type: ConfigVariableType.STRING,
})
@@ -412,7 +412,7 @@ export class ConfigVariables {
STORAGE_S3_ENDPOINT: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.StorageConfig,
+ group: ConfigVariablesGroup.STORAGE_CONFIG,
isSensitive: true,
description:
'S3 access key ID for authentication when using S3 storage type',
@@ -423,7 +423,7 @@ export class ConfigVariables {
STORAGE_S3_ACCESS_KEY_ID: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.StorageConfig,
+ group: ConfigVariablesGroup.STORAGE_CONFIG,
isSensitive: true,
description:
'S3 secret access key for authentication when using S3 storage type',
@@ -434,7 +434,7 @@ export class ConfigVariables {
STORAGE_S3_SECRET_ACCESS_KEY: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerlessConfig,
+ group: ConfigVariablesGroup.SERVERLESS_CONFIG,
description: 'Type of serverless execution (local or Lambda)',
type: ConfigVariableType.ENUM,
options: Object.values(ServerlessDriverType),
@@ -445,7 +445,7 @@ export class ConfigVariables {
SERVERLESS_TYPE: ServerlessDriverType = ServerlessDriverType.LOCAL;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerlessConfig,
+ group: ConfigVariablesGroup.SERVERLESS_CONFIG,
description:
'Configure whether console logs from serverless functions are displayed in the terminal',
type: ConfigVariableType.BOOLEAN,
@@ -454,7 +454,7 @@ export class ConfigVariables {
SERVERLESS_LOGS_ENABLED: false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerlessConfig,
+ group: ConfigVariablesGroup.SERVERLESS_CONFIG,
description: 'Throttle limit for serverless function execution',
type: ConfigVariableType.NUMBER,
})
@@ -463,7 +463,7 @@ export class ConfigVariables {
// milliseconds
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerlessConfig,
+ group: ConfigVariablesGroup.SERVERLESS_CONFIG,
description: 'Time-to-live for serverless function execution throttle',
type: ConfigVariableType.NUMBER,
})
@@ -471,7 +471,7 @@ export class ConfigVariables {
SERVERLESS_FUNCTION_EXEC_THROTTLE_TTL = 1000;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerlessConfig,
+ group: ConfigVariablesGroup.SERVERLESS_CONFIG,
description: 'Region for AWS Lambda functions',
type: ConfigVariableType.STRING,
})
@@ -480,7 +480,7 @@ export class ConfigVariables {
SERVERLESS_LAMBDA_REGION: AwsRegion;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerlessConfig,
+ group: ConfigVariablesGroup.SERVERLESS_CONFIG,
description: 'IAM role for AWS Lambda functions',
type: ConfigVariableType.STRING,
})
@@ -488,7 +488,7 @@ export class ConfigVariables {
SERVERLESS_LAMBDA_ROLE: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerlessConfig,
+ group: ConfigVariablesGroup.SERVERLESS_CONFIG,
description: 'Role to assume when hosting lambdas in dedicated AWS account',
type: ConfigVariableType.STRING,
})
@@ -497,7 +497,7 @@ export class ConfigVariables {
SERVERLESS_LAMBDA_SUBHOSTING_ROLE?: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerlessConfig,
+ group: ConfigVariablesGroup.SERVERLESS_CONFIG,
isSensitive: true,
description: 'Access key ID for AWS Lambda functions',
type: ConfigVariableType.STRING,
@@ -507,7 +507,7 @@ export class ConfigVariables {
SERVERLESS_LAMBDA_ACCESS_KEY_ID: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerlessConfig,
+ group: ConfigVariablesGroup.SERVERLESS_CONFIG,
isSensitive: true,
description: 'Secret access key for AWS Lambda functions',
type: ConfigVariableType.STRING,
@@ -517,7 +517,7 @@ export class ConfigVariables {
SERVERLESS_LAMBDA_SECRET_ACCESS_KEY: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.AnalyticsConfig,
+ group: ConfigVariablesGroup.ANALYTICS_CONFIG,
description: 'Enable or disable analytics for telemetry',
type: ConfigVariableType.BOOLEAN,
})
@@ -525,7 +525,7 @@ export class ConfigVariables {
ANALYTICS_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.AnalyticsConfig,
+ group: ConfigVariablesGroup.ANALYTICS_CONFIG,
description: 'Clickhouse host for analytics',
type: ConfigVariableType.STRING,
isSensitive: true,
@@ -539,7 +539,7 @@ export class ConfigVariables {
CLICKHOUSE_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Logging,
+ group: ConfigVariablesGroup.LOGGING,
description: 'Enable or disable telemetry logging',
type: ConfigVariableType.BOOLEAN,
})
@@ -547,7 +547,7 @@ export class ConfigVariables {
TELEMETRY_ENABLED = true;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.BillingConfig,
+ group: ConfigVariablesGroup.BILLING_CONFIG,
description: 'Enable or disable billing features',
type: ConfigVariableType.BOOLEAN,
})
@@ -555,7 +555,7 @@ export class ConfigVariables {
IS_BILLING_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.BillingConfig,
+ group: ConfigVariablesGroup.BILLING_CONFIG,
description: 'Link required for billing plan',
type: ConfigVariableType.STRING,
})
@@ -563,7 +563,7 @@ export class ConfigVariables {
BILLING_PLAN_REQUIRED_LINK: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.BillingConfig,
+ group: ConfigVariablesGroup.BILLING_CONFIG,
description: 'Duration of free trial with credit card in days',
type: ConfigVariableType.NUMBER,
})
@@ -573,7 +573,7 @@ export class ConfigVariables {
BILLING_FREE_TRIAL_WITH_CREDIT_CARD_DURATION_IN_DAYS = 30;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.BillingConfig,
+ group: ConfigVariablesGroup.BILLING_CONFIG,
description: 'Duration of free trial without credit card in days',
type: ConfigVariableType.NUMBER,
})
@@ -583,7 +583,7 @@ export class ConfigVariables {
BILLING_FREE_TRIAL_WITHOUT_CREDIT_CARD_DURATION_IN_DAYS = 7;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.BillingConfig,
+ group: ConfigVariablesGroup.BILLING_CONFIG,
description: 'Amount of credits for the free trial without credit card',
type: ConfigVariableType.NUMBER,
})
@@ -592,7 +592,7 @@ export class ConfigVariables {
BILLING_FREE_WORKFLOW_CREDITS_FOR_TRIAL_PERIOD_WITHOUT_CREDIT_CARD = 500_000;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.BillingConfig,
+ group: ConfigVariablesGroup.BILLING_CONFIG,
description: 'Amount of credits for the free trial with credit card',
type: ConfigVariableType.NUMBER,
})
@@ -601,7 +601,7 @@ export class ConfigVariables {
BILLING_FREE_WORKFLOW_CREDITS_FOR_TRIAL_PERIOD_WITH_CREDIT_CARD = 5_000_000;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.BillingConfig,
+ group: ConfigVariablesGroup.BILLING_CONFIG,
isSensitive: true,
description: 'Stripe API key for billing',
type: ConfigVariableType.STRING,
@@ -610,7 +610,7 @@ export class ConfigVariables {
BILLING_STRIPE_API_KEY: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.BillingConfig,
+ group: ConfigVariablesGroup.BILLING_CONFIG,
isSensitive: true,
description: 'Stripe webhook secret for billing',
type: ConfigVariableType.STRING,
@@ -619,7 +619,7 @@ export class ConfigVariables {
BILLING_STRIPE_WEBHOOK_SECRET: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Url for the frontend application',
type: ConfigVariableType.STRING,
isEnvOnly: true,
@@ -629,7 +629,7 @@ export class ConfigVariables {
FRONTEND_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description:
'Default subdomain for the frontend when multi-workspace is enabled',
type: ConfigVariableType.STRING,
@@ -638,7 +638,7 @@ export class ConfigVariables {
DEFAULT_SUBDOMAIN = 'app';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'ID for the Chrome extension',
type: ConfigVariableType.STRING,
})
@@ -646,7 +646,7 @@ export class ConfigVariables {
CHROME_EXTENSION_ID: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Page ID for Cal.com booking integration',
type: ConfigVariableType.STRING,
})
@@ -654,7 +654,7 @@ export class ConfigVariables {
CALENDAR_BOOKING_PAGE_ID?: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Logging,
+ group: ConfigVariablesGroup.LOGGING,
description: 'Enable or disable buffering for logs before sending',
type: ConfigVariableType.BOOLEAN,
})
@@ -662,7 +662,7 @@ export class ConfigVariables {
LOGGER_IS_BUFFER_ENABLED = true;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Logging,
+ group: ConfigVariablesGroup.LOGGING,
description: 'Driver used for handling exceptions (Console or Sentry)',
type: ConfigVariableType.ENUM,
options: Object.values(ExceptionHandlerDriver),
@@ -674,7 +674,7 @@ export class ConfigVariables {
ExceptionHandlerDriver.CONSOLE;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Logging,
+ group: ConfigVariablesGroup.LOGGING,
description: 'Levels of logging to be captured',
type: ConfigVariableType.ARRAY,
options: ['log', 'error', 'warn', 'debug'],
@@ -685,7 +685,7 @@ export class ConfigVariables {
LOG_LEVELS: LogLevel[] = ['log', 'error', 'warn'];
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Metering,
+ group: ConfigVariablesGroup.METERING,
description: 'Driver used for collect metrics (OpenTelemetry or Console)',
type: ConfigVariableType.ARRAY,
options: ['OpenTelemetry', 'Console'],
@@ -696,7 +696,7 @@ export class ConfigVariables {
METER_DRIVER: MeterDriver[] = [];
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Metering,
+ group: ConfigVariablesGroup.METERING,
description: 'Endpoint URL for the OpenTelemetry collector',
type: ConfigVariableType.STRING,
isEnvOnly: true,
@@ -705,7 +705,7 @@ export class ConfigVariables {
OTLP_COLLECTOR_ENDPOINT_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ExceptionHandler,
+ group: ConfigVariablesGroup.EXCEPTION_HANDLER,
description: 'Driver used for logging (only console for now)',
type: ConfigVariableType.ENUM,
options: Object.values(LoggerDriverType),
@@ -716,7 +716,7 @@ export class ConfigVariables {
LOGGER_DRIVER: LoggerDriverType = LoggerDriverType.CONSOLE;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ExceptionHandler,
+ group: ConfigVariablesGroup.EXCEPTION_HANDLER,
description: 'Data Source Name (DSN) for Sentry logging',
type: ConfigVariableType.STRING,
isSensitive: true,
@@ -727,7 +727,7 @@ export class ConfigVariables {
SENTRY_DSN: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ExceptionHandler,
+ group: ConfigVariablesGroup.EXCEPTION_HANDLER,
description: 'Front-end DSN for Sentry logging',
type: ConfigVariableType.STRING,
isSensitive: true,
@@ -737,7 +737,7 @@ export class ConfigVariables {
)
SENTRY_FRONT_DSN: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ExceptionHandler,
+ group: ConfigVariablesGroup.EXCEPTION_HANDLER,
description: 'Environment name for Sentry logging',
type: ConfigVariableType.STRING,
})
@@ -748,7 +748,7 @@ export class ConfigVariables {
SENTRY_ENVIRONMENT: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.SupportChatConfig,
+ group: ConfigVariablesGroup.SUPPORT_CHAT_CONFIG,
description: 'Driver used for support chat integration',
type: ConfigVariableType.ENUM,
options: Object.values(SupportDriver),
@@ -758,7 +758,7 @@ export class ConfigVariables {
SUPPORT_DRIVER: SupportDriver = SupportDriver.NONE;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.SupportChatConfig,
+ group: ConfigVariablesGroup.SUPPORT_CHAT_CONFIG,
isSensitive: true,
description: 'Chat ID for the support front integration',
type: ConfigVariableType.STRING,
@@ -767,7 +767,7 @@ export class ConfigVariables {
SUPPORT_FRONT_CHAT_ID: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.SupportChatConfig,
+ group: ConfigVariablesGroup.SUPPORT_CHAT_CONFIG,
isSensitive: true,
description: 'HMAC key for the support front integration',
type: ConfigVariableType.STRING,
@@ -776,7 +776,7 @@ export class ConfigVariables {
SUPPORT_FRONT_HMAC_KEY: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
isSensitive: true,
description: 'Database connection URL',
type: ConfigVariableType.STRING,
@@ -792,7 +792,7 @@ export class ConfigVariables {
PG_DATABASE_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description:
'Allow connections to a database with self-signed certificates',
isEnvOnly: true,
@@ -802,7 +802,7 @@ export class ConfigVariables {
PG_SSL_ALLOW_SELF_SIGNED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Enable pg connection pool sharing across tenants',
isEnvOnly: true,
type: ConfigVariableType.BOOLEAN,
@@ -811,7 +811,7 @@ export class ConfigVariables {
PG_ENABLE_POOL_SHARING = true;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Maximum number of clients in pg connection pool',
isEnvOnly: true,
type: ConfigVariableType.NUMBER,
@@ -821,7 +821,7 @@ export class ConfigVariables {
PG_POOL_MAX_CONNECTIONS = 10;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Idle timeout in milliseconds for pg connection pool clients',
isEnvOnly: true,
type: ConfigVariableType.NUMBER,
@@ -831,7 +831,7 @@ export class ConfigVariables {
PG_POOL_IDLE_TIMEOUT_MS = 600000;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Allow idle pg connection pool clients to exit',
isEnvOnly: true,
type: ConfigVariableType.BOOLEAN,
@@ -840,7 +840,7 @@ export class ConfigVariables {
PG_POOL_ALLOW_EXIT_ON_IDLE = true;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Enable configuration variables to be stored in the database',
isEnvOnly: true,
type: ConfigVariableType.BOOLEAN,
@@ -849,7 +849,7 @@ export class ConfigVariables {
IS_CONFIG_VARIABLES_IN_DB_ENABLED = true;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.TokensDuration,
+ group: ConfigVariablesGroup.TOKENS_DURATION,
description: 'Time-to-live for cache storage in seconds',
type: ConfigVariableType.NUMBER,
})
@@ -857,7 +857,7 @@ export class ConfigVariables {
CACHE_STORAGE_TTL: number = 3600 * 24 * 7;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
isSensitive: true,
description: 'Redis connection URL used for cache and queues by default',
isEnvOnly: true,
@@ -871,7 +871,7 @@ export class ConfigVariables {
REDIS_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
isSensitive: true,
description:
'Optional separate Redis connection for queues with a different eviction policy (advanced production use case, most self-hosters do not need this)',
@@ -887,7 +887,7 @@ export class ConfigVariables {
REDIS_QUEUE_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Node environment (development, production, etc.)',
type: ConfigVariableType.ENUM,
options: Object.values(NodeEnvironment),
@@ -897,7 +897,7 @@ export class ConfigVariables {
NODE_ENV: NodeEnvironment = NodeEnvironment.PRODUCTION;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Port for the node server',
type: ConfigVariableType.NUMBER,
isEnvOnly: true,
@@ -907,7 +907,7 @@ export class ConfigVariables {
NODE_PORT = 3000;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Base URL for the server',
type: ConfigVariableType.STRING,
isEnvOnly: true,
@@ -917,7 +917,7 @@ export class ConfigVariables {
SERVER_URL = 'http://localhost:3000';
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Base URL for public domains',
type: ConfigVariableType.STRING,
})
@@ -926,7 +926,7 @@ export class ConfigVariables {
PUBLIC_DOMAIN_URL: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
isSensitive: true,
description: 'Secret key for the application',
isEnvOnly: true,
@@ -935,7 +935,7 @@ export class ConfigVariables {
APP_SECRET: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.RateLimiting,
+ group: ConfigVariablesGroup.RATE_LIMITING,
description: 'Maximum number of records affected by mutations',
type: ConfigVariableType.NUMBER,
})
@@ -944,7 +944,7 @@ export class ConfigVariables {
MUTATION_MAXIMUM_AFFECTED_RECORDS = 100;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.RateLimiting,
+ group: ConfigVariablesGroup.RATE_LIMITING,
description: 'Time-to-live for API rate limiting in milliseconds',
type: ConfigVariableType.NUMBER,
})
@@ -952,7 +952,7 @@ export class ConfigVariables {
API_RATE_LIMITING_TTL = 100;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.RateLimiting,
+ group: ConfigVariablesGroup.RATE_LIMITING,
description:
'Maximum number of requests allowed in the rate limiting window',
type: ConfigVariableType.NUMBER,
@@ -980,7 +980,7 @@ export class ConfigVariables {
SSL_CERT_PATH: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.CloudflareConfig,
+ group: ConfigVariablesGroup.CLOUDFLARE_CONFIG,
isSensitive: true,
description: 'API key for Cloudflare integration',
type: ConfigVariableType.STRING,
@@ -989,7 +989,7 @@ export class ConfigVariables {
CLOUDFLARE_API_KEY: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.CloudflareConfig,
+ group: ConfigVariablesGroup.CLOUDFLARE_CONFIG,
description: 'Zone ID for Cloudflare integration',
type: ConfigVariableType.STRING,
})
@@ -997,7 +997,7 @@ export class ConfigVariables {
CLOUDFLARE_ZONE_ID: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.CloudflareConfig,
+ group: ConfigVariablesGroup.CLOUDFLARE_CONFIG,
description: 'Zone ID for public domain Cloudflare integration',
type: ConfigVariableType.STRING,
})
@@ -1005,7 +1005,7 @@ export class ConfigVariables {
CLOUDFLARE_PUBLIC_DOMAIN_ZONE_ID: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Random string to validate queries from Cloudflare',
type: ConfigVariableType.STRING,
isSensitive: true,
@@ -1014,7 +1014,7 @@ export class ConfigVariables {
CLOUDFLARE_WEBHOOK_SECRET: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description:
'Id to generate value for CNAME record to validate ownership and manage ssl for custom hostname with Cloudflare',
type: ConfigVariableType.STRING,
@@ -1087,7 +1087,7 @@ export class ConfigVariables {
XAI_API_KEY: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Enable or disable multi-workspace support',
type: ConfigVariableType.BOOLEAN,
isEnvOnly: true,
@@ -1096,7 +1096,7 @@ export class ConfigVariables {
IS_MULTIWORKSPACE_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description:
'Number of inactive days before sending a deletion warning for workspaces. Used in the workspace deletion cron job to determine when to send warning emails.',
type: ConfigVariableType.NUMBER,
@@ -1109,7 +1109,7 @@ export class ConfigVariables {
WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION = 7;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Number of inactive days before soft deleting workspaces',
type: ConfigVariableType.NUMBER,
})
@@ -1121,7 +1121,7 @@ export class ConfigVariables {
WORKSPACE_INACTIVE_DAYS_BEFORE_SOFT_DELETION = 14;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Number of inactive days before deleting workspaces',
type: ConfigVariableType.NUMBER,
})
@@ -1129,7 +1129,7 @@ export class ConfigVariables {
WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION = 21;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description:
'Maximum number of workspaces that can be deleted in a single execution',
type: ConfigVariableType.NUMBER,
@@ -1139,7 +1139,7 @@ export class ConfigVariables {
MAX_NUMBER_OF_WORKSPACES_DELETED_PER_EXECUTION = 5;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.RateLimiting,
+ group: ConfigVariablesGroup.RATE_LIMITING,
description: 'Throttle limit for workflow execution',
type: ConfigVariableType.NUMBER,
})
@@ -1147,7 +1147,7 @@ export class ConfigVariables {
WORKFLOW_EXEC_THROTTLE_LIMIT = 10;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.RateLimiting,
+ group: ConfigVariablesGroup.RATE_LIMITING,
description: 'Time-to-live for workflow execution throttle in milliseconds',
type: ConfigVariableType.NUMBER,
})
@@ -1155,7 +1155,7 @@ export class ConfigVariables {
WORKFLOW_EXEC_THROTTLE_TTL = 1000;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.CaptchaConfig,
+ group: ConfigVariablesGroup.CAPTCHA_CONFIG,
description: 'Driver for captcha integration',
type: ConfigVariableType.ENUM,
options: Object.values(CaptchaDriverType),
@@ -1166,7 +1166,7 @@ export class ConfigVariables {
CAPTCHA_DRIVER?: CaptchaDriverType;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.CaptchaConfig,
+ group: ConfigVariablesGroup.CAPTCHA_CONFIG,
isSensitive: true,
description: 'Site key for captcha integration',
type: ConfigVariableType.STRING,
@@ -1175,7 +1175,7 @@ export class ConfigVariables {
CAPTCHA_SITE_KEY?: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.CaptchaConfig,
+ group: ConfigVariablesGroup.CAPTCHA_CONFIG,
isSensitive: true,
description: 'Secret key for captcha integration',
type: ConfigVariableType.STRING,
@@ -1184,7 +1184,7 @@ export class ConfigVariables {
CAPTCHA_SECRET_KEY?: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
isSensitive: true,
description: 'License key for the Enterprise version',
type: ConfigVariableType.STRING,
@@ -1193,7 +1193,7 @@ export class ConfigVariables {
ENTERPRISE_KEY: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Health monitoring time window in minutes',
type: ConfigVariableType.NUMBER,
})
@@ -1202,7 +1202,7 @@ export class ConfigVariables {
HEALTH_METRICS_TIME_WINDOW_IN_MINUTES = 5;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Enable or disable the attachment preview feature',
type: ConfigVariableType.BOOLEAN,
})
@@ -1210,7 +1210,7 @@ export class ConfigVariables {
IS_ATTACHMENT_PREVIEW_ENABLED = true;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Twenty server version',
type: ConfigVariableType.STRING,
isEnvOnly: true,
@@ -1220,7 +1220,7 @@ export class ConfigVariables {
APP_VERSION?: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Enable or disable google map api usage',
type: ConfigVariableType.BOOLEAN,
})
@@ -1228,7 +1228,7 @@ export class ConfigVariables {
IS_MAPS_AND_ADDRESS_AUTOCOMPLETE_ENABLED = false;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
isSensitive: true,
description: 'Google map api key for places and map',
type: ConfigVariableType.STRING,
@@ -1237,7 +1237,7 @@ export class ConfigVariables {
GOOGLE_MAP_API_KEY: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.AwsSesSettings,
+ group: ConfigVariablesGroup.AWS_SES_SETTINGS,
description: 'AWS region',
type: ConfigVariableType.STRING,
})
@@ -1246,7 +1246,7 @@ export class ConfigVariables {
AWS_SES_REGION: AwsRegion;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.AwsSesSettings,
+ group: ConfigVariablesGroup.AWS_SES_SETTINGS,
isSensitive: true,
description: 'AWS access key ID',
type: ConfigVariableType.STRING,
@@ -1255,7 +1255,7 @@ export class ConfigVariables {
AWS_SES_ACCESS_KEY_ID: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.AwsSesSettings,
+ group: ConfigVariablesGroup.AWS_SES_SETTINGS,
isSensitive: true,
description: 'AWS session token',
type: ConfigVariableType.STRING,
@@ -1264,7 +1264,7 @@ export class ConfigVariables {
AWS_SES_SESSION_TOKEN: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.AwsSesSettings,
+ group: ConfigVariablesGroup.AWS_SES_SETTINGS,
isSensitive: true,
description: 'AWS secret access key',
type: ConfigVariableType.STRING,
@@ -1273,7 +1273,7 @@ export class ConfigVariables {
AWS_SES_SECRET_ACCESS_KEY: string;
@ConfigVariablesMetadata({
- group: ConfigVariablesGroup.AwsSesSettings,
+ group: ConfigVariablesGroup.AWS_SES_SETTINGS,
description: 'AWS Account ID for SES ARN construction',
type: ConfigVariableType.STRING,
})
diff --git a/packages/twenty-server/src/engine/core-modules/twenty-config/constants/config-variables-group-metadata.ts b/packages/twenty-server/src/engine/core-modules/twenty-config/constants/config-variables-group-metadata.ts
index ecc913b8061..e852636244e 100644
--- a/packages/twenty-server/src/engine/core-modules/twenty-config/constants/config-variables-group-metadata.ts
+++ b/packages/twenty-server/src/engine/core-modules/twenty-config/constants/config-variables-group-metadata.ts
@@ -10,75 +10,75 @@ export const CONFIG_VARIABLES_GROUP_METADATA: Record<
ConfigVariablesGroup,
GroupMetadata
> = {
- [ConfigVariablesGroup.ServerConfig]: {
+ [ConfigVariablesGroup.SERVER_CONFIG]: {
position: 100,
description: '',
isHiddenOnLoad: false,
},
- [ConfigVariablesGroup.RateLimiting]: {
+ [ConfigVariablesGroup.RATE_LIMITING]: {
position: 200,
description:
'We use this to limit the number of requests to the server. This is useful to prevent abuse.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.StorageConfig]: {
+ [ConfigVariablesGroup.STORAGE_CONFIG]: {
position: 300,
description:
'By default, file uploads are stored on the local filesystem, which is suitable for traditional servers. However, for ephemeral deployment servers, it is essential to configure the variables here to set up an S3-compatible file system. This ensures that files remain unaffected by server redeploys.',
isHiddenOnLoad: false,
},
- [ConfigVariablesGroup.GoogleAuth]: {
+ [ConfigVariablesGroup.GOOGLE_AUTH]: {
position: 400,
description: 'Configure Google integration (login, calendar, email)',
isHiddenOnLoad: false,
},
- [ConfigVariablesGroup.MicrosoftAuth]: {
+ [ConfigVariablesGroup.MICROSOFT_AUTH]: {
position: 500,
description: 'Configure Microsoft integration (login, calendar, email)',
isHiddenOnLoad: false,
},
- [ConfigVariablesGroup.EmailSettings]: {
+ [ConfigVariablesGroup.EMAIL_SETTINGS]: {
position: 600,
description:
'This is used for emails that are sent by the app such as invitations to join a workspace. This is not used to email CRM contacts.',
isHiddenOnLoad: false,
},
- [ConfigVariablesGroup.Logging]: {
+ [ConfigVariablesGroup.LOGGING]: {
position: 700,
description: '',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.ExceptionHandler]: {
+ [ConfigVariablesGroup.EXCEPTION_HANDLER]: {
position: 800,
description:
'By default, exceptions are sent to the logs. This should be enough for most self-hosting use-cases. For our cloud app we use Sentry.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.Metering]: {
+ [ConfigVariablesGroup.METERING]: {
position: 900,
description:
'By default, metrics are sent to the console. OpenTelemetry collector can be set up for self-hosting use-cases.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.Other]: {
+ [ConfigVariablesGroup.OTHER]: {
position: 1000,
description:
"The variables in this section are mostly used for internal purposes (running our Cloud offering), but shouldn't usually be required for a simple self-hosted instance",
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.BillingConfig]: {
+ [ConfigVariablesGroup.BILLING_CONFIG]: {
position: 1100,
description:
'We use Stripe in our Cloud app to charge customers. Not relevant to Self-hosters.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.CaptchaConfig]: {
+ [ConfigVariablesGroup.CAPTCHA_CONFIG]: {
position: 1200,
description:
'This protects critical endpoints like login and signup with a captcha to prevent bot attacks. Likely unnecessary for self-hosting scenarios.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.CloudflareConfig]: {
+ [ConfigVariablesGroup.CLOUDFLARE_CONFIG]: {
position: 1300,
description: '',
isHiddenOnLoad: true,
@@ -89,7 +89,7 @@ export const CONFIG_VARIABLES_GROUP_METADATA: Record<
'Configure the LLM provider and model to use for the app. This is experimental and not linked to any public feature.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.ServerlessConfig]: {
+ [ConfigVariablesGroup.SERVERLESS_CONFIG]: {
position: 1500,
description:
'In our multi-tenant cloud app, we offload untrusted custom code from workflows to a serverless system (Lambda) for enhanced security and scalability. Self-hosters with a single tenant can typically ignore this configuration.',
@@ -101,31 +101,31 @@ export const CONFIG_VARIABLES_GROUP_METADATA: Record<
'Configure this if you want to setup SSL on your server or full end-to-end encryption. If you just want basic HTTPS, a simple setup like Cloudflare in flexible mode might be easier.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.SupportChatConfig]: {
+ [ConfigVariablesGroup.SUPPORT_CHAT_CONFIG]: {
position: 1700,
description:
'We use this to setup a small support chat on the bottom left. Currently powered by Front.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.AnalyticsConfig]: {
+ [ConfigVariablesGroup.ANALYTICS_CONFIG]: {
position: 1800,
description:
'We’re running a test to perform analytics within the app. This will evolve.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.TokensDuration]: {
+ [ConfigVariablesGroup.TOKENS_DURATION]: {
position: 1900,
description:
'These have been set to sensible default so you probably don’t need to change them unless you have a specific use-case.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.TwoFactorAuthentication]: {
+ [ConfigVariablesGroup.TWO_FACTOR_AUTHENTICATION]: {
position: 2000,
description:
'These have been set to sensible default so you probably don’t need to change them unless you have a specific use-case.',
isHiddenOnLoad: true,
},
- [ConfigVariablesGroup.AwsSesSettings]: {
+ [ConfigVariablesGroup.AWS_SES_SETTINGS]: {
position: 2100,
description: 'Configure AWS SES settings for emailing domains',
isHiddenOnLoad: true,
diff --git a/packages/twenty-server/src/engine/core-modules/twenty-config/conversion/__tests__/config-value-converter.service.spec.ts b/packages/twenty-server/src/engine/core-modules/twenty-config/conversion/__tests__/config-value-converter.service.spec.ts
index 94c66dcbb43..037d4a90d5e 100644
--- a/packages/twenty-server/src/engine/core-modules/twenty-config/conversion/__tests__/config-value-converter.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/twenty-config/conversion/__tests__/config-value-converter.service.spec.ts
@@ -101,7 +101,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
AUTH_PASSWORD_ENABLED: {
type: ConfigVariableType.BOOLEAN,
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Enable or disable password authentication for users',
},
});
@@ -124,7 +124,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
CACHE_STORAGE_TTL: {
type: ConfigVariableType.NUMBER,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Time-to-live for cache storage in seconds',
},
});
@@ -147,7 +147,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
FRONTEND_URL: {
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Frontend URL',
},
});
@@ -172,7 +172,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
LOG_LEVELS: {
type: ConfigVariableType.ARRAY,
- group: ConfigVariablesGroup.Logging,
+ group: ConfigVariablesGroup.LOGGING,
description: 'Levels of logging to be captured',
options: ['log', 'error', 'warn', 'debug', 'verbose'],
},
@@ -198,7 +198,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
NODE_ENV: {
type: ConfigVariableType.ENUM,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Node environment',
options: ['development', 'production', 'test'],
},
@@ -254,7 +254,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
CACHE_STORAGE_TTL: {
type: ConfigVariableType.NUMBER,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Time-to-live for cache storage in seconds',
},
});
@@ -281,7 +281,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
AUTH_PASSWORD_ENABLED: {
type: ConfigVariableType.BOOLEAN,
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Enable or disable password authentication for users',
},
});
@@ -304,7 +304,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
CACHE_STORAGE_TTL: {
type: ConfigVariableType.NUMBER,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Time-to-live for cache storage in seconds',
},
});
@@ -327,7 +327,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
FRONTEND_URL: {
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Frontend URL',
},
});
@@ -352,7 +352,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
LOG_LEVELS: {
type: ConfigVariableType.ARRAY,
- group: ConfigVariablesGroup.Logging,
+ group: ConfigVariablesGroup.LOGGING,
description: 'Levels of logging to be captured',
options: ['log', 'error', 'warn', 'debug', 'verbose'],
},
@@ -379,7 +379,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
NODE_ENV: {
type: ConfigVariableType.ENUM,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Node environment',
options: ['development', 'production', 'test'],
},
@@ -434,7 +434,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
CUSTOM_OBJECT: {
type: 'unknown-type' as ConfigVariableType,
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Custom object',
},
});
@@ -453,7 +453,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
CACHE_STORAGE_TTL: {
type: ConfigVariableType.NUMBER,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Time-to-live for cache storage in seconds',
},
});
@@ -478,7 +478,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
AUTH_PASSWORD_ENABLED: {
type: ConfigVariableType.BOOLEAN,
- group: ConfigVariablesGroup.Other,
+ group: ConfigVariablesGroup.OTHER,
description: 'Enable or disable password authentication for users',
},
});
@@ -501,7 +501,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
CACHE_STORAGE_TTL: {
type: ConfigVariableType.NUMBER,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Time-to-live for cache storage in seconds',
},
});
@@ -524,7 +524,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
FRONTEND_URL: {
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Frontend URL',
},
});
@@ -547,7 +547,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
LOG_LEVELS: {
type: ConfigVariableType.ARRAY,
- group: ConfigVariablesGroup.Logging,
+ group: ConfigVariablesGroup.LOGGING,
description: 'Levels of logging to be captured',
options: ['log', 'error', 'warn', 'debug', 'verbose'],
},
@@ -571,7 +571,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
NODE_ENV: {
type: ConfigVariableType.ENUM,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Node environment',
options: ['development', 'production', 'test'],
},
@@ -595,7 +595,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
NODE_ENV: {
type: ConfigVariableType.ENUM,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Node environment',
options: ['development', 'production', 'test'],
},
@@ -630,7 +630,7 @@ describe('ConfigValueConverterService', () => {
jest.spyOn(TypedReflect, 'getMetadata').mockReturnValueOnce({
LOG_LEVELS: {
type: ConfigVariableType.ARRAY,
- group: ConfigVariablesGroup.Logging,
+ group: ConfigVariablesGroup.LOGGING,
description: 'Levels of logging to be captured',
options: ['log', 'error', 'warn', 'debug', 'verbose'],
},
diff --git a/packages/twenty-server/src/engine/core-modules/twenty-config/enums/config-variables-group.enum.ts b/packages/twenty-server/src/engine/core-modules/twenty-config/enums/config-variables-group.enum.ts
index 6faef1b56da..47dfac79864 100644
--- a/packages/twenty-server/src/engine/core-modules/twenty-config/enums/config-variables-group.enum.ts
+++ b/packages/twenty-server/src/engine/core-modules/twenty-config/enums/config-variables-group.enum.ts
@@ -1,23 +1,23 @@
export enum ConfigVariablesGroup {
- ServerConfig = 'server-config',
- RateLimiting = 'rate-limiting',
- StorageConfig = 'storage-config',
- GoogleAuth = 'google-auth',
- MicrosoftAuth = 'microsoft-auth',
- EmailSettings = 'email-settings',
- Logging = 'logging',
- Metering = 'metering',
- ExceptionHandler = 'exception-handler',
- Other = 'other',
- BillingConfig = 'billing-config',
- CaptchaConfig = 'captcha-config',
- CloudflareConfig = 'cloudflare-config',
- LLM = 'llm',
- ServerlessConfig = 'serverless-config',
- SSL = 'ssl',
- SupportChatConfig = 'support-chat-config',
- AnalyticsConfig = 'audit-config',
- TokensDuration = 'tokens-duration',
- TwoFactorAuthentication = 'two-factor-authentication',
- AwsSesSettings = 'aws-ses-settings',
+ SERVER_CONFIG = 'SERVER_CONFIG',
+ RATE_LIMITING = 'RATE_LIMITING',
+ STORAGE_CONFIG = 'STORAGE_CONFIG',
+ GOOGLE_AUTH = 'GOOGLE_AUTH',
+ MICROSOFT_AUTH = 'MICROSOFT_AUTH',
+ EMAIL_SETTINGS = 'EMAIL_SETTINGS',
+ LOGGING = 'LOGGING',
+ METERING = 'METERING',
+ EXCEPTION_HANDLER = 'EXCEPTION_HANDLER',
+ OTHER = 'OTHER',
+ BILLING_CONFIG = 'BILLING_CONFIG',
+ CAPTCHA_CONFIG = 'CAPTCHA_CONFIG',
+ CLOUDFLARE_CONFIG = 'CLOUDFLARE_CONFIG',
+ LLM = 'LLM',
+ SERVERLESS_CONFIG = 'SERVERLESS_CONFIG',
+ SSL = 'SSL',
+ SUPPORT_CHAT_CONFIG = 'SUPPORT_CHAT_CONFIG',
+ ANALYTICS_CONFIG = 'ANALYTICS_CONFIG',
+ TOKENS_DURATION = 'TOKENS_DURATION',
+ TWO_FACTOR_AUTHENTICATION = 'TWO_FACTOR_AUTHENTICATION',
+ AWS_SES_SETTINGS = 'AWS_SES_SETTINGS',
}
diff --git a/packages/twenty-server/src/engine/core-modules/twenty-config/storage/__tests__/config-storage.service.spec.ts b/packages/twenty-server/src/engine/core-modules/twenty-config/storage/__tests__/config-storage.service.spec.ts
index 49a661b951e..1456d1c9cbb 100644
--- a/packages/twenty-server/src/engine/core-modules/twenty-config/storage/__tests__/config-storage.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/twenty-config/storage/__tests__/config-storage.service.spec.ts
@@ -179,7 +179,7 @@ describe('ConfigStorageService', () => {
[key]: {
isSensitive: true,
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Test sensitive config',
},
});
@@ -213,7 +213,7 @@ describe('ConfigStorageService', () => {
[key]: {
isSensitive: true,
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Test sensitive config',
},
});
@@ -241,7 +241,7 @@ describe('ConfigStorageService', () => {
[key]: {
isSensitive: true,
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Test sensitive config',
},
});
@@ -413,7 +413,7 @@ describe('ConfigStorageService', () => {
[key]: {
isSensitive: true,
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Test sensitive config',
},
});
@@ -449,7 +449,7 @@ describe('ConfigStorageService', () => {
[key]: {
isSensitive: true,
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Test sensitive config',
},
});
@@ -617,12 +617,12 @@ describe('ConfigStorageService', () => {
SENSITIVE_CONFIG: {
isSensitive: true,
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Test sensitive config',
},
NORMAL_CONFIG: {
type: ConfigVariableType.STRING,
- group: ConfigVariablesGroup.ServerConfig,
+ group: ConfigVariablesGroup.SERVER_CONFIG,
description: 'Test normal config',
},
});
diff --git a/packages/twenty-server/src/engine/core-modules/twenty-config/twenty-config.service.spec.ts b/packages/twenty-server/src/engine/core-modules/twenty-config/twenty-config.service.spec.ts
index 12136b5ece2..b39a7b241ae 100644
--- a/packages/twenty-server/src/engine/core-modules/twenty-config/twenty-config.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/twenty-config/twenty-config.service.spec.ts
@@ -43,17 +43,17 @@ type TwentyConfigServicePrivateProps = {
const mockConfigVarMetadata = {
TEST_VAR: {
- group: ConfigVariablesGroup.GoogleAuth,
+ group: ConfigVariablesGroup.GOOGLE_AUTH,
description: 'Test variable',
isEnvOnly: false,
},
ENV_ONLY_VAR: {
- group: ConfigVariablesGroup.StorageConfig,
+ group: ConfigVariablesGroup.STORAGE_CONFIG,
description: 'Environment only variable',
isEnvOnly: true,
},
SENSITIVE_VAR: {
- group: ConfigVariablesGroup.Logging,
+ group: ConfigVariablesGroup.LOGGING,
description: 'Sensitive variable',
isSensitive: true,
},
diff --git a/packages/twenty-server/src/engine/core-modules/user/dtos/deleted-workspace-member.dto.ts b/packages/twenty-server/src/engine/core-modules/user/dtos/deleted-workspace-member.dto.ts
index 56a0a916b36..acef2f7b316 100644
--- a/packages/twenty-server/src/engine/core-modules/user/dtos/deleted-workspace-member.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/user/dtos/deleted-workspace-member.dto.ts
@@ -3,15 +3,15 @@ import { Field, ObjectType } from '@nestjs/graphql';
import { IDField } from '@ptc-org/nestjs-query-graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { FullName } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
+import { FullNameDTO } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
-@ObjectType()
-export class DeletedWorkspaceMember {
+@ObjectType('DeletedWorkspaceMember')
+export class DeletedWorkspaceMemberDTO {
@IDField(() => UUIDScalarType)
id: string;
- @Field(() => FullName)
- name: FullName;
+ @Field(() => FullNameDTO)
+ name: FullNameDTO;
@Field({ nullable: false })
userEmail: string;
diff --git a/packages/twenty-server/src/engine/core-modules/user/dtos/workspace-member.dto.ts b/packages/twenty-server/src/engine/core-modules/user/dtos/workspace-member.dto.ts
index 4f8307a5489..97c16c8745c 100644
--- a/packages/twenty-server/src/engine/core-modules/user/dtos/workspace-member.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/user/dtos/workspace-member.dto.ts
@@ -11,8 +11,8 @@ import {
WorkspaceMemberTimeFormatEnum,
} from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
-@ObjectType()
-export class FullName {
+@ObjectType('FullName')
+export class FullNameDTO {
@Field({ nullable: false })
firstName: string;
@@ -20,13 +20,13 @@ export class FullName {
lastName: string;
}
-@ObjectType()
-export class WorkspaceMember {
+@ObjectType('WorkspaceMember')
+export class WorkspaceMemberDTO {
@IDField(() => UUIDScalarType)
id: string;
- @Field(() => FullName)
- name: FullName;
+ @Field(() => FullNameDTO)
+ name: FullNameDTO;
@Field({ nullable: false })
userEmail: string;
diff --git a/packages/twenty-server/src/engine/core-modules/user/services/workspace-member-transpiler.service.ts b/packages/twenty-server/src/engine/core-modules/user/services/workspace-member-transpiler.service.ts
index a1cb1779709..f45f438f605 100644
--- a/packages/twenty-server/src/engine/core-modules/user/services/workspace-member-transpiler.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/user/services/workspace-member-transpiler.service.ts
@@ -5,13 +5,13 @@ import { isDefined } from 'twenty-shared/utils';
import { FileService } from 'src/engine/core-modules/file/services/file.service';
import { type UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
-import { type DeletedWorkspaceMember } from 'src/engine/core-modules/user/dtos/deleted-workspace-member.dto';
-import { type WorkspaceMember } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
+import { type DeletedWorkspaceMemberDTO } from 'src/engine/core-modules/user/dtos/deleted-workspace-member.dto';
+import { type WorkspaceMemberDTO } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
import { type RoleEntity } from 'src/engine/metadata-modules/role/role.entity';
import { fromRoleEntitiesToRoleDtos } from 'src/engine/metadata-modules/role/utils/fromRoleEntityToRoleDto.util';
import {
- type WorkspaceMemberNumberFormatEnum,
type WorkspaceMemberDateFormatEnum,
+ type WorkspaceMemberNumberFormatEnum,
type WorkspaceMemberTimeFormatEnum,
type WorkspaceMemberWorkspaceEntity,
} from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
@@ -50,7 +50,7 @@ export class WorkspaceMemberTranspiler {
userWorkspace,
workspaceMemberEntity,
userWorkspaceRoles,
- }: ToWorkspaceMemberDtoArgs): WorkspaceMember {
+ }: ToWorkspaceMemberDtoArgs): WorkspaceMemberDTO {
const {
avatarUrl: avatarUrlFromEntity,
id,
@@ -89,7 +89,7 @@ export class WorkspaceMemberTranspiler {
roles,
calendarStartDay,
numberFormat: numberFormat as WorkspaceMemberNumberFormatEnum,
- } satisfies WorkspaceMember;
+ } satisfies WorkspaceMemberDTO;
}
toWorkspaceMemberDtos(
@@ -103,7 +103,7 @@ export class WorkspaceMemberTranspiler {
toDeletedWorkspaceMemberDto(
workspaceMember: WorkspaceMemberWorkspaceEntity,
userWorkspaceId?: string,
- ): DeletedWorkspaceMember {
+ ): DeletedWorkspaceMemberDTO {
const {
avatarUrl: avatarUrlFromEntity,
id,
@@ -127,13 +127,13 @@ export class WorkspaceMemberTranspiler {
userEmail,
avatarUrl,
userWorkspaceId: userWorkspaceId ?? null,
- } satisfies DeletedWorkspaceMember;
+ } satisfies DeletedWorkspaceMemberDTO;
}
toDeletedWorkspaceMemberDtos(
workspaceMembers: WorkspaceMemberWorkspaceEntity[],
userWorkspaceId?: string,
- ): DeletedWorkspaceMember[] {
+ ): DeletedWorkspaceMemberDTO[] {
return workspaceMembers.map((workspaceMember) =>
this.toDeletedWorkspaceMemberDto(workspaceMember, userWorkspaceId),
);
diff --git a/packages/twenty-server/src/engine/core-modules/user/user.entity.ts b/packages/twenty-server/src/engine/core-modules/user/user.entity.ts
index 0d15a90cb21..086fff9b2ec 100644
--- a/packages/twenty-server/src/engine/core-modules/user/user.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/user/user.entity.ts
@@ -1,6 +1,7 @@
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
import { IDField } from '@ptc-org/nestjs-query-graphql';
+import { SOURCE_LOCALE } from 'twenty-shared/translations';
import {
BeforeInsert,
BeforeUpdate,
@@ -14,14 +15,13 @@ import {
Relation,
UpdateDateColumn,
} from 'typeorm';
-import { SOURCE_LOCALE } from 'twenty-shared/translations';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
import { OnboardingStatus } from 'src/engine/core-modules/onboarding/enums/onboarding-status.enum';
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
-import { WorkspaceMember } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
+import { WorkspaceMemberDTO } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
registerEnumType(OnboardingStatus, {
@@ -108,8 +108,8 @@ export class User {
})
keyValuePairs: Relation<KeyValuePair[]>;
- @Field(() => WorkspaceMember, { nullable: true })
- workspaceMember: Relation<WorkspaceMember>;
+ @Field(() => WorkspaceMemberDTO, { nullable: true })
+ workspaceMember: Relation<WorkspaceMemberDTO>;
@Field(() => [UserWorkspace])
@OneToMany(() => UserWorkspace, (userWorkspace) => userWorkspace.user)
diff --git a/packages/twenty-server/src/engine/core-modules/user/user.resolver.ts b/packages/twenty-server/src/engine/core-modules/user/user.resolver.ts
index 0cbaeefa99f..eaf9aa0ca4e 100644
--- a/packages/twenty-server/src/engine/core-modules/user/user.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/user/user.resolver.ts
@@ -36,8 +36,8 @@ import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twent
import { buildTwoFactorAuthenticationMethodSummary } from 'src/engine/core-modules/two-factor-authentication/utils/two-factor-authentication-method.presenter';
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
-import { DeletedWorkspaceMember } from 'src/engine/core-modules/user/dtos/deleted-workspace-member.dto';
-import { WorkspaceMember } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
+import { DeletedWorkspaceMemberDTO } from 'src/engine/core-modules/user/dtos/deleted-workspace-member.dto';
+import { WorkspaceMemberDTO } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
import { UserService } from 'src/engine/core-modules/user/services/user.service';
import {
type ToWorkspaceMemberDtoArgs,
@@ -195,13 +195,13 @@ export class UserResolver {
return Object.fromEntries(filteredMap);
}
- @ResolveField(() => WorkspaceMember, {
+ @ResolveField(() => WorkspaceMemberDTO, {
nullable: true,
})
async workspaceMember(
@Parent() user: User,
@AuthWorkspace({ allowUndefined: true }) workspace: Workspace | undefined,
- ): Promise<WorkspaceMember | null> {
+ ): Promise<WorkspaceMemberDTO | null> {
if (!workspace) return null;
const workspaceMemberEntity = await this.userService.loadWorkspaceMember(
@@ -239,13 +239,13 @@ export class UserResolver {
});
}
- @ResolveField(() => [WorkspaceMember], {
+ @ResolveField(() => [WorkspaceMemberDTO], {
nullable: true,
})
async workspaceMembers(
@Parent() _user: User,
@AuthWorkspace({ allowUndefined: true }) workspace: Workspace | undefined,
- ): Promise<WorkspaceMember[]> {
+ ): Promise<WorkspaceMemberDTO[]> {
if (!workspace) return [];
const workspaceMemberEntities = await this.userService.loadWorkspaceMembers(
@@ -307,13 +307,13 @@ export class UserResolver {
);
}
- @ResolveField(() => [DeletedWorkspaceMember], {
+ @ResolveField(() => [DeletedWorkspaceMemberDTO], {
nullable: true,
})
async deletedWorkspaceMembers(
@Parent() _user: User,
@AuthWorkspace({ allowUndefined: true }) workspace: Workspace | undefined,
- ): Promise<DeletedWorkspaceMember[]> {
+ ): Promise<DeletedWorkspaceMemberDTO[]> {
if (!workspace) return [];
const workspaceMemberEntities =
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data-output.ts b/packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data-output.ts
index 4d67833b8f4..8c2a7bf1e06 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data-output.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/dtos/public-workspace-data-output.ts
@@ -5,11 +5,11 @@ import {
IdentityProviderType,
SSOIdentityProviderStatus,
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
-import { WorkspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
+import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
import { type Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
-@ObjectType()
-export class SSOIdentityProvider {
+@ObjectType('SSOIdentityProvider')
+export class SSOIdentityProviderDTO {
@Field(() => UUIDScalarType)
id: string;
@@ -26,10 +26,10 @@ export class SSOIdentityProvider {
issuer: string;
}
-@ObjectType()
-export class AuthProviders {
- @Field(() => [SSOIdentityProvider])
- sso: Array<SSOIdentityProvider>;
+@ObjectType('AuthProviders')
+export class AuthProvidersDTO {
+ @Field(() => [SSOIdentityProviderDTO])
+ sso: Array<SSOIdentityProviderDTO>;
@Field(() => Boolean)
google: boolean;
@@ -44,13 +44,13 @@ export class AuthProviders {
microsoft: boolean;
}
-@ObjectType()
+@ObjectType('PublicWorkspaceDataOutput')
export class PublicWorkspaceDataOutput {
@Field(() => UUIDScalarType)
id: string;
- @Field(() => AuthProviders)
- authProviders: AuthProviders;
+ @Field(() => AuthProvidersDTO)
+ authProviders: AuthProvidersDTO;
@Field(() => String, { nullable: true })
logo: Workspace['logo'];
@@ -58,6 +58,6 @@ export class PublicWorkspaceDataOutput {
@Field(() => String, { nullable: true })
displayName: Workspace['displayName'];
- @Field(() => WorkspaceUrls)
- workspaceUrls: WorkspaceUrls;
+ @Field(() => WorkspaceUrlsDTO)
+ workspaceUrls: WorkspaceUrlsDTO;
}
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto.ts b/packages/twenty-server/src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto.ts
index 3fcd1c3ed20..eee67a6bf1c 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto.ts
@@ -1,12 +1,12 @@
import { Field, ObjectType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { WorkspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
+import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
-@ObjectType()
-export class WorkspaceUrlsAndId {
- @Field(() => WorkspaceUrls)
- workspaceUrls: WorkspaceUrls;
+@ObjectType('WorkspaceUrlsAndId')
+export class WorkspaceUrlsAndIdDTO {
+ @Field(() => WorkspaceUrlsDTO)
+ workspaceUrls: WorkspaceUrlsDTO;
@Field(() => UUIDScalarType)
id: string;
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/dtos/workspace-urls.dto.ts b/packages/twenty-server/src/engine/core-modules/workspace/dtos/workspace-urls.dto.ts
index 8a93371c485..913f34d88a4 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/dtos/workspace-urls.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/dtos/workspace-urls.dto.ts
@@ -1,7 +1,7 @@
-import { ObjectType, Field } from '@nestjs/graphql';
+import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class WorkspaceUrls {
+@ObjectType('WorkspaceUrls')
+export class WorkspaceUrlsDTO {
@Field(() => String, { nullable: true })
customUrl?: string;
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-providers-by-workspace.util.ts b/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-providers-by-workspace.util.ts
index e2f097fc30b..e3984afb0a2 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-providers-by-workspace.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/utils/get-auth-providers-by-workspace.util.ts
@@ -1,7 +1,7 @@
import { isDefined } from 'twenty-shared/utils';
import { SSOIdentityProviderStatus } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
-import { type AuthProviders } from 'src/engine/core-modules/workspace/dtos/public-workspace-data-output';
+import { type AuthProvidersDTO } from 'src/engine/core-modules/workspace/dtos/public-workspace-data-output';
import { type Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
export const getAuthProvidersByWorkspace = ({
@@ -15,7 +15,7 @@ export const getAuthProvidersByWorkspace = ({
| 'isMicrosoftAuthEnabled'
| 'workspaceSSOIdentityProviders'
>;
- systemEnabledProviders: AuthProviders;
+ systemEnabledProviders: AuthProvidersDTO;
}) => {
return {
google: workspace.isGoogleAuthEnabled && systemEnabledProviders.google,
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts b/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
index 14bc1e02478..37ffb803e0b 100644
--- a/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
@@ -39,11 +39,11 @@ import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/use
import { User } from 'src/engine/core-modules/user/user.entity';
import { ActivateWorkspaceInput } from 'src/engine/core-modules/workspace/dtos/activate-workspace-input';
import {
- type AuthProviders,
+ type AuthProvidersDTO,
PublicWorkspaceDataOutput,
} from 'src/engine/core-modules/workspace/dtos/public-workspace-data-output';
import { UpdateWorkspaceInput } from 'src/engine/core-modules/workspace/dtos/update-workspace-input';
-import { WorkspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
+import { WorkspaceUrlsDTO } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
import { WorkspaceService } from 'src/engine/core-modules/workspace/services/workspace.service';
import { getAuthProvidersByWorkspace } from 'src/engine/core-modules/workspace/utils/get-auth-providers-by-workspace.util';
import { workspaceGraphqlApiExceptionHandler } from 'src/engine/core-modules/workspace/utils/workspace-graphql-api-exception-handler.util';
@@ -293,7 +293,7 @@ export class WorkspaceResolver {
return isDefined(this.twentyConfigService.get('ENTERPRISE_KEY'));
}
- @ResolveField(() => WorkspaceUrls)
+ @ResolveField(() => WorkspaceUrlsDTO)
workspaceUrls(@Parent() workspace: Workspace) {
return this.domainManagerService.getWorkspaceUrls(workspace);
}
@@ -334,7 +334,7 @@ export class WorkspaceResolver {
@Args('origin', { nullable: true }) origin?: string,
): Promise<PublicWorkspaceDataOutput | undefined> {
try {
- const systemEnabledProviders: AuthProviders = {
+ const systemEnabledProviders: AuthProvidersDTO = {
google: this.twentyConfigService.get('AUTH_GOOGLE_ENABLED'),
magicLink: false,
password: this.twentyConfigService.get('AUTH_PASSWORD_ENABLED'),
diff --git a/packages/twenty-server/src/engine/metadata-modules/agent/dtos/agent-handoff.dto.ts b/packages/twenty-server/src/engine/metadata-modules/agent/dtos/agent-handoff.dto.ts
index 788550dda98..a137650edc9 100644
--- a/packages/twenty-server/src/engine/metadata-modules/agent/dtos/agent-handoff.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/agent/dtos/agent-handoff.dto.ts
@@ -4,7 +4,7 @@ import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/
import { AgentDTO } from './agent.dto';
-@ObjectType()
+@ObjectType('AgentHandoff')
export class AgentHandoffDTO {
@Field(() => UUIDScalarType)
id: string;
diff --git a/packages/twenty-server/src/engine/metadata-modules/role/dtos/role.dto.ts b/packages/twenty-server/src/engine/metadata-modules/role/dtos/role.dto.ts
index f0be4dad6e0..90440787a48 100644
--- a/packages/twenty-server/src/engine/metadata-modules/role/dtos/role.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/role/dtos/role.dto.ts
@@ -3,7 +3,7 @@ import { Field, HideField, ObjectType } from '@nestjs/graphql';
import { Relation } from 'typeorm';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
-import { WorkspaceMember } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
+import { WorkspaceMemberDTO } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
import { AgentDTO } from 'src/engine/metadata-modules/agent/dtos/agent.dto';
import { FieldPermissionDTO } from 'src/engine/metadata-modules/object-permission/dtos/field-permission.dto';
import { ObjectPermissionDTO } from 'src/engine/metadata-modules/object-permission/dtos/object-permission.dto';
@@ -57,8 +57,8 @@ export class RoleDTO {
@HideField()
roleTargets: Relation<RoleTargetsEntity[]>;
- @Field(() => [WorkspaceMember], { nullable: true })
- workspaceMembers?: WorkspaceMember[];
+ @Field(() => [WorkspaceMemberDTO], { nullable: true })
+ workspaceMembers?: WorkspaceMemberDTO[];
@Field(() => [AgentDTO], { nullable: true })
agents?: AgentDTO[];
diff --git a/packages/twenty-server/src/engine/metadata-modules/role/role.resolver.ts b/packages/twenty-server/src/engine/metadata-modules/role/role.resolver.ts
index 68446d351e7..7d5777ed904 100644
--- a/packages/twenty-server/src/engine/metadata-modules/role/role.resolver.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/role/role.resolver.ts
@@ -16,7 +16,7 @@ import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/featu
import { PreventNestToAutoLogGraphqlErrorsFilter } from 'src/engine/core-modules/graphql/filters/prevent-nest-to-auto-log-graphql-errors.filter';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/user-workspace.service';
-import { WorkspaceMember } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
+import { WorkspaceMemberDTO } from 'src/engine/core-modules/user/dtos/workspace-member.dto';
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { AuthWorkspaceMemberId } from 'src/engine/decorators/auth/auth-workspace-member-id.decorator';
import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
@@ -79,7 +79,7 @@ export class RoleResolver {
return this.roleService.getWorkspaceRoles(workspace.id);
}
- @Mutation(() => WorkspaceMember)
+ @Mutation(() => WorkspaceMemberDTO)
@UseGuards(UserAuthGuard)
async updateWorkspaceMemberRole(
@AuthWorkspace() workspace: Workspace,
@@ -88,7 +88,7 @@ export class RoleResolver {
@Args('roleId', { type: () => UUIDScalarType }) roleId: string,
@AuthWorkspaceMemberId()
updatorWorkspaceMemberId: string,
- ): Promise<WorkspaceMember> {
+ ): Promise<WorkspaceMemberDTO> {
if (updatorWorkspaceMemberId === workspaceMemberId) {
throw new PermissionsException(
PermissionsExceptionMessage.CANNOT_UPDATE_SELF_ROLE,
@@ -131,7 +131,7 @@ export class RoleResolver {
...workspaceMember,
userWorkspaceId: userWorkspace.id,
roles,
- } as WorkspaceMember;
+ } as WorkspaceMemberDTO;
}
@Mutation(() => RoleDTO)
@@ -237,7 +237,7 @@ export class RoleResolver {
return true;
}
- @ResolveField('workspaceMembers', () => [WorkspaceMember])
+ @ResolveField('workspaceMembers', () => [WorkspaceMemberDTO])
async getWorkspaceMembersAssignedToRole(
@Parent() role: RoleDTO,
@AuthWorkspace() workspace: Workspace,
diff --git a/packages/twenty-server/src/engine/subscriptions/dtos/on-db-event.dto.ts b/packages/twenty-server/src/engine/subscriptions/dtos/on-db-event.dto.ts
index 630d00dd20d..279629f6c87 100644
--- a/packages/twenty-server/src/engine/subscriptions/dtos/on-db-event.dto.ts
+++ b/packages/twenty-server/src/engine/subscriptions/dtos/on-db-event.dto.ts
@@ -10,7 +10,7 @@ registerEnumType(DatabaseEventAction, {
description: 'Database Event Action',
});
-@ObjectType()
+@ObjectType('OnDbEvent')
export class OnDbEventDTO {
@Field(() => DatabaseEventAction)
action: DatabaseEventAction;
diff --git a/packages/twenty-server/src/modules/connected-account/channel-sync/channel-sync.resolver.ts b/packages/twenty-server/src/modules/connected-account/channel-sync/channel-sync.resolver.ts
index 8f8110d69ea..4ebc8b4d8a5 100644
--- a/packages/twenty-server/src/modules/connected-account/channel-sync/channel-sync.resolver.ts
+++ b/packages/twenty-server/src/modules/connected-account/channel-sync/channel-sync.resolver.ts
@@ -7,7 +7,7 @@ import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/re
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
-import { ChannelSyncSuccess } from 'src/modules/connected-account/channel-sync/dtos/channel-sync-success.dto';
+import { ChannelSyncSuccessDTO } from 'src/modules/connected-account/channel-sync/dtos/channel-sync-success.dto';
import { ChannelSyncService } from 'src/modules/connected-account/channel-sync/services/channel-sync.service';
@Resolver()
@@ -17,12 +17,12 @@ import { ChannelSyncService } from 'src/modules/connected-account/channel-sync/s
export class ChannelSyncResolver {
constructor(private readonly channelSyncService: ChannelSyncService) {}
- @Mutation(() => ChannelSyncSuccess)
+ @Mutation(() => ChannelSyncSuccessDTO)
async startChannelSync(
@Args('connectedAccountId', { type: () => UUIDScalarType })
connectedAccountId: string,
@AuthWorkspace() workspace: Workspace,
- ): Promise<ChannelSyncSuccess> {
+ ): Promise<ChannelSyncSuccessDTO> {
await this.channelSyncService.startChannelSync({
connectedAccountId,
workspaceId: workspace.id,
diff --git a/packages/twenty-server/src/modules/connected-account/channel-sync/dtos/channel-sync-success.dto.ts b/packages/twenty-server/src/modules/connected-account/channel-sync/dtos/channel-sync-success.dto.ts
index 7df25e05336..8f37c70b999 100644
--- a/packages/twenty-server/src/modules/connected-account/channel-sync/dtos/channel-sync-success.dto.ts
+++ b/packages/twenty-server/src/modules/connected-account/channel-sync/dtos/channel-sync-success.dto.ts
@@ -1,7 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
-@ObjectType()
-export class ChannelSyncSuccess {
+@ObjectType('ChannelSyncSuccess')
+export class ChannelSyncSuccessDTO {
@Field(() => Boolean)
success: boolean;
}
diff --git a/packages/twenty-shared/src/types/SettingsPath.ts b/packages/twenty-shared/src/types/SettingsPath.ts
index 889983a4456..974ae160377 100644
--- a/packages/twenty-shared/src/types/SettingsPath.ts
+++ b/packages/twenty-shared/src/types/SettingsPath.ts
@@ -54,6 +54,7 @@ export enum SettingsPath {
AdminPanel = 'admin-panel',
AdminPanelHealthStatus = 'admin-panel#health-status',
AdminPanelIndicatorHealthStatus = 'admin-panel/health-status/:indicatorId',
+ AdminPanelQueueDetail = 'admin-panel/health-status/queue/:queueName',
AdminPanelConfigVariableDetails = 'admin-panel/config-variables/:variableName',
Roles = 'roles',