Skip to content

The open alternative to Salesforce, designed for AI.

Publish queue job events over SSE (#25333)

martmull9db6004013d5
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index 11291003b27..7ca5575f2f2 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -1595,6 +1595,27 @@ enum NavigationMenuItemType {
PAGE_LAYOUT
}
+type JobStatus {
+ jobId: String!
+ state: JobState!
+ attemptsMade: Int!
+ failedReason: String
+ enqueuedAt: Float!
+ startedAt: Float
+ finishedAt: Float
+}
+
+"""Job state in the queue"""
+enum JobState {
+ COMPLETED
+ FAILED
+ ACTIVE
+ WAITING
+ DELAYED
+ PRIORITIZED
+ WAITING_CHILDREN
+}
+
type ObjectRecordEventProperties {
updatedFields: [String!]
before: JSON
@@ -1645,6 +1666,7 @@ type EventSubscription {
eventStreamId: String!
objectRecordEventsWithQueryIds: [ObjectRecordEventWithQueryIds!]!
metadataEvents: [MetadataEvent!]!
+ queueJobEvents: [JobStatus!]!
}
type UserSession {
@@ -3257,27 +3279,6 @@ type EnqueueJobsResult {
jobIds: [String!]!
}
-type JobStatus {
- jobId: String!
- state: JobState!
- attemptsMade: Int!
- failedReason: String
- enqueuedAt: Float!
- startedAt: Float
- finishedAt: Float
-}
-
-"""Job state in the queue"""
-enum JobState {
- COMPLETED
- FAILED
- ACTIVE
- WAITING
- DELAYED
- PRIORITIZED
- WAITING_CHILDREN
-}
-
type AppKeyValue {
key: String!
value: JSON
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index 72b29f84a83..63fc89edbab 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -1257,6 +1257,21 @@ export interface NavigationMenuItem {
export type NavigationMenuItemType = 'VIEW' | 'FOLDER' | 'LINK' | 'OBJECT' | 'RECORD' | 'PAGE_LAYOUT'
+export interface JobStatus {
+ jobId: Scalars['String']
+ state: JobState
+ attemptsMade: Scalars['Int']
+ failedReason?: Scalars['String']
+ enqueuedAt: Scalars['Float']
+ startedAt?: Scalars['Float']
+ finishedAt?: Scalars['Float']
+ __typename: 'JobStatus'
+}
+
+
+/** Job state in the queue */
+export type JobState = 'COMPLETED' | 'FAILED' | 'ACTIVE' | 'WAITING' | 'DELAYED' | 'PRIORITIZED' | 'WAITING_CHILDREN'
+
export interface ObjectRecordEventProperties {
updatedFields?: Scalars['String'][]
before?: Scalars['JSON']
@@ -1302,6 +1317,7 @@ export interface EventSubscription {
eventStreamId: Scalars['String']
objectRecordEventsWithQueryIds: ObjectRecordEventWithQueryIds[]
metadataEvents: MetadataEvent[]
+ queueJobEvents: JobStatus[]
__typename: 'EventSubscription'
}
@@ -2888,21 +2904,6 @@ export interface EnqueueJobsResult {
__typename: 'EnqueueJobsResult'
}
-export interface JobStatus {
- jobId: Scalars['String']
- state: JobState
- attemptsMade: Scalars['Int']
- failedReason?: Scalars['String']
- enqueuedAt: Scalars['Float']
- startedAt?: Scalars['Float']
- finishedAt?: Scalars['Float']
- __typename: 'JobStatus'
-}
-
-
-/** Job state in the queue */
-export type JobState = 'COMPLETED' | 'FAILED' | 'ACTIVE' | 'WAITING' | 'DELAYED' | 'PRIORITIZED' | 'WAITING_CHILDREN'
-
export interface AppKeyValue {
key: Scalars['String']
value?: Scalars['JSON']
@@ -4731,6 +4732,18 @@ export interface NavigationMenuItemGenqlSelection{
__scalar?: boolean | number
}
+export interface JobStatusGenqlSelection{
+ jobId?: boolean | number
+ state?: boolean | number
+ attemptsMade?: boolean | number
+ failedReason?: boolean | number
+ enqueuedAt?: boolean | number
+ startedAt?: boolean | number
+ finishedAt?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
export interface ObjectRecordEventPropertiesGenqlSelection{
updatedFields?: boolean | number
before?: boolean | number
@@ -4772,6 +4785,7 @@ export interface EventSubscriptionGenqlSelection{
eventStreamId?: boolean | number
objectRecordEventsWithQueryIds?: ObjectRecordEventWithQueryIdsGenqlSelection
metadataEvents?: MetadataEventGenqlSelection
+ queueJobEvents?: JobStatusGenqlSelection
__typename?: boolean | number
__scalar?: boolean | number
}
@@ -6463,18 +6477,6 @@ export interface EnqueueJobsResultGenqlSelection{
__scalar?: boolean | number
}
-export interface JobStatusGenqlSelection{
- jobId?: boolean | number
- state?: boolean | number
- attemptsMade?: boolean | number
- failedReason?: boolean | number
- enqueuedAt?: boolean | number
- startedAt?: boolean | number
- finishedAt?: boolean | number
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
export interface AppKeyValueGenqlSelection{
key?: boolean | number
value?: boolean | number
@@ -8230,6 +8232,14 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
+ const JobStatus_possibleTypes: string[] = ['JobStatus']
+ export const isJobStatus = (obj?: { __typename?: any } | null): obj is JobStatus => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isJobStatus"')
+ return JobStatus_possibleTypes.includes(obj.__typename)
+ }
+
+
+
const ObjectRecordEventProperties_possibleTypes: string[] = ['ObjectRecordEventProperties']
export const isObjectRecordEventProperties = (obj?: { __typename?: any } | null): obj is ObjectRecordEventProperties => {
if (!obj?.__typename) throw new Error('__typename is missing in "isObjectRecordEventProperties"')
@@ -9646,14 +9656,6 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
- const JobStatus_possibleTypes: string[] = ['JobStatus']
- export const isJobStatus = (obj?: { __typename?: any } | null): obj is JobStatus => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isJobStatus"')
- return JobStatus_possibleTypes.includes(obj.__typename)
- }
-
-
-
const AppKeyValue_possibleTypes: string[] = ['AppKeyValue']
export const isAppKeyValue = (obj?: { __typename?: any } | null): obj is AppKeyValue => {
if (!obj?.__typename) throw new Error('__typename is missing in "isAppKeyValue"')
@@ -10222,6 +10224,16 @@ export const enumNavigationMenuItemType = {
PAGE_LAYOUT: 'PAGE_LAYOUT' as const
}
+export const enumJobState = {
+ COMPLETED: 'COMPLETED' as const,
+ FAILED: 'FAILED' as const,
+ ACTIVE: 'ACTIVE' as const,
+ WAITING: 'WAITING' as const,
+ DELAYED: 'DELAYED' as const,
+ PRIORITIZED: 'PRIORITIZED' as const,
+ WAITING_CHILDREN: 'WAITING_CHILDREN' as const
+}
+
export const enumMetadataEventAction = {
CREATED: 'CREATED' as const,
UPDATED: 'UPDATED' as const,
@@ -10481,16 +10493,6 @@ export const enumWorkspaceSetupChatOutcome = {
UNAVAILABLE: 'UNAVAILABLE' as const
}
-export const enumJobState = {
- COMPLETED: 'COMPLETED' as const,
- FAILED: 'FAILED' as const,
- ACTIVE: 'ACTIVE' as const,
- WAITING: 'WAITING' as const,
- DELAYED: 'DELAYED' as const,
- PRIORITIZED: 'PRIORITIZED' as const,
- WAITING_CHILDREN: 'WAITING_CHILDREN' as const
-}
-
export const enumAppKeyValueScope = {
WORKSPACE: 'WORKSPACE' as const,
SERVER: 'SERVER' as const
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index 20a06122128..077fd7ec11c 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -52,42 +52,42 @@ export default {
143,
145,
152,
- 155,
+ 154,
157,
- 172,
- 173,
+ 159,
174,
- 182,
- 186,
- 193,
- 194,
- 201,
- 204,
- 207,
- 218,
- 235,
- 236,
+ 175,
+ 176,
+ 184,
+ 188,
+ 195,
+ 196,
+ 203,
+ 206,
+ 209,
+ 220,
+ 237,
238,
- 243,
- 246,
- 255,
- 286,
- 293,
- 301,
- 302,
+ 240,
+ 245,
+ 248,
+ 257,
+ 288,
+ 295,
303,
+ 304,
305,
- 306,
307,
308,
309,
310,
311,
- 318,
- 319,
- 322,
- 359,
- 366,
+ 312,
+ 313,
+ 320,
+ 321,
+ 324,
+ 361,
368,
370,
371,
@@ -566,7 +566,7 @@ export default {
1
],
"fields": [
- 250,
+ 252,
{
"paging": [
25,
@@ -579,7 +579,7 @@ export default {
}
],
"indexMetadatas": [
- 251,
+ 253,
{
"paging": [
25,
@@ -592,13 +592,13 @@ export default {
}
],
"fieldsList": [
- 237
+ 239
],
"indexMetadataList": [
- 245
+ 247
],
"searchFieldMetadataList": [
- 253
+ 255
],
"__typename": [
1
@@ -1640,7 +1640,7 @@ export default {
47
],
"featureFlags": [
- 185
+ 187
],
"billingSubscriptions": [
142
@@ -1655,7 +1655,7 @@ export default {
141
],
"billingEntitlements": [
- 254
+ 256
],
"hasValidSignedEnterpriseKey": [
8
@@ -1664,7 +1664,7 @@ export default {
8
],
"workspaceUrls": [
- 187
+ 189
],
"workspaceCustomApplicationId": [
1
@@ -1737,7 +1737,7 @@ export default {
33
],
"deletedWorkspaceMembers": [
- 228
+ 230
],
"hasPassword": [
8
@@ -1752,7 +1752,7 @@ export default {
50
],
"availableWorkspaces": [
- 227
+ 229
],
"__typename": [
1
@@ -3106,6 +3106,33 @@ export default {
]
},
"NavigationMenuItemType": {},
+ "JobStatus": {
+ "jobId": [
+ 1
+ ],
+ "state": [
+ 154
+ ],
+ "attemptsMade": [
+ 26
+ ],
+ "failedReason": [
+ 1
+ ],
+ "enqueuedAt": [
+ 15
+ ],
+ "startedAt": [
+ 15
+ ],
+ "finishedAt": [
+ 15
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "JobState": {},
"ObjectRecordEventProperties": {
"updatedFields": [
1
@@ -3125,7 +3152,7 @@ export default {
},
"MetadataEvent": {
"type": [
- 155
+ 157
],
"metadataName": [
1
@@ -3134,7 +3161,7 @@ export default {
1
],
"properties": [
- 153
+ 155
],
"updatedCollectionHash": [
1
@@ -3146,7 +3173,7 @@ export default {
"MetadataEventAction": {},
"ObjectRecordEvent": {
"action": [
- 157
+ 159
],
"objectNameSingular": [
1
@@ -3161,7 +3188,7 @@ export default {
1
],
"properties": [
- 153
+ 155
],
"__typename": [
1
@@ -3173,7 +3200,7 @@ export default {
1
],
"objectRecordEvent": [
- 156
+ 158
],
"__typename": [
1
@@ -3184,10 +3211,13 @@ export default {
1
],
"objectRecordEventsWithQueryIds": [
- 158
+ 160
],
"metadataEvents": [
- 154
+ 156
+ ],
+ "queueJobEvents": [
+ 153
],
"__typename": [
1
@@ -3354,7 +3384,7 @@ export default {
1
],
"dailyUsage": [
- 168
+ 170
],
"__typename": [
1
@@ -3362,19 +3392,19 @@ export default {
},
"UsageAnalytics": {
"usageByUser": [
- 167
+ 169
],
"usageByOperationType": [
- 167
+ 169
],
"usageByApplication": [
- 167
+ 169
],
"usageByModel": [
- 167
+ 169
],
"timeSeries": [
- 168
+ 170
],
"periodStart": [
4
@@ -3383,7 +3413,7 @@ export default {
4
],
"userDailyUsage": [
- 169
+ 171
],
"__typename": [
1
@@ -3394,10 +3424,10 @@ export default {
3
],
"resourceType": [
- 172
+ 174
],
"operationType": [
- 173
+ 175
],
"spenderType": [
1
@@ -3418,10 +3448,10 @@ export default {
1
],
"limitValue": [
- 174
+ 176
],
"burstValue": [
- 174
+ 176
],
"createdAt": [
4
@@ -3508,7 +3538,7 @@ export default {
1
],
"result": [
- 179
+ 181
],
"__typename": [
1
@@ -3525,7 +3555,7 @@ export default {
1
],
"connectionSecurity": [
- 182
+ 184
],
"__typename": [
1
@@ -3534,13 +3564,13 @@ export default {
"EmailConnectionSecurity": {},
"PublicImapSmtpCaldavConnectionParameters": {
"IMAP": [
- 181
+ 183
],
"SMTP": [
- 181
+ 183
],
"CALDAV": [
- 181
+ 183
],
"__typename": [
1
@@ -3596,7 +3626,7 @@ export default {
4
],
"connectionParameters": [
- 183
+ 185
],
"__typename": [
1
@@ -3604,7 +3634,7 @@ export default {
},
"FeatureFlag": {
"key": [
- 186
+ 188
],
"value": [
8
@@ -3688,7 +3718,7 @@ export default {
1
],
"versionDistribution": [
- 189
+ 191
],
"__typename": [
1
@@ -3713,10 +3743,10 @@ export default {
1
],
"type": [
- 193
+ 195
],
"status": [
- 194
+ 196
],
"issuer": [
1
@@ -3729,7 +3759,7 @@ export default {
"SSOIdentityProviderStatus": {},
"AuthProviders": {
"sso": [
- 192
+ 194
],
"google": [
8
@@ -3766,10 +3796,10 @@ export default {
3
],
"authProviders": [
- 195
+ 197
],
"authBypassProviders": [
- 196
+ 198
],
"logo": [
1
@@ -3778,7 +3808,7 @@ export default {
1
],
"workspaceUrls": [
- 187
+ 189
],
"__typename": [
1
@@ -3817,7 +3847,7 @@ export default {
1
],
"modelFamily": [
- 201
+ 203
],
"modelFamilyLabel": [
1
@@ -3832,7 +3862,7 @@ export default {
15
],
"nativeCapabilities": [
- 199
+ 201
],
"isDeprecated": [
8
@@ -3871,7 +3901,7 @@ export default {
1
],
"trialPeriods": [
- 191
+ 193
],
"__typename": [
1
@@ -3879,7 +3909,7 @@ export default {
},
"Support": {
"supportDriver": [
- 204
+ 206
],
"supportFrontChatId": [
1
@@ -3908,7 +3938,7 @@ export default {
},
"Captcha": {
"provider": [
- 207
+ 209
],
"siteKey": [
1
@@ -3945,10 +3975,10 @@ export default {
},
"PublicFeatureFlag": {
"key": [
- 186
+ 188
],
"metadata": [
- 209
+ 211
],
"__typename": [
1
@@ -3973,13 +4003,13 @@ export default {
1
],
"authProviders": [
- 195
+ 197
],
"billing": [
- 202
+ 204
],
"aiModels": [
- 200
+ 202
],
"signInPrefilled": [
8
@@ -4003,25 +4033,25 @@ export default {
8
],
"support": [
- 203
+ 205
],
"isAttachmentPreviewEnabled": [
8
],
"sentry": [
- 205
+ 207
],
"captcha": [
- 206
+ 208
],
"api": [
- 208
+ 210
],
"canManageFeatureFlags": [
8
],
"publicFeatureFlags": [
- 210
+ 212
],
"isCookieSessionEnabled": [
8
@@ -4075,7 +4105,7 @@ export default {
1
],
"maintenance": [
- 211
+ 213
],
"__typename": [
1
@@ -4151,7 +4181,7 @@ export default {
},
"AppConnection": {
"id": [
- 218
+ 220
],
"providerName": [
1
@@ -4206,7 +4236,7 @@ export default {
3
],
"type": [
- 193
+ 195
],
"issuer": [
1
@@ -4215,7 +4245,7 @@ export default {
1
],
"status": [
- 194
+ 196
],
"__typename": [
1
@@ -4234,7 +4264,7 @@ export default {
},
"FindAvailableSSOIDP": {
"type": [
- 193
+ 195
],
"id": [
3
@@ -4246,10 +4276,10 @@ export default {
1
],
"status": [
- 194
+ 196
],
"workspace": [
- 222
+ 224
],
"__typename": [
1
@@ -4260,7 +4290,7 @@ export default {
3
],
"type": [
- 193
+ 195
],
"issuer": [
1
@@ -4269,7 +4299,7 @@ export default {
1
],
"status": [
- 194
+ 196
],
"__typename": [
1
@@ -4277,7 +4307,7 @@ export default {
},
"SSOConnection": {
"type": [
- 193
+ 195
],
"id": [
3
@@ -4289,7 +4319,7 @@ export default {
1
],
"status": [
- 194
+ 196
],
"__typename": [
1
@@ -4312,13 +4342,13 @@ export default {
1
],
"workspaceUrls": [
- 187
+ 189
],
"logo": [
1
],
"sso": [
- 225
+ 227
],
"__typename": [
1
@@ -4326,10 +4356,10 @@ export default {
},
"AvailableWorkspaces": {
"availableWorkspacesForSignIn": [
- 226
+ 228
],
"availableWorkspacesForSignUp": [
- 226
+ 228
],
"__typename": [
1
@@ -4462,10 +4492,10 @@ export default {
1
],
"objectPermissions": [
- 230
+ 232
],
"fieldPermissions": [
- 231
+ 233
],
"__typename": [
1
@@ -4536,7 +4566,7 @@ export default {
1
],
"roles": [
- 232
+ 234
],
"manifest": [
9
@@ -4547,13 +4577,13 @@ export default {
},
"WorkspaceCompanyEnrichmentResult": {
"outcome": [
- 235
+ 237
],
"enrichment": [
9
],
"personOutcome": [
- 236
+ 238
],
"personEnrichment": [
9
@@ -4575,7 +4605,7 @@ export default {
1
],
"type": [
- 238
+ 240
],
"name": [
1
@@ -4638,10 +4668,10 @@ export default {
23
],
"relation": [
- 242
+ 244
],
"morphRelations": [
- 242
+ 244
],
"__typename": [
1
@@ -4667,7 +4697,7 @@ export default {
},
"FieldEdge": {
"node": [
- 237
+ 239
],
"cursor": [
27
@@ -4678,10 +4708,10 @@ export default {
},
"FieldConnection": {
"pageInfo": [
- 239
+ 241
],
"edges": [
- 240
+ 242
],
"__typename": [
1
@@ -4689,7 +4719,7 @@ export default {
},
"Relation": {
"type": [
- 243
+ 245
],
"sourceObjectMetadata": [
23
@@ -4698,10 +4728,10 @@ export default {
23
],
"sourceFieldMetadata": [
- 237
+ 239
],
"targetFieldMetadata": [
- 237
+ 239
],
"__typename": [
1
@@ -4748,7 +4778,7 @@ export default {
1
],
"indexType": [
- 246
+ 248
],
"createdAt": [
4
@@ -4757,7 +4787,7 @@ export default {
4
],
"indexFieldMetadataList": [
- 244
+ 246
],
"__typename": [
1
@@ -4766,7 +4796,7 @@ export default {
"IndexType": {},
"IndexEdge": {
"node": [
- 245
+ 247
],
"cursor": [
27
@@ -4788,10 +4818,10 @@ export default {
},
"ObjectConnection": {
"pageInfo": [
- 239
+ 241
],
"edges": [
- 248
+ 250
],
"__typename": [
1
@@ -4799,10 +4829,10 @@ export default {
},
"ObjectFieldsConnection": {
"pageInfo": [
- 239
+ 241
],
"edges": [
- 240
+ 242
],
"__typename": [
1
@@ -4810,10 +4840,10 @@ export default {
},
"ObjectIndexMetadatasConnection": {
"pageInfo": [
- 239
+ 241
],
"edges": [
- 247
+ 249
],
"__typename": [
1
@@ -4855,7 +4885,7 @@ export default {
},
"BillingEntitlement": {
"key": [
- 255
+ 257
],
"value": [
8
@@ -4893,7 +4923,7 @@ export default {
1
],
"records": [
- 256
+ 258
],
"isCustomDomainEnabled": [
8
@@ -4966,10 +4996,10 @@ export default {
},
"AvailableWorkspacesAndAccessTokens": {
"tokens": [
- 264
+ 266
],
"availableWorkspaces": [
- 227
+ 229
],
"__typename": [
1
@@ -5007,7 +5037,7 @@ export default {
},
"WorkspaceUrlsAndId": {
"workspaceUrls": [
- 187
+ 189
],
"id": [
3
@@ -5021,7 +5051,7 @@ export default {
11
],
"workspace": [
- 269
+ 271
],
"__typename": [
1
@@ -5054,7 +5084,7 @@ export default {
11
],
"workspaceUrls": [
- 187
+ 189
],
"__typename": [
1
@@ -5098,7 +5128,7 @@ export default {
},
"AuthTokens": {
"tokens": [
- 264
+ 266
],
"__typename": [
1
@@ -5139,7 +5169,7 @@ export default {
11
],
"workspace": [
- 269
+ 271
],
"__typename": [
1
@@ -5207,7 +5237,7 @@ export default {
1
],
"status": [
- 286
+ 288
],
"reason": [
1
@@ -5233,16 +5263,16 @@ export default {
},
"ApplicationExport": {
"application": [
- 284
+ 286
],
"manifest": [
9
],
"coverage": [
- 285
+ 287
],
"files": [
- 287
+ 289
],
"__typename": [
1
@@ -5278,10 +5308,10 @@ export default {
},
"CompleteApplicationFileUploadsResult": {
"files": [
- 289
+ 291
],
"errors": [
- 290
+ 292
],
"__typename": [
1
@@ -5292,7 +5322,7 @@ export default {
3
],
"fileFolder": [
- 293
+ 295
],
"filePath": [
1
@@ -5313,7 +5343,7 @@ export default {
"FileFolder": {},
"ApplicationFileUploadError": {
"fileFolder": [
- 293
+ 295
],
"filePath": [
1
@@ -5327,10 +5357,10 @@ export default {
},
"CreateApplicationFileUploadsResult": {
"targets": [
- 292
+ 294
],
"errors": [
- 294
+ 296
],
"__typename": [
1
@@ -5412,16 +5442,16 @@ export default {
1
],
"status": [
- 301
+ 303
],
"tenantStatus": [
- 302
+ 304
],
"unsubscribeHostnameStatus": [
- 303
+ 305
],
"verificationRecords": [
- 299
+ 301
],
"verifiedAt": [
4
@@ -5438,7 +5468,7 @@ export default {
3
],
"visibility": [
- 305
+ 307
],
"handle": [
1
@@ -5447,16 +5477,16 @@ export default {
1
],
"type": [
- 306
+ 308
],
"isContactAutoCreationEnabled": [
8
],
"contactAutoCreationPolicy": [
- 307
+ 309
],
"messageFolderImportPolicy": [
- 308
+ 310
],
"excludeNonProfessionalEmails": [
8
@@ -5465,7 +5495,7 @@ export default {
8
],
"pendingGroupEmailsAction": [
- 309
+ 311
],
"isSyncEnabled": [
8
@@ -5474,10 +5504,10 @@ export default {
4
],
"syncStatus": [
- 310
+ 312
],
"syncStage": [
- 311
+ 313
],
"syncStageStartedAt": [
4
@@ -5498,7 +5528,7 @@ export default {
4
],
"connectedAccount": [
- 184
+ 186
],
"__typename": [
1
@@ -5513,7 +5543,7 @@ export default {
"MessageChannelSyncStage": {},
"CreateEmailGroupChannelOutput": {
"messageChannel": [
- 304
+ 306
],
"forwardingAddress": [
1
@@ -5575,7 +5605,7 @@ export default {
26
],
"audience": [
- 313
+ 315
],
"__typename": [
1
@@ -5592,10 +5622,10 @@ export default {
1
],
"reason": [
- 318
+ 320
],
"source": [
- 319
+ 321
],
"unsubscribeTopicId": [
3
@@ -5608,7 +5638,7 @@ export default {
"MessageSuppressionSource": {},
"MessageSuppressionList": {
"records": [
- 317
+ 319
],
"totalCount": [
26
@@ -5634,7 +5664,7 @@ export default {
1
],
"visibility": [
- 322
+ 324
],
"__typename": [
1
@@ -5680,7 +5710,7 @@ export default {
1
],
"location": [
- 324
+ 326
],
"__typename": [
1
@@ -5697,7 +5727,7 @@ export default {
1
],
"connectionSecurity": [
- 182
+ 184
],
"__typename": [
1
@@ -5708,13 +5738,13 @@ export default {
1
],
"IMAP": [
- 326
+ 328
],
"SMTP": [
- 326
+ 328
],
"CALDAV": [
- 326
+ 328
],
"__typename": [
1
@@ -5734,7 +5764,7 @@ export default {
3
],
"connectionParameters": [
- 327
+ 329
],
"__typename": [
1
@@ -5959,7 +5989,7 @@ export default {
1
],
"series": [
- 336
+ 338
],
"xAxisLabel": [
1
@@ -6008,7 +6038,7 @@ export default {
1
],
"data": [
- 338
+ 340
],
"__typename": [
1
@@ -6016,7 +6046,7 @@ export default {
},
"LineChartData": {
"series": [
- 339
+ 341
],
"xAxisLabel": [
1
@@ -6053,7 +6083,7 @@ export default {
},
"PieChartData": {
"data": [
- 341
+ 343
],
"showLegend": [
8
@@ -6158,13 +6188,13 @@ export default {
},
"EventLogQueryResult": {
"records": [
- 346
+ 348
],
"totalCount": [
26
],
"pageInfo": [
- 347
+ 349
],
"__typename": [
1
@@ -6228,7 +6258,7 @@ export default {
1
],
"parts": [
- 332
+ 334
],
"processedAt": [
4
@@ -6242,7 +6272,7 @@ export default {
},
"AgentChatThread": {
"id": [
- 218
+ 220
],
"title": [
1
@@ -6297,7 +6327,7 @@ export default {
},
"AiSystemPromptPreview": {
"sections": [
- 352
+ 354
],
"estimatedTokenCount": [
26
@@ -6325,7 +6355,7 @@ export default {
26
],
"error": [
- 354
+ 356
],
"__typename": [
1
@@ -6358,10 +6388,10 @@ export default {
},
"StartWorkspaceSetupChatResult": {
"outcome": [
- 359
+ 361
],
"thread": [
- 351
+ 353
],
"__typename": [
1
@@ -6399,10 +6429,10 @@ export default {
3
],
"evaluations": [
- 360
+ 362
],
"messages": [
- 350
+ 352
],
"createdAt": [
4
@@ -6456,33 +6486,6 @@ export default {
1
]
},
- "JobStatus": {
- "jobId": [
- 1
- ],
- "state": [
- 366
- ],
- "attemptsMade": [
- 26
- ],
- "failedReason": [
- 1
- ],
- "enqueuedAt": [
- 15
- ],
- "startedAt": [
- 15
- ],
- "finishedAt": [
- 15
- ],
- "__typename": [
- 1
- ]
- },
- "JobState": {},
"AppKeyValue": {
"key": [
1
@@ -6822,7 +6825,7 @@ export default {
147
],
"getUsageAnalytics": [
- 170,
+ 172,
{
"input": [
387
@@ -6830,7 +6833,7 @@ export default {
}
],
"usageLimits": [
- 171
+ 173
],
"getViewFilterGroups": [
54,
@@ -6956,10 +6959,10 @@ export default {
}
],
"currentUserSessions": [
- 160
+ 162
],
"myConnectedAccounts": [
- 184
+ 186
],
"applicationConnectionProviders": [
126,
@@ -6971,7 +6974,7 @@ export default {
}
],
"billingPortalSession": [
- 165,
+ 167,
{
"returnUrlPath": [
1
@@ -6982,19 +6985,19 @@ export default {
}
],
"listPlans": [
- 163
+ 165
],
"getResourceCreditUsage": [
- 162
+ 164
],
"getInviteSuggestions": [
- 176
+ 178
],
"findWorkspaceInvitations": [
- 179
+ 181
],
"getApprovedAccessDomains": [
- 175
+ 177
],
"getPageLayoutTabs": [
122,
@@ -7065,7 +7068,7 @@ export default {
}
],
"objects": [
- 249,
+ 251,
{
"paging": [
25,
@@ -7087,7 +7090,7 @@ export default {
}
],
"objectRecordCounts": [
- 252
+ 254
],
"mostlyEmptyFieldMetadataIds": [
3,
@@ -7156,7 +7159,7 @@ export default {
68
],
"getPublicWorkspaceDataByDomain": [
- 197,
+ 199,
{
"origin": [
1
@@ -7164,7 +7167,7 @@ export default {
}
],
"getPublicWorkspaceDataById": [
- 198,
+ 200,
{
"id": [
3,
@@ -7173,7 +7176,7 @@ export default {
}
],
"findApplicationRegistrationByClientId": [
- 215,
+ 217,
{
"clientId": [
1,
@@ -7203,7 +7206,7 @@ export default {
}
],
"findApplicationRegistrationStats": [
- 190,
+ 192,
{
"id": [
1,
@@ -7212,7 +7215,7 @@ export default {
}
],
"findApplicationRegistrationVariables": [
- 188,
+ 190,
{
"applicationRegistrationId": [
1,
@@ -7230,7 +7233,7 @@ export default {
}
],
"findClaimableApplicationRegistration": [
- 213,
+ 215,
{
"sourcePackage": [
1
@@ -7264,7 +7267,7 @@ export default {
}
],
"findManyMarketplaceApps": [
- 229,
+ 231,
{
"universalIdentifiers": [
1,
@@ -7273,7 +7276,7 @@ export default {
}
],
"findMarketplaceAppDetail": [
- 233,
+ 235,
{
"universalIdentifier": [
1,
@@ -7282,7 +7285,7 @@ export default {
}
],
"publicMarketplaceApps": [
- 229,
+ 231,
{
"isVetted": [
8,
@@ -7291,7 +7294,7 @@ export default {
}
],
"publicMarketplaceAppDetail": [
- 233,
+ 235,
{
"universalIdentifier": [
1,
@@ -7300,7 +7303,7 @@ export default {
}
],
"fields": [
- 241,
+ 243,
{
"paging": [
25,
@@ -7313,7 +7316,7 @@ export default {
}
],
"field": [
- 237,
+ 239,
{
"id": [
3,
@@ -7342,7 +7345,7 @@ export default {
46
],
"previewMessageCampaignAudience": [
- 313,
+ 315,
{
"input": [
392,
@@ -7351,7 +7354,7 @@ export default {
}
],
"messageSuppressions": [
- 320,
+ 322,
{
"input": [
393,
@@ -7360,10 +7363,10 @@ export default {
}
],
"unsubscribeTopics": [
- 321
+ 323
],
"myMessageChannels": [
- 304,
+ 306,
{
"connectedAccountId": [
3
@@ -7371,10 +7374,10 @@ export default {
}
],
"getEmailingDomains": [
- 300
+ 302
],
"getToolIndex": [
- 331
+ 333
],
"getToolInputSchema": [
9,
@@ -7386,10 +7389,10 @@ export default {
}
],
"webhooks": [
- 330
+ 332
],
"webhook": [
- 330,
+ 332,
{
"id": [
3,
@@ -7429,7 +7432,7 @@ export default {
}
],
"getJobs": [
- 365,
+ 153,
{
"jobIds": [
1,
@@ -7438,7 +7441,7 @@ export default {
}
],
"appConnections": [
- 217,
+ 219,
{
"filter": [
394
@@ -7446,22 +7449,22 @@ export default {
}
],
"appConnection": [
- 217,
+ 219,
{
"id": [
- 218,
+ 220,
"ID!"
]
}
],
"findWorkspaceAiStats": [
- 362
+ 364
],
"chatThreads": [
- 351
+ 353
],
"chatThread": [
- 351,
+ 353,
{
"id": [
3,
@@ -7470,7 +7473,7 @@ export default {
}
],
"chatMessages": [
- 350,
+ 352,
{
"threadId": [
3,
@@ -7479,7 +7482,7 @@ export default {
}
],
"chatStreamCatchupChunks": [
- 355,
+ 357,
{
"threadId": [
3,
@@ -7488,13 +7491,13 @@ export default {
}
],
"getAiSystemPromptPreview": [
- 353
+ 355
],
"skills": [
- 349
+ 351
],
"skill": [
- 349,
+ 351,
{
"id": [
3,
@@ -7503,7 +7506,7 @@ export default {
}
],
"agentTurns": [
- 361,
+ 363,
{
"agentId": [
3,
@@ -7524,7 +7527,7 @@ export default {
}
],
"checkUserExists": [
- 279,
+ 281,
{
"email": [
1,
@@ -7536,7 +7539,7 @@ export default {
}
],
"checkWorkspaceInviteHashIsValid": [
- 280,
+ 282,
{
"inviteHash": [
1,
@@ -7554,7 +7557,7 @@ export default {
}
],
"checkWorkspaceSubdomainAvailability": [
- 274,
+ 276,
{
"subdomain": [
1,
@@ -7563,10 +7566,10 @@ export default {
}
],
"getWorkspaceCreationDefaults": [
- 275
+ 277
],
"validatePasswordResetToken": [
- 272,
+ 274,
{
"passwordResetToken": [
1,
@@ -7578,10 +7581,10 @@ export default {
71
],
"getSSOIdentityProviders": [
- 223
+ 225
],
"eventLogs": [
- 348,
+ 350,
{
"input": [
396,
@@ -7590,7 +7593,7 @@ export default {
}
],
"pieChartData": [
- 342,
+ 344,
{
"input": [
400,
@@ -7599,7 +7602,7 @@ export default {
}
],
"lineChartData": [
- 340,
+ 342,
{
"input": [
401,
@@ -7608,7 +7611,7 @@ export default {
}
],
"barChartData": [
- 337,
+ 339,
{
"input": [
402,
@@ -7626,7 +7629,7 @@ export default {
}
],
"getConnectedImapSmtpCaldavAccount": [
- 328,
+ 330,
{
"id": [
3,
@@ -7635,7 +7638,7 @@ export default {
}
],
"getAutoCompleteAddress": [
- 323,
+ 325,
{
"address": [
1,
@@ -7654,7 +7657,7 @@ export default {
}
],
"getAddressDetails": [
- 325,
+ 327,
{
"placeId": [
1,
@@ -7667,10 +7670,10 @@ export default {
}
],
"findManyPublicDomains": [
- 298
+ 300
],
"exportApplication": [
- 288,
+ 290,
{
"universalIdentifier": [
3,
@@ -7679,7 +7682,7 @@ export default {
}
],
"currentUserApplicationAuthorizations": [
- 283
+ 285
],
"__typename": [
1
@@ -7696,7 +7699,7 @@ export default {
1
],
"operationTypes": [
- 173
+ 175
],
"__typename": [
1
@@ -7758,7 +7761,7 @@ export default {
},
"LogicFunctionIdInput": {
"id": [
- 218
+ 220
],
"__typename": [
1
@@ -7777,7 +7780,7 @@ export default {
},
"FindMessageSuppressionsInput": {
"reason": [
- 318
+ 320
],
"searchTerm": [
1
@@ -7990,7 +7993,7 @@ export default {
"Float!"
],
"fileFolder": [
- 293,
+ 295,
"FileFolder!"
],
"fieldMetadataId": [
@@ -8057,7 +8060,7 @@ export default {
}
],
"upsertUsageLimit": [
- 171,
+ 173,
{
"input": [
410,
@@ -8387,7 +8390,7 @@ export default {
26
],
"deleteConnectedAccount": [
- 184,
+ 186,
{
"id": [
3,
@@ -8413,7 +8416,7 @@ export default {
}
],
"checkoutSession": [
- 165,
+ 167,
{
"recurringInterval": [
134,
@@ -8433,7 +8436,7 @@ export default {
}
],
"createSubscriptionPaymentIntent": [
- 164,
+ 166,
{
"recurringInterval": [
134,
@@ -8457,22 +8460,22 @@ export default {
}
],
"createBillingPaymentMethodSetupIntent": [
- 164
+ 166
],
"switchSubscriptionInterval": [
- 166
+ 168
],
"switchBillingPlan": [
- 166
+ 168
],
"cancelSwitchBillingPlan": [
- 166
+ 168
],
"cancelSwitchBillingInterval": [
- 166
+ 168
],
"setResourceCreditSubscriptionPrice": [
- 166,
+ 168,
{
"priceId": [
1,
@@ -8481,13 +8484,13 @@ export default {
}
],
"endSubscriptionTrialPeriod": [
- 161
+ 163
],
"cancelSwitchResourceCreditPrice": [
- 166
+ 168
],
"skipSyncEmailOnboardingStep": [
- 178,
+ 180,
{
"isAutoSkipped": [
8,
@@ -8496,7 +8499,7 @@ export default {
}
],
"completeBookCallOnboardingStep": [
- 178,
+ 180,
{
"hasBookedCall": [
8,
@@ -8509,7 +8512,7 @@ export default {
}
],
"triggerInstallAppsOnboardingStep": [
- 178,
+ 180,
{
"universalIdentifiers": [
1,
@@ -8522,7 +8525,7 @@ export default {
}
],
"goBackToPreviousOnboardingStep": [
- 177
+ 179
],
"deleteWorkspaceInvitation": [
1,
@@ -8534,7 +8537,7 @@ export default {
}
],
"resendWorkspaceInvitation": [
- 180,
+ 182,
{
"appTokenId": [
1,
@@ -8543,7 +8546,7 @@ export default {
}
],
"sendInvitations": [
- 180,
+ 182,
{
"emails": [
1,
@@ -8555,7 +8558,7 @@ export default {
}
],
"createApprovedAccessDomain": [
- 175,
+ 177,
{
"input": [
447,
@@ -8573,7 +8576,7 @@ export default {
}
],
"validateApprovedAccessDomain": [
- 175,
+ 177,
{
"input": [
449,
@@ -8769,7 +8772,7 @@ export default {
}
],
"createOneIndex": [
- 245,
+ 247,
{
"input": [
467,
@@ -8778,7 +8781,7 @@ export default {
}
],
"deleteOneIndex": [
- 245,
+ 247,
{
"input": [
470,
@@ -8907,10 +8910,10 @@ export default {
68
],
"checkCustomDomainValidRecords": [
- 257
+ 259
],
"enrichWorkspaceCompany": [
- 234
+ 236
],
"upgradeApplication": [
8,
@@ -8926,7 +8929,7 @@ export default {
}
],
"createApplicationRegistration": [
- 214,
+ 216,
{
"input": [
482,
@@ -8953,7 +8956,7 @@ export default {
}
],
"rotateApplicationRegistrationClientSecret": [
- 216,
+ 218,
{
"id": [
1,
@@ -8962,7 +8965,7 @@ export default {
}
],
"createApplicationRegistrationVariable": [
- 188,
+ 190,
{
"input": [
485,
@@ -8971,7 +8974,7 @@ export default {
}
],
"updateApplicationRegistrationVariable": [
- 188,
+ 190,
{
"input": [
486,
@@ -9072,7 +9075,7 @@ export default {
8
],
"createOneField": [
- 237,
+ 239,
{
"input": [
489,
@@ -9081,7 +9084,7 @@ export default {
}
],
"updateOneField": [
- 237,
+ 239,
{
"input": [
491,
@@ -9090,7 +9093,7 @@ export default {
}
],
"deleteOneField": [
- 237,
+ 239,
{
"input": [
493,
@@ -9220,7 +9223,7 @@ export default {
}
],
"upsertRowLevelPermissionPredicates": [
- 258,
+ 260,
{
"input": [
507,
@@ -9251,7 +9254,7 @@ export default {
}
],
"sendEmailViaEmailingDomain": [
- 315,
+ 317,
{
"input": [
510,
@@ -9260,7 +9263,7 @@ export default {
}
],
"sendMessageCampaign": [
- 316,
+ 318,
{
"input": [
511,
@@ -9269,7 +9272,7 @@ export default {
}
],
"cancelMessageCampaign": [
- 314,
+ 316,
{
"input": [
512,
@@ -9278,7 +9281,7 @@ export default {
}
],
"sendMessageCampaignTest": [
- 315,
+ 317,
{
"input": [
513,
@@ -9287,7 +9290,7 @@ export default {
}
],
"createMessageSuppression": [
- 317,
+ 319,
{
"input": [
514,
@@ -9305,7 +9308,7 @@ export default {
}
],
"createUnsubscribeTopic": [
- 321,
+ 323,
{
"input": [
515,
@@ -9314,7 +9317,7 @@ export default {
}
],
"updateUnsubscribeTopic": [
- 321,
+ 323,
{
"input": [
516,
@@ -9332,7 +9335,7 @@ export default {
}
],
"updateMessageChannel": [
- 304,
+ 306,
{
"input": [
517,
@@ -9341,7 +9344,7 @@ export default {
}
],
"createEmailGroupChannel": [
- 312,
+ 314,
{
"input": [
519,
@@ -9350,7 +9353,7 @@ export default {
}
],
"updateEmailGroupChannel": [
- 304,
+ 306,
{
"input": [
520,
@@ -9359,7 +9362,7 @@ export default {
}
],
"deleteEmailGroupChannel": [
- 304,
+ 306,
{
"id": [
3,
@@ -9368,7 +9371,7 @@ export default {
}
],
"createEmailingDomain": [
- 300,
+ 302,
{
"input": [
521,
@@ -9386,7 +9389,7 @@ export default {
}
],
"verifyEmailingDomain": [
- 300,
+ 302,
{
"id": [
1,
@@ -9395,7 +9398,7 @@ export default {
}
],
"runAgent": [
- 333,
+ 335,
{
"input": [
522,
@@ -9404,7 +9407,7 @@ export default {
}
],
"createWebhook": [
- 330,
+ 332,
{
"input": [
525,
@@ -9413,7 +9416,7 @@ export default {
}
],
"updateWebhook": [
- 330,
+ 332,
{
"input": [
526,
@@ -9422,7 +9425,7 @@ export default {
}
],
"deleteWebhook": [
- 330,
+ 332,
{
"id": [
3,
@@ -9479,7 +9482,7 @@ export default {
}
],
"enqueueJob": [
- 363,
+ 365,
{
"input": [
534,
@@ -9488,7 +9491,7 @@ export default {
}
],
"enqueueJobs": [
- 364,
+ 366,
{
"input": [
535,
@@ -9497,10 +9500,10 @@ export default {
}
],
"createChatThread": [
- 351
+ 353
],
"sendChatMessage": [
- 356,
+ 358,
{
"threadId": [
3,
@@ -9527,7 +9530,7 @@ export default {
}
],
"retryChatMessage": [
- 356,
+ 358,
{
"threadId": [
3,
@@ -9539,7 +9542,7 @@ export default {
}
],
"answerAgentChatQuestion": [
- 356,
+ 358,
{
"threadId": [
3,
@@ -9572,7 +9575,7 @@ export default {
}
],
"renameChatThread": [
- 351,
+ 353,
{
"id": [
3,
@@ -9585,7 +9588,7 @@ export default {
}
],
"archiveChatThread": [
- 351,
+ 353,
{
"id": [
3,
@@ -9594,7 +9597,7 @@ export default {
}
],
"unarchiveChatThread": [
- 351,
+ 353,
{
"id": [
3,
@@ -9621,7 +9624,7 @@ export default {
}
],
"startWorkspaceSetupChat": [
- 358,
+ 360,
{
"companyContext": [
9
@@ -9632,7 +9635,7 @@ export default {
}
],
"createSkill": [
- 349,
+ 351,
{
"input": [
539,
@@ -9641,7 +9644,7 @@ export default {
}
],
"updateSkill": [
- 349,
+ 351,
{
"input": [
540,
@@ -9650,7 +9653,7 @@ export default {
}
],
"deleteSkill": [
- 349,
+ 351,
{
"id": [
3,
@@ -9659,7 +9662,7 @@ export default {
}
],
"activateSkill": [
- 349,
+ 351,
{
"id": [
3,
@@ -9668,7 +9671,7 @@ export default {
}
],
"deactivateSkill": [
- 349,
+ 351,
{
"id": [
3,
@@ -9677,7 +9680,7 @@ export default {
}
],
"evaluateAgentTurn": [
- 360,
+ 362,
{
"turnId": [
3,
@@ -9686,7 +9689,7 @@ export default {
}
],
"runEvaluationInput": [
- 361,
+ 363,
{
"agentId": [
3,
@@ -9717,7 +9720,7 @@ export default {
}
],
"getAuthorizationUrlForSSO": [
- 267,
+ 269,
{
"input": [
542,
@@ -9726,7 +9729,7 @@ export default {
}
],
"getLoginTokenFromCredentials": [
- 278,
+ 280,
{
"email": [
1,
@@ -9752,7 +9755,7 @@ export default {
}
],
"signIn": [
- 265,
+ 267,
{
"email": [
1,
@@ -9774,7 +9777,7 @@ export default {
}
],
"verifyEmailAndGetLoginToken": [
- 273,
+ 275,
{
"emailVerificationToken": [
1,
@@ -9794,7 +9797,7 @@ export default {
}
],
"verifyEmailAndGetWorkspaceAgnosticToken": [
- 265,
+ 267,
{
"emailVerificationToken": [
1,
@@ -9810,7 +9813,7 @@ export default {
}
],
"getAuthTokensFromOTP": [
- 277,
+ 279,
{
"otp": [
1,
@@ -9830,7 +9833,7 @@ export default {
}
],
"signUp": [
- 265,
+ 267,
{
"email": [
1,
@@ -9852,7 +9855,7 @@ export default {
}
],
"signUpInWorkspace": [
- 270,
+ 272,
{
"email": [
1,
@@ -9883,7 +9886,7 @@ export default {
}
],
"signUpInNewWorkspace": [
- 270,
+ 272,
{
"input": [
543
@@ -9904,10 +9907,10 @@ export default {
}
],
"generateTransientToken": [
- 271
+ 273
],
"getAuthTokensFromLoginToken": [
- 277,
+ 279,
{
"loginToken": [
1,
@@ -9920,7 +9923,7 @@ export default {
}
],
"getAuthTokensFromSSOExchangeToken": [
- 277,
+ 279,
{
"ssoExchangeToken": [
1,
@@ -9929,7 +9932,7 @@ export default {
}
],
"authorizeApp": [
- 263,
+ 265,
{
"clientId": [
1,
@@ -9954,7 +9957,7 @@ export default {
}
],
"renewToken": [
- 277,
+ 279,
{
"appToken": [
1,
@@ -9971,7 +9974,7 @@ export default {
}
],
"generateApiKeyToken": [
- 276,
+ 278,
{
"apiKeyId": [
3,
@@ -9987,7 +9990,7 @@ export default {
11
],
"emailPasswordResetLink": [
- 266,
+ 268,
{
"email": [
1,
@@ -10002,7 +10005,7 @@ export default {
}
],
"updatePasswordViaResetToken": [
- 268,
+ 270,
{
"passwordResetToken": [
1,
@@ -10015,7 +10018,7 @@ export default {
}
],
"initiateOTPProvisioning": [
- 261,
+ 263,
{
"loginToken": [
1,
@@ -10028,10 +10031,10 @@ export default {
}
],
"initiateOTPProvisioningForAuthenticatedUser": [
- 261
+ 263
],
"deleteTwoFactorAuthenticationMethod": [
- 260,
+ 262,
{
"twoFactorAuthenticationMethodId": [
3,
@@ -10040,7 +10043,7 @@ export default {
}
],
"verifyTwoFactorAuthenticationMethodForAuthenticatedUser": [
- 262,
+ 264,
{
"otp": [
1,
@@ -10082,7 +10085,7 @@ export default {
}
],
"resendEmailVerificationToken": [
- 219,
+ 221,
{
"email": [
1,
@@ -10095,7 +10098,7 @@ export default {
}
],
"createOIDCIdentityProvider": [
- 224,
+ 226,
{
"input": [
545,
@@ -10104,7 +10107,7 @@ export default {
}
],
"createSAMLIdentityProvider": [
- 224,
+ 226,
{
"input": [
546,
@@ -10113,7 +10116,7 @@ export default {
}
],
"deleteSSOIdentityProvider": [
- 220,
+ 222,
{
"input": [
547,
@@ -10122,7 +10125,7 @@ export default {
}
],
"editSSOIdentityProvider": [
- 221,
+ 223,
{
"input": [
548,
@@ -10131,7 +10134,7 @@ export default {
}
],
"createObjectEvent": [
- 345,
+ 347,
{
"event": [
1,
@@ -10151,7 +10154,7 @@ export default {
}
],
"trackAnalytics": [
- 345,
+ 347,
{
"type": [
549,
@@ -10169,7 +10172,7 @@ export default {
}
],
"duplicateDashboard": [
- 343,
+ 345,
{
"id": [
3,
@@ -10178,7 +10181,7 @@ export default {
}
],
"impersonate": [
- 281,
+ 283,
{
"userId": [
3,
@@ -10191,10 +10194,10 @@ export default {
}
],
"stopImpersonation": [
- 282
+ 284
],
"createCalendarEvent": [
- 335,
+ 337,
{
"input": [
550,
@@ -10203,7 +10206,7 @@ export default {
}
],
"sendEmail": [
- 344,
+ 346,
{
"input": [
551,
@@ -10212,7 +10215,7 @@ export default {
}
],
"startChannelSync": [
- 334,
+ 336,
{
"connectedAccountId": [
3,
@@ -10221,7 +10224,7 @@ export default {
}
],
"saveImapSmtpCaldavAccount": [
- 329,
+ 331,
{
"handle": [
1,
@@ -10237,7 +10240,7 @@ export default {
}
],
"updateLabPublicFeatureFlag": [
- 185,
+ 187,
{
"input": [
555,
@@ -10246,7 +10249,7 @@ export default {
}
],
"createPublicDomain": [
- 298,
+ 300,
{
"domain": [
1,
@@ -10268,7 +10271,7 @@ export default {
}
],
"checkPublicDomainValidRecords": [
- 257,
+ 259,
{
"domain": [
1,
@@ -10277,7 +10280,7 @@ export default {
}
],
"createDevelopmentApplication": [
- 296,
+ 298,
{
"universalIdentifier": [
1,
@@ -10290,7 +10293,7 @@ export default {
}
],
"syncApplication": [
- 297,
+ 299,
{
"manifest": [
9,
@@ -10305,7 +10308,7 @@ export default {
}
],
"uploadApplicationFile": [
- 289,
+ 291,
{
"file": [
409,
@@ -10316,7 +10319,7 @@ export default {
"String!"
],
"fileFolder": [
- 293,
+ 295,
"FileFolder!"
],
"filePath": [
@@ -10326,7 +10329,7 @@ export default {
}
],
"createApplicationFileUploads": [
- 295,
+ 297,
{
"applicationUniversalIdentifier": [
1,
@@ -10339,7 +10342,7 @@ export default {
}
],
"completeApplicationFileUploads": [
- 291,
+ 293,
{
"applicationUniversalIdentifier": [
1,
@@ -10491,10 +10494,10 @@ export default {
"Upload": {},
"UpsertUsageLimitInput": {
"resourceType": [
- 172
+ 174
],
"operationType": [
- 173
+ 175
],
"spenderType": [
1
@@ -10515,10 +10518,10 @@ export default {
1
],
"limitValue": [
- 174
+ 176
],
"burstValue": [
- 174
+ 176
],
"__typename": [
1
@@ -11642,7 +11645,7 @@ export default {
469
],
"indexType": [
- 246
+ 248
],
"__typename": [
1
@@ -12106,7 +12109,7 @@ export default {
},
"CreateFieldInput": {
"type": [
- 238
+ 240
],
"name": [
1
@@ -12630,7 +12633,7 @@ export default {
1
],
"visibility": [
- 322
+ 324
],
"__typename": [
1
@@ -12647,7 +12650,7 @@ export default {
1
],
"visibility": [
- 322
+ 324
],
"__typename": [
1
@@ -12666,16 +12669,16 @@ export default {
},
"UpdateMessageChannelInputUpdates": {
"visibility": [
- 305
+ 307
],
"isContactAutoCreationEnabled": [
8
],
"contactAutoCreationPolicy": [
- 307
+ 309
],
"messageFolderImportPolicy": [
- 308
+ 310
],
"isSyncEnabled": [
8
@@ -13100,7 +13103,7 @@ export default {
3
],
"status": [
- 194
+ 196
],
"__typename": [
1
@@ -13222,7 +13225,7 @@ export default {
1
],
"connectionSecurity": [
- 182
+ 184
],
"__typename": [
1
@@ -13241,7 +13244,7 @@ export default {
},
"ApplicationFileUploadRequestInput": {
"fileFolder": [
- 293
+ 295
],
"filePath": [
1
@@ -13255,7 +13258,7 @@ export default {
},
"Subscription": {
"onEventSubscription": [
- 159,
+ 161,
{
"eventStreamId": [
1,
@@ -13264,7 +13267,7 @@ export default {
}
],
"logicFunctionLogs": [
- 259,
+ 261,
{
"input": [
558,
@@ -13273,7 +13276,7 @@ export default {
}
],
"onAgentChatEvent": [
- 357,
+ 359,
{
"threadId": [
3,
@@ -13282,7 +13285,7 @@ export default {
}
],
"eventLogsLive": [
- 346,
+ 348,
{
"table": [
397,
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 14a28d6143f..ad64cf75eea 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -1918,6 +1918,7 @@ export type EventSubscription = {
eventStreamId: Scalars['String']['output'];
metadataEvents: Array<MetadataEvent>;
objectRecordEventsWithQueryIds: Array<ObjectRecordEventWithQueryIds>;
+ queueJobEvents: Array<JobStatus>;
};
export type ExecuteOneLogicFunctionInput = {
@@ -9263,7 +9264,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 } }> } | 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, 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 }> }> };
@@ -9871,7 +9872,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"}}]}}]}}]}}]}}]} 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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"fastModel"}},{"kind":"Field","name":{"kind":"Name","value":"smartModel"}},{"kind":"Field","name":{"kind":"Name","value":"aiAdditionalInstructions"}},{"kind":"Field","name":{"kind":"Name","value":"enabledAiModelIds"}},{"kind":"Field","name":{"kind":"Name","value":"useRecommendedModels"}},{"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/queue-job/constants/QueueJobBrowserEventName.ts b/packages/twenty-front/src/modules/queue-job/constants/QueueJobBrowserEventName.ts
new file mode 100644
index 00000000000..61b2b3afebe
--- /dev/null
+++ b/packages/twenty-front/src/modules/queue-job/constants/QueueJobBrowserEventName.ts
@@ -0,0 +1 @@
+export const QUEUE_JOB_BROWSER_EVENT_NAME = 'queue-job-browser-event';
diff --git a/packages/twenty-front/src/modules/queue-job/hooks/__tests__/useListenToQueueJob.test.tsx b/packages/twenty-front/src/modules/queue-job/hooks/__tests__/useListenToQueueJob.test.tsx
new file mode 100644
index 00000000000..733e4f73cd8
--- /dev/null
+++ b/packages/twenty-front/src/modules/queue-job/hooks/__tests__/useListenToQueueJob.test.tsx
@@ -0,0 +1,43 @@
+import { renderHook } from '@testing-library/react';
+
+import { dispatchBrowserEvent } from '@/browser-event/utils/dispatchBrowserEvent';
+import { QUEUE_JOB_BROWSER_EVENT_NAME } from '@/queue-job/constants/QueueJobBrowserEventName';
+import { useListenToQueueJob } from '@/queue-job/hooks/useListenToQueueJob';
+import { JobState, type JobStatus } from '~/generated-metadata/graphql';
+
+const JOB_ID = 'job-1';
+
+const dispatchQueueJobEvent = (jobId: string, state: JobState) => {
+ dispatchBrowserEvent<JobStatus>(QUEUE_JOB_BROWSER_EVENT_NAME, {
+ jobId,
+ state,
+ attemptsMade: 1,
+ enqueuedAt: 1,
+ });
+};
+
+describe('useListenToQueueJob', () => {
+ it('only forwards state changes of the listened job', () => {
+ const onQueueJobEvent = jest.fn();
+
+ renderHook(() => useListenToQueueJob({ jobId: JOB_ID, onQueueJobEvent }));
+
+ dispatchQueueJobEvent('job-2', JobState.COMPLETED);
+ dispatchQueueJobEvent(JOB_ID, JobState.FAILED);
+
+ expect(onQueueJobEvent).toHaveBeenCalledTimes(1);
+ expect(onQueueJobEvent).toHaveBeenCalledWith(
+ expect.objectContaining({ jobId: JOB_ID, state: JobState.FAILED }),
+ );
+ });
+
+ it('ignores events without a job id', () => {
+ const onQueueJobEvent = jest.fn();
+
+ renderHook(() => useListenToQueueJob({ onQueueJobEvent }));
+
+ dispatchQueueJobEvent(JOB_ID, JobState.COMPLETED);
+
+ expect(onQueueJobEvent).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-front/src/modules/queue-job/hooks/useListenToQueueJob.ts b/packages/twenty-front/src/modules/queue-job/hooks/useListenToQueueJob.ts
new file mode 100644
index 00000000000..2a736cd2066
--- /dev/null
+++ b/packages/twenty-front/src/modules/queue-job/hooks/useListenToQueueJob.ts
@@ -0,0 +1,35 @@
+import { useListenToBrowserEvent } from '@/browser-event/hooks/useListenToBrowserEvent';
+import { QUEUE_JOB_BROWSER_EVENT_NAME } from '@/queue-job/constants/QueueJobBrowserEventName';
+import { useCallback } from 'react';
+import { isDefined } from 'twenty-shared/utils';
+import { type JobStatus } from '~/generated-metadata/graphql';
+
+type UseListenToQueueJobArgs = {
+ jobId?: string;
+ onQueueJobEvent: (jobStatus: JobStatus) => void;
+};
+
+export const useListenToQueueJob = ({
+ jobId,
+ onQueueJobEvent,
+}: UseListenToQueueJobArgs) => {
+ const handleQueueJobEvent = useCallback(
+ (jobStatus?: JobStatus) => {
+ if (
+ !isDefined(jobId) ||
+ !isDefined(jobStatus) ||
+ jobStatus.jobId !== jobId
+ ) {
+ return;
+ }
+
+ onQueueJobEvent(jobStatus);
+ },
+ [jobId, onQueueJobEvent],
+ );
+
+ useListenToBrowserEvent<JobStatus>({
+ eventName: QUEUE_JOB_BROWSER_EVENT_NAME,
+ onBrowserEvent: handleQueueJobEvent,
+ });
+};
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 85b2af8cd24..e2479e2f8c9 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
@@ -32,6 +32,15 @@ export const ON_EVENT_SUBSCRIPTION = gql`
diff
}
}
+ queueJobEvents {
+ jobId
+ state
+ attemptsMade
+ failedReason
+ enqueuedAt
+ startedAt
+ finishedAt
+ }
}
}
`;
diff --git a/packages/twenty-front/src/modules/sse-db-event/hooks/useTriggerEventStreamCreation.ts b/packages/twenty-front/src/modules/sse-db-event/hooks/useTriggerEventStreamCreation.ts
index 09bb58a46b9..4508fd1c6f8 100644
--- a/packages/twenty-front/src/modules/sse-db-event/hooks/useTriggerEventStreamCreation.ts
+++ b/packages/twenty-front/src/modules/sse-db-event/hooks/useTriggerEventStreamCreation.ts
@@ -1,4 +1,5 @@
import { dispatchBrowserEvent } from '@/browser-event/utils/dispatchBrowserEvent';
+import { dispatchQueueJobEventsFromSseToBrowserEvents } from '@/sse-db-event/utils/dispatchQueueJobEventsFromSseToBrowserEvents';
import { SSE_CLIENT_RECONNECTED_EVENT_NAME } from '@/sse-db-event/constants/SseClientReconnectedEventName';
import { ON_EVENT_SUBSCRIPTION } from '@/sse-db-event/graphql/subscriptions/OnEventSubscription';
import { useDispatchMetadataEventsFromSseToBrowserEvents } from '@/sse-db-event/hooks/useDispatchMetadataEventsFromSseToBrowserEvents';
@@ -135,12 +136,16 @@ export const useTriggerEventStreamCreation = () => {
const metadataEvents = eventSubscription?.metadataEvents ?? [];
+ const queueJobEvents = eventSubscription?.queueJobEvents ?? [];
+
const objectRecordEvents = objectRecordEventsWithQueryIds.map(
(item) => item.objectRecordEvent,
);
dispatchMetadataEventsFromSseToBrowserEvents(metadataEvents);
+ dispatchQueueJobEventsFromSseToBrowserEvents(queueJobEvents);
+
triggerOptimisticEffectFromSseEvents({
objectRecordEvents,
});
@@ -200,8 +205,13 @@ export const useTriggerEventStreamCreation = () => {
const metadataEvents =
result?.data?.onEventSubscription?.metadataEvents ?? [];
+ const queueJobEvents =
+ result?.data?.onEventSubscription?.queueJobEvents ?? [];
+
dispatchMetadataEventsFromSseToBrowserEvents(metadataEvents);
+ dispatchQueueJobEventsFromSseToBrowserEvents(queueJobEvents);
+
triggerOptimisticEffectFromSseEvents({
objectRecordEvents,
});
diff --git a/packages/twenty-front/src/modules/sse-db-event/utils/dispatchQueueJobEventsFromSseToBrowserEvents.ts b/packages/twenty-front/src/modules/sse-db-event/utils/dispatchQueueJobEventsFromSseToBrowserEvents.ts
new file mode 100644
index 00000000000..d7fad562854
--- /dev/null
+++ b/packages/twenty-front/src/modules/sse-db-event/utils/dispatchQueueJobEventsFromSseToBrowserEvents.ts
@@ -0,0 +1,11 @@
+import { dispatchBrowserEvent } from '@/browser-event/utils/dispatchBrowserEvent';
+import { QUEUE_JOB_BROWSER_EVENT_NAME } from '@/queue-job/constants/QueueJobBrowserEventName';
+import { type JobStatus } from '~/generated-metadata/graphql';
+
+export const dispatchQueueJobEventsFromSseToBrowserEvents = (
+ queueJobEvents: JobStatus[],
+) => {
+ for (const queueJobEvent of queueJobEvents) {
+ dispatchBrowserEvent(QUEUE_JOB_BROWSER_EVENT_NAME, queueJobEvent);
+ }
+};
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-job/application-job.resolver.ts b/packages/twenty-server/src/engine/core-modules/application/application-job/application-job.resolver.ts
index 973fd55bf0f..c9770643bfa 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-job/application-job.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-job/application-job.resolver.ts
@@ -12,7 +12,7 @@ import { EnqueueJobResultDTO } from 'src/engine/core-modules/application/applica
import { EnqueueJobInputDTO } from 'src/engine/core-modules/application/application-job/dtos/enqueue-job.input';
import { EnqueueJobsResultDTO } from 'src/engine/core-modules/application/application-job/dtos/enqueue-jobs-result.dto';
import { EnqueueJobsInputDTO } from 'src/engine/core-modules/application/application-job/dtos/enqueue-jobs.input';
-import { JobStatusDTO } from 'src/engine/core-modules/application/application-job/dtos/job-status.dto';
+import { JobStatusDTO } from 'src/engine/core-modules/message-queue/dtos/job-status.dto';
import { ApplicationJobService } from 'src/engine/core-modules/application/application-job/services/application-job.service';
import { type FlatApplication } from 'src/engine/core-modules/application/types/flat-application.type';
import { type AuthContextUser } from 'src/engine/core-modules/auth/types/auth-context.type';
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-job/services/application-job.service.ts b/packages/twenty-server/src/engine/core-modules/application/application-job/services/application-job.service.ts
index b19d87d5d4d..7a229f67182 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-job/services/application-job.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-job/services/application-job.service.ts
@@ -14,7 +14,7 @@ import { ENQUEUE_JOB_PRIORITY } from 'src/engine/core-modules/application/applic
import { MAX_JOBS_PER_STATUS_READ } from 'src/engine/core-modules/application/application-job/constants/max-jobs-per-status-read.constant';
import { type EnqueueJobInputDTO } from 'src/engine/core-modules/application/application-job/dtos/enqueue-job.input';
import { type EnqueueJobsInputDTO } from 'src/engine/core-modules/application/application-job/dtos/enqueue-jobs.input';
-import { type JobStatusDTO } from 'src/engine/core-modules/application/application-job/dtos/job-status.dto';
+import { type JobStatusDTO } from 'src/engine/core-modules/message-queue/dtos/job-status.dto';
import { buildQueueJobId } from 'src/engine/core-modules/application/application-job/utils/build-queue-job-id.util';
import {
ApplicationException,
diff --git a/packages/twenty-server/src/engine/core-modules/core-engine.module.ts b/packages/twenty-server/src/engine/core-modules/core-engine.module.ts
index a3e89da4dc2..739f950c134 100644
--- a/packages/twenty-server/src/engine/core-modules/core-engine.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/core-engine.module.ts
@@ -1,6 +1,6 @@
import { Module } from '@nestjs/common';
import { APP_FILTER, HttpAdapterHost } from '@nestjs/core';
-import { EventEmitterModule } from '@nestjs/event-emitter';
+import { EventEmitter2, EventEmitterModule } from '@nestjs/event-emitter';
import { WorkspaceQueryRunnerModule } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-runner.module';
import { ActorModule } from 'src/engine/core-modules/actor/actor.module';
@@ -148,7 +148,12 @@ import { FileModule } from './file/file.module';
MetricsModule,
MessageQueueModule.registerAsync({
useFactory: messageQueueModuleFactory,
- inject: [TwentyConfigService, RedisClientService, MetricsService],
+ inject: [
+ TwentyConfigService,
+ RedisClientService,
+ MetricsService,
+ EventEmitter2,
+ ],
}),
ExceptionHandlerModule.forRootAsync({
useFactory: exceptionHandlerModuleFactory,
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/constants/queue-job-changed-event.constant.ts b/packages/twenty-server/src/engine/core-modules/message-queue/constants/queue-job-changed-event.constant.ts
new file mode 100644
index 00000000000..8ff4e2953f0
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/constants/queue-job-changed-event.constant.ts
@@ -0,0 +1 @@
+export const QUEUE_JOB_CHANGED_EVENT = 'queue.job-changed';
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 a3367862de4..d0163ec3e97 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
@@ -4,20 +4,24 @@ import {
type OnModuleInit,
} from '@nestjs/common';
+import { type EventEmitter2 } from '@nestjs/event-emitter';
import * as Sentry from '@sentry/node';
import {
+ type Job,
type JobsOptions,
MetricsTime,
Queue,
type QueueOptions,
Worker,
} from 'bullmq';
+import { type JobState as BullMQJobState } from 'bullmq/dist/esm/types';
import { isDefined } from 'twenty-shared/utils';
import { v4 } from 'uuid';
import {
type QueueCronJobOptions,
type QueueJobOptions,
+ type QueueJobRecipient,
} from 'src/engine/core-modules/message-queue/drivers/interfaces/job-options.interface';
import {
type InFlightQueueJob,
@@ -31,9 +35,11 @@ import {
} from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
import { type MessageQueueWorkerOptions } from 'src/engine/core-modules/message-queue/interfaces/message-queue-worker-options.interface';
+import { QUEUE_JOB_CHANGED_EVENT } from 'src/engine/core-modules/message-queue/constants/queue-job-changed-event.constant';
import { QUEUE_RETENTION } from 'src/engine/core-modules/message-queue/constants/queue-retention.constants';
import { MESSAGE_QUEUE_WORKER_CONFIG } from 'src/engine/core-modules/message-queue/message-queue-worker-config.constant';
import { type MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
+import { type QueueJobChangedEvent } from 'src/engine/core-modules/message-queue/types/queue-job-changed-event.type';
import { getJobKey } from 'src/engine/core-modules/message-queue/utils/get-job-key.util';
import { type MetricsService } from 'src/engine/core-modules/metrics/metrics.service';
import { MetricsKeys } from 'src/engine/core-modules/metrics/types/metrics-keys.type';
@@ -42,6 +48,10 @@ import { type TwentyConfigService } from 'src/engine/core-modules/twenty-config/
export type BullMQDriverOptions = QueueOptions;
+type BullMQJobsOptions = JobsOptions & {
+ broadcastTo?: QueueJobRecipient;
+};
+
const V4_LENGTH = 36;
export class BullMQDriver
@@ -64,6 +74,7 @@ export class BullMQDriver
private options: BullMQDriverOptions,
private metricsService: MetricsService,
private twentyConfigService: TwentyConfigService,
+ private eventEmitter: EventEmitter2,
) {}
onModuleInit() {
@@ -237,6 +248,16 @@ export class BullMQDriver
workerOptions,
);
+ this.workerMap[queueName].on('active', (job) =>
+ this.emitJobChange({ queueName, job, state: 'active' }),
+ );
+ this.workerMap[queueName].on('completed', (job) =>
+ this.emitJobChange({ queueName, job, state: 'completed' }),
+ );
+ this.workerMap[queueName].on('failed', (job) =>
+ this.emitJobChange({ queueName, job, state: 'failed' }),
+ );
+
this.workerMap[queueName].on('completed', (job) => {
void this.metricsService.incrementCounterForEvent({
key: MetricsKeys.JobCompleted,
@@ -331,13 +352,44 @@ export class BullMQDriver
);
}
+ private emitJobChange({
+ queueName,
+ job,
+ state,
+ }: {
+ queueName: MessageQueue;
+ job: Job | undefined;
+ state: BullMQJobState;
+ }): void {
+ if (!isDefined(job) || !isDefined(this.getBroadcastTo(job))) {
+ return;
+ }
+
+ const jobDetails = this.buildQueueJobDetails({ job, state });
+
+ if (!isDefined(jobDetails)) {
+ return;
+ }
+
+ this.eventEmitter.emit(QUEUE_JOB_CHANGED_EVENT, {
+ queueName,
+ job: jobDetails,
+ } satisfies QueueJobChangedEvent);
+ }
+
+ private getBroadcastTo(job: Job): QueueJobRecipient | undefined {
+ const { broadcastTo }: BullMQJobsOptions = job.opts;
+
+ return broadcastTo;
+ }
+
private buildJobsOptions({
queueName,
options,
}: {
queueName: MessageQueue;
options?: QueueJobOptions;
- }): JobsOptions {
+ }): BullMQJobsOptions {
return {
// We suffix the id with V4() to make sure ids are unique so we can add a waiting job when a job related with the same option.id is running
jobId: options?.id ? `${options.id}-${v4()}` : undefined,
@@ -360,6 +412,7 @@ export class BullMQDriver
count: QUEUE_RETENTION.failedMaxCount,
},
delay: options?.delay,
+ broadcastTo: options?.broadcastTo,
};
}
@@ -454,7 +507,7 @@ export class BullMQDriver
): Promise<QueueJobDetails<T> | undefined> {
const job = await this.queueMap[queueName].getJob(jobId);
- if (!isDefined(job) || !isDefined(job.id)) {
+ if (!isDefined(job)) {
return undefined;
}
@@ -465,6 +518,20 @@ export class BullMQDriver
return undefined;
}
+ return this.buildQueueJobDetails<T>({ job, state });
+ }
+
+ private buildQueueJobDetails<T extends MessageQueueJobData>({
+ job,
+ state,
+ }: {
+ job: Job;
+ state: BullMQJobState;
+ }): QueueJobDetails<T> | undefined {
+ if (!isDefined(job.id)) {
+ return undefined;
+ }
+
return {
id: job.id,
data: job.data,
@@ -474,6 +541,7 @@ export class BullMQDriver
timestamp: job.timestamp,
processedOn: job.processedOn,
finishedOn: job.finishedOn,
+ broadcastTo: this.getBroadcastTo(job),
};
}
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/drivers/interfaces/job-options.interface.ts b/packages/twenty-server/src/engine/core-modules/message-queue/drivers/interfaces/job-options.interface.ts
index e7d328d4717..64370774efe 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/drivers/interfaces/job-options.interface.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/drivers/interfaces/job-options.interface.ts
@@ -4,6 +4,11 @@ export type QueueJobBackoffOptions = {
jitter?: number;
};
+export type QueueJobRecipient = {
+ workspaceId: string;
+ userWorkspaceId: string;
+};
+
export interface QueueJobOptions {
id?: string;
allowDuplicatedPrefixes?: boolean;
@@ -11,6 +16,7 @@ export interface QueueJobOptions {
retryLimit?: number;
backoff?: QueueJobBackoffOptions;
delay?: number;
+ broadcastTo?: QueueJobRecipient;
}
export interface QueueCronJobOptions extends QueueJobOptions {
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/drivers/interfaces/message-queue-driver.interface.ts b/packages/twenty-server/src/engine/core-modules/message-queue/drivers/interfaces/message-queue-driver.interface.ts
index 0d9953917b0..966a523ca2c 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/drivers/interfaces/message-queue-driver.interface.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/drivers/interfaces/message-queue-driver.interface.ts
@@ -3,6 +3,7 @@ import { type JobState } from 'bullmq/dist/esm/types';
import {
type QueueCronJobOptions,
type QueueJobOptions,
+ type QueueJobRecipient,
} from 'src/engine/core-modules/message-queue/drivers/interfaces/job-options.interface';
import { type MessageQueueJobData } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
import { type MessageQueueWorkerOptions } from 'src/engine/core-modules/message-queue/interfaces/message-queue-worker-options.interface';
@@ -73,6 +74,7 @@ export type QueueJobDetails<T extends MessageQueueJobData> = {
timestamp: number;
processedOn?: number;
finishedOn?: number;
+ broadcastTo?: QueueJobRecipient;
};
export interface InFlightQueueJob<T extends MessageQueueJobData> {
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-job/dtos/job-status.dto.ts b/packages/twenty-server/src/engine/core-modules/message-queue/dtos/job-status.dto.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/application/application-job/dtos/job-status.dto.ts
rename to packages/twenty-server/src/engine/core-modules/message-queue/dtos/job-status.dto.ts
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/interfaces/message-queue-module-options.interface.ts b/packages/twenty-server/src/engine/core-modules/message-queue/interfaces/message-queue-module-options.interface.ts
index 6888049e5df..d5641821f3a 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/interfaces/message-queue-module-options.interface.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/interfaces/message-queue-module-options.interface.ts
@@ -1,3 +1,5 @@
+import { type EventEmitter2 } from '@nestjs/event-emitter';
+
import { type BullMQDriverOptions } from 'src/engine/core-modules/message-queue/drivers/bullmq.driver';
import { type MetricsService } from 'src/engine/core-modules/metrics/metrics.service';
import { type TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
@@ -12,6 +14,7 @@ export interface BullMQDriverFactoryOptions {
options: BullMQDriverOptions;
metricsService: MetricsService;
twentyConfigService: TwentyConfigService;
+ eventEmitter: EventEmitter2;
}
export interface SyncDriverFactoryOptions {
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/message-queue-core.module.ts b/packages/twenty-server/src/engine/core-modules/message-queue/message-queue-core.module.ts
index 368d22409b0..9f4219bb09b 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/message-queue-core.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/message-queue-core.module.ts
@@ -115,6 +115,7 @@ export class MessageQueueCoreModule extends ConfigurableModuleClass {
config.options,
config.metricsService,
config.twentyConfigService,
+ config.eventEmitter,
);
}
case MessageQueueDriverType.Sync: {
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/message-queue.module-factory.ts b/packages/twenty-server/src/engine/core-modules/message-queue/message-queue.module-factory.ts
index 21cb0169770..c5fda367234 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/message-queue.module-factory.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/message-queue.module-factory.ts
@@ -1,3 +1,5 @@
+import { type EventEmitter2 } from '@nestjs/event-emitter';
+
import {
type BullMQDriverFactoryOptions,
MessageQueueDriverType,
@@ -11,6 +13,7 @@ export const messageQueueModuleFactory = async (
twentyConfigService: TwentyConfigService,
redisClientService: RedisClientService,
metricsService: MetricsService,
+ eventEmitter: EventEmitter2,
): Promise<MessageQueueModuleOptions> => {
const driverType = MessageQueueDriverType.BullMQ;
@@ -23,6 +26,7 @@ export const messageQueueModuleFactory = async (
},
metricsService,
twentyConfigService,
+ eventEmitter,
} satisfies BullMQDriverFactoryOptions;
}
default:
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/types/queue-job-changed-event.type.ts b/packages/twenty-server/src/engine/core-modules/message-queue/types/queue-job-changed-event.type.ts
new file mode 100644
index 00000000000..1dad1b3e28b
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/types/queue-job-changed-event.type.ts
@@ -0,0 +1,9 @@
+import { type QueueJobDetails } from 'src/engine/core-modules/message-queue/drivers/interfaces/message-queue-driver.interface';
+import { type MessageQueueJobData } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
+
+import { type MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
+
+export type QueueJobChangedEvent = {
+ queueName: MessageQueue;
+ job: QueueJobDetails<MessageQueueJobData>;
+};
diff --git a/packages/twenty-server/src/engine/subscriptions/dtos/event-subscription.dto.ts b/packages/twenty-server/src/engine/subscriptions/dtos/event-subscription.dto.ts
index ff4fc0760bd..77b0b9c9ada 100644
--- a/packages/twenty-server/src/engine/subscriptions/dtos/event-subscription.dto.ts
+++ b/packages/twenty-server/src/engine/subscriptions/dtos/event-subscription.dto.ts
@@ -1,5 +1,7 @@
import { Field, ObjectType } from '@nestjs/graphql';
+import { JobStatusDTO } from 'src/engine/core-modules/message-queue/dtos/job-status.dto';
+
import { MetadataEventDTO } from './metadata-event.dto';
import { ObjectRecordEventDTO } from './object-record-event.dto';
@@ -22,4 +24,7 @@ export class EventSubscriptionDTO {
@Field(() => [MetadataEventDTO])
metadataEvents: MetadataEventDTO[];
+
+ @Field(() => [JobStatusDTO])
+ queueJobEvents: JobStatusDTO[];
}
diff --git a/packages/twenty-server/src/engine/subscriptions/event-stream.resolver.ts b/packages/twenty-server/src/engine/subscriptions/event-stream.resolver.ts
index 20786468154..ee1782f2bb2 100644
--- a/packages/twenty-server/src/engine/subscriptions/event-stream.resolver.ts
+++ b/packages/twenty-server/src/engine/subscriptions/event-stream.resolver.ts
@@ -62,6 +62,7 @@ export class EventStreamResolver {
eventStreamId: variables.eventStreamId,
objectRecordEventsWithQueryIds: payload.objectRecordEventsWithQueryIds,
metadataEvents: payload.metadataEvents,
+ queueJobEvents: payload.queueJobEvents ?? [],
};
},
})
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
new file mode 100644
index 00000000000..6658073e41c
--- /dev/null
+++ b/packages/twenty-server/src/engine/subscriptions/queue-job-event/queue-job-event.listener.ts
@@ -0,0 +1,65 @@
+import { Injectable, Logger } from '@nestjs/common';
+import { OnEvent } from '@nestjs/event-emitter';
+
+import { isDefined } from 'twenty-shared/utils';
+
+import { type QueueJobRecipient } from 'src/engine/core-modules/message-queue/drivers/interfaces/job-options.interface';
+import { type QueueJobDetails } from 'src/engine/core-modules/message-queue/drivers/interfaces/message-queue-driver.interface';
+import { type MessageQueueJobData } from 'src/engine/core-modules/message-queue/interfaces/message-queue-job.interface';
+
+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 { WorkspaceEventBroadcaster } from 'src/engine/subscriptions/workspace-event-broadcaster/workspace-event-broadcaster.service';
+
+@Injectable()
+export class QueueJobEventListener {
+ private readonly logger = new Logger(QueueJobEventListener.name);
+ private publishChain = Promise.resolve();
+
+ constructor(
+ private readonly workspaceEventBroadcaster: WorkspaceEventBroadcaster,
+ ) {}
+
+ @OnEvent(QUEUE_JOB_CHANGED_EVENT)
+ handleJobChanged({ job }: QueueJobChangedEvent): void {
+ const { broadcastTo } = job;
+
+ if (!isDefined(broadcastTo)) {
+ return;
+ }
+
+ this.publishChain = this.publishChain.then(() =>
+ this.publish({ job, broadcastTo }),
+ );
+ }
+
+ private async publish({
+ job,
+ broadcastTo: { workspaceId, userWorkspaceId },
+ }: {
+ job: QueueJobDetails<MessageQueueJobData>;
+ broadcastTo: QueueJobRecipient;
+ }): Promise<void> {
+ try {
+ await this.workspaceEventBroadcaster.broadcastQueueJobEvent({
+ workspaceId,
+ userWorkspaceId,
+ queueJobEvent: {
+ jobId: job.id,
+ state: bullMQToJobStateEnum[job.state],
+ attemptsMade: job.attemptsMade,
+ failedReason: job.failedReason,
+ enqueuedAt: job.timestamp,
+ startedAt: job.processedOn,
+ finishedAt: job.finishedOn,
+ },
+ });
+ } catch (error) {
+ this.logger.warn(
+ `Failed to broadcast ${job.state} status of job ${job.id} in workspace ${workspaceId}`,
+ error,
+ );
+ }
+ }
+}
diff --git a/packages/twenty-server/src/engine/subscriptions/subscriptions.module.ts b/packages/twenty-server/src/engine/subscriptions/subscriptions.module.ts
index 45b45ada479..48827647186 100644
--- a/packages/twenty-server/src/engine/subscriptions/subscriptions.module.ts
+++ b/packages/twenty-server/src/engine/subscriptions/subscriptions.module.ts
@@ -19,6 +19,7 @@ import { MetadataEventPublisher } from 'src/engine/subscriptions/metadata-event/
import { MetadataEventResolutionService } from 'src/engine/subscriptions/metadata-event/services/metadata-event-resolution.service';
import { MetadataEventsToDbListener } from 'src/engine/subscriptions/metadata-event/metadata-events-to-db.listener';
import { ObjectRecordEventPublisher } from 'src/engine/subscriptions/object-record-event/object-record-event-publisher';
+import { QueueJobEventListener } from 'src/engine/subscriptions/queue-job-event/queue-job-event.listener';
import { SubscriptionService } from 'src/engine/subscriptions/subscription.service';
import { WorkspaceEventBroadcaster } from 'src/engine/subscriptions/workspace-event-broadcaster/workspace-event-broadcaster.service';
import { WorkspaceCacheModule } from 'src/engine/workspace-cache/workspace-cache.module';
@@ -47,6 +48,7 @@ import { WorkspaceCacheModule } from 'src/engine/workspace-cache/workspace-cache
MetadataEventEmitter,
MetadataEventsToDbListener,
WorkspaceEventBroadcaster,
+ QueueJobEventListener,
ProcessNestedRelationsHelper,
CommonSelectFieldsHelper,
],
diff --git a/packages/twenty-server/src/engine/subscriptions/types/event-stream-payload.type.ts b/packages/twenty-server/src/engine/subscriptions/types/event-stream-payload.type.ts
index 3b5a327a8d3..a0d3d668ba7 100644
--- a/packages/twenty-server/src/engine/subscriptions/types/event-stream-payload.type.ts
+++ b/packages/twenty-server/src/engine/subscriptions/types/event-stream-payload.type.ts
@@ -1,5 +1,6 @@
import { type EventStreamMetadataEvent } from 'src/engine/subscriptions/types/event-stream-metadata-event.type';
import { type ObjectRecordSubscriptionEvent } from 'src/engine/subscriptions/types/object-record-subscription-event.type';
+import { type QueueJobEvent } from 'src/engine/subscriptions/types/queue-job-event.type';
export type EventStreamPayload = {
objectRecordEventsWithQueryIds: {
@@ -7,4 +8,5 @@ export type EventStreamPayload = {
objectRecordEvent: ObjectRecordSubscriptionEvent;
}[];
metadataEvents: EventStreamMetadataEvent[];
+ queueJobEvents?: QueueJobEvent[];
};
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
new file mode 100644
index 00000000000..cc63b376e65
--- /dev/null
+++ b/packages/twenty-server/src/engine/subscriptions/types/queue-job-event.type.ts
@@ -0,0 +1,11 @@
+import { type JobStateEnum } from 'src/engine/core-modules/message-queue/enums/job-state.enum';
+
+export type QueueJobEvent = {
+ jobId: string;
+ state: JobStateEnum;
+ attemptsMade: number;
+ failedReason?: string;
+ enqueuedAt: number;
+ startedAt?: number;
+ finishedAt?: number;
+};
diff --git a/packages/twenty-server/src/engine/subscriptions/workspace-event-broadcaster/workspace-event-broadcaster.service.ts b/packages/twenty-server/src/engine/subscriptions/workspace-event-broadcaster/workspace-event-broadcaster.service.ts
index 36f6ca5dae7..06533eed2d2 100644
--- a/packages/twenty-server/src/engine/subscriptions/workspace-event-broadcaster/workspace-event-broadcaster.service.ts
+++ b/packages/twenty-server/src/engine/subscriptions/workspace-event-broadcaster/workspace-event-broadcaster.service.ts
@@ -4,7 +4,9 @@ import { isDefined } from 'twenty-shared/utils';
import { EventStreamService } from 'src/engine/subscriptions/event-stream.service';
import { SubscriptionService } from 'src/engine/subscriptions/subscription.service';
+import { type EventStreamData } from 'src/engine/subscriptions/types/event-stream-data.type';
import { type EventStreamPayload } from 'src/engine/subscriptions/types/event-stream-payload.type';
+import { type QueueJobEvent } from 'src/engine/subscriptions/types/queue-job-event.type';
import { type WorkspaceBroadcastEvent } from 'src/engine/subscriptions/workspace-event-broadcaster/types/workspace-broadcast-event.type';
@Injectable()
@@ -27,26 +29,7 @@ export class WorkspaceEventBroadcaster {
return;
}
- const activeStreamIds =
- await this.eventStreamService.getActiveStreamIds(workspaceId);
-
- if (activeStreamIds.length === 0) {
- return;
- }
-
- const streamsData = await this.eventStreamService.getStreamsData(
- workspaceId,
- activeStreamIds,
- );
-
- const streamIdsToRemove: string[] = [];
-
- for (const [streamChannelId, streamData] of streamsData) {
- if (!isDefined(streamData)) {
- streamIdsToRemove.push(streamChannelId);
- continue;
- }
-
+ await this.publishToActiveStreams(workspaceId, (streamData) => {
const streamUserWorkspaceId = streamData.authContext.userWorkspaceId;
const metadataEventsForStream = events
@@ -72,13 +55,67 @@ export class WorkspaceEventBroadcaster {
}));
if (metadataEventsForStream.length === 0) {
- continue;
+ return undefined;
}
- const payload: EventStreamPayload = {
+ return {
objectRecordEventsWithQueryIds: [],
metadataEvents: metadataEventsForStream,
};
+ });
+ }
+
+ async broadcastQueueJobEvent({
+ workspaceId,
+ userWorkspaceId,
+ queueJobEvent,
+ }: {
+ workspaceId: string;
+ userWorkspaceId: string;
+ queueJobEvent: QueueJobEvent;
+ }): Promise<void> {
+ await this.publishToActiveStreams(workspaceId, (streamData) =>
+ streamData.authContext.userWorkspaceId === userWorkspaceId
+ ? {
+ objectRecordEventsWithQueryIds: [],
+ metadataEvents: [],
+ queueJobEvents: [queueJobEvent],
+ }
+ : undefined,
+ );
+ }
+
+ private async publishToActiveStreams(
+ workspaceId: string,
+ buildPayloadForStream: (
+ streamData: EventStreamData,
+ ) => EventStreamPayload | undefined,
+ ): Promise<void> {
+ const activeStreamIds =
+ await this.eventStreamService.getActiveStreamIds(workspaceId);
+
+ if (activeStreamIds.length === 0) {
+ return;
+ }
+
+ const streamsData = await this.eventStreamService.getStreamsData(
+ workspaceId,
+ activeStreamIds,
+ );
+
+ const streamIdsToRemove: string[] = [];
+
+ for (const [streamChannelId, streamData] of streamsData) {
+ if (!isDefined(streamData)) {
+ streamIdsToRemove.push(streamChannelId);
+ continue;
+ }
+
+ const payload = buildPayloadForStream(streamData);
+
+ if (!isDefined(payload)) {
+ continue;
+ }
await this.subscriptionService.publishToEventStream({
workspaceId,