Skip to content

The open alternative to Salesforce, designed for AI.

feat(applications): show install and uninstall progress in the action buttons (#27357)

martmull832380371b7f
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index 82c1ab6beb6..74e6c480167 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -1971,6 +1971,7 @@ type JobStatus {
state: JobState!
attemptsMade: Int!
failedReason: String
+ progress: Int
enqueuedAt: Float!
startedAt: Float
finishedAt: Float
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index 70988196560..5956456defa 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -1554,6 +1554,7 @@ export interface JobStatus {
state: JobState
attemptsMade: Scalars['Int']
failedReason?: Scalars['String']
+ progress?: Scalars['Int']
enqueuedAt: Scalars['Float']
startedAt?: Scalars['Float']
finishedAt?: Scalars['Float']
@@ -5432,6 +5433,7 @@ export interface JobStatusGenqlSelection{
state?: boolean | number
attemptsMade?: boolean | number
failedReason?: boolean | number
+ progress?: boolean | number
enqueuedAt?: boolean | number
startedAt?: boolean | number
finishedAt?: boolean | number
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index 5596f0a953c..d322ca77d9d 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -3741,6 +3741,9 @@ export default {
"failedReason": [
1
],
+ "progress": [
+ 32
+ ],
"enqueuedAt": [
16
],
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 16a5659d186..86872e609b7 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -2607,6 +2607,7 @@ export type JobStatus = {
failedReason?: Maybe<Scalars['String']['output']>;
finishedAt?: Maybe<Scalars['Float']['output']>;
jobId: Scalars['String']['output'];
+ progress?: Maybe<Scalars['Int']['output']>;
startedAt?: Maybe<Scalars['Float']['output']>;
state: JobState;
};
@@ -8929,7 +8930,7 @@ export type FindInstallApplicationJobStatusQueryVariables = Exact<{
}>;
-export type FindInstallApplicationJobStatusQuery = { __typename?: 'Query', findInstallApplicationJobStatus?: { __typename?: 'JobStatus', jobId: string, state: JobState, failedReason?: string | null } | null };
+export type FindInstallApplicationJobStatusQuery = { __typename?: 'Query', findInstallApplicationJobStatus?: { __typename?: 'JobStatus', jobId: string, state: JobState, failedReason?: string | null, progress?: number | null } | null };
export type FindManyMarketplaceAppsQueryVariables = Exact<{ [key: string]: never; }>;
@@ -9724,7 +9725,7 @@ export type FindUninstallApplicationJobStatusQueryVariables = Exact<{
}>;
-export type FindUninstallApplicationJobStatusQuery = { __typename?: 'Query', findUninstallApplicationJobStatus?: { __typename?: 'JobStatus', jobId: string, state: JobState, failedReason?: string | null } | null };
+export type FindUninstallApplicationJobStatusQuery = { __typename?: 'Query', findUninstallApplicationJobStatus?: { __typename?: 'JobStatus', jobId: string, state: JobState, failedReason?: string | null, progress?: number | null } | null };
export type BillingPriceLicensedFragmentFragment = { __typename?: 'BillingPriceLicensed', stripePriceId: string, unitAmount: number, recurringInterval: SubscriptionInterval, priceUsageType: BillingUsageType, creditAmount?: number | null, isSellable: boolean };
@@ -10301,7 +10302,7 @@ export type OnEventSubscriptionSubscriptionVariables = Exact<{
}>;
-export type OnEventSubscriptionSubscription = { __typename?: 'Subscription', onEventSubscription?: { __typename?: 'EventSubscription', eventStreamId: string, objectRecordEventsWithQueryIds: Array<{ __typename?: 'ObjectRecordEventWithQueryIds', queryIds: Array<string>, objectRecordEvent: { __typename?: 'ObjectRecordEvent', action: DatabaseEventAction, objectNameSingular: string, recordId: string, userId?: string | null, workspaceMemberId?: string | null, properties: { __typename?: 'ObjectRecordEventProperties', updatedFields?: Array<string> | null, before?: any | null, after?: any | null, diff?: any | null } } }>, metadataEvents: Array<{ __typename?: 'MetadataEvent', type: MetadataEventAction, metadataName: string, recordId: string, updatedCollectionHash?: string | null, properties: { __typename?: 'ObjectRecordEventProperties', updatedFields?: Array<string> | null, before?: any | null, after?: any | null, diff?: any | null } }>, queueJobEvents: Array<{ __typename?: 'JobStatus', jobId: string, state: JobState, attemptsMade: number, failedReason?: string | null, enqueuedAt: number, startedAt?: number | null, finishedAt?: number | null }> } | null };
+export type OnEventSubscriptionSubscription = { __typename?: 'Subscription', onEventSubscription?: { __typename?: 'EventSubscription', eventStreamId: string, objectRecordEventsWithQueryIds: Array<{ __typename?: 'ObjectRecordEventWithQueryIds', queryIds: Array<string>, objectRecordEvent: { __typename?: 'ObjectRecordEvent', action: DatabaseEventAction, objectNameSingular: string, recordId: string, userId?: string | null, workspaceMemberId?: string | null, properties: { __typename?: 'ObjectRecordEventProperties', updatedFields?: Array<string> | null, before?: any | null, after?: any | null, diff?: any | null } } }>, metadataEvents: Array<{ __typename?: 'MetadataEvent', type: MetadataEventAction, metadataName: string, recordId: string, updatedCollectionHash?: string | null, properties: { __typename?: 'ObjectRecordEventProperties', updatedFields?: Array<string> | null, before?: any | null, after?: any | null, diff?: any | null } }>, queueJobEvents: Array<{ __typename?: 'JobStatus', jobId: string, state: JobState, attemptsMade: number, failedReason?: string | null, progress?: number | null, enqueuedAt: number, startedAt?: number | null, finishedAt?: number | null }> } | null };
export type BillingSubscriptionFragmentFragment = { __typename?: 'BillingSubscription', id: string, status: SubscriptionStatus, metadata: any, cancelAt?: string | null, phases: Array<{ __typename?: 'BillingSubscriptionSchedulePhase', start_date: number, end_date: number, items: Array<{ __typename?: 'BillingSubscriptionSchedulePhaseItem', price: string, quantity?: number | null }> }> };
@@ -10799,7 +10800,7 @@ export const InstallApplicationDocument = {"kind":"Document","definitions":[{"ki
export const SyncMarketplaceCatalogDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SyncMarketplaceCatalog"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"syncMarketplaceCatalog"}}]}}]} as unknown as DocumentNode<SyncMarketplaceCatalogMutation, SyncMarketplaceCatalogMutationVariables>;
export const TriggerInstallApplicationJobDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"TriggerInstallApplicationJob"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"TriggerInstallApplicationJobInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"triggerInstallApplicationJob"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}}]}}]}}]} as unknown as DocumentNode<TriggerInstallApplicationJobMutation, TriggerInstallApplicationJobMutationVariables>;
export const UpgradeApplicationDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpgradeApplication"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"appRegistrationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"targetVersion"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"upgradeApplication"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"appRegistrationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"appRegistrationId"}}},{"kind":"Argument","name":{"kind":"Name","value":"targetVersion"},"value":{"kind":"Variable","name":{"kind":"Name","value":"targetVersion"}}}]}]}}]} as unknown as DocumentNode<UpgradeApplicationMutation, UpgradeApplicationMutationVariables>;
-export const FindInstallApplicationJobStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindInstallApplicationJobStatus"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findInstallApplicationJobStatus"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"failedReason"}}]}}]}}]} as unknown as DocumentNode<FindInstallApplicationJobStatusQuery, FindInstallApplicationJobStatusQueryVariables>;
+export const FindInstallApplicationJobStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindInstallApplicationJobStatus"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findInstallApplicationJobStatus"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"failedReason"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}}]}}]}}]} as unknown as DocumentNode<FindInstallApplicationJobStatusQuery, FindInstallApplicationJobStatusQueryVariables>;
export const FindManyMarketplaceAppsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyMarketplaceApps"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findManyMarketplaceApps"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MarketplaceAppFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MarketplaceAppFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MarketplaceApp"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"author"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"logoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePackage"}},{"kind":"Field","name":{"kind":"Name","value":"isVetted"}}]}}]} as unknown as DocumentNode<FindManyMarketplaceAppsQuery, FindManyMarketplaceAppsQueryVariables>;
export const FindMarketplaceAppDetailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindMarketplaceAppDetail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findMarketplaceAppDetail"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MarketplaceAppDetailFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MarketplaceAppDetailFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"MarketplaceAppDetail"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"sourceType"}},{"kind":"Field","name":{"kind":"Name","value":"sourcePackage"}},{"kind":"Field","name":{"kind":"Name","value":"latestAvailableVersion"}},{"kind":"Field","name":{"kind":"Name","value":"isListed"}},{"kind":"Field","name":{"kind":"Name","value":"isVetted"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"author"}},{"kind":"Field","name":{"kind":"Name","value":"category"}},{"kind":"Field","name":{"kind":"Name","value":"logoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"websiteUrl"}},{"kind":"Field","name":{"kind":"Name","value":"aboutDescription"}},{"kind":"Field","name":{"kind":"Name","value":"pricingDescription"}},{"kind":"Field","name":{"kind":"Name","value":"termsUrl"}},{"kind":"Field","name":{"kind":"Name","value":"emailSupport"}},{"kind":"Field","name":{"kind":"Name","value":"issueReportUrl"}},{"kind":"Field","name":{"kind":"Name","value":"galleryImages"}},{"kind":"Field","name":{"kind":"Name","value":"installCount"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRoleUniversalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"requestedCapabilities"}},{"kind":"Field","name":{"kind":"Name","value":"roles"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlagUniversalIdentifiers"}},{"kind":"Field","name":{"kind":"Name","value":"objectPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"objectUniversalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}}]}},{"kind":"Field","name":{"kind":"Name","value":"fieldPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"objectUniversalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"fieldUniversalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"canReadFieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateFieldValue"}}]}}]}}]}}]} as unknown as DocumentNode<FindMarketplaceAppDetailQuery, FindMarketplaceAppDetailQueryVariables>;
export const FindMarketplaceAppManifestDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindMarketplaceAppManifest"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findMarketplaceAppDetail"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"manifest"}}]}}]}}]} as unknown as DocumentNode<FindMarketplaceAppManifestQuery, FindMarketplaceAppManifestQueryVariables>;
@@ -10878,7 +10879,7 @@ export const UpdateApplicationDocument = {"kind":"Document","definitions":[{"kin
export const UpdateOneApplicationVariableDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateOneApplicationVariable"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"value"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateOneApplicationVariable"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}},{"kind":"Argument","name":{"kind":"Name","value":"value"},"value":{"kind":"Variable","name":{"kind":"Name","value":"value"}}},{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}]}]}}]} as unknown as DocumentNode<UpdateOneApplicationVariableMutation, UpdateOneApplicationVariableMutationVariables>;
export const ApplicationConnectedAccountsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ApplicationConnectedAccounts"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"applicationConnectedAccounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"handle"}},{"kind":"Field","name":{"kind":"Name","value":"authFailedAt"}},{"kind":"Field","name":{"kind":"Name","value":"authFailedReason"}},{"kind":"Field","name":{"kind":"Name","value":"scopes"}},{"kind":"Field","name":{"kind":"Name","value":"lastSignedInAt"}},{"kind":"Field","name":{"kind":"Name","value":"connectionProviderId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"lastCredentialsRefreshedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<ApplicationConnectedAccountsQuery, ApplicationConnectedAccountsQueryVariables>;
export const ApplicationConnectionProvidersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ApplicationConnectionProviders"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"applicationConnectionProviders"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"logoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"oauth"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scopes"}},{"kind":"Field","name":{"kind":"Name","value":"isClientCredentialsConfigured"}}]}}]}}]}}]} as unknown as DocumentNode<ApplicationConnectionProvidersQuery, ApplicationConnectionProvidersQueryVariables>;
-export const FindUninstallApplicationJobStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindUninstallApplicationJobStatus"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findUninstallApplicationJobStatus"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"failedReason"}}]}}]}}]} as unknown as DocumentNode<FindUninstallApplicationJobStatusQuery, FindUninstallApplicationJobStatusQueryVariables>;
+export const FindUninstallApplicationJobStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindUninstallApplicationJobStatus"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findUninstallApplicationJobStatus"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"failedReason"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}}]}}]}}]} as unknown as DocumentNode<FindUninstallApplicationJobStatusQuery, FindUninstallApplicationJobStatusQueryVariables>;
export const CancelSwitchBillingIntervalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchBillingInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchBillingInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"creditAmount"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}},{"kind":"Field","name":{"kind":"Name","value":"isLegacy"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchBillingIntervalMutation, CancelSwitchBillingIntervalMutationVariables>;
export const CancelSwitchBillingPlanDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"creditAmount"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}},{"kind":"Field","name":{"kind":"Name","value":"isLegacy"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchBillingPlanMutation, CancelSwitchBillingPlanMutationVariables>;
export const CancelSwitchResourceCreditPriceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchResourceCreditPrice"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchResourceCreditPrice"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"creditAmount"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}},{"kind":"Field","name":{"kind":"Name","value":"isLegacy"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchResourceCreditPriceMutation, CancelSwitchResourceCreditPriceMutationVariables>;
@@ -10959,7 +10960,7 @@ export const MessageSuppressionsDocument = {"kind":"Document","definitions":[{"k
export const GetUsageAnalyticsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUsageAnalytics"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UsageAnalyticsInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getUsageAnalytics"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"usageByUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"usageByOperationType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"usageByApplication"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"usageByModel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timeSeries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"periodStart"}},{"kind":"Field","name":{"kind":"Name","value":"periodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"userDailyUsage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"dailyUsage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetUsageAnalyticsQuery, GetUsageAnalyticsQueryVariables>;
export const AddQueryToEventStreamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AddQueryToEventStream"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AddQuerySubscriptionInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"addQueryToEventStream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode<AddQueryToEventStreamMutation, AddQueryToEventStreamMutationVariables>;
export const RemoveQueryFromEventStreamDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RemoveQueryFromEventStream"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"RemoveQueryFromEventStreamInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"removeQueryFromEventStream"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]} as unknown as DocumentNode<RemoveQueryFromEventStreamMutation, RemoveQueryFromEventStreamMutationVariables>;
-export const OnEventSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"OnEventSubscription"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"eventStreamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"onEventSubscription"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"eventStreamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventStreamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"eventStreamId"}},{"kind":"Field","name":{"kind":"Name","value":"objectRecordEventsWithQueryIds"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectRecordEvent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"action"}},{"kind":"Field","name":{"kind":"Name","value":"objectNameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"recordId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberId"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatedFields"}},{"kind":"Field","name":{"kind":"Name","value":"before"}},{"kind":"Field","name":{"kind":"Name","value":"after"}},{"kind":"Field","name":{"kind":"Name","value":"diff"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"queryIds"}}]}},{"kind":"Field","name":{"kind":"Name","value":"metadataEvents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"metadataName"}},{"kind":"Field","name":{"kind":"Name","value":"recordId"}},{"kind":"Field","name":{"kind":"Name","value":"updatedCollectionHash"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatedFields"}},{"kind":"Field","name":{"kind":"Name","value":"before"}},{"kind":"Field","name":{"kind":"Name","value":"after"}},{"kind":"Field","name":{"kind":"Name","value":"diff"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"queueJobEvents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"attemptsMade"}},{"kind":"Field","name":{"kind":"Name","value":"failedReason"}},{"kind":"Field","name":{"kind":"Name","value":"enqueuedAt"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"finishedAt"}}]}}]}}]}}]} as unknown as DocumentNode<OnEventSubscriptionSubscription, OnEventSubscriptionSubscriptionVariables>;
+export const OnEventSubscriptionDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"OnEventSubscription"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"eventStreamId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"onEventSubscription"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"eventStreamId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"eventStreamId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"eventStreamId"}},{"kind":"Field","name":{"kind":"Name","value":"objectRecordEventsWithQueryIds"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectRecordEvent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"action"}},{"kind":"Field","name":{"kind":"Name","value":"objectNameSingular"}},{"kind":"Field","name":{"kind":"Name","value":"recordId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberId"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatedFields"}},{"kind":"Field","name":{"kind":"Name","value":"before"}},{"kind":"Field","name":{"kind":"Name","value":"after"}},{"kind":"Field","name":{"kind":"Name","value":"diff"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"queryIds"}}]}},{"kind":"Field","name":{"kind":"Name","value":"metadataEvents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"metadataName"}},{"kind":"Field","name":{"kind":"Name","value":"recordId"}},{"kind":"Field","name":{"kind":"Name","value":"updatedCollectionHash"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatedFields"}},{"kind":"Field","name":{"kind":"Name","value":"before"}},{"kind":"Field","name":{"kind":"Name","value":"after"}},{"kind":"Field","name":{"kind":"Name","value":"diff"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"queueJobEvents"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"attemptsMade"}},{"kind":"Field","name":{"kind":"Name","value":"failedReason"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"enqueuedAt"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"finishedAt"}}]}}]}}]}}]} as unknown as DocumentNode<OnEventSubscriptionSubscription, OnEventSubscriptionSubscriptionVariables>;
export const DeleteUserAccountDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteUserAccount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<DeleteUserAccountMutation, DeleteUserAccountMutationVariables>;
export const DeleteUserWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteUserWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceMemberIdToDelete"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteUserFromWorkspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceMemberIdToDelete"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceMemberIdToDelete"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<DeleteUserWorkspaceMutation, DeleteUserWorkspaceMutationVariables>;
export const GetCurrentUserDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetCurrentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"UserQueryFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"colorScheme"}},{"kind":"Field","name":{"kind":"Name","value":"uiScale"}},{"kind":"Field","name":{"kind":"Name","value":"openRecordIn"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"locale"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","name":{"kind":"Name","value":"dateFormat"}},{"kind":"Field","name":{"kind":"Name","value":"timeFormat"}},{"kind":"Field","name":{"kind":"Name","value":"calendarStartDay"}},{"kind":"Field","name":{"kind":"Name","value":"numberFormat"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"DeletedWorkspaceMember"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}}]}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}},{"kind":"Field","name":{"kind":"Name","value":"userEmail"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ObjectPermissionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"canReadObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"restrictedFields"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicate"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMemberSubFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentRowLevelPermissionPredicateGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInRowLevelPermissionPredicateGroup"}},{"kind":"Field","name":{"kind":"Name","value":"roleId"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"WorkspaceUrlsFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"WorkspaceUrls"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"creditAmount"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}},{"kind":"Field","name":{"kind":"Name","value":"isLegacy"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"RoleFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Role"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllSettings"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessAllTools"}},{"kind":"Field","name":{"kind":"Name","value":"isEditable"}},{"kind":"Field","name":{"kind":"Name","value":"canReadAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canUpdateAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canSoftDeleteAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canDestroyAllObjectRecords"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToUsers"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToAgents"}},{"kind":"Field","name":{"kind":"Name","value":"canBeAssignedToApiKeys"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspaceFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspace"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"loginToken"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"personalInviteToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"subdomainUrl"}},{"kind":"Field","name":{"kind":"Name","value":"customUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"sso"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AvailableWorkspacesFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AvailableWorkspaces"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignIn"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesForSignUp"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspaceFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"UserQueryFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"User"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"firstName"}},{"kind":"Field","name":{"kind":"Name","value":"lastName"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"hasPassword"}},{"kind":"Field","name":{"kind":"Name","value":"canAccessFullAdminPanel"}},{"kind":"Field","name":{"kind":"Name","value":"canImpersonate"}},{"kind":"Field","name":{"kind":"Name","value":"supportUserHash"}},{"kind":"Field","name":{"kind":"Name","value":"onboardingStatus"}},{"kind":"Field","name":{"kind":"Name","value":"previousOnboardingStatus"}},{"kind":"Field","name":{"kind":"Name","value":"isWorkspaceCreator"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMember"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"PartialWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"deletedWorkspaceMembers"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"DeletedWorkspaceMemberQueryFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentUserWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"permissionFlags"}},{"kind":"Field","name":{"kind":"Name","value":"isImpersonating"}},{"kind":"Field","name":{"kind":"Name","value":"objectsPermissions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ObjectPermissionFragment"}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"rowLevelPermissionPredicateGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RowLevelPermissionPredicateGroupFragment"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodSummary"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"twoFactorAuthenticationMethodId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"strategy"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"inviteHash"}},{"kind":"Field","name":{"kind":"Name","value":"allowImpersonation"}},{"kind":"Field","name":{"kind":"Name","value":"activationStatus"}},{"kind":"Field","name":{"kind":"Name","value":"isPublicInviteLinkEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isCampaignClickTrackingEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceDiscoverability"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isGoogleAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isMicrosoftAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"isPasswordAuthBypassEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"subdomain"}},{"kind":"Field","name":{"kind":"Name","value":"customDomain"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidSignedEnterpriseKey"}},{"kind":"Field","name":{"kind":"Name","value":"hasValidEnterpriseValidityToken"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceCustomApplication"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"installedApplications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"universalIdentifier"}},{"kind":"Field","name":{"kind":"Name","value":"logoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"isCustomDomainEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceUrlsFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"featureFlags"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingCustomer"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasPaymentMethod"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingEntitlements"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceMembersCount"}},{"kind":"Field","name":{"kind":"Name","value":"defaultRole"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"RoleFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"aiChatModelTier"}},{"kind":"Field","name":{"kind":"Name","value":"aiAgentModelTier"}},{"kind":"Field","name":{"kind":"Name","value":"isAutoModelSelectionEnabled"}},{"kind":"Field","name":{"kind":"Name","value":"aiModelIdByTier"}},{"kind":"Field","name":{"kind":"Name","value":"aiAdditionalInstructions"}},{"kind":"Field","name":{"kind":"Name","value":"isTwoFactorAuthenticationEnforced"}},{"kind":"Field","name":{"kind":"Name","value":"trashRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"eventLogRetentionDays"}},{"kind":"Field","name":{"kind":"Name","value":"editableProfileFields"}},{"kind":"Field","name":{"kind":"Name","value":"isInternalMessagesImportEnabled"}}]}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspacesFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"userVars"}}]}}]} as unknown as DocumentNode<GetCurrentUserQuery, GetCurrentUserQueryVariables>;
diff --git a/packages/twenty-front/src/modules/marketplace/graphql/queries/findInstallApplicationJobStatus.ts b/packages/twenty-front/src/modules/marketplace/graphql/queries/findInstallApplicationJobStatus.ts
index 7f9132381aa..888a802928d 100644
--- a/packages/twenty-front/src/modules/marketplace/graphql/queries/findInstallApplicationJobStatus.ts
+++ b/packages/twenty-front/src/modules/marketplace/graphql/queries/findInstallApplicationJobStatus.ts
@@ -6,6 +6,7 @@ export const FIND_INSTALL_APPLICATION_JOB_STATUS = gql`
jobId
state
failedReason
+ progress
}
}
`;
diff --git a/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useInstallMarketplaceApp.test.tsx b/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useInstallMarketplaceApp.test.tsx
index 4884ceb39ae..579203d37fc 100644
--- a/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useInstallMarketplaceApp.test.tsx
+++ b/packages/twenty-front/src/modules/marketplace/hooks/__tests__/useInstallMarketplaceApp.test.tsx
@@ -70,6 +70,19 @@ describe('useInstallMarketplaceApp', () => {
});
expect(result.current.isInstalling).toBe(true);
+ expect(result.current.installProgress).toBeUndefined();
+
+ act(() => {
+ dispatchBrowserEvent<JobStatus>(QUEUE_JOB_BROWSER_EVENT_NAME, {
+ jobId: JOB_ID,
+ state: JobState.ACTIVE,
+ attemptsMade: 1,
+ progress: 43,
+ enqueuedAt: 1,
+ });
+ });
+
+ expect(result.current.installProgress).toBe(43);
act(() => {
dispatchBrowserEvent<JobStatus>(QUEUE_JOB_BROWSER_EVENT_NAME, {
@@ -88,7 +101,7 @@ describe('useInstallMarketplaceApp', () => {
});
});
- it('reports an installation still running on the server', async () => {
+ it('reports an installation still running on the server with its progress', async () => {
const { result } = renderHook(
() =>
useInstallMarketplaceApp({
@@ -101,11 +114,25 @@ describe('useInstallMarketplaceApp', () => {
jobId: JOB_ID,
state: JobState.ACTIVE,
failedReason: null,
+ progress: 57,
}),
]),
},
);
await waitFor(() => expect(result.current.isInstalling).toBe(true));
+ expect(result.current.installProgress).toBe(57);
+
+ act(() => {
+ dispatchBrowserEvent<JobStatus>(QUEUE_JOB_BROWSER_EVENT_NAME, {
+ jobId: JOB_ID,
+ state: JobState.ACTIVE,
+ attemptsMade: 1,
+ progress: 86,
+ enqueuedAt: 1,
+ });
+ });
+
+ expect(result.current.installProgress).toBe(86);
});
});
diff --git a/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts b/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts
index f7a442c026c..9efbcb199c4 100644
--- a/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts
+++ b/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceApp.ts
@@ -47,9 +47,15 @@ export const useInstallMarketplaceApp = ({
);
const runningJobStatus = jobStatusData?.findInstallApplicationJobStatus;
- const runningJobId =
- isDefined(runningJobStatus) && !isTerminalJobState(runningJobStatus.state)
- ? runningJobStatus.jobId
+ const runningJob =
+ isDefined(runningJobStatus) &&
+ !isTerminalJobState(runningJobStatus.state) &&
+ isDefined(universalIdentifier)
+ ? {
+ jobId: runningJobStatus.jobId,
+ context: universalIdentifier,
+ progress: runningJobStatus.progress ?? undefined,
+ }
: undefined;
const handleInstallJobSettled = useCallback(
@@ -113,11 +119,8 @@ export const useInstallMarketplaceApp = ({
[enqueueToast, findInstalledApplication, onCompleted, setCurrentWorkspace],
);
- const { activeJobId, trackJob } = useTrackedQueueJob({
- runningJob:
- isDefined(runningJobId) && isDefined(universalIdentifier)
- ? { jobId: runningJobId, context: universalIdentifier }
- : undefined,
+ const { activeJobId, activeJobProgress, trackJob } = useTrackedQueueJob({
+ runningJob,
onQueueJobSettled: handleInstallJobSettled,
});
@@ -149,5 +152,6 @@ export const useInstallMarketplaceApp = ({
return {
install,
isInstalling: isTriggeringInstall || isDefined(activeJobId),
+ installProgress: activeJobProgress,
};
};
diff --git a/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceAppWithPermissionValidation.ts b/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceAppWithPermissionValidation.ts
index b9465c719a4..54c16958b24 100644
--- a/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceAppWithPermissionValidation.ts
+++ b/packages/twenty-front/src/modules/marketplace/hooks/useInstallMarketplaceAppWithPermissionValidation.ts
@@ -13,7 +13,8 @@ export const useInstallMarketplaceAppWithPermissionValidation = (
args?: UseInstallMarketplaceAppWithPermissionValidationArgs,
) => {
const { openDialog } = useDialog();
- const { install, isInstalling } = useInstallMarketplaceApp(args);
+ const { install, isInstalling, installProgress } =
+ useInstallMarketplaceApp(args);
const requestInstall = useCallback(() => {
openDialog(INSTALL_PERMISSION_VALIDATION_MODAL_ID);
@@ -23,6 +24,7 @@ export const useInstallMarketplaceAppWithPermissionValidation = (
requestInstall,
install,
isInstalling,
+ installProgress,
modalInstanceId: INSTALL_PERMISSION_VALIDATION_MODAL_ID,
};
};
diff --git a/packages/twenty-front/src/modules/queue-job/hooks/__tests__/useTrackedQueueJob.test.tsx b/packages/twenty-front/src/modules/queue-job/hooks/__tests__/useTrackedQueueJob.test.tsx
index 98deea51fff..73b8feccb2f 100644
--- a/packages/twenty-front/src/modules/queue-job/hooks/__tests__/useTrackedQueueJob.test.tsx
+++ b/packages/twenty-front/src/modules/queue-job/hooks/__tests__/useTrackedQueueJob.test.tsx
@@ -13,18 +13,27 @@ const FIRST_JOB_ID = 'install-application.workspace-id.application-first';
const SECOND_JOB_ID = 'install-application.workspace-id.application-second';
const CONTEXT = 'application-universal-identifier';
-const buildJobStatus = (jobId: string, state: JobState): JobStatus => ({
+const buildJobStatus = (
+ jobId: string,
+ state: JobState,
+ progress?: number,
+): JobStatus => ({
jobId,
state,
attemptsMade: 1,
enqueuedAt: 1,
+ ...(progress === undefined ? {} : { progress }),
});
-const dispatchJobStatus = (jobId: string, state: JobState) => {
+const dispatchJobStatus = (
+ jobId: string,
+ state: JobState,
+ progress?: number,
+) => {
act(() => {
dispatchBrowserEvent<JobStatus>(
QUEUE_JOB_BROWSER_EVENT_NAME,
- buildJobStatus(jobId, state),
+ buildJobStatus(jobId, state, progress),
);
});
};
@@ -120,6 +129,69 @@ describe('useTrackedQueueJob', () => {
expect(onQueueJobSettled).toHaveBeenCalledTimes(2);
});
+ it('exposes the latest progress of the active job', () => {
+ const onQueueJobSettled = jest.fn();
+
+ const { result } = renderHook(() =>
+ useTrackedQueueJob<string>({ onQueueJobSettled }),
+ );
+
+ act(() => {
+ result.current.trackJob({ jobId: FIRST_JOB_ID, context: CONTEXT });
+ });
+
+ expect(result.current.activeJobProgress).toBeUndefined();
+
+ dispatchJobStatus(FIRST_JOB_ID, JobState.ACTIVE, 25);
+
+ expect(result.current.activeJobProgress).toBe(25);
+
+ dispatchJobStatus(FIRST_JOB_ID, JobState.ACTIVE);
+
+ expect(result.current.activeJobProgress).toBe(25);
+
+ dispatchJobStatus(FIRST_JOB_ID, JobState.ACTIVE, 75);
+
+ expect(result.current.activeJobProgress).toBe(75);
+
+ dispatchJobStatus(FIRST_JOB_ID, JobState.COMPLETED, 100);
+
+ expect(result.current.activeJobId).toBeUndefined();
+ expect(result.current.activeJobProgress).toBeUndefined();
+ });
+
+ it('starts from the progress the server reports for a running job', () => {
+ const onQueueJobSettled = jest.fn();
+
+ const { result } = renderHook(() =>
+ useTrackedQueueJob<string>({
+ runningJob: { jobId: FIRST_JOB_ID, context: CONTEXT, progress: 40 },
+ onQueueJobSettled,
+ }),
+ );
+
+ expect(result.current.activeJobProgress).toBe(40);
+
+ dispatchJobStatus(FIRST_JOB_ID, JobState.ACTIVE, 60);
+
+ expect(result.current.activeJobProgress).toBe(60);
+ });
+
+ it('ignores progress events of other jobs', () => {
+ const onQueueJobSettled = jest.fn();
+
+ const { result } = renderHook(() =>
+ useTrackedQueueJob<string>({ onQueueJobSettled }),
+ );
+
+ act(() => {
+ result.current.trackJob({ jobId: FIRST_JOB_ID, context: CONTEXT });
+ });
+ dispatchJobStatus(SECOND_JOB_ID, JobState.ACTIVE, 50);
+
+ expect(result.current.activeJobProgress).toBeUndefined();
+ });
+
it('settles with the context the job was tracked with', () => {
const onQueueJobSettled = jest.fn();
diff --git a/packages/twenty-front/src/modules/queue-job/hooks/useTrackedQueueJob.ts b/packages/twenty-front/src/modules/queue-job/hooks/useTrackedQueueJob.ts
index 34de034dc84..deba870e59b 100644
--- a/packages/twenty-front/src/modules/queue-job/hooks/useTrackedQueueJob.ts
+++ b/packages/twenty-front/src/modules/queue-job/hooks/useTrackedQueueJob.ts
@@ -7,6 +7,7 @@ import { isDefined } from 'twenty-shared/utils';
type TrackedQueueJob<TContext> = {
jobId: string;
context: TContext;
+ progress?: number;
};
type UseTrackedQueueJobArgs<TContext> = {
@@ -23,6 +24,9 @@ export const useTrackedQueueJob = <TContext>({
}: UseTrackedQueueJobArgs<TContext>) => {
const [triggeredJob, setTriggeredJob] = useState<TrackedQueueJob<TContext>>();
const [settledJobIds, setSettledJobIds] = useState<string[]>([]);
+ const [progressByJobId, setProgressByJobId] = useState<
+ Record<string, number>
+ >({});
const trackedJob = triggeredJob ?? runningJob;
const activeJob =
@@ -31,14 +35,26 @@ export const useTrackedQueueJob = <TContext>({
: undefined;
const activeJobId = activeJob?.jobId;
const activeJobContext = activeJob?.context;
+ const activeJobProgress = isDefined(activeJob)
+ ? (progressByJobId[activeJob.jobId] ?? activeJob.progress)
+ : undefined;
const handleQueueJobEvent = useCallback(
(jobStatus: TrackedJobStatus) => {
- if (
- !isTerminalJobState(jobStatus.state) ||
- !isDefined(activeJobId) ||
- !isDefined(activeJobContext)
- ) {
+ if (!isDefined(activeJobId) || !isDefined(activeJobContext)) {
+ return;
+ }
+
+ if (isDefined(jobStatus.progress)) {
+ const progress = jobStatus.progress;
+
+ setProgressByJobId((currentProgressByJobId) => ({
+ ...currentProgressByJobId,
+ [jobStatus.jobId]: progress,
+ }));
+ }
+
+ if (!isTerminalJobState(jobStatus.state)) {
return;
}
@@ -65,5 +81,5 @@ export const useTrackedQueueJob = <TContext>({
setTriggeredJob(job);
};
- return { activeJobId, trackJob };
+ return { activeJobId, activeJobProgress, trackJob };
};
diff --git a/packages/twenty-front/src/modules/queue-job/types/TrackedJobStatus.ts b/packages/twenty-front/src/modules/queue-job/types/TrackedJobStatus.ts
index 714d8456dad..95ef2b4b829 100644
--- a/packages/twenty-front/src/modules/queue-job/types/TrackedJobStatus.ts
+++ b/packages/twenty-front/src/modules/queue-job/types/TrackedJobStatus.ts
@@ -2,5 +2,5 @@ import { type JobStatus } from '~/generated-metadata/graphql';
export type TrackedJobStatus = Pick<
JobStatus,
- 'jobId' | 'state' | 'failedReason'
+ 'jobId' | 'state' | 'failedReason' | 'progress'
>;
diff --git a/packages/twenty-front/src/modules/queue-job/utils/__tests__/formatQueueJobProgressLabel.test.ts b/packages/twenty-front/src/modules/queue-job/utils/__tests__/formatQueueJobProgressLabel.test.ts
new file mode 100644
index 00000000000..47cee9c814d
--- /dev/null
+++ b/packages/twenty-front/src/modules/queue-job/utils/__tests__/formatQueueJobProgressLabel.test.ts
@@ -0,0 +1,19 @@
+import { formatQueueJobProgressLabel } from '@/queue-job/utils/formatQueueJobProgressLabel';
+
+describe('formatQueueJobProgressLabel', () => {
+ it('pads a single-digit percentage with a figure space', () => {
+ expect(formatQueueJobProgressLabel(0)).toBe(' (0%)');
+ expect(formatQueueJobProgressLabel(7)).toBe(' (7%)');
+ });
+
+ it('leaves a two-digit percentage unpadded', () => {
+ expect(formatQueueJobProgressLabel(10)).toBe('(10%)');
+ expect(formatQueueJobProgressLabel(42)).toBe('(42%)');
+ expect(formatQueueJobProgressLabel(100)).toBe('(100%)');
+ });
+
+ it('rounds the percentage', () => {
+ expect(formatQueueJobProgressLabel(9.6)).toBe('(10%)');
+ expect(formatQueueJobProgressLabel(42.4)).toBe('(42%)');
+ });
+});
diff --git a/packages/twenty-front/src/modules/queue-job/utils/formatQueueJobProgressLabel.ts b/packages/twenty-front/src/modules/queue-job/utils/formatQueueJobProgressLabel.ts
new file mode 100644
index 00000000000..50c33978e70
--- /dev/null
+++ b/packages/twenty-front/src/modules/queue-job/utils/formatQueueJobProgressLabel.ts
@@ -0,0 +1,9 @@
+// A figure space is one digit wide, so single-digit labels keep the same width
+const FIGURE_SPACE = ' ';
+
+export const formatQueueJobProgressLabel = (progress: number): string => {
+ const roundedProgress = Math.round(progress);
+ const padding = roundedProgress < 10 ? FIGURE_SPACE : '';
+
+ return `${padding}(${roundedProgress}%)`;
+};
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationActionButton.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationActionButton.tsx
index e4fbb14c341..e9667e9175a 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationActionButton.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationActionButton.tsx
@@ -1,8 +1,10 @@
+import { formatQueueJobProgressLabel } from '@/queue-job/utils/formatQueueJobProgressLabel';
import { t } from '@lingui/core/macro';
import { Link } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { IconDownload, IconSettings } from 'twenty-ui/icon';
+import { Loader } from 'twenty-ui/primitives/feedback';
import { Button } from 'twenty-ui/primitives/input';
type SettingsApplicationActionButtonProps = {
@@ -10,6 +12,7 @@ type SettingsApplicationActionButtonProps = {
canInstallMarketplaceApps?: boolean;
onInstall?: () => void;
isInstalling?: boolean;
+ installProgress?: number;
};
export const SettingsApplicationActionButton = ({
@@ -17,6 +20,7 @@ export const SettingsApplicationActionButton = ({
canInstallMarketplaceApps,
onInstall,
isInstalling,
+ installProgress,
}: SettingsApplicationActionButtonProps) => {
if (isDefined(installedApplicationId) && !isInstalling) {
return (
@@ -40,16 +44,21 @@ export const SettingsApplicationActionButton = ({
return null;
}
+ const displayedInstallProgress = formatQueueJobProgressLabel(
+ installProgress ?? 0,
+ );
+
return (
<Button
startIcon={<IconDownload />}
+ endIcon={isInstalling ? <Loader /> : undefined}
variant="solid"
color="accent"
size="sm"
onClick={onInstall}
disabled={isInstalling}
>
- {isInstalling ? t`Installing...` : t`Install`}
+ {isInstalling ? t`Installing ${displayedInstallProgress}` : t`Install`}
</Button>
);
};
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationUninstallButton.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationUninstallButton.tsx
index aebee505f39..220810f9396 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationUninstallButton.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationUninstallButton.tsx
@@ -1,36 +1,46 @@
+import { formatQueueJobProgressLabel } from '@/queue-job/utils/formatQueueJobProgressLabel';
import { ConfirmationDialog } from '@/ui/layout/dialog/components/ConfirmationDialog';
import { useDialog } from '@/ui/layout/dialog/hooks/useDialog';
import { t } from '@lingui/core/macro';
import { Trans } from '@lingui/react/macro';
import { useId } from 'react';
import { IconTrash } from 'twenty-ui/icon';
+import { Loader } from 'twenty-ui/primitives/feedback';
import { Button } from 'twenty-ui/primitives/input';
type SettingsApplicationUninstallButtonProps = {
onUninstall: () => void;
isUninstalling?: boolean;
+ uninstallProgress?: number;
};
export const SettingsApplicationUninstallButton = ({
onUninstall,
isUninstalling,
+ uninstallProgress,
}: SettingsApplicationUninstallButtonProps) => {
const { openDialog } = useDialog();
const uninstallDialogId = useId();
const confirmationValue = t`yes`;
+ const displayedUninstallProgress = formatQueueJobProgressLabel(
+ uninstallProgress ?? 0,
+ );
return (
<>
<Button
startIcon={<IconTrash />}
+ endIcon={isUninstalling ? <Loader /> : undefined}
variant="outline"
color="danger"
size="sm"
onClick={() => openDialog(uninstallDialogId)}
disabled={isUninstalling}
>
- {isUninstalling ? t`Uninstalling...` : t`Uninstall`}
+ {isUninstalling
+ ? t`Uninstalling ${displayedUninstallProgress}`
+ : t`Uninstall`}
</Button>
<ConfirmationDialog
confirmationPlaceholder={confirmationValue}
diff --git a/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationActionButton.stories.tsx b/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationActionButton.stories.tsx
index e12fd7a3b75..0290b456777 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationActionButton.stories.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationActionButton.stories.tsx
@@ -42,6 +42,17 @@ export const Installing: Story = {
},
};
+export const InstallingWithProgress: Story = {
+ args: { isInstalling: true, installProgress: 60 },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ expect(
+ await canvas.findByRole('button', { name: 'Installing (60%)' }),
+ ).toBeDisabled();
+ },
+};
+
export const Installed: Story = {
args: { installedApplicationId: INSTALLED_APPLICATION_ID },
play: async ({ canvasElement }) => {
diff --git a/packages/twenty-front/src/modules/settings/applications/components/__tests__/SettingsApplicationActionButton.test.tsx b/packages/twenty-front/src/modules/settings/applications/components/__tests__/SettingsApplicationActionButton.test.tsx
index 2d4c63a5244..f514ad688fe 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/__tests__/SettingsApplicationActionButton.test.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/__tests__/SettingsApplicationActionButton.test.tsx
@@ -13,6 +13,7 @@ type RenderActionButtonOptions = {
canInstallMarketplaceApps?: boolean;
onInstall?: () => void;
isInstalling?: boolean;
+ installProgress?: number;
};
const renderActionButton = ({
@@ -20,6 +21,7 @@ const renderActionButton = ({
canInstallMarketplaceApps = true,
onInstall,
isInstalling,
+ installProgress,
}: RenderActionButtonOptions = {}) =>
render(
<MemoryRouter>
@@ -29,6 +31,7 @@ const renderActionButton = ({
canInstallMarketplaceApps={canInstallMarketplaceApps}
onInstall={onInstall}
isInstalling={isInstalling}
+ installProgress={installProgress}
/>
</I18nProvider>
</MemoryRouter>,
@@ -62,6 +65,30 @@ describe('SettingsApplicationActionButton', () => {
).toBeDisabled();
});
+ it('shows the installation progress in the label while installing', () => {
+ renderActionButton({ isInstalling: true, installProgress: 60 });
+
+ expect(
+ screen.getByRole('button', { name: 'Installing (60%)' }),
+ ).toBeDisabled();
+ });
+
+ it('starts the installation progress at zero before the first progress event', () => {
+ renderActionButton({ isInstalling: true });
+
+ expect(
+ screen.getByRole('button', { name: 'Installing (0%)' }),
+ ).toBeDisabled();
+ });
+
+ it('pads a single-digit percentage so the button keeps its width', () => {
+ renderActionButton({ isInstalling: true, installProgress: 7 });
+
+ expect(screen.getByRole('button').textContent).toContain(
+ 'Installing \u2007(7%)',
+ );
+ });
+
it('links to the application settings once installed', () => {
renderActionButton({ installedApplicationId: INSTALLED_APPLICATION_ID });
diff --git a/packages/twenty-front/src/modules/settings/applications/graphql/queries/findUninstallApplicationJobStatus.ts b/packages/twenty-front/src/modules/settings/applications/graphql/queries/findUninstallApplicationJobStatus.ts
index 8c71e4db071..125786e9939 100644
--- a/packages/twenty-front/src/modules/settings/applications/graphql/queries/findUninstallApplicationJobStatus.ts
+++ b/packages/twenty-front/src/modules/settings/applications/graphql/queries/findUninstallApplicationJobStatus.ts
@@ -8,6 +8,7 @@ export const FIND_UNINSTALL_APPLICATION_JOB_STATUS = gql`
jobId
state
failedReason
+ progress
}
}
`;
diff --git a/packages/twenty-front/src/modules/settings/applications/hooks/__tests__/useUninstallApplication.test.tsx b/packages/twenty-front/src/modules/settings/applications/hooks/__tests__/useUninstallApplication.test.tsx
index c9a2e0690b1..a4542756bee 100644
--- a/packages/twenty-front/src/modules/settings/applications/hooks/__tests__/useUninstallApplication.test.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/hooks/__tests__/useUninstallApplication.test.tsx
@@ -122,7 +122,7 @@ describe('useUninstallApplication', () => {
});
});
- it('reports an uninstallation still running on the server', async () => {
+ it('reports an uninstallation still running on the server with its progress', async () => {
const { result } = renderHook(
() =>
useUninstallApplication({
@@ -135,11 +135,25 @@ describe('useUninstallApplication', () => {
jobId: JOB_ID,
state: JobState.ACTIVE,
failedReason: null,
+ progress: 20,
}),
]),
},
);
await waitFor(() => expect(result.current.isUninstalling).toBe(true));
+ expect(result.current.uninstallProgress).toBe(20);
+
+ act(() => {
+ dispatchBrowserEvent<JobStatus>(QUEUE_JOB_BROWSER_EVENT_NAME, {
+ jobId: JOB_ID,
+ state: JobState.ACTIVE,
+ attemptsMade: 1,
+ progress: 80,
+ enqueuedAt: 1,
+ });
+ });
+
+ expect(result.current.uninstallProgress).toBe(80);
});
});
diff --git a/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts b/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts
index 0e165aa0f7a..ca627df695d 100644
--- a/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts
+++ b/packages/twenty-front/src/modules/settings/applications/hooks/useUninstallApplication.ts
@@ -39,9 +39,15 @@ export const useUninstallApplication = ({
);
const runningJobStatus = jobStatusData?.findUninstallApplicationJobStatus;
- const runningJobId =
- isDefined(runningJobStatus) && !isTerminalJobState(runningJobStatus.state)
- ? runningJobStatus.jobId
+ const runningJob =
+ isDefined(runningJobStatus) &&
+ !isTerminalJobState(runningJobStatus.state) &&
+ isDefined(universalIdentifier)
+ ? {
+ jobId: runningJobStatus.jobId,
+ context: universalIdentifier,
+ progress: runningJobStatus.progress ?? undefined,
+ }
: undefined;
const handleUninstallJobSettled = useCallback(
@@ -79,11 +85,8 @@ export const useUninstallApplication = ({
[enqueueToast, onCompleted, setCurrentWorkspace],
);
- const { activeJobId, trackJob } = useTrackedQueueJob({
- runningJob:
- isDefined(runningJobId) && isDefined(universalIdentifier)
- ? { jobId: runningJobId, context: universalIdentifier }
- : undefined,
+ const { activeJobId, activeJobProgress, trackJob } = useTrackedQueueJob({
+ runningJob,
onQueueJobSettled: handleUninstallJobSettled,
});
@@ -115,5 +118,6 @@ export const useUninstallApplication = ({
return {
uninstall,
isUninstalling: isTriggeringUninstall || isDefined(activeJobId),
+ uninstallProgress: activeJobProgress,
};
};
diff --git a/packages/twenty-front/src/modules/sse-db-event/graphql/subscriptions/OnEventSubscription.ts b/packages/twenty-front/src/modules/sse-db-event/graphql/subscriptions/OnEventSubscription.ts
index e2479e2f8c9..5f2bb94dbf7 100644
--- a/packages/twenty-front/src/modules/sse-db-event/graphql/subscriptions/OnEventSubscription.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/graphql/subscriptions/OnEventSubscription.ts
@@ -37,6 +37,7 @@ export const ON_EVENT_SUBSCRIPTION = gql`
state
attemptsMade
failedReason
+ progress
enqueuedAt
startedAt
finishedAt
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx
index fee20450212..2d0857ce0d6 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx
@@ -152,10 +152,11 @@ export const SettingsApplicationDetails = () => {
const handleUninstallCompleted = useCallback(() => {
navigate(SettingsPath.Applications);
}, [navigate]);
- const { uninstall, isUninstalling } = useUninstallApplication({
- universalIdentifier: application?.universalIdentifier,
- onCompleted: handleUninstallCompleted,
- });
+ const { uninstall, isUninstalling, uninstallProgress } =
+ useUninstallApplication({
+ universalIdentifier: application?.universalIdentifier,
+ onCompleted: handleUninstallCompleted,
+ });
const displayedApplicationVariables = getDisplayedApplicationVariables(
application?.applicationVariables ?? [],
@@ -258,6 +259,7 @@ export const SettingsApplicationDetails = () => {
isUpgrading={isUpgrading}
onUninstall={uninstall}
isUninstalling={isUninstalling}
+ uninstallProgress={uninstallProgress}
/>
);
case VARIABLES_TAB_ID:
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsAvailableApplicationDetails.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsAvailableApplicationDetails.tsx
index 111955792d5..b4e03c71f96 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsAvailableApplicationDetails.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsAvailableApplicationDetails.tsx
@@ -55,11 +55,16 @@ export const SettingsAvailableApplicationDetails = () => {
},
[navigateSettings],
);
- const { requestInstall, install, isInstalling, modalInstanceId } =
- useInstallMarketplaceAppWithPermissionValidation({
- universalIdentifier: availableApplicationId,
- onCompleted: handleInstallCompleted,
- });
+ const {
+ requestInstall,
+ install,
+ isInstalling,
+ installProgress,
+ modalInstanceId,
+ } = useInstallMarketplaceAppWithPermissionValidation({
+ universalIdentifier: availableApplicationId,
+ onCompleted: handleInstallCompleted,
+ });
const { copyMarketplaceAppLink } = useCopyMarketplaceAppLink();
const canInstallMarketplaceApps = useHasPermissionFlag(
@@ -221,6 +226,7 @@ export const SettingsAvailableApplicationDetails = () => {
canInstallMarketplaceApps={canInstallMarketplaceApps}
onInstall={requestInstall}
isInstalling={isInstalling}
+ installProgress={installProgress}
/>
) : undefined
}
diff --git a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationShareLinkButtons.tsx b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationShareLinkButtons.tsx
index 88850049848..c6731fd184d 100644
--- a/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationShareLinkButtons.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/components/SettingsApplicationRegistrationShareLinkButtons.tsx
@@ -4,6 +4,7 @@ import { SettingsApplicationInstallPermissionValidationModal } from '@/marketpla
import { useCopyMarketplaceAppLink } from '@/marketplace/hooks/useCopyMarketplaceAppLink';
import { useInstallMarketplaceAppWithPermissionValidation } from '@/marketplace/hooks/useInstallMarketplaceAppWithPermissionValidation';
import { getMarketplaceAppDefaultRoleManifest } from '@/marketplace/utils/getMarketplaceAppDefaultRoleManifest';
+import { formatQueueJobProgressLabel } from '@/queue-job/utils/formatQueueJobProgressLabel';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { useQuery } from '@apollo/client/react';
@@ -14,6 +15,7 @@ import {
IconDownload,
IconInfoCircle,
} from 'twenty-ui/icon';
+import { Loader } from 'twenty-ui/primitives/feedback';
import { Button } from 'twenty-ui/primitives/input';
import { themeCssVariables } from 'twenty-ui/theme';
import { FindMarketplaceAppDetailDocument } from '~/generated-metadata/graphql';
@@ -43,10 +45,15 @@ export const SettingsApplicationRegistrationShareLinkButtons = ({
const installable =
isDefined(isInstalled) && isDefined(universalIdentifier) && !isInstalled;
- const { requestInstall, install, isInstalling, modalInstanceId } =
- useInstallMarketplaceAppWithPermissionValidation({
- universalIdentifier,
- });
+ const {
+ requestInstall,
+ install,
+ isInstalling,
+ installProgress,
+ modalInstanceId,
+ } = useInstallMarketplaceAppWithPermissionValidation({
+ universalIdentifier,
+ });
const { data: detailData } = useQuery(FindMarketplaceAppDetailDocument, {
variables: { universalIdentifier: universalIdentifier ?? '' },
@@ -58,17 +65,24 @@ export const SettingsApplicationRegistrationShareLinkButtons = ({
const defaultRole = getMarketplaceAppDefaultRoleManifest(detail);
+ const displayedInstallProgress = formatQueueJobProgressLabel(
+ installProgress ?? 0,
+ );
+
return (
<StyledButtonGroup>
{installable && (
<>
<Button
startIcon={<IconDownload />}
+ endIcon={isInstalling ? <Loader /> : undefined}
onClick={requestInstall}
disabled={isInstalling}
variant="outline"
>
- {isInstalling ? t`Installing...` : t`Install`}
+ {isInstalling
+ ? t`Installing ${displayedInstallProgress}`
+ : t`Install`}
</Button>
<SettingsApplicationInstallPermissionValidationModal
modalInstanceId={modalInstanceId}
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationDetailGeneralTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationDetailGeneralTab.tsx
index 282310e82fb..4b19888008c 100644
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationDetailGeneralTab.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationDetailGeneralTab.tsx
@@ -40,6 +40,7 @@ type SettingsApplicationDetailGeneralTabProps = {
isUpgrading: boolean;
onUninstall: () => void;
isUninstalling: boolean;
+ uninstallProgress?: number;
};
export const SettingsApplicationDetailGeneralTab = ({
@@ -54,6 +55,7 @@ export const SettingsApplicationDetailGeneralTab = ({
isUpgrading,
onUninstall,
isUninstalling,
+ uninstallProgress,
}: SettingsApplicationDetailGeneralTabProps) => {
const navigateSettings = useNavigateSettings();
@@ -103,6 +105,7 @@ export const SettingsApplicationDetailGeneralTab = ({
key="uninstall"
onUninstall={onUninstall}
isUninstalling={isUninstalling}
+ uninstallProgress={uninstallProgress}
/>,
]
: []),
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/application-install.service.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/application-install.service.ts
index 9c4c6ab45dc..fea3b05bd1f 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-install/application-install.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/application-install.service.ts
@@ -35,8 +35,14 @@ import {
} from 'src/engine/core-modules/application/application.exception';
import { ApplicationLookupService } from 'src/engine/core-modules/application/application-lookup/application-lookup.service';
import { ApplicationService } from 'src/engine/core-modules/application/application.service';
+import {
+ APPLICATION_INSTALL_STEPS,
+ type ApplicationInstallStep,
+} from 'src/engine/core-modules/application/application-install/constants/application-install-steps.constant';
import { APPLICATION_LIFECYCLE_LOCK_OPTIONS } from 'src/engine/core-modules/application/application-install/constants/application-lifecycle-lock-options.constant';
+import { type ApplicationLifecycleProgressReporter } from 'src/engine/core-modules/application/application-install/types/application-lifecycle-progress-reporter.type';
import { buildApplicationLifecycleLockKey } from 'src/engine/core-modules/application/application-install/utils/build-application-lifecycle-lock-key.util';
+import { createApplicationLifecycleProgressReporter } from 'src/engine/core-modules/application/application-install/utils/create-application-lifecycle-progress-reporter.util';
import { CacheLockService } from 'src/engine/core-modules/cache-lock/cache-lock.service';
import { FileStorageService } from 'src/engine/core-modules/file-storage/services/file-storage.service';
import { LogicFunctionExecutorService } from 'src/engine/core-modules/logic-function/logic-function-executor/logic-function-executor.service';
@@ -52,6 +58,7 @@ import {
} from 'src/engine/core-modules/logic-function/logic-function-prebuilt-warm-up/jobs/warm-up-application-logic-functions.job-constants';
import { findLogicFunctionUniversalIdentifiersToWarmUp } from 'src/engine/core-modules/logic-function/logic-function-prebuilt-warm-up/utils/find-logic-function-universal-identifiers-to-warm-up.util';
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
+import { type MessageQueueJobProgressContext } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
import { MetricsService } from 'src/engine/core-modules/metrics/metrics.service';
@@ -88,6 +95,7 @@ export class ApplicationInstallService {
workspaceId: string;
skipWorkspaceCompatibilityCheck?: boolean;
hasUserApprovedCapabilities?: boolean;
+ updateProgress?: MessageQueueJobProgressContext['updateProgress'];
}): Promise<boolean> {
const appRegistration = await this.appRegistrationRepository.findOne({
where: { id: params.appRegistrationId },
@@ -121,15 +129,24 @@ export class ApplicationInstallService {
return true;
}
+ const progressReporter = createApplicationLifecycleProgressReporter({
+ steps: APPLICATION_INSTALL_STEPS,
+ updateProgress: params.updateProgress,
+ });
+
return this.cacheLockService.withLock(
() =>
- this.doInstallApplication(appRegistration, {
- version: params.version,
- workspaceId: params.workspaceId,
- skipWorkspaceCompatibilityCheck:
- params.skipWorkspaceCompatibilityCheck,
- hasUserApprovedCapabilities: params.hasUserApprovedCapabilities,
- }),
+ this.doInstallApplication(
+ appRegistration,
+ {
+ version: params.version,
+ workspaceId: params.workspaceId,
+ skipWorkspaceCompatibilityCheck:
+ params.skipWorkspaceCompatibilityCheck,
+ hasUserApprovedCapabilities: params.hasUserApprovedCapabilities,
+ },
+ progressReporter,
+ ),
buildApplicationLifecycleLockKey({
workspaceId: params.workspaceId,
universalIdentifier: appRegistration.universalIdentifier,
@@ -146,6 +163,7 @@ export class ApplicationInstallService {
skipWorkspaceCompatibilityCheck?: boolean;
hasUserApprovedCapabilities?: boolean;
},
+ progressReporter: ApplicationLifecycleProgressReporter<ApplicationInstallStep>,
): Promise<boolean> {
// Re-read inside the lock so a concurrent tarball upload cannot make us
// resolve a stale package.
@@ -170,6 +188,8 @@ export class ApplicationInstallService {
return true;
}
+ await progressReporter.reportStepCompleted('RESOLVE_PACKAGE');
+
try {
const existingApplication =
await this.applicationLookupService.findByUniversalIdentifier({
@@ -182,6 +202,7 @@ export class ApplicationInstallService {
params,
resolvedPackage,
existingApplication,
+ progressReporter,
});
} finally {
await this.applicationPackageFetcherService.cleanupExtractedDir(
@@ -195,6 +216,7 @@ export class ApplicationInstallService {
params,
resolvedPackage,
existingApplication,
+ progressReporter,
}: {
appRegistration: ApplicationRegistrationEntity;
params: {
@@ -205,6 +227,7 @@ export class ApplicationInstallService {
};
resolvedPackage: ResolvedPackage;
existingApplication: ApplicationEntity | null;
+ progressReporter: ApplicationLifecycleProgressReporter<ApplicationInstallStep>;
}): Promise<boolean> {
const isVersionUpgrade = isDefined(existingApplication);
@@ -221,6 +244,7 @@ export class ApplicationInstallService {
params,
resolvedPackage,
existingApplication,
+ progressReporter,
});
this.metricsService.incrementCounterBy({
@@ -254,6 +278,7 @@ export class ApplicationInstallService {
params,
resolvedPackage,
existingApplication,
+ progressReporter,
}: {
appRegistration: ApplicationRegistrationEntity;
params: {
@@ -264,6 +289,7 @@ export class ApplicationInstallService {
};
resolvedPackage: ResolvedPackage;
existingApplication: ApplicationEntity | null;
+ progressReporter: ApplicationLifecycleProgressReporter<ApplicationInstallStep>;
}): Promise<boolean> {
const universalIdentifier = appRegistration.universalIdentifier;
@@ -328,6 +354,8 @@ export class ApplicationInstallService {
sourceType: appRegistration.sourceType,
});
+ await progressReporter.reportStepCompleted('CREATE_APPLICATION');
+
const incomingVersion = resolvedPackage.packageJson.version;
// Rollback is scoped to the work after the application row exists: reaching
@@ -385,6 +413,8 @@ export class ApplicationInstallService {
});
}
+ await progressReporter.reportStepCompleted('WRITE_FILES');
+
await this.runPreInstallHook({
manifest: resolvedPackage.manifest,
workspaceId: params.workspaceId,
@@ -395,6 +425,8 @@ export class ApplicationInstallService {
universalIdentifier,
});
+ await progressReporter.reportStepCompleted('PRE_INSTALL_HOOK');
+
const { workspaceMigration } =
await this.applicationManifestApplyService.applyManifestToWorkspace({
workspaceId: params.workspaceId,
@@ -405,6 +437,8 @@ export class ApplicationInstallService {
persistVersion: false,
});
+ await progressReporter.reportStepCompleted('APPLY_MANIFEST');
+
const isPostInstallHookSynchronous =
resolvedPackage.manifest.application.postInstallLogicFunction
?.shouldRunSynchronously === true;
@@ -434,6 +468,8 @@ export class ApplicationInstallService {
});
}
+ await progressReporter.reportStepCompleted('POST_INSTALL_HOOK');
+
await this.applicationManifestApplyService.refreshRegistrationFromManifest(
{
applicationRegistrationId: appRegistration.id,
@@ -450,6 +486,8 @@ export class ApplicationInstallService {
findLogicFunctionUniversalIdentifiersToWarmUp(workspaceMigration),
});
+ await progressReporter.reportStepCompleted('FINALIZE');
+
this.logger.log(
`Successfully installed app ${universalIdentifier} v${resolvedPackage.packageJson.version ?? 'unknown'}`,
);
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/constants/application-install-steps.constant.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/constants/application-install-steps.constant.ts
new file mode 100644
index 00000000000..308e0d13822
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/constants/application-install-steps.constant.ts
@@ -0,0 +1,11 @@
+export const APPLICATION_INSTALL_STEPS = [
+ 'RESOLVE_PACKAGE',
+ 'CREATE_APPLICATION',
+ 'WRITE_FILES',
+ 'PRE_INSTALL_HOOK',
+ 'APPLY_MANIFEST',
+ 'POST_INSTALL_HOOK',
+ 'FINALIZE',
+] as const;
+
+export type ApplicationInstallStep = (typeof APPLICATION_INSTALL_STEPS)[number];
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/constants/application-uninstall-steps.constant.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/constants/application-uninstall-steps.constant.ts
new file mode 100644
index 00000000000..bfd3c4aaaf7
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/constants/application-uninstall-steps.constant.ts
@@ -0,0 +1,10 @@
+export const APPLICATION_UNINSTALL_STEPS = [
+ 'UNINSTALL_HOOK',
+ 'COMPUTE_METADATA_TO_DELETE',
+ 'RUN_WORKSPACE_MIGRATION',
+ 'DELETE_APPLICATION',
+ 'CLEANUP_RUNTIME_RESOURCES',
+] as const;
+
+export type ApplicationUninstallStep =
+ (typeof APPLICATION_UNINSTALL_STEPS)[number];
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/__tests__/trigger-install-application.job.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/__tests__/trigger-install-application.job.spec.ts
index d3337d70446..07e63056dd4 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/__tests__/trigger-install-application.job.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/__tests__/trigger-install-application.job.spec.ts
@@ -3,6 +3,7 @@ import {
TriggerInstallApplicationJob,
type TriggerInstallApplicationJobData,
} from 'src/engine/core-modules/application/application-install/jobs/trigger-install-application.job';
+import { type MessageQueueJobProgressContext } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
describe('TriggerInstallApplicationJob', () => {
const applicationInstallService = {
@@ -16,17 +17,22 @@ describe('TriggerInstallApplicationJob', () => {
workspaceId: 'workspace-id',
};
+ const jobContext: MessageQueueJobProgressContext = {
+ updateProgress: jest.fn(),
+ };
+
beforeEach(() => {
jest.clearAllMocks();
});
- it('installs the requested application', async () => {
- await job.handle(jobData);
+ it('installs the requested application and forwards progress updates', async () => {
+ await job.handle(jobData, jobContext);
expect(applicationInstallService.installApplication).toHaveBeenCalledWith({
appRegistrationId: jobData.applicationRegistrationId,
workspaceId: jobData.workspaceId,
hasUserApprovedCapabilities: true,
+ updateProgress: jobContext.updateProgress,
});
});
@@ -37,6 +43,6 @@ describe('TriggerInstallApplicationJob', () => {
.spyOn(applicationInstallService, 'installApplication')
.mockRejectedValueOnce(error);
- await expect(job.handle(jobData)).rejects.toThrow(error);
+ await expect(job.handle(jobData, jobContext)).rejects.toThrow(error);
});
});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/__tests__/trigger-uninstall-application.job.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/__tests__/trigger-uninstall-application.job.spec.ts
index 120c989ff89..bf1a71123ec 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/__tests__/trigger-uninstall-application.job.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/__tests__/trigger-uninstall-application.job.spec.ts
@@ -3,6 +3,7 @@ import {
TriggerUninstallApplicationJob,
type TriggerUninstallApplicationJobData,
} from 'src/engine/core-modules/application/application-install/jobs/trigger-uninstall-application.job';
+import { type MessageQueueJobProgressContext } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
describe('TriggerUninstallApplicationJob', () => {
const applicationUninstallRunnerService = {
@@ -18,16 +19,23 @@ describe('TriggerUninstallApplicationJob', () => {
workspaceId: 'workspace-id',
};
+ const jobContext: MessageQueueJobProgressContext = {
+ updateProgress: jest.fn(),
+ };
+
beforeEach(() => {
jest.clearAllMocks();
});
- it('uninstalls the requested application', async () => {
- await job.handle(jobData);
+ it('uninstalls the requested application and forwards progress updates', async () => {
+ await job.handle(jobData, jobContext);
expect(
applicationUninstallRunnerService.uninstallApplication,
- ).toHaveBeenCalledWith(jobData);
+ ).toHaveBeenCalledWith({
+ ...jobData,
+ updateProgress: jobContext.updateProgress,
+ });
});
it('propagates uninstallation failures to the queue', async () => {
@@ -37,6 +45,6 @@ describe('TriggerUninstallApplicationJob', () => {
.spyOn(applicationUninstallRunnerService, 'uninstallApplication')
.mockRejectedValueOnce(error);
- await expect(job.handle(jobData)).rejects.toThrow(error);
+ await expect(job.handle(jobData, jobContext)).rejects.toThrow(error);
});
});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/trigger-install-application.job.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/trigger-install-application.job.ts
index ed18e786ff2..9eaf8ca243d 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/trigger-install-application.job.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/trigger-install-application.job.ts
@@ -1,6 +1,7 @@
import { ApplicationInstallService } from 'src/engine/core-modules/application/application-install/application-install.service';
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
+import { type MessageQueueJobProgressContext } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
export type TriggerInstallApplicationJobData = {
@@ -15,11 +16,15 @@ export class TriggerInstallApplicationJob {
) {}
@Process(TriggerInstallApplicationJob.name)
- async handle(data: TriggerInstallApplicationJobData): Promise<void> {
+ async handle(
+ data: TriggerInstallApplicationJobData,
+ { updateProgress }: MessageQueueJobProgressContext,
+ ): Promise<void> {
await this.applicationInstallService.installApplication({
appRegistrationId: data.applicationRegistrationId,
workspaceId: data.workspaceId,
hasUserApprovedCapabilities: true,
+ updateProgress,
});
}
}
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/trigger-uninstall-application.job.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/trigger-uninstall-application.job.ts
index b37dae59178..450188b1094 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/trigger-uninstall-application.job.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/jobs/trigger-uninstall-application.job.ts
@@ -1,6 +1,7 @@
import { ApplicationUninstallRunnerService } from 'src/engine/core-modules/application/application-install/services/application-uninstall-runner.service';
import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
+import { type MessageQueueJobProgressContext } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
export type TriggerUninstallApplicationJobData = {
@@ -15,7 +16,13 @@ export class TriggerUninstallApplicationJob {
) {}
@Process(TriggerUninstallApplicationJob.name)
- async handle(data: TriggerUninstallApplicationJobData): Promise<void> {
- await this.applicationUninstallRunnerService.uninstallApplication(data);
+ async handle(
+ data: TriggerUninstallApplicationJobData,
+ { updateProgress }: MessageQueueJobProgressContext,
+ ): Promise<void> {
+ await this.applicationUninstallRunnerService.uninstallApplication({
+ ...data,
+ updateProgress,
+ });
}
}
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/services/application-uninstall-runner.service.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/services/application-uninstall-runner.service.ts
index 62aa39997d2..56528b01bdd 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-install/services/application-uninstall-runner.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/services/application-uninstall-runner.service.ts
@@ -5,8 +5,11 @@ import { ApplicationException } from 'src/engine/core-modules/application/applic
import { ApplicationLookupService } from 'src/engine/core-modules/application/application-lookup/application-lookup.service';
import { type ApplicationEntity } from 'src/engine/core-modules/application/application.entity';
import { APPLICATION_LIFECYCLE_LOCK_OPTIONS } from 'src/engine/core-modules/application/application-install/constants/application-lifecycle-lock-options.constant';
+import { APPLICATION_UNINSTALL_STEPS } from 'src/engine/core-modules/application/application-install/constants/application-uninstall-steps.constant';
import { buildApplicationLifecycleLockKey } from 'src/engine/core-modules/application/application-install/utils/build-application-lifecycle-lock-key.util';
+import { createApplicationLifecycleProgressReporter } from 'src/engine/core-modules/application/application-install/utils/create-application-lifecycle-progress-reporter.util';
import { CacheLockService } from 'src/engine/core-modules/cache-lock/cache-lock.service';
+import { type MessageQueueJobProgressContext } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
import { MetricsService } from 'src/engine/core-modules/metrics/metrics.service';
import { MetricsKeys } from 'src/engine/core-modules/metrics/types/metrics-keys.type';
@@ -22,12 +25,19 @@ export class ApplicationUninstallRunnerService {
async uninstallApplication({
universalIdentifier,
workspaceId,
+ updateProgress,
}: {
universalIdentifier: string;
workspaceId: string;
+ updateProgress?: MessageQueueJobProgressContext['updateProgress'];
}): Promise<void> {
let application: ApplicationEntity | null = null;
+ const progressReporter = createApplicationLifecycleProgressReporter({
+ steps: APPLICATION_UNINSTALL_STEPS,
+ updateProgress,
+ });
+
try {
application =
await this.applicationLookupService.findByUniversalIdentifier({
@@ -40,6 +50,7 @@ export class ApplicationUninstallRunnerService {
this.applicationSyncService.uninstallApplication({
applicationUniversalIdentifier: universalIdentifier,
workspaceId,
+ progressReporter,
}),
buildApplicationLifecycleLockKey({ workspaceId, universalIdentifier }),
APPLICATION_LIFECYCLE_LOCK_OPTIONS,
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/types/application-lifecycle-progress-reporter.type.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/types/application-lifecycle-progress-reporter.type.ts
new file mode 100644
index 00000000000..725faaa05c6
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/types/application-lifecycle-progress-reporter.type.ts
@@ -0,0 +1,3 @@
+export type ApplicationLifecycleProgressReporter<TStep extends string> = {
+ reportStepCompleted: (step: TStep) => Promise<void>;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/utils/__tests__/create-application-lifecycle-progress-reporter.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/utils/__tests__/create-application-lifecycle-progress-reporter.util.spec.ts
new file mode 100644
index 00000000000..d08fdc7d45a
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/utils/__tests__/create-application-lifecycle-progress-reporter.util.spec.ts
@@ -0,0 +1,44 @@
+import { createApplicationLifecycleProgressReporter } from 'src/engine/core-modules/application/application-install/utils/create-application-lifecycle-progress-reporter.util';
+
+const STEPS = ['FIRST', 'SECOND', 'THIRD', 'FOURTH'] as const;
+
+describe('createApplicationLifecycleProgressReporter', () => {
+ it('reports the percentage of completed steps', async () => {
+ const updateProgress = jest.fn().mockResolvedValue(undefined);
+ const reporter = createApplicationLifecycleProgressReporter({
+ steps: STEPS,
+ updateProgress,
+ });
+
+ await reporter.reportStepCompleted('FIRST');
+ await reporter.reportStepCompleted('THIRD');
+ await reporter.reportStepCompleted('FOURTH');
+
+ expect(updateProgress.mock.calls).toEqual([[25], [75], [100]]);
+ });
+
+ it('is a no-op without an updateProgress callback', async () => {
+ const reporter = createApplicationLifecycleProgressReporter({
+ steps: STEPS,
+ });
+
+ await expect(
+ reporter.reportStepCompleted('FIRST'),
+ ).resolves.toBeUndefined();
+ });
+
+ it('swallows progress update failures', async () => {
+ const updateProgress = jest
+ .fn()
+ .mockRejectedValue(new Error('job lock lost'));
+ const reporter = createApplicationLifecycleProgressReporter({
+ steps: STEPS,
+ updateProgress,
+ });
+
+ await expect(
+ reporter.reportStepCompleted('SECOND'),
+ ).resolves.toBeUndefined();
+ expect(updateProgress).toHaveBeenCalledWith(50);
+ });
+});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-install/utils/create-application-lifecycle-progress-reporter.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-install/utils/create-application-lifecycle-progress-reporter.util.ts
new file mode 100644
index 00000000000..a649e51b880
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/application/application-install/utils/create-application-lifecycle-progress-reporter.util.ts
@@ -0,0 +1,35 @@
+import { Logger } from '@nestjs/common';
+
+import { isDefined } from 'twenty-shared/utils';
+
+import { type ApplicationLifecycleProgressReporter } from 'src/engine/core-modules/application/application-install/types/application-lifecycle-progress-reporter.type';
+import { type MessageQueueJobProgressContext } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
+
+const logger = new Logger('ApplicationLifecycleProgressReporter');
+
+export const createApplicationLifecycleProgressReporter = <
+ TStep extends string,
+>({
+ steps,
+ updateProgress,
+}: {
+ steps: readonly TStep[];
+ updateProgress?: MessageQueueJobProgressContext['updateProgress'];
+}): ApplicationLifecycleProgressReporter<TStep> => ({
+ reportStepCompleted: async (step) => {
+ if (!isDefined(updateProgress)) {
+ return;
+ }
+
+ const completedStepCount = steps.indexOf(step) + 1;
+ const percentage = Math.round((completedStepCount / steps.length) * 100);
+
+ try {
+ await updateProgress(percentage);
+ } catch (error) {
+ logger.warn(
+ `Failed to report progress for step ${step}: ${error instanceof Error ? error.message : String(error)}`,
+ );
+ }
+ },
+});
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/application-sync.service.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/application-sync.service.ts
index d893ccdd8a5..23db25d7de4 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/application-sync.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/application-sync.service.ts
@@ -7,6 +7,12 @@ import { isDefined } from 'twenty-shared/utils';
import { PackageJson } from 'type-fest';
import { v4 } from 'uuid';
+import {
+ APPLICATION_UNINSTALL_STEPS,
+ type ApplicationUninstallStep,
+} from 'src/engine/core-modules/application/application-install/constants/application-uninstall-steps.constant';
+import { type ApplicationLifecycleProgressReporter } from 'src/engine/core-modules/application/application-install/types/application-lifecycle-progress-reporter.type';
+import { createApplicationLifecycleProgressReporter } from 'src/engine/core-modules/application/application-install/utils/create-application-lifecycle-progress-reporter.util';
import { ApplicationRegistrationSourceType } from 'src/engine/core-modules/application/application-registration/enums/application-registration-source-type.enum';
import { resolveSyncedApplicationCapabilities } from 'src/engine/core-modules/application/utils/resolve-synced-application-capabilities.util';
import { toApplicationCapabilities } from 'src/engine/core-modules/application/utils/to-application-capabilities.util';
@@ -363,10 +369,14 @@ export class ApplicationSyncService {
workspaceId,
applicationUniversalIdentifier,
shouldRunUninstallHook = true,
+ progressReporter = createApplicationLifecycleProgressReporter({
+ steps: APPLICATION_UNINSTALL_STEPS,
+ }),
}: {
workspaceId: string;
applicationUniversalIdentifier: string;
shouldRunUninstallHook?: boolean;
+ progressReporter?: ApplicationLifecycleProgressReporter<ApplicationUninstallStep>;
}): Promise<WorkspaceMigration> {
const application =
await this.applicationService.findOneApplicationWithRelationsOrThrow({
@@ -386,6 +396,7 @@ export class ApplicationSyncService {
workspaceId,
applicationUniversalIdentifier,
shouldRunUninstallHook,
+ progressReporter,
});
}
@@ -394,11 +405,13 @@ export class ApplicationSyncService {
workspaceId,
applicationUniversalIdentifier,
shouldRunUninstallHook,
+ progressReporter,
}: {
application: ApplicationEntity;
workspaceId: string;
applicationUniversalIdentifier: string;
shouldRunUninstallHook: boolean;
+ progressReporter: ApplicationLifecycleProgressReporter<ApplicationUninstallStep>;
}): Promise<WorkspaceMigration> {
if (shouldRunUninstallHook) {
await this.applicationUninstallService.runUninstallHookBestEffort({
@@ -407,6 +420,8 @@ export class ApplicationSyncService {
});
}
+ await progressReporter.reportStepCompleted('UNINSTALL_HOOK');
+
const flatEntityMapsCacheKeys = Object.values(ALL_METADATA_NAME).map(
getMetadataFlatEntityMapsKey,
);
@@ -441,6 +456,8 @@ export class ApplicationSyncService {
]),
);
+ await progressReporter.reportStepCompleted('COMPUTE_METADATA_TO_DELETE');
+
const validateAndBuildResult =
await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunWorkspaceMigrationFromRecord(
{
@@ -458,16 +475,22 @@ export class ApplicationSyncService {
);
}
+ await progressReporter.reportStepCompleted('RUN_WORKSPACE_MIGRATION');
+
await this.applicationService.delete(
applicationUniversalIdentifier,
workspaceId,
);
+ await progressReporter.reportStepCompleted('DELETE_APPLICATION');
+
await this.cleanupApplicationRuntimeResources({
workspaceId,
applicationUniversalIdentifier,
});
+ await progressReporter.reportStepCompleted('CLEANUP_RUNTIME_RESOURCES');
+
return validateAndBuildResult.workspaceMigration;
}
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/drivers/__tests__/bullmq.driver.spec.ts b/packages/twenty-server/src/engine/core-modules/message-queue/drivers/__tests__/bullmq.driver.spec.ts
index c188ea2c69e..9a3cd40c41d 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/drivers/__tests__/bullmq.driver.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/drivers/__tests__/bullmq.driver.spec.ts
@@ -1,5 +1,6 @@
import { type Job, Worker } from 'bullmq';
+import { QUEUE_JOB_CHANGED_EVENT } from 'src/engine/core-modules/message-queue/constants/queue-job-changed-event.constant';
import { BullMQDriver } from 'src/engine/core-modules/message-queue/drivers/bullmq.driver';
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
@@ -198,6 +199,83 @@ describe('BullMQDriver progress', () => {
);
});
+describe('BullMQDriver job change events', () => {
+ const eventEmitter = { emit: jest.fn() };
+ const driver = new BullMQDriver(
+ {} as never,
+ { recordHistogram: jest.fn() } as never,
+ {} as never,
+ eventEmitter as never,
+ );
+
+ driver.register(MessageQueue.workspaceQueue);
+
+ const getWorkerListener = (eventName: string) => {
+ driver.work(MessageQueue.workspaceQueue, async () => {});
+
+ const workerInstances = jest.mocked(Worker).mock.results;
+ const worker = workerInstances[workerInstances.length - 1]
+ .value as unknown as { on: jest.Mock };
+ const listener = worker.on.mock.calls.find(
+ ([name]: [string, unknown]) => name === eventName,
+ )?.[1];
+
+ if (typeof listener !== 'function') {
+ throw new Error(`No ${eventName} listener registered on the worker`);
+ }
+
+ return listener;
+ };
+
+ beforeEach(() => {
+ jest.clearAllMocks();
+ });
+
+ it('forwards a progress update of a broadcast job as an active job change', () => {
+ const onProgress = getWorkerListener('progress');
+
+ onProgress(
+ {
+ id: 'job-id',
+ data: {},
+ opts: { broadcastTo: { workspaceId: 'workspace-id' } },
+ attemptsMade: 0,
+ progress: 40,
+ timestamp: 1,
+ } as unknown as Job,
+ 40,
+ );
+
+ expect(eventEmitter.emit).toHaveBeenCalledWith(QUEUE_JOB_CHANGED_EVENT, {
+ queueName: MessageQueue.workspaceQueue,
+ job: expect.objectContaining({
+ id: 'job-id',
+ state: 'active',
+ progress: 40,
+ broadcastTo: { workspaceId: 'workspace-id' },
+ }),
+ });
+ });
+
+ it('ignores progress updates of jobs without recipients', () => {
+ const onProgress = getWorkerListener('progress');
+
+ onProgress(
+ {
+ id: 'job-id',
+ data: {},
+ opts: {},
+ attemptsMade: 0,
+ progress: 40,
+ timestamp: 1,
+ } as unknown as Job,
+ 40,
+ );
+
+ expect(eventEmitter.emit).not.toHaveBeenCalled();
+ });
+});
+
describe('BullMQDriver queue wait metric', () => {
const recordHistogram = jest.fn();
const driver = new BullMQDriver(
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 0ef97b56a42..9be4bced60c 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
@@ -295,6 +295,9 @@ export class BullMQDriver
this.workerMap[queueName].on('active', (job) =>
this.emitJobChange({ queueName, job, state: 'active' }),
);
+ this.workerMap[queueName].on('progress', (job) =>
+ this.emitJobChange({ queueName, job, state: 'active' }),
+ );
this.workerMap[queueName].on('completed', (job) =>
this.emitJobChange({ queueName, job, state: 'completed' }),
);
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/dtos/job-status.dto.ts b/packages/twenty-server/src/engine/core-modules/message-queue/dtos/job-status.dto.ts
index e4b9d5b413a..bbedf4ee9af 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/dtos/job-status.dto.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/dtos/job-status.dto.ts
@@ -16,6 +16,9 @@ export class JobStatusDTO {
@Field(() => String, { nullable: true })
failedReason?: string;
+ @Field(() => Int, { nullable: true })
+ progress?: number;
+
@Field(() => Number)
enqueuedAt: number;
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/utils/__tests__/get-queue-job-progress-percentage.util.spec.ts b/packages/twenty-server/src/engine/core-modules/message-queue/utils/__tests__/get-queue-job-progress-percentage.util.spec.ts
new file mode 100644
index 00000000000..11096ecd004
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/utils/__tests__/get-queue-job-progress-percentage.util.spec.ts
@@ -0,0 +1,21 @@
+import { getQueueJobProgressPercentage } from 'src/engine/core-modules/message-queue/utils/get-queue-job-progress-percentage.util';
+
+describe('getQueueJobProgressPercentage', () => {
+ it.each([
+ [0, 0],
+ [42, 42],
+ [42.6, 43],
+ [100, 100],
+ [120, 100],
+ [-5, 0],
+ ])('maps the numeric progress %p to %p', (progress, expected) => {
+ expect(getQueueJobProgressPercentage(progress)).toBe(expected);
+ });
+
+ it.each([undefined, null, Number.NaN, 'half', { completed: 5, total: 10 }])(
+ 'ignores the non-percentage progress %p',
+ (progress) => {
+ expect(getQueueJobProgressPercentage(progress)).toBeUndefined();
+ },
+ );
+});
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/utils/build-job-status.util.ts b/packages/twenty-server/src/engine/core-modules/message-queue/utils/build-job-status.util.ts
index 9e493ef9942..48a9f9d0a66 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/utils/build-job-status.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/utils/build-job-status.util.ts
@@ -2,6 +2,7 @@ import { type JobStatusDTO } from 'src/engine/core-modules/message-queue/dtos/jo
import { type QueueJobDetails } from 'src/engine/core-modules/message-queue/drivers/interfaces/message-queue-driver.interface';
import { bullMQToJobStateEnum } from 'src/engine/core-modules/message-queue/enums/job-state.enum';
import { type MessageQueueJobData } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
+import { getQueueJobProgressPercentage } from 'src/engine/core-modules/message-queue/utils/get-queue-job-progress-percentage.util';
export const buildJobStatus = ({
jobId,
@@ -14,6 +15,7 @@ export const buildJobStatus = ({
state: bullMQToJobStateEnum[job.state],
attemptsMade: job.attemptsMade,
failedReason: job.failedReason,
+ progress: getQueueJobProgressPercentage(job.progress),
enqueuedAt: job.timestamp,
startedAt: job.processedOn,
finishedAt: job.finishedOn,
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/utils/get-queue-job-progress-percentage.util.ts b/packages/twenty-server/src/engine/core-modules/message-queue/utils/get-queue-job-progress-percentage.util.ts
new file mode 100644
index 00000000000..adc143b3cf9
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/utils/get-queue-job-progress-percentage.util.ts
@@ -0,0 +1,8 @@
+import { isNumber } from '@sniptt/guards';
+
+export const getQueueJobProgressPercentage = (
+ progress: unknown,
+): number | undefined =>
+ isNumber(progress) && Number.isFinite(progress)
+ ? Math.min(100, Math.max(0, Math.round(progress)))
+ : undefined;
diff --git a/packages/twenty-server/src/engine/subscriptions/queue-job-event/queue-job-event.listener.ts b/packages/twenty-server/src/engine/subscriptions/queue-job-event/queue-job-event.listener.ts
index 6658073e41c..4aed4a8da6d 100644
--- a/packages/twenty-server/src/engine/subscriptions/queue-job-event/queue-job-event.listener.ts
+++ b/packages/twenty-server/src/engine/subscriptions/queue-job-event/queue-job-event.listener.ts
@@ -10,6 +10,7 @@ import { type MessageQueueJobData } from 'src/engine/core-modules/message-queue/
import { QUEUE_JOB_CHANGED_EVENT } from 'src/engine/core-modules/message-queue/constants/queue-job-changed-event.constant';
import { bullMQToJobStateEnum } from 'src/engine/core-modules/message-queue/enums/job-state.enum';
import { type QueueJobChangedEvent } from 'src/engine/core-modules/message-queue/types/queue-job-changed-event.type';
+import { getQueueJobProgressPercentage } from 'src/engine/core-modules/message-queue/utils/get-queue-job-progress-percentage.util';
import { WorkspaceEventBroadcaster } from 'src/engine/subscriptions/workspace-event-broadcaster/workspace-event-broadcaster.service';
@Injectable()
@@ -50,6 +51,7 @@ export class QueueJobEventListener {
state: bullMQToJobStateEnum[job.state],
attemptsMade: job.attemptsMade,
failedReason: job.failedReason,
+ progress: getQueueJobProgressPercentage(job.progress),
enqueuedAt: job.timestamp,
startedAt: job.processedOn,
finishedAt: job.finishedOn,
diff --git a/packages/twenty-server/src/engine/subscriptions/types/queue-job-event.type.ts b/packages/twenty-server/src/engine/subscriptions/types/queue-job-event.type.ts
index cc63b376e65..4e9aa151f6f 100644
--- a/packages/twenty-server/src/engine/subscriptions/types/queue-job-event.type.ts
+++ b/packages/twenty-server/src/engine/subscriptions/types/queue-job-event.type.ts
@@ -5,6 +5,7 @@ export type QueueJobEvent = {
state: JobStateEnum;
attemptsMade: number;
failedReason?: string;
+ progress?: number;
enqueuedAt: number;
startedAt?: number;
finishedAt?: number;