Skip to content

The open alternative to Salesforce, designed for AI.

Let users pick their workspace subdomain during sign-up (#21641)

Félix Malfaiteeed998c9ea7
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index 4c2e06ea2b7..6ea43648671 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -2337,6 +2337,17 @@ type VerifyEmailAndGetLoginToken {
workspaceUrls: WorkspaceUrls!
}
+type SubdomainAvailabilityDTO {
+ isValid: Boolean!
+ available: Boolean!
+ suggestedSubdomain: String!
+}
+
+type WorkspaceCreationDefaultsDTO {
+ displayName: String!
+ subdomain: String!
+}
+
type ApiKeyToken {
token: String!
}
@@ -3102,6 +3113,8 @@ type Query {
checkUserExists(email: String!, captchaToken: String): CheckUserExist!
checkWorkspaceInviteHashIsValid(inviteHash: String!): WorkspaceInviteHashValid!
findWorkspaceFromInviteHash(inviteHash: String!): Workspace!
+ checkWorkspaceSubdomainAvailability(subdomain: String!): SubdomainAvailabilityDTO!
+ getWorkspaceCreationDefaults: WorkspaceCreationDefaultsDTO!
validatePasswordResetToken(passwordResetToken: String!): ValidatePasswordResetToken!
findApplicationRegistrationByClientId(clientId: String!): PublicApplicationRegistration
findApplicationRegistrationByUniversalIdentifier(universalIdentifier: String!): ApplicationRegistration
@@ -3373,7 +3386,7 @@ type Mutation {
getAuthTokensFromOTP(otp: String!, loginToken: String!, captchaToken: String, origin: String!): AuthTokens!
signUp(email: String!, password: String!, captchaToken: String, locale: String, verifyEmailRedirectPath: String): AvailableWorkspacesAndAccessTokens!
signUpInWorkspace(email: String!, password: String!, workspaceId: UUID, workspaceInviteHash: String, workspacePersonalInviteToken: String, captchaToken: String, locale: String, verifyEmailRedirectPath: String): SignUp!
- signUpInNewWorkspace: SignUp!
+ signUpInNewWorkspace(input: SignUpInNewWorkspaceInput): SignUp!
generateTransientToken: TransientToken!
getAuthTokensFromLoginToken(loginToken: String!, origin: String!): AuthTokens!
authorizeApp(clientId: String!, codeChallenge: String, redirectUrl: String!, state: String, scope: String): AuthorizeApp!
@@ -4405,6 +4418,11 @@ input GetAuthorizationUrlForSSOInput {
workspaceInviteHash: String
}
+input SignUpInNewWorkspaceInput {
+ displayName: String
+ subdomain: String
+}
+
input CreateApplicationRegistrationInput {
name: String!
universalIdentifier: String
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index 6f0727d8700..b353662072c 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -1994,6 +1994,19 @@ export interface VerifyEmailAndGetLoginToken {
__typename: 'VerifyEmailAndGetLoginToken'
}
+export interface SubdomainAvailabilityDTO {
+ isValid: Scalars['Boolean']
+ available: Scalars['Boolean']
+ suggestedSubdomain: Scalars['String']
+ __typename: 'SubdomainAvailabilityDTO'
+}
+
+export interface WorkspaceCreationDefaultsDTO {
+ displayName: Scalars['String']
+ subdomain: Scalars['String']
+ __typename: 'WorkspaceCreationDefaultsDTO'
+}
+
export interface ApiKeyToken {
token: Scalars['String']
__typename: 'ApiKeyToken'
@@ -2699,6 +2712,8 @@ export interface Query {
checkUserExists: CheckUserExist
checkWorkspaceInviteHashIsValid: WorkspaceInviteHashValid
findWorkspaceFromInviteHash: Workspace
+ checkWorkspaceSubdomainAvailability: SubdomainAvailabilityDTO
+ getWorkspaceCreationDefaults: WorkspaceCreationDefaultsDTO
validatePasswordResetToken: ValidatePasswordResetToken
findApplicationRegistrationByClientId?: PublicApplicationRegistration
findApplicationRegistrationByUniversalIdentifier?: ApplicationRegistration
@@ -5067,6 +5082,21 @@ export interface VerifyEmailAndGetLoginTokenGenqlSelection{
__scalar?: boolean | number
}
+export interface SubdomainAvailabilityDTOGenqlSelection{
+ isValid?: boolean | number
+ available?: boolean | number
+ suggestedSubdomain?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface WorkspaceCreationDefaultsDTOGenqlSelection{
+ displayName?: boolean | number
+ subdomain?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
export interface ApiKeyTokenGenqlSelection{
token?: boolean | number
__typename?: boolean | number
@@ -5826,6 +5856,8 @@ export interface QueryGenqlSelection{
checkUserExists?: (CheckUserExistGenqlSelection & { __args: {email: Scalars['String'], captchaToken?: (Scalars['String'] | null)} })
checkWorkspaceInviteHashIsValid?: (WorkspaceInviteHashValidGenqlSelection & { __args: {inviteHash: Scalars['String']} })
findWorkspaceFromInviteHash?: (WorkspaceGenqlSelection & { __args: {inviteHash: Scalars['String']} })
+ checkWorkspaceSubdomainAvailability?: (SubdomainAvailabilityDTOGenqlSelection & { __args: {subdomain: Scalars['String']} })
+ getWorkspaceCreationDefaults?: WorkspaceCreationDefaultsDTOGenqlSelection
validatePasswordResetToken?: (ValidatePasswordResetTokenGenqlSelection & { __args: {passwordResetToken: Scalars['String']} })
findApplicationRegistrationByClientId?: (PublicApplicationRegistrationGenqlSelection & { __args: {clientId: Scalars['String']} })
findApplicationRegistrationByUniversalIdentifier?: (ApplicationRegistrationGenqlSelection & { __args: {universalIdentifier: Scalars['String']} })
@@ -6044,7 +6076,7 @@ export interface MutationGenqlSelection{
getAuthTokensFromOTP?: (AuthTokensGenqlSelection & { __args: {otp: Scalars['String'], loginToken: Scalars['String'], captchaToken?: (Scalars['String'] | null), origin: Scalars['String']} })
signUp?: (AvailableWorkspacesAndAccessTokensGenqlSelection & { __args: {email: Scalars['String'], password: Scalars['String'], captchaToken?: (Scalars['String'] | null), locale?: (Scalars['String'] | null), verifyEmailRedirectPath?: (Scalars['String'] | null)} })
signUpInWorkspace?: (SignUpGenqlSelection & { __args: {email: Scalars['String'], password: Scalars['String'], workspaceId?: (Scalars['UUID'] | null), workspaceInviteHash?: (Scalars['String'] | null), workspacePersonalInviteToken?: (Scalars['String'] | null), captchaToken?: (Scalars['String'] | null), locale?: (Scalars['String'] | null), verifyEmailRedirectPath?: (Scalars['String'] | null)} })
- signUpInNewWorkspace?: SignUpGenqlSelection
+ signUpInNewWorkspace?: (SignUpGenqlSelection & { __args?: {input?: (SignUpInNewWorkspaceInput | null)} })
generateTransientToken?: TransientTokenGenqlSelection
getAuthTokensFromLoginToken?: (AuthTokensGenqlSelection & { __args: {loginToken: Scalars['String'], origin: Scalars['String']} })
authorizeApp?: (AuthorizeAppGenqlSelection & { __args: {clientId: Scalars['String'], codeChallenge?: (Scalars['String'] | null), redirectUrl: Scalars['String'], state?: (Scalars['String'] | null), scope?: (Scalars['String'] | null)} })
@@ -6442,6 +6474,8 @@ export interface UpdateSkillInput {id: Scalars['UUID'],name?: (Scalars['String']
export interface GetAuthorizationUrlForSSOInput {identityProviderId: Scalars['UUID'],workspaceInviteHash?: (Scalars['String'] | null)}
+export interface SignUpInNewWorkspaceInput {displayName?: (Scalars['String'] | null),subdomain?: (Scalars['String'] | null)}
+
export interface CreateApplicationRegistrationInput {name: Scalars['String'],universalIdentifier?: (Scalars['String'] | null),oAuthRedirectUris?: (Scalars['String'][] | null),oAuthScopes?: (Scalars['String'][] | null)}
export interface UpdateApplicationRegistrationInput {id: Scalars['String'],update: UpdateApplicationRegistrationPayload}
@@ -7964,6 +7998,22 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
+ const SubdomainAvailabilityDTO_possibleTypes: string[] = ['SubdomainAvailabilityDTO']
+ export const isSubdomainAvailabilityDTO = (obj?: { __typename?: any } | null): obj is SubdomainAvailabilityDTO => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSubdomainAvailabilityDTO"')
+ return SubdomainAvailabilityDTO_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const WorkspaceCreationDefaultsDTO_possibleTypes: string[] = ['WorkspaceCreationDefaultsDTO']
+ export const isWorkspaceCreationDefaultsDTO = (obj?: { __typename?: any } | null): obj is WorkspaceCreationDefaultsDTO => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isWorkspaceCreationDefaultsDTO"')
+ return WorkspaceCreationDefaultsDTO_possibleTypes.includes(obj.__typename)
+ }
+
+
+
const ApiKeyToken_possibleTypes: string[] = ['ApiKeyToken']
export const isApiKeyToken = (obj?: { __typename?: any } | null): obj is ApiKeyToken => {
if (!obj?.__typename) throw new Error('__typename is missing in "isApiKeyToken"')
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index 06d7741a98b..485d9a9c3bf 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -62,27 +62,27 @@ export default {
217,
229,
235,
- 269,
271,
- 272,
273,
274,
275,
276,
277,
- 284,
- 322,
- 323,
+ 278,
+ 279,
+ 286,
324,
325,
+ 326,
327,
329,
- 340,
- 347,
- 354,
- 476,
- 481,
- 489
+ 331,
+ 342,
+ 349,
+ 356,
+ 479,
+ 484,
+ 492
],
"types": {
"BillingProductDTO": {
@@ -4566,6 +4566,31 @@ export default {
1
]
},
+ "SubdomainAvailabilityDTO": {
+ "isValid": [
+ 6
+ ],
+ "available": [
+ 6
+ ],
+ "suggestedSubdomain": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "WorkspaceCreationDefaultsDTO": {
+ "displayName": [
+ 1
+ ],
+ "subdomain": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
"ApiKeyToken": {
"token": [
1
@@ -4639,7 +4664,7 @@ export default {
1
],
"dailyUsage": [
- 258
+ 260
],
"__typename": [
1
@@ -4656,7 +4681,7 @@ export default {
195
],
"timeSeries": [
- 258
+ 260
],
"periodStart": [
4
@@ -4665,7 +4690,7 @@ export default {
4
],
"userDailyUsage": [
- 259
+ 261
],
"__typename": [
1
@@ -4822,10 +4847,10 @@ export default {
1
],
"status": [
- 269
+ 271
],
"verificationRecords": [
- 267
+ 269
],
"verifiedAt": [
4
@@ -4840,22 +4865,22 @@ export default {
3
],
"visibility": [
- 271
+ 273
],
"handle": [
1
],
"type": [
- 272
+ 274
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 273
+ 275
],
"messageFolderImportPolicy": [
- 274
+ 276
],
"excludeNonProfessionalEmails": [
6
@@ -4864,7 +4889,7 @@ export default {
6
],
"pendingGroupEmailsAction": [
- 275
+ 277
],
"isSyncEnabled": [
6
@@ -4873,10 +4898,10 @@ export default {
4
],
"syncStatus": [
- 276
+ 278
],
"syncStage": [
- 277
+ 279
],
"syncStageStartedAt": [
4
@@ -4912,7 +4937,7 @@ export default {
"MessageChannelSyncStage": {},
"CreateEmailGroupChannelOutput": {
"messageChannel": [
- 270
+ 272
],
"forwardingAddress": [
1
@@ -4974,7 +4999,7 @@ export default {
21
],
"skipped": [
- 281
+ 283
],
"__typename": [
1
@@ -4997,7 +5022,7 @@ export default {
1
],
"visibility": [
- 284
+ 286
],
"__typename": [
1
@@ -5043,7 +5068,7 @@ export default {
1
],
"location": [
- 286
+ 288
],
"__typename": [
1
@@ -5068,13 +5093,13 @@ export default {
},
"ImapSmtpCaldavPublicConnectionParameters": {
"IMAP": [
- 288
+ 290
],
"SMTP": [
- 288
+ 290
],
"CALDAV": [
- 288
+ 290
],
"__typename": [
1
@@ -5094,7 +5119,7 @@ export default {
3
],
"connectionParameters": [
- 289
+ 291
],
"__typename": [
1
@@ -5296,7 +5321,7 @@ export default {
1
],
"series": [
- 297
+ 299
],
"xAxisLabel": [
1
@@ -5345,7 +5370,7 @@ export default {
1
],
"data": [
- 299
+ 301
],
"__typename": [
1
@@ -5353,7 +5378,7 @@ export default {
},
"LineChartData": {
"series": [
- 300
+ 302
],
"xAxisLabel": [
1
@@ -5390,7 +5415,7 @@ export default {
},
"PieChartData": {
"data": [
- 302
+ 304
],
"showLegend": [
6
@@ -5492,13 +5517,13 @@ export default {
},
"EventLogQueryResult": {
"records": [
- 307
+ 309
],
"totalCount": [
21
],
"pageInfo": [
- 308
+ 310
],
"__typename": [
1
@@ -5562,7 +5587,7 @@ export default {
1
],
"parts": [
- 294
+ 296
],
"processedAt": [
4
@@ -5631,7 +5656,7 @@ export default {
},
"AiSystemPromptPreview": {
"sections": [
- 313
+ 315
],
"estimatedTokenCount": [
21
@@ -5707,10 +5732,10 @@ export default {
3
],
"evaluations": [
- 318
+ 320
],
"messages": [
- 311
+ 313
],
"createdAt": [
4
@@ -5741,19 +5766,19 @@ export default {
1
],
"syncStatus": [
- 322
+ 324
],
"syncStage": [
- 323
+ 325
],
"visibility": [
- 324
+ 326
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 325
+ 327
],
"isSyncEnabled": [
6
@@ -5804,7 +5829,7 @@ export default {
1
],
"pendingSyncAction": [
- 327
+ 329
],
"messageChannelId": [
3
@@ -5822,7 +5847,7 @@ export default {
"MessageFolderPendingSyncAction": {},
"CollectionHash": {
"collectionName": [
- 329
+ 331
],
"hash": [
1
@@ -5889,13 +5914,13 @@ export default {
},
"MinimalMetadata": {
"objectMetadataItems": [
- 330
+ 332
],
"views": [
- 331
+ 333
],
"collectionHashes": [
- 328
+ 330
],
"__typename": [
1
@@ -6048,7 +6073,7 @@ export default {
2,
{
"input": [
- 334,
+ 336,
"GetApiKeyInput!"
]
}
@@ -6145,7 +6170,7 @@ export default {
41,
{
"input": [
- 335,
+ 337,
"LogicFunctionIdInput!"
]
}
@@ -6157,7 +6182,7 @@ export default {
15,
{
"input": [
- 335,
+ 337,
"LogicFunctionIdInput!"
]
}
@@ -6166,7 +6191,7 @@ export default {
1,
{
"input": [
- 335,
+ 337,
"LogicFunctionIdInput!"
]
}
@@ -6249,28 +6274,28 @@ export default {
25,
{
"input": [
- 336,
+ 338,
"AgentIdInput!"
]
}
],
"previewMessageCampaignAudience": [
- 279,
+ 281,
{
"input": [
- 337,
+ 339,
"PreviewMessageCampaignAudienceInput!"
]
}
],
"unsubscribeTopics": [
- 283
+ 285
],
"unsubscribePagePreviewUrl": [
1
],
"myMessageChannels": [
- 270,
+ 272,
{
"connectedAccountId": [
3
@@ -6278,7 +6303,7 @@ export default {
}
],
"getEmailingDomains": [
- 268
+ 270
],
"myConnectedAccounts": [
237
@@ -6287,7 +6312,7 @@ export default {
29
],
"getToolIndex": [
- 293
+ 295
],
"getToolInputSchema": [
15,
@@ -6299,10 +6324,10 @@ export default {
}
],
"webhooks": [
- 292
+ 294
],
"webhook": [
- 292,
+ 294,
{
"id": [
3,
@@ -6350,7 +6375,7 @@ export default {
}
],
"myMessageFolders": [
- 326,
+ 328,
{
"messageChannelId": [
3
@@ -6358,7 +6383,7 @@ export default {
}
],
"myCalendarChannels": [
- 321,
+ 323,
{
"connectedAccountId": [
3
@@ -6366,13 +6391,13 @@ export default {
}
],
"minimalMetadata": [
- 332
+ 334
],
"appConnections": [
216,
{
"filter": [
- 338
+ 340
]
}
],
@@ -6386,13 +6411,13 @@ export default {
}
],
"findWorkspaceAiStats": [
- 320
+ 322
],
"chatThreads": [
- 312
+ 314
],
"chatThread": [
- 312,
+ 314,
{
"id": [
3,
@@ -6401,7 +6426,7 @@ export default {
}
],
"chatMessages": [
- 311,
+ 313,
{
"threadId": [
3,
@@ -6410,7 +6435,7 @@ export default {
}
],
"chatStreamCatchupChunks": [
- 315,
+ 317,
{
"threadId": [
3,
@@ -6419,13 +6444,13 @@ export default {
}
],
"getAiSystemPromptPreview": [
- 314
+ 316
],
"skills": [
- 310
+ 312
],
"skill": [
- 310,
+ 312,
{
"id": [
3,
@@ -6434,7 +6459,7 @@ export default {
}
],
"agentTurns": [
- 319,
+ 321,
{
"agentId": [
3,
@@ -6443,7 +6468,7 @@ export default {
}
],
"checkUserExists": [
- 255,
+ 257,
{
"email": [
1,
@@ -6455,7 +6480,7 @@ export default {
}
],
"checkWorkspaceInviteHashIsValid": [
- 256,
+ 258,
{
"inviteHash": [
1,
@@ -6472,6 +6497,18 @@ export default {
]
}
],
+ "checkWorkspaceSubdomainAvailability": [
+ 252,
+ {
+ "subdomain": [
+ 1,
+ "String!"
+ ]
+ }
+ ],
+ "getWorkspaceCreationDefaults": [
+ 253
+ ],
"validatePasswordResetToken": [
250,
{
@@ -6579,43 +6616,43 @@ export default {
222
],
"eventLogs": [
- 309,
+ 311,
{
"input": [
- 339,
+ 341,
"EventLogQueryInput!"
]
}
],
"pieChartData": [
- 303,
+ 305,
{
"input": [
- 343,
+ 345,
"PieChartDataInput!"
]
}
],
"lineChartData": [
- 301,
+ 303,
{
"input": [
- 344,
+ 346,
"LineChartDataInput!"
]
}
],
"barChartData": [
- 298,
+ 300,
{
"input": [
- 345,
+ 347,
"BarChartDataInput!"
]
}
],
"getConnectedImapSmtpCaldavAccount": [
- 290,
+ 292,
{
"id": [
3,
@@ -6624,7 +6661,7 @@ export default {
}
],
"getAutoCompleteAddress": [
- 285,
+ 287,
{
"address": [
1,
@@ -6643,7 +6680,7 @@ export default {
}
],
"getAddressDetails": [
- 287,
+ 289,
{
"placeId": [
1,
@@ -6656,21 +6693,21 @@ export default {
}
],
"getUsageAnalytics": [
- 260,
+ 262,
{
"input": [
- 346
+ 348
]
}
],
"findManyPublicDomains": [
- 266
+ 268
],
"findManyMarketplaceApps": [
- 264
+ 266
],
"findMarketplaceAppDetail": [
- 265,
+ 267,
{
"universalIdentifier": [
1,
@@ -6733,10 +6770,10 @@ export default {
},
"EventLogQueryInput": {
"table": [
- 340
+ 342
],
"filters": [
- 341
+ 343
],
"first": [
21
@@ -6757,7 +6794,7 @@ export default {
1
],
"dateRange": [
- 342
+ 344
],
"recordId": [
1
@@ -6824,7 +6861,7 @@ export default {
1
],
"operationTypes": [
- 347
+ 349
],
"__typename": [
1
@@ -6836,7 +6873,7 @@ export default {
6,
{
"input": [
- 349,
+ 351,
"AddQuerySubscriptionInput!"
]
}
@@ -6845,7 +6882,7 @@ export default {
6,
{
"input": [
- 350,
+ 352,
"RemoveQueryFromEventStreamInput!"
]
}
@@ -6854,7 +6891,7 @@ export default {
158,
{
"inputs": [
- 351,
+ 353,
"[CreateNavigationMenuItemInput!]!"
]
}
@@ -6863,7 +6900,7 @@ export default {
158,
{
"input": [
- 351,
+ 353,
"CreateNavigationMenuItemInput!"
]
}
@@ -6872,7 +6909,7 @@ export default {
158,
{
"inputs": [
- 352,
+ 354,
"[UpdateOneNavigationMenuItemInput!]!"
]
}
@@ -6881,7 +6918,7 @@ export default {
158,
{
"input": [
- 352,
+ 354,
"UpdateOneNavigationMenuItemInput!"
]
}
@@ -6908,7 +6945,7 @@ export default {
131,
{
"file": [
- 354,
+ 356,
"Upload!"
]
}
@@ -6929,7 +6966,7 @@ export default {
131,
{
"file": [
- 354,
+ 356,
"Upload!"
]
}
@@ -6938,7 +6975,7 @@ export default {
131,
{
"file": [
- 354,
+ 356,
"Upload!"
]
}
@@ -6947,7 +6984,7 @@ export default {
131,
{
"file": [
- 354,
+ 356,
"Upload!"
]
}
@@ -6956,7 +6993,7 @@ export default {
131,
{
"file": [
- 354,
+ 356,
"Upload!"
]
}
@@ -6965,7 +7002,7 @@ export default {
131,
{
"file": [
- 354,
+ 356,
"Upload!"
],
"fieldMetadataId": [
@@ -6978,7 +7015,7 @@ export default {
131,
{
"file": [
- 354,
+ 356,
"Upload!"
],
"fieldMetadataUniversalIdentifier": [
@@ -6991,7 +7028,7 @@ export default {
62,
{
"input": [
- 355,
+ 357,
"CreateViewFilterGroupInput!"
]
}
@@ -7004,7 +7041,7 @@ export default {
"String!"
],
"input": [
- 356,
+ 358,
"UpdateViewFilterGroupInput!"
]
}
@@ -7031,7 +7068,7 @@ export default {
64,
{
"input": [
- 357,
+ 359,
"CreateViewFilterInput!"
]
}
@@ -7040,7 +7077,7 @@ export default {
64,
{
"input": [
- 358,
+ 360,
"UpdateViewFilterInput!"
]
}
@@ -7049,7 +7086,7 @@ export default {
64,
{
"input": [
- 360,
+ 362,
"DeleteViewFilterInput!"
]
}
@@ -7058,7 +7095,7 @@ export default {
64,
{
"input": [
- 361,
+ 363,
"DestroyViewFilterInput!"
]
}
@@ -7067,7 +7104,7 @@ export default {
70,
{
"input": [
- 362,
+ 364,
"CreateViewInput!"
]
}
@@ -7080,7 +7117,7 @@ export default {
"String!"
],
"input": [
- 363,
+ 365,
"UpdateViewInput!"
]
}
@@ -7107,7 +7144,7 @@ export default {
70,
{
"input": [
- 364,
+ 366,
"UpsertViewWidgetInput!"
]
}
@@ -7116,7 +7153,7 @@ export default {
67,
{
"input": [
- 369,
+ 371,
"CreateViewSortInput!"
]
}
@@ -7125,7 +7162,7 @@ export default {
67,
{
"input": [
- 370,
+ 372,
"UpdateViewSortInput!"
]
}
@@ -7134,7 +7171,7 @@ export default {
6,
{
"input": [
- 372,
+ 374,
"DeleteViewSortInput!"
]
}
@@ -7143,7 +7180,7 @@ export default {
6,
{
"input": [
- 373,
+ 375,
"DestroyViewSortInput!"
]
}
@@ -7152,7 +7189,7 @@ export default {
60,
{
"input": [
- 374,
+ 376,
"UpdateViewFieldInput!"
]
}
@@ -7161,7 +7198,7 @@ export default {
60,
{
"input": [
- 376,
+ 378,
"CreateViewFieldInput!"
]
}
@@ -7170,7 +7207,7 @@ export default {
60,
{
"inputs": [
- 376,
+ 378,
"[CreateViewFieldInput!]!"
]
}
@@ -7179,7 +7216,7 @@ export default {
60,
{
"input": [
- 377,
+ 379,
"DeleteViewFieldInput!"
]
}
@@ -7188,7 +7225,7 @@ export default {
60,
{
"input": [
- 378,
+ 380,
"DestroyViewFieldInput!"
]
}
@@ -7197,7 +7234,7 @@ export default {
69,
{
"input": [
- 379,
+ 381,
"UpdateViewFieldGroupInput!"
]
}
@@ -7206,7 +7243,7 @@ export default {
69,
{
"input": [
- 381,
+ 383,
"CreateViewFieldGroupInput!"
]
}
@@ -7215,7 +7252,7 @@ export default {
69,
{
"inputs": [
- 381,
+ 383,
"[CreateViewFieldGroupInput!]!"
]
}
@@ -7224,7 +7261,7 @@ export default {
69,
{
"input": [
- 382,
+ 384,
"DeleteViewFieldGroupInput!"
]
}
@@ -7233,7 +7270,7 @@ export default {
69,
{
"input": [
- 383,
+ 385,
"DestroyViewFieldGroupInput!"
]
}
@@ -7242,7 +7279,7 @@ export default {
70,
{
"input": [
- 384,
+ 386,
"UpsertFieldsWidgetInput!"
]
}
@@ -7251,7 +7288,7 @@ export default {
2,
{
"input": [
- 387,
+ 389,
"CreateApiKeyInput!"
]
}
@@ -7260,7 +7297,7 @@ export default {
2,
{
"input": [
- 388,
+ 390,
"UpdateApiKeyInput!"
]
}
@@ -7269,7 +7306,7 @@ export default {
2,
{
"input": [
- 389,
+ 391,
"RevokeApiKeyInput!"
]
}
@@ -7391,7 +7428,7 @@ export default {
130,
{
"input": [
- 390,
+ 392,
"CreateApprovedAccessDomainInput!"
]
}
@@ -7400,7 +7437,7 @@ export default {
6,
{
"input": [
- 391,
+ 393,
"DeleteApprovedAccessDomainInput!"
]
}
@@ -7409,7 +7446,7 @@ export default {
130,
{
"input": [
- 392,
+ 394,
"ValidateApprovedAccessDomainInput!"
]
}
@@ -7418,7 +7455,7 @@ export default {
123,
{
"input": [
- 393,
+ 395,
"CreatePageLayoutTabInput!"
]
}
@@ -7431,7 +7468,7 @@ export default {
"String!"
],
"input": [
- 394,
+ 396,
"UpdatePageLayoutTabInput!"
]
}
@@ -7449,7 +7486,7 @@ export default {
124,
{
"input": [
- 395,
+ 397,
"CreatePageLayoutInput!"
]
}
@@ -7462,7 +7499,7 @@ export default {
"String!"
],
"input": [
- 396,
+ 398,
"UpdatePageLayoutInput!"
]
}
@@ -7484,7 +7521,7 @@ export default {
"String!"
],
"input": [
- 397,
+ 399,
"UpdatePageLayoutWithTabsInput!"
]
}
@@ -7520,7 +7557,7 @@ export default {
85,
{
"input": [
- 401,
+ 403,
"CreatePageLayoutWidgetInput!"
]
}
@@ -7533,7 +7570,7 @@ export default {
"String!"
],
"input": [
- 402,
+ 404,
"UpdatePageLayoutWidgetInput!"
]
}
@@ -7551,7 +7588,7 @@ export default {
41,
{
"input": [
- 335,
+ 337,
"LogicFunctionIdInput!"
]
}
@@ -7560,7 +7597,7 @@ export default {
41,
{
"input": [
- 403,
+ 405,
"CreateLogicFunctionFromSourceInput!"
]
}
@@ -7569,7 +7606,7 @@ export default {
167,
{
"input": [
- 404,
+ 406,
"ExecuteOneLogicFunctionInput!"
]
}
@@ -7578,7 +7615,7 @@ export default {
6,
{
"input": [
- 405,
+ 407,
"UpdateLogicFunctionFromSourceInput!"
]
}
@@ -7587,7 +7624,7 @@ export default {
35,
{
"input": [
- 407,
+ 409,
"CreateCommandMenuItemInput!"
]
}
@@ -7596,7 +7633,7 @@ export default {
35,
{
"input": [
- 408,
+ 410,
"UpdateCommandMenuItemInput!"
]
}
@@ -7623,7 +7660,7 @@ export default {
34,
{
"input": [
- 409,
+ 411,
"CreateFrontComponentInput!"
]
}
@@ -7632,7 +7669,7 @@ export default {
34,
{
"input": [
- 410,
+ 412,
"UpdateFrontComponentInput!"
]
}
@@ -7650,7 +7687,7 @@ export default {
56,
{
"input": [
- 412,
+ 414,
"CreateOneObjectInput!"
]
}
@@ -7659,7 +7696,7 @@ export default {
56,
{
"input": [
- 414,
+ 416,
"DeleteOneObjectInput!"
]
}
@@ -7668,7 +7705,7 @@ export default {
56,
{
"input": [
- 415,
+ 417,
"UpdateOneObjectInput!"
]
}
@@ -7677,7 +7714,7 @@ export default {
47,
{
"input": [
- 417,
+ 419,
"CreateOneIndexInput!"
]
}
@@ -7686,7 +7723,7 @@ export default {
47,
{
"input": [
- 420,
+ 422,
"DeleteOneIndexInput!"
]
}
@@ -7695,7 +7732,7 @@ export default {
25,
{
"input": [
- 421,
+ 423,
"CreateAgentInput!"
]
}
@@ -7704,7 +7741,7 @@ export default {
25,
{
"input": [
- 422,
+ 424,
"UpdateAgentInput!"
]
}
@@ -7713,43 +7750,43 @@ export default {
25,
{
"input": [
- 336,
+ 338,
"AgentIdInput!"
]
}
],
"sendEmailViaEmailingDomain": [
- 280,
+ 282,
{
"input": [
- 423,
+ 425,
"SendEmailViaDomainInput!"
]
}
],
"sendMessageCampaign": [
- 282,
+ 284,
{
"input": [
- 424,
+ 426,
"SendMessageCampaignInput!"
]
}
],
"createUnsubscribeTopic": [
- 283,
+ 285,
{
"input": [
- 425,
+ 427,
"CreateUnsubscribeTopicInput!"
]
}
],
"updateUnsubscribeTopic": [
- 283,
+ 285,
{
"input": [
- 426,
+ 428,
"UpdateUnsubscribeTopicInput!"
]
}
@@ -7764,25 +7801,25 @@ export default {
}
],
"updateMessageChannel": [
- 270,
+ 272,
{
"input": [
- 427,
+ 429,
"UpdateMessageChannelInput!"
]
}
],
"createEmailGroupChannel": [
- 278,
+ 280,
{
"input": [
- 429,
+ 431,
"CreateEmailGroupChannelInput!"
]
}
],
"deleteEmailGroupChannel": [
- 270,
+ 272,
{
"id": [
3,
@@ -7791,10 +7828,10 @@ export default {
}
],
"createEmailingDomain": [
- 268,
+ 270,
{
"input": [
- 430,
+ 432,
"CreateEmailingDomainInput!"
]
}
@@ -7809,7 +7846,7 @@ export default {
}
],
"verifyEmailingDomain": [
- 268,
+ 270,
{
"id": [
1,
@@ -7843,7 +7880,7 @@ export default {
29,
{
"createRoleInput": [
- 431,
+ 433,
"CreateRoleInput!"
]
}
@@ -7852,7 +7889,7 @@ export default {
29,
{
"updateRoleInput": [
- 432,
+ 434,
"UpdateRoleInput!"
]
}
@@ -7870,7 +7907,7 @@ export default {
16,
{
"upsertObjectPermissionsInput": [
- 434,
+ 436,
"UpsertObjectPermissionsInput!"
]
}
@@ -7879,7 +7916,7 @@ export default {
27,
{
"upsertPermissionFlagsInput": [
- 436,
+ 438,
"UpsertPermissionFlagsInput!"
]
}
@@ -7888,7 +7925,7 @@ export default {
26,
{
"upsertFieldPermissionsInput": [
- 437,
+ 439,
"UpsertFieldPermissionsInput!"
]
}
@@ -7897,7 +7934,7 @@ export default {
232,
{
"input": [
- 439,
+ 441,
"UpsertRowLevelPermissionPredicatesInput!"
]
}
@@ -7925,34 +7962,34 @@ export default {
}
],
"runAgent": [
- 295,
+ 297,
{
"input": [
- 442,
+ 444,
"RunAgentInput!"
]
}
],
"createWebhook": [
- 292,
+ 294,
{
"input": [
- 443,
+ 445,
"CreateWebhookInput!"
]
}
],
"updateWebhook": [
- 292,
+ 294,
{
"input": [
- 444,
+ 446,
"UpdateWebhookInput!"
]
}
],
"deleteWebhook": [
- 292,
+ 294,
{
"id": [
3,
@@ -7964,7 +8001,7 @@ export default {
44,
{
"input": [
- 446,
+ 448,
"CreateOneFieldMetadataInput!"
]
}
@@ -7973,7 +8010,7 @@ export default {
44,
{
"input": [
- 448,
+ 450,
"UpdateOneFieldMetadataInput!"
]
}
@@ -7982,7 +8019,7 @@ export default {
44,
{
"input": [
- 450,
+ 452,
"DeleteOneFieldInput!"
]
}
@@ -7991,7 +8028,7 @@ export default {
66,
{
"input": [
- 451,
+ 453,
"CreateViewGroupInput!"
]
}
@@ -8000,7 +8037,7 @@ export default {
66,
{
"inputs": [
- 451,
+ 453,
"[CreateViewGroupInput!]!"
]
}
@@ -8009,7 +8046,7 @@ export default {
66,
{
"input": [
- 452,
+ 454,
"UpdateViewGroupInput!"
]
}
@@ -8018,7 +8055,7 @@ export default {
66,
{
"inputs": [
- 452,
+ 454,
"[UpdateViewGroupInput!]!"
]
}
@@ -8027,7 +8064,7 @@ export default {
66,
{
"input": [
- 454,
+ 456,
"DeleteViewGroupInput!"
]
}
@@ -8036,43 +8073,43 @@ export default {
66,
{
"input": [
- 455,
+ 457,
"DestroyViewGroupInput!"
]
}
],
"updateMessageFolder": [
- 326,
+ 328,
{
"input": [
- 456,
+ 458,
"UpdateMessageFolderInput!"
]
}
],
"updateMessageFolders": [
- 326,
+ 328,
{
"input": [
- 458,
+ 460,
"UpdateMessageFoldersInput!"
]
}
],
"updateCalendarChannel": [
- 321,
+ 323,
{
"input": [
- 459,
+ 461,
"UpdateCalendarChannelInput!"
]
}
],
"createChatThread": [
- 312
+ 314
],
"sendChatMessage": [
- 316,
+ 318,
{
"threadId": [
3,
@@ -8093,7 +8130,7 @@ export default {
1
],
"fileAttachments": [
- 461,
+ 463,
"[FileAttachmentInput!]"
]
}
@@ -8108,7 +8145,7 @@ export default {
}
],
"renameChatThread": [
- 312,
+ 314,
{
"id": [
3,
@@ -8121,7 +8158,7 @@ export default {
}
],
"archiveChatThread": [
- 312,
+ 314,
{
"id": [
3,
@@ -8130,7 +8167,7 @@ export default {
}
],
"unarchiveChatThread": [
- 312,
+ 314,
{
"id": [
3,
@@ -8157,25 +8194,25 @@ export default {
}
],
"createSkill": [
- 310,
+ 312,
{
"input": [
- 462,
+ 464,
"CreateSkillInput!"
]
}
],
"updateSkill": [
- 310,
+ 312,
{
"input": [
- 463,
+ 465,
"UpdateSkillInput!"
]
}
],
"deleteSkill": [
- 310,
+ 312,
{
"id": [
3,
@@ -8184,7 +8221,7 @@ export default {
}
],
"activateSkill": [
- 310,
+ 312,
{
"id": [
3,
@@ -8193,7 +8230,7 @@ export default {
}
],
"deactivateSkill": [
- 310,
+ 312,
{
"id": [
3,
@@ -8202,7 +8239,7 @@ export default {
}
],
"evaluateAgentTurn": [
- 318,
+ 320,
{
"turnId": [
3,
@@ -8211,7 +8248,7 @@ export default {
}
],
"runEvaluationInput": [
- 319,
+ 321,
{
"agentId": [
3,
@@ -8227,13 +8264,13 @@ export default {
245,
{
"input": [
- 464,
+ 466,
"GetAuthorizationUrlForSSOInput!"
]
}
],
"getLoginTokenFromCredentials": [
- 254,
+ 256,
{
"email": [
1,
@@ -8317,7 +8354,7 @@ export default {
}
],
"getAuthTokensFromOTP": [
- 253,
+ 255,
{
"otp": [
1,
@@ -8390,13 +8427,18 @@ export default {
}
],
"signUpInNewWorkspace": [
- 248
+ 248,
+ {
+ "input": [
+ 467
+ ]
+ }
],
"generateTransientToken": [
249
],
"getAuthTokensFromLoginToken": [
- 253,
+ 255,
{
"loginToken": [
1,
@@ -8431,7 +8473,7 @@ export default {
}
],
"renewToken": [
- 253,
+ 255,
{
"appToken": [
1,
@@ -8440,7 +8482,7 @@ export default {
}
],
"generateApiKeyToken": [
- 252,
+ 254,
{
"apiKeyId": [
3,
@@ -8484,7 +8526,7 @@ export default {
198,
{
"input": [
- 465,
+ 468,
"CreateApplicationRegistrationInput!"
]
}
@@ -8493,7 +8535,7 @@ export default {
7,
{
"input": [
- 466,
+ 469,
"UpdateApplicationRegistrationInput!"
]
}
@@ -8520,7 +8562,7 @@ export default {
5,
{
"input": [
- 468,
+ 471,
"CreateApplicationRegistrationVariableInput!"
]
}
@@ -8529,7 +8571,7 @@ export default {
5,
{
"input": [
- 469,
+ 472,
"UpdateApplicationRegistrationVariableInput!"
]
}
@@ -8547,7 +8589,7 @@ export default {
7,
{
"file": [
- 354,
+ 356,
"Upload!"
],
"universalIdentifier": [
@@ -8618,7 +8660,7 @@ export default {
6,
{
"input": [
- 471,
+ 474,
"UpdateWorkspaceMemberSettingsInput!"
]
}
@@ -8652,7 +8694,7 @@ export default {
76,
{
"data": [
- 472,
+ 475,
"ActivateWorkspaceInput!"
]
}
@@ -8661,7 +8703,7 @@ export default {
76,
{
"data": [
- 473,
+ 476,
"UpdateWorkspaceInput!"
]
}
@@ -8676,7 +8718,7 @@ export default {
6,
{
"workspaceMigration": [
- 474,
+ 477,
"WorkspaceMigrationInput!"
]
}
@@ -8694,7 +8736,7 @@ export default {
223,
{
"input": [
- 477,
+ 480,
"SetupOIDCSsoInput!"
]
}
@@ -8703,7 +8745,7 @@ export default {
223,
{
"input": [
- 478,
+ 481,
"SetupSAMLSsoInput!"
]
}
@@ -8712,7 +8754,7 @@ export default {
219,
{
"input": [
- 479,
+ 482,
"DeleteSsoInput!"
]
}
@@ -8721,13 +8763,13 @@ export default {
220,
{
"input": [
- 480,
+ 483,
"EditSsoInput!"
]
}
],
"createObjectEvent": [
- 306,
+ 308,
{
"event": [
1,
@@ -8747,10 +8789,10 @@ export default {
}
],
"trackAnalytics": [
- 306,
+ 308,
{
"type": [
- 481,
+ 484,
"AnalyticsType!"
],
"name": [
@@ -8765,7 +8807,7 @@ export default {
}
],
"duplicateDashboard": [
- 304,
+ 306,
{
"id": [
3,
@@ -8774,7 +8816,7 @@ export default {
}
],
"impersonate": [
- 257,
+ 259,
{
"userId": [
3,
@@ -8787,16 +8829,16 @@ export default {
}
],
"sendEmail": [
- 305,
+ 307,
{
"input": [
- 482,
+ 485,
"SendEmailInput!"
]
}
],
"startChannelSync": [
- 296,
+ 298,
{
"connectedAccountId": [
3,
@@ -8805,14 +8847,14 @@ export default {
}
],
"saveImapSmtpCaldavAccount": [
- 291,
+ 293,
{
"handle": [
1,
"String!"
],
"connectionParameters": [
- 484,
+ 487,
"EmailAccountConnectionParameters!"
],
"id": [
@@ -8824,13 +8866,13 @@ export default {
169,
{
"input": [
- 486,
+ 489,
"UpdateLabPublicFeatureFlagInput!"
]
}
],
"createPublicDomain": [
- 266,
+ 268,
{
"domain": [
1,
@@ -8842,7 +8884,7 @@ export default {
}
],
"updatePublicDomain": [
- 266,
+ 268,
{
"domain": [
1,
@@ -8875,7 +8917,7 @@ export default {
78,
{
"input": [
- 487,
+ 490,
"CreateOneAppTokenInput!"
]
}
@@ -8908,7 +8950,7 @@ export default {
6
],
"createDevelopmentApplication": [
- 261,
+ 263,
{
"universalIdentifier": [
1,
@@ -8930,7 +8972,7 @@ export default {
}
],
"syncApplication": [
- 262,
+ 264,
{
"manifest": [
15,
@@ -8942,10 +8984,10 @@ export default {
}
],
"uploadApplicationFile": [
- 263,
+ 265,
{
"file": [
- 354,
+ 356,
"Upload!"
],
"applicationUniversalIdentifier": [
@@ -8953,7 +8995,7 @@ export default {
"String!"
],
"fileFolder": [
- 489,
+ 492,
"FileFolder!"
],
"filePath": [
@@ -9062,7 +9104,7 @@ export default {
3
],
"update": [
- 353
+ 355
],
"__typename": [
1
@@ -9172,7 +9214,7 @@ export default {
3
],
"update": [
- 359
+ 361
],
"__typename": [
1
@@ -9331,16 +9373,16 @@ export default {
3
],
"viewFields": [
- 365
+ 367
],
"viewFilters": [
- 366
+ 368
],
"viewFilterGroups": [
- 367
+ 369
],
"viewSorts": [
- 368
+ 370
],
"__typename": [
1
@@ -9451,7 +9493,7 @@ export default {
3
],
"update": [
- 371
+ 373
],
"__typename": [
1
@@ -9489,7 +9531,7 @@ export default {
3
],
"update": [
- 375
+ 377
],
"__typename": [
1
@@ -9565,7 +9607,7 @@ export default {
3
],
"update": [
- 380
+ 382
],
"__typename": [
1
@@ -9629,10 +9671,10 @@ export default {
3
],
"groups": [
- 385
+ 387
],
"fields": [
- 386
+ 388
],
"__typename": [
1
@@ -9652,7 +9694,7 @@ export default {
6
],
"fields": [
- 386
+ 388
],
"__typename": [
1
@@ -9820,7 +9862,7 @@ export default {
3
],
"tabs": [
- 398
+ 400
],
"__typename": [
1
@@ -9843,7 +9885,7 @@ export default {
89
],
"widgets": [
- 399
+ 401
],
"__typename": [
1
@@ -9866,7 +9908,7 @@ export default {
3
],
"gridPosition": [
- 400
+ 402
],
"position": [
15
@@ -9915,7 +9957,7 @@ export default {
3
],
"gridPosition": [
- 400
+ 402
],
"position": [
15
@@ -9941,7 +9983,7 @@ export default {
3
],
"gridPosition": [
- 400
+ 402
],
"position": [
15
@@ -10013,7 +10055,7 @@ export default {
3
],
"update": [
- 406
+ 408
],
"__typename": [
1
@@ -10173,7 +10215,7 @@ export default {
3
],
"update": [
- 411
+ 413
],
"__typename": [
1
@@ -10192,7 +10234,7 @@ export default {
},
"CreateOneObjectInput": {
"object": [
- 413
+ 415
],
"__typename": [
1
@@ -10252,7 +10294,7 @@ export default {
},
"UpdateOneObjectInput": {
"update": [
- 416
+ 418
],
"id": [
3
@@ -10307,7 +10349,7 @@ export default {
},
"CreateOneIndexInput": {
"index": [
- 418
+ 420
],
"__typename": [
1
@@ -10318,7 +10360,7 @@ export default {
3
],
"fields": [
- 419
+ 421
],
"indexType": [
48
@@ -10479,7 +10521,7 @@ export default {
1
],
"visibility": [
- 284
+ 286
],
"__typename": [
1
@@ -10496,7 +10538,7 @@ export default {
1
],
"visibility": [
- 284
+ 286
],
"__typename": [
1
@@ -10507,7 +10549,7 @@ export default {
3
],
"update": [
- 428
+ 430
],
"__typename": [
1
@@ -10515,16 +10557,16 @@ export default {
},
"UpdateMessageChannelInputUpdates": {
"visibility": [
- 271
+ 273
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 273
+ 275
],
"messageFolderImportPolicy": [
- 274
+ 276
],
"isSyncEnabled": [
6
@@ -10601,7 +10643,7 @@ export default {
},
"UpdateRoleInput": {
"update": [
- 433
+ 435
],
"id": [
3
@@ -10656,7 +10698,7 @@ export default {
3
],
"objectPermissions": [
- 435
+ 437
],
"__typename": [
1
@@ -10698,7 +10740,7 @@ export default {
3
],
"fieldPermissions": [
- 438
+ 440
],
"__typename": [
1
@@ -10729,10 +10771,10 @@ export default {
3
],
"predicates": [
- 440
+ 442
],
"predicateGroups": [
- 441
+ 443
],
"__typename": [
1
@@ -10826,7 +10868,7 @@ export default {
3
],
"update": [
- 445
+ 447
],
"__typename": [
1
@@ -10851,7 +10893,7 @@ export default {
},
"CreateOneFieldMetadataInput": {
"field": [
- 447
+ 449
],
"__typename": [
1
@@ -10927,7 +10969,7 @@ export default {
3
],
"update": [
- 449
+ 451
],
"__typename": [
1
@@ -11022,7 +11064,7 @@ export default {
3
],
"update": [
- 453
+ 455
],
"__typename": [
1
@@ -11066,7 +11108,7 @@ export default {
3
],
"update": [
- 457
+ 459
],
"__typename": [
1
@@ -11085,7 +11127,7 @@ export default {
3
],
"update": [
- 457
+ 459
],
"__typename": [
1
@@ -11096,7 +11138,7 @@ export default {
3
],
"update": [
- 460
+ 462
],
"__typename": [
1
@@ -11104,13 +11146,13 @@ export default {
},
"UpdateCalendarChannelInputUpdates": {
"visibility": [
- 324
+ 326
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 325
+ 327
],
"isSyncEnabled": [
6
@@ -11190,6 +11232,17 @@ export default {
1
]
},
+ "SignUpInNewWorkspaceInput": {
+ "displayName": [
+ 1
+ ],
+ "subdomain": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
"CreateApplicationRegistrationInput": {
"name": [
1
@@ -11212,7 +11265,7 @@ export default {
1
],
"update": [
- 467
+ 470
],
"__typename": [
1
@@ -11260,7 +11313,7 @@ export default {
1
],
"update": [
- 470
+ 473
],
"__typename": [
1
@@ -11378,7 +11431,7 @@ export default {
},
"WorkspaceMigrationInput": {
"actions": [
- 475
+ 478
],
"__typename": [
1
@@ -11386,10 +11439,10 @@ export default {
},
"WorkspaceMigrationDeleteActionInput": {
"type": [
- 476
+ 479
],
"metadataName": [
- 329
+ 331
],
"universalIdentifier": [
1
@@ -11482,7 +11535,7 @@ export default {
1
],
"files": [
- 483
+ 486
],
"__typename": [
1
@@ -11501,13 +11554,13 @@ export default {
},
"EmailAccountConnectionParameters": {
"IMAP": [
- 485
+ 488
],
"SMTP": [
- 485
+ 488
],
"CALDAV": [
- 485
+ 488
],
"__typename": [
1
@@ -11546,7 +11599,7 @@ export default {
},
"CreateOneAppTokenInput": {
"appToken": [
- 488
+ 491
],
"__typename": [
1
@@ -11575,13 +11628,13 @@ export default {
233,
{
"input": [
- 491,
+ 494,
"LogicFunctionLogsInput!"
]
}
],
"onAgentChatEvent": [
- 317,
+ 319,
{
"threadId": [
3,
@@ -11590,10 +11643,10 @@ export default {
}
],
"eventLogsLive": [
- 307,
+ 309,
{
"table": [
- 340,
+ 342,
"EventLogTable!"
]
}
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 2e329d8f5b6..c6d58c8be25 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -3365,6 +3365,11 @@ export type MutationSignUpArgs = {
};
+export type MutationSignUpInNewWorkspaceArgs = {
+ input?: InputMaybe<SignUpInNewWorkspaceInput>;
+};
+
+
export type MutationSignUpInWorkspaceArgs = {
captchaToken?: InputMaybe<Scalars['String']['input']>;
email: Scalars['String']['input'];
@@ -4241,6 +4246,7 @@ export type Query = {
chatThreads: Array<AgentChatThread>;
checkUserExists: CheckUserExist;
checkWorkspaceInviteHashIsValid: WorkspaceInviteHashValid;
+ checkWorkspaceSubdomainAvailability: SubdomainAvailabilityDto;
commandMenuItem?: Maybe<CommandMenuItem>;
commandMenuItems: Array<CommandMenuItem>;
currentUser: User;
@@ -4308,6 +4314,7 @@ export type Query = {
getViewSort?: Maybe<ViewSort>;
getViewSorts: Array<ViewSort>;
getViews: Array<View>;
+ getWorkspaceCreationDefaults: WorkspaceCreationDefaultsDto;
index: Index;
indexMetadatas: IndexConnection;
lineChartData: LineChartData;
@@ -4400,6 +4407,11 @@ export type QueryCheckWorkspaceInviteHashIsValidArgs = {
};
+export type QueryCheckWorkspaceSubdomainAvailabilityArgs = {
+ subdomain: Scalars['String']['input'];
+};
+
+
export type QueryCommandMenuItemArgs = {
id: Scalars['UUID']['input'];
};
@@ -5014,6 +5026,11 @@ export type SignUp = {
workspace: WorkspaceUrlsAndId;
};
+export type SignUpInNewWorkspaceInput = {
+ displayName?: InputMaybe<Scalars['String']['input']>;
+ subdomain?: InputMaybe<Scalars['String']['input']>;
+};
+
export type Skill = {
__typename?: 'Skill';
applicationId?: Maybe<Scalars['UUID']['output']>;
@@ -5043,6 +5060,13 @@ export type StandardOverrides = {
translations?: Maybe<Scalars['JSON']['output']>;
};
+export type SubdomainAvailabilityDto = {
+ __typename?: 'SubdomainAvailabilityDTO';
+ available: Scalars['Boolean']['output'];
+ isValid: Scalars['Boolean']['output'];
+ suggestedSubdomain: Scalars['String']['output'];
+};
+
export type Subscription = {
__typename?: 'Subscription';
eventLogsLive?: Maybe<Array<EventLogRecord>>;
@@ -6163,6 +6187,12 @@ export type WorkspaceAiStats = {
toolsCount: Scalars['Int']['output'];
};
+export type WorkspaceCreationDefaultsDto = {
+ __typename?: 'WorkspaceCreationDefaultsDTO';
+ displayName: Scalars['String']['output'];
+ subdomain: Scalars['String']['output'];
+};
+
export type WorkspaceInvitation = {
__typename?: 'WorkspaceInvitation';
email: Scalars['String']['output'];
@@ -6689,7 +6719,9 @@ export type SignUpMutationVariables = Exact<{
export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: 'AvailableWorkspacesAndAccessTokens', availableWorkspaces: { __typename?: 'AvailableWorkspaces', availableWorkspacesForSignIn: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }>, availableWorkspacesForSignUp: Array<{ __typename?: 'AvailableWorkspace', id: string, displayName?: string | null, loginToken?: string | null, inviteHash?: string | null, personalInviteToken?: string | null, logo?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, sso: Array<{ __typename?: 'SSOConnection', type: IdentityProviderType, id: string, issuer: string, name: string, status: SsoIdentityProviderStatus }> }> }, tokens: { __typename?: 'AuthTokenPair', accessOrWorkspaceAgnosticToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, refreshToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } } };
-export type SignUpInNewWorkspaceMutationVariables = Exact<{ [key: string]: never; }>;
+export type SignUpInNewWorkspaceMutationVariables = Exact<{
+ input?: InputMaybe<SignUpInNewWorkspaceInput>;
+}>;
export type SignUpInNewWorkspaceMutation = { __typename?: 'Mutation', signUpInNewWorkspace: { __typename?: 'SignUp', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null } } } };
@@ -6743,6 +6775,13 @@ export type CheckUserExistsQueryVariables = Exact<{
export type CheckUserExistsQuery = { __typename?: 'Query', checkUserExists: { __typename?: 'CheckUserExist', exists: boolean, availableWorkspacesCount: number, isEmailVerified: boolean } };
+export type CheckWorkspaceSubdomainAvailabilityQueryVariables = Exact<{
+ subdomain: Scalars['String']['input'];
+}>;
+
+
+export type CheckWorkspaceSubdomainAvailabilityQuery = { __typename?: 'Query', checkWorkspaceSubdomainAvailability: { __typename?: 'SubdomainAvailabilityDTO', isValid: boolean, available: boolean, suggestedSubdomain: string } };
+
export type FindApplicationRegistrationByClientIdQueryVariables = Exact<{
clientId: Scalars['String']['input'];
}>;
@@ -6757,6 +6796,11 @@ export type GetPublicWorkspaceDataByDomainQueryVariables = Exact<{
export type GetPublicWorkspaceDataByDomainQuery = { __typename?: 'Query', getPublicWorkspaceDataByDomain: { __typename?: 'PublicWorkspaceData', id: string, logo?: string | null, displayName?: string | null, workspaceUrls: { __typename?: 'WorkspaceUrls', subdomainUrl: string, customUrl?: string | null }, authProviders: { __typename?: 'AuthProviders', google: boolean, magicLink: boolean, password: boolean, microsoft: boolean, sso: Array<{ __typename?: 'SSOIdentityProvider', id: string, name: string, type: IdentityProviderType, status: SsoIdentityProviderStatus, issuer: string }> }, authBypassProviders?: { __typename?: 'AuthBypassProviders', google: boolean, password: boolean, microsoft: boolean } | null } };
+export type GetWorkspaceCreationDefaultsQueryVariables = Exact<{ [key: string]: never; }>;
+
+
+export type GetWorkspaceCreationDefaultsQuery = { __typename?: 'Query', getWorkspaceCreationDefaults: { __typename?: 'WorkspaceCreationDefaultsDTO', displayName: string, subdomain: string } };
+
export type ValidatePasswordResetTokenQueryVariables = Exact<{
token: Scalars['String']['input'];
}>;
@@ -8641,14 +8685,16 @@ export const ResendEmailVerificationTokenDocument = {"kind":"Document","definiti
export const DeleteTwoFactorAuthenticationMethodDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"deleteTwoFactorAuthenticationMethod"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"twoFactorAuthenticationMethodId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteTwoFactorAuthenticationMethod"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"twoFactorAuthenticationMethodId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"twoFactorAuthenticationMethodId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode<DeleteTwoFactorAuthenticationMethodMutation, DeleteTwoFactorAuthenticationMethodMutationVariables>;
export const SignInDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SignIn"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"signIn"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}},{"kind":"Argument","name":{"kind":"Name","value":"password"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password"}}},{"kind":"Argument","name":{"kind":"Name","value":"captchaToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableWorkspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspacesFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"tokens"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenPairFragment"}}]}}]}}]}},{"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":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}},{"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":"AuthTokenPairFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthTokenPair"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessOrWorkspaceAgnosticToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"refreshToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}}]}}]} as unknown as DocumentNode<SignInMutation, SignInMutationVariables>;
export const SignUpDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SignUp"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"verifyEmailRedirectPath"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"signUp"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}},{"kind":"Argument","name":{"kind":"Name","value":"password"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password"}}},{"kind":"Argument","name":{"kind":"Name","value":"captchaToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}}},{"kind":"Argument","name":{"kind":"Name","value":"locale"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}},{"kind":"Argument","name":{"kind":"Name","value":"verifyEmailRedirectPath"},"value":{"kind":"Variable","name":{"kind":"Name","value":"verifyEmailRedirectPath"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableWorkspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspacesFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"tokens"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenPairFragment"}}]}}]}}]}},{"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":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}},{"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":"AuthTokenPairFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthTokenPair"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessOrWorkspaceAgnosticToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"refreshToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}}]}}]} as unknown as DocumentNode<SignUpMutation, SignUpMutationVariables>;
-export const SignUpInNewWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SignUpInNewWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"signUpInNewWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"loginToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceUrlsFragment"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}},{"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"}}]}}]} as unknown as DocumentNode<SignUpInNewWorkspaceMutation, SignUpInNewWorkspaceMutationVariables>;
+export const SignUpInNewWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SignUpInNewWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"SignUpInNewWorkspaceInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"signUpInNewWorkspace"},"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":"loginToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceUrlsFragment"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}},{"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"}}]}}]} as unknown as DocumentNode<SignUpInNewWorkspaceMutation, SignUpInNewWorkspaceMutationVariables>;
export const SignUpInWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SignUpInWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"password"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceInviteHash"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspacePersonalInviteToken"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"defaultValue":{"kind":"NullValue"}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"locale"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"verifyEmailRedirectPath"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"signUpInWorkspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}},{"kind":"Argument","name":{"kind":"Name","value":"password"},"value":{"kind":"Variable","name":{"kind":"Name","value":"password"}}},{"kind":"Argument","name":{"kind":"Name","value":"workspaceInviteHash"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceInviteHash"}}},{"kind":"Argument","name":{"kind":"Name","value":"workspacePersonalInviteToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspacePersonalInviteToken"}}},{"kind":"Argument","name":{"kind":"Name","value":"captchaToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}}},{"kind":"Argument","name":{"kind":"Name","value":"workspaceId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceId"}}},{"kind":"Argument","name":{"kind":"Name","value":"locale"},"value":{"kind":"Variable","name":{"kind":"Name","value":"locale"}}},{"kind":"Argument","name":{"kind":"Name","value":"verifyEmailRedirectPath"},"value":{"kind":"Variable","name":{"kind":"Name","value":"verifyEmailRedirectPath"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"loginToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"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":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}}]} as unknown as DocumentNode<SignUpInWorkspaceMutation, SignUpInWorkspaceMutationVariables>;
export const UpdatePasswordViaResetTokenDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdatePasswordViaResetToken"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"newPassword"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatePasswordViaResetToken"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"passwordResetToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}},{"kind":"Argument","name":{"kind":"Name","value":"newPassword"},"value":{"kind":"Variable","name":{"kind":"Name","value":"newPassword"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode<UpdatePasswordViaResetTokenMutation, UpdatePasswordViaResetTokenMutationVariables>;
export const VerifyEmailAndGetLoginTokenDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"VerifyEmailAndGetLoginToken"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"emailVerificationToken"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"origin"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"verifyEmailAndGetLoginToken"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"emailVerificationToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"emailVerificationToken"}}},{"kind":"Argument","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}},{"kind":"Argument","name":{"kind":"Name","value":"captchaToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}}},{"kind":"Argument","name":{"kind":"Name","value":"origin"},"value":{"kind":"Variable","name":{"kind":"Name","value":"origin"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"loginToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceUrlsFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}},{"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"}}]}}]} as unknown as DocumentNode<VerifyEmailAndGetLoginTokenMutation, VerifyEmailAndGetLoginTokenMutationVariables>;
export const VerifyEmailAndGetWorkspaceAgnosticTokenDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"VerifyEmailAndGetWorkspaceAgnosticToken"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"emailVerificationToken"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"verifyEmailAndGetWorkspaceAgnosticToken"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"emailVerificationToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"emailVerificationToken"}}},{"kind":"Argument","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}},{"kind":"Argument","name":{"kind":"Name","value":"captchaToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"availableWorkspaces"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AvailableWorkspacesFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"tokens"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenPairFragment"}}]}}]}}]}},{"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":"AuthTokenFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthToken"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"token"}},{"kind":"Field","name":{"kind":"Name","value":"expiresAt"}}]}},{"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":"AuthTokenPairFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"AuthTokenPair"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessOrWorkspaceAgnosticToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"refreshToken"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"AuthTokenFragment"}}]}}]}}]} as unknown as DocumentNode<VerifyEmailAndGetWorkspaceAgnosticTokenMutation, VerifyEmailAndGetWorkspaceAgnosticTokenMutationVariables>;
export const CheckUserExistsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CheckUserExists"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"email"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"checkUserExists"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"email"},"value":{"kind":"Variable","name":{"kind":"Name","value":"email"}}},{"kind":"Argument","name":{"kind":"Name","value":"captchaToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"captchaToken"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"exists"}},{"kind":"Field","name":{"kind":"Name","value":"availableWorkspacesCount"}},{"kind":"Field","name":{"kind":"Name","value":"isEmailVerified"}}]}}]}}]} as unknown as DocumentNode<CheckUserExistsQuery, CheckUserExistsQueryVariables>;
+export const CheckWorkspaceSubdomainAvailabilityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"CheckWorkspaceSubdomainAvailability"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"subdomain"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"checkWorkspaceSubdomainAvailability"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"subdomain"},"value":{"kind":"Variable","name":{"kind":"Name","value":"subdomain"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isValid"}},{"kind":"Field","name":{"kind":"Name","value":"available"}},{"kind":"Field","name":{"kind":"Name","value":"suggestedSubdomain"}}]}}]}}]} as unknown as DocumentNode<CheckWorkspaceSubdomainAvailabilityQuery, CheckWorkspaceSubdomainAvailabilityQueryVariables>;
export const FindApplicationRegistrationByClientIdDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindApplicationRegistrationByClientId"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"clientId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findApplicationRegistrationByClientId"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"clientId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"clientId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"logoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"oAuthScopes"}},{"kind":"Field","name":{"kind":"Name","value":"websiteUrl"}}]}}]}}]} as unknown as DocumentNode<FindApplicationRegistrationByClientIdQuery, FindApplicationRegistrationByClientIdQueryVariables>;
export const GetPublicWorkspaceDataByDomainDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetPublicWorkspaceDataByDomain"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"origin"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getPublicWorkspaceDataByDomain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"origin"},"value":{"kind":"Variable","name":{"kind":"Name","value":"origin"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"logo"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"workspaceUrls"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"WorkspaceUrlsFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"authProviders"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sso"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}}]}},{"kind":"Field","name":{"kind":"Name","value":"google"}},{"kind":"Field","name":{"kind":"Name","value":"magicLink"}},{"kind":"Field","name":{"kind":"Name","value":"password"}},{"kind":"Field","name":{"kind":"Name","value":"microsoft"}}]}},{"kind":"Field","name":{"kind":"Name","value":"authBypassProviders"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"google"}},{"kind":"Field","name":{"kind":"Name","value":"password"}},{"kind":"Field","name":{"kind":"Name","value":"microsoft"}}]}}]}}]}},{"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"}}]}}]} as unknown as DocumentNode<GetPublicWorkspaceDataByDomainQuery, GetPublicWorkspaceDataByDomainQueryVariables>;
+export const GetWorkspaceCreationDefaultsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetWorkspaceCreationDefaults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getWorkspaceCreationDefaults"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"subdomain"}}]}}]}}]} as unknown as DocumentNode<GetWorkspaceCreationDefaultsQuery, GetWorkspaceCreationDefaultsQueryVariables>;
export const ValidatePasswordResetTokenDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ValidatePasswordResetToken"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"token"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"validatePasswordResetToken"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"passwordResetToken"},"value":{"kind":"Variable","name":{"kind":"Name","value":"token"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"hasPassword"}}]}}]}}]} as unknown as DocumentNode<ValidatePasswordResetTokenQuery, ValidatePasswordResetTokenQueryVariables>;
export const ResetCommandMenuItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ResetCommandMenuItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"resetCommandMenuItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectMetadataCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataItemId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<ResetCommandMenuItemMutation, ResetCommandMenuItemMutationVariables>;
export const UpdateCommandMenuItemDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCommandMenuItem"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCommandMenuItemInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCommandMenuItem"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CommandMenuItemFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CommandMenuItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"CommandMenuItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"workflowVersionId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponentId"}},{"kind":"Field","name":{"kind":"Name","value":"frontComponent"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isHeadless"}}]}},{"kind":"Field","name":{"kind":"Name","value":"engineComponentKey"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"shortLabel"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isPinned"}},{"kind":"Field","name":{"kind":"Name","value":"payload"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"PathCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"path"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectMetadataCommandMenuItemPayload"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"objectMetadataItemId"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"hotKeys"}},{"kind":"Field","name":{"kind":"Name","value":"conditionalAvailabilityExpression"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityType"}},{"kind":"Field","name":{"kind":"Name","value":"availabilityObjectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"pageLayoutId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}}]}}]} as unknown as DocumentNode<UpdateCommandMenuItemMutation, UpdateCommandMenuItemMutationVariables>;
diff --git a/packages/twenty-front/src/modules/auth/graphql/mutations/signUpInNewWorkspace.ts b/packages/twenty-front/src/modules/auth/graphql/mutations/signUpInNewWorkspace.ts
index bbef891be17..9c45c62790e 100644
--- a/packages/twenty-front/src/modules/auth/graphql/mutations/signUpInNewWorkspace.ts
+++ b/packages/twenty-front/src/modules/auth/graphql/mutations/signUpInNewWorkspace.ts
@@ -1,8 +1,8 @@
import { gql } from '@apollo/client';
export const SIGN_UP_IN_NEW_WORKSPACE = gql`
- mutation SignUpInNewWorkspace {
- signUpInNewWorkspace {
+ mutation SignUpInNewWorkspace($input: SignUpInNewWorkspaceInput) {
+ signUpInNewWorkspace(input: $input) {
loginToken {
...AuthTokenFragment
}
diff --git a/packages/twenty-front/src/modules/auth/graphql/queries/checkWorkspaceSubdomainAvailability.ts b/packages/twenty-front/src/modules/auth/graphql/queries/checkWorkspaceSubdomainAvailability.ts
new file mode 100644
index 00000000000..8d0f17f5eff
--- /dev/null
+++ b/packages/twenty-front/src/modules/auth/graphql/queries/checkWorkspaceSubdomainAvailability.ts
@@ -0,0 +1,11 @@
+import { gql } from '@apollo/client';
+
+export const CHECK_WORKSPACE_SUBDOMAIN_AVAILABILITY = gql`
+ query CheckWorkspaceSubdomainAvailability($subdomain: String!) {
+ checkWorkspaceSubdomainAvailability(subdomain: $subdomain) {
+ isValid
+ available
+ suggestedSubdomain
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/auth/graphql/queries/getWorkspaceCreationDefaults.ts b/packages/twenty-front/src/modules/auth/graphql/queries/getWorkspaceCreationDefaults.ts
new file mode 100644
index 00000000000..edb1dd259b7
--- /dev/null
+++ b/packages/twenty-front/src/modules/auth/graphql/queries/getWorkspaceCreationDefaults.ts
@@ -0,0 +1,10 @@
+import { gql } from '@apollo/client';
+
+export const GET_WORKSPACE_CREATION_DEFAULTS = gql`
+ query GetWorkspaceCreationDefaults {
+ getWorkspaceCreationDefaults {
+ displayName
+ subdomain
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/auth/hooks/useAuth.ts b/packages/twenty-front/src/modules/auth/hooks/useAuth.ts
index 66e22df49c6..570706bc1c6 100644
--- a/packages/twenty-front/src/modules/auth/hooks/useAuth.ts
+++ b/packages/twenty-front/src/modules/auth/hooks/useAuth.ts
@@ -1,4 +1,8 @@
-import { useLazyQuery, useMutation } from '@apollo/client/react';
+import {
+ useApolloClient,
+ useLazyQuery,
+ useMutation,
+} from '@apollo/client/react';
import { useCallback } from 'react';
import { AppPath } from 'twenty-shared/types';
@@ -10,6 +14,7 @@ import {
GetAuthTokensFromLoginTokenDocument,
GetAuthTokensFromOtpDocument,
GetLoginTokenFromCredentialsDocument,
+ GetWorkspaceCreationDefaultsDocument,
SignInDocument,
SignUpInWorkspaceDocument,
SignUpDocument,
@@ -70,6 +75,7 @@ export const useAuth = () => {
isEmailVerificationRequiredState,
);
const { loadCurrentUser } = useLoadCurrentUser();
+ const apolloClient = useApolloClient();
const { createWorkspace } = useSignUpInNewWorkspace();
@@ -121,6 +127,54 @@ export const useAuth = () => {
[setTokenPair],
);
+ const navigateAfterMultiWorkspaceSignInUp = useCallback(
+ async (
+ availableWorkspaces: Parameters<typeof countAvailableWorkspaces>[0],
+ email: string,
+ { newTab = true }: { newTab?: boolean } = {},
+ ) => {
+ const availableWorkspacesCount =
+ countAvailableWorkspaces(availableWorkspaces);
+
+ if (availableWorkspacesCount === 0) {
+ if (!isMultiWorkspaceEnabled) {
+ return await createWorkspace({ newTab });
+ }
+
+ await apolloClient.query({
+ query: GetWorkspaceCreationDefaultsDocument,
+ });
+ setSignInUpStep(SignInUpStep.WorkspaceCreation);
+ return;
+ }
+
+ if (availableWorkspacesCount === 1) {
+ const targetWorkspace =
+ getFirstAvailableWorkspaces(availableWorkspaces);
+
+ return await redirectToWorkspaceDomain(
+ getWorkspaceUrl(targetWorkspace.workspaceUrls),
+ targetWorkspace.loginToken ? AppPath.Verify : AppPath.SignInUp,
+ {
+ ...(targetWorkspace.loginToken && {
+ loginToken: targetWorkspace.loginToken,
+ }),
+ email,
+ },
+ );
+ }
+
+ setSignInUpStep(SignInUpStep.WorkspaceSelection);
+ },
+ [
+ apolloClient,
+ createWorkspace,
+ isMultiWorkspaceEnabled,
+ redirectToWorkspaceDomain,
+ setSignInUpStep,
+ ],
+ );
+
const handleGetLoginTokenFromCredentials = useCallback(
async (email: string, password: string, captchaToken?: string) => {
try {
@@ -207,18 +261,17 @@ export const useAuth = () => {
const { user } = await loadCurrentUser();
- if (countAvailableWorkspaces(user.availableWorkspaces) === 0) {
- return await createWorkspace({ newTab: false });
- }
-
- setSignInUpStep(SignInUpStep.WorkspaceSelection);
+ await navigateAfterMultiWorkspaceSignInUp(
+ user.availableWorkspaces,
+ user.email,
+ { newTab: false },
+ );
},
[
- createWorkspace,
verifyEmailAndGetWorkspaceAgnosticToken,
handleSetAuthTokens,
loadCurrentUser,
- setSignInUpStep,
+ navigateAfterMultiWorkspaceSignInUp,
],
);
@@ -307,31 +360,11 @@ export const useAuth = () => {
handleSetAuthTokens(data.signIn.tokens);
const { user } = await loadCurrentUser();
- const availableWorkspacesCount = countAvailableWorkspaces(
+ await navigateAfterMultiWorkspaceSignInUp(
user.availableWorkspaces,
+ user.email,
+ { newTab: false },
);
-
- if (availableWorkspacesCount === 0) {
- return createWorkspace();
- }
-
- if (availableWorkspacesCount === 1) {
- const targetWorkspace = getFirstAvailableWorkspaces(
- user.availableWorkspaces,
- );
- return await redirectToWorkspaceDomain(
- getWorkspaceUrl(targetWorkspace.workspaceUrls),
- targetWorkspace.loginToken ? AppPath.Verify : AppPath.SignInUp,
- {
- ...(targetWorkspace.loginToken && {
- loginToken: targetWorkspace.loginToken,
- }),
- email: user.email,
- },
- );
- }
-
- setSignInUpStep(SignInUpStep.WorkspaceSelection);
},
onError: (error) => {
if (isGraphqlErrorOfType(error, 'EMAIL_NOT_VERIFIED')) {
@@ -345,12 +378,11 @@ export const useAuth = () => {
},
[
handleSetAuthTokens,
- redirectToWorkspaceDomain,
signIn,
loadCurrentUser,
setSearchParams,
setSignInUpStep,
- createWorkspace,
+ navigateAfterMultiWorkspaceSignInUp,
],
);
@@ -383,11 +415,11 @@ export const useAuth = () => {
const { user } = await loadCurrentUser();
- if (countAvailableWorkspaces(user.availableWorkspaces) === 0) {
- return await createWorkspace({ newTab: false });
- }
-
- setSignInUpStep(SignInUpStep.WorkspaceSelection);
+ await navigateAfterMultiWorkspaceSignInUp(
+ user.availableWorkspaces,
+ user.email,
+ { newTab: false },
+ );
},
[
isEmailVerificationRequired,
@@ -396,7 +428,7 @@ export const useAuth = () => {
signUp,
loadCurrentUser,
setSignInUpStep,
- createWorkspace,
+ navigateAfterMultiWorkspaceSignInUp,
],
);
@@ -608,5 +640,6 @@ export const useAuth = () => {
signInWithMicrosoft: handleMicrosoftLogin,
setAuthTokens: handleSetAuthTokens,
getAuthTokensFromOTP: handleGetAuthTokensFromOTP,
+ navigateAfterMultiWorkspaceSignInUp,
};
};
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx
index 1f245d0e96d..13ef11e8210 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx
@@ -1,6 +1,7 @@
import { availableWorkspacesState } from '@/auth/states/availableWorkspacesState';
import { returnToPathState } from '@/auth/states/returnToPathState';
import { useBuildWorkspaceUrl } from '@/domain-manager/hooks/useBuildWorkspaceUrl';
+import { useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
import { Trans, useLingui } from '@lingui/react/macro';
import { FormProvider } from 'react-hook-form';
@@ -13,9 +14,9 @@ import { StyledOnboardingContentContainer } from '@/auth/components/StyledOnboar
import { SignInUpWithCredentials } from '@/auth/sign-in-up/components/internal/SignInUpWithCredentials';
import { SignInUpWithGoogle } from '@/auth/sign-in-up/components/internal/SignInUpWithGoogle';
import { SignInUpWithMicrosoft } from '@/auth/sign-in-up/components/internal/SignInUpWithMicrosoft';
+import { SignInUpWorkspaceCreationForm } from '@/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm';
import { useHandleResetPassword } from '@/auth/sign-in-up/hooks/useHandleResetPassword';
import { useSignInUpForm } from '@/auth/sign-in-up/hooks/useSignInUpForm';
-import { useSignUpInNewWorkspace } from '@/auth/sign-in-up/hooks/useSignUpInNewWorkspace';
import {
SignInUpStep,
signInUpStepState,
@@ -25,6 +26,7 @@ import { authProvidersState } from '@/client-config/states/authProvidersState';
import { isDDLLockedState } from '@/client-config/states/isDDLLockedState';
import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { isNonEmptyString } from '@sniptt/guards';
import { useContext } from 'react';
import {
@@ -37,7 +39,10 @@ import {
ThemeContext,
themeCssVariables,
} from 'twenty-ui-deprecated/theme-constants';
-import { type AvailableWorkspace } from '~/generated-metadata/graphql';
+import {
+ type AvailableWorkspace,
+ GetWorkspaceCreationDefaultsDocument,
+} from '~/generated-metadata/graphql';
import { getWorkspaceUrl } from '~/utils/getWorkspaceUrl';
const StyledWorkspaceContainer = styled.div`
@@ -131,9 +136,8 @@ export const SignInUpGlobalScopeForm = () => {
const authProviders = useAtomStateValue(authProvidersState);
const isDDLLocked = useAtomStateValue(isDDLLockedState);
const signInUpStep = useAtomStateValue(signInUpStepState);
+ const setSignInUpStep = useSetAtomState(signInUpStepState);
const { buildWorkspaceUrl } = useBuildWorkspaceUrl();
-
- const { createWorkspace } = useSignUpInNewWorkspace();
const availableWorkspaces = useAtomStateValue(availableWorkspacesState);
const { t } = useLingui();
@@ -141,6 +145,10 @@ export const SignInUpGlobalScopeForm = () => {
const { handleResetPassword } = useHandleResetPassword();
const returnToPath = useAtomStateValue(returnToPathState);
+ useQuery(GetWorkspaceCreationDefaultsDocument, {
+ skip: signInUpStep !== SignInUpStep.WorkspaceSelection,
+ });
+
const getAvailableWorkspaceUrl = (availableWorkspace: AvailableWorkspace) => {
const { pathname, searchParams } = getAvailableWorkspacePathAndSearchParams(
availableWorkspace,
@@ -200,7 +208,9 @@ export const SignInUpGlobalScopeForm = () => {
</UndecoratedLink>
))}
{!isDDLLocked && (
- <StyledWorkspaceItem onClick={() => createWorkspace()}>
+ <StyledWorkspaceItem
+ onClick={() => setSignInUpStep(SignInUpStep.WorkspaceCreation)}
+ >
<StyledWorkspaceContent>
<StyledWorkspaceLogo>
<IconPlus size={theme.icon.size.lg} />
@@ -217,38 +227,42 @@ export const SignInUpGlobalScopeForm = () => {
</StyledWorkspaceContainer>
</StyledOnboardingContentContainer>
)}
- {signInUpStep !== SignInUpStep.WorkspaceSelection && (
- <StyledOnboardingContentContainer>
- {authProviders.google && (
- <SignInUpWithGoogle
- action="list-available-workspaces"
- isGlobalScope
- />
- )}
- {authProviders.microsoft && (
- <SignInUpWithMicrosoft
- action="list-available-workspaces"
- isGlobalScope
- />
- )}
- {(authProviders.google || authProviders.microsoft) && (
- <HorizontalSeparator />
- )}
- {/* oxlint-disable-next-line react/jsx-props-no-spreading */}
- <FormProvider {...form}>
- <SignInUpWithCredentials isGlobalScope />
- </FormProvider>
- {signInUpStep === SignInUpStep.Password && (
- <StyledForgotPasswordLinkContainer>
- <ClickToActionLink
- onClick={handleResetPassword(form.getValues('email'))}
- >
- <Trans>Forgot your password?</Trans>
- </ClickToActionLink>
- </StyledForgotPasswordLinkContainer>
- )}
- </StyledOnboardingContentContainer>
+ {signInUpStep === SignInUpStep.WorkspaceCreation && (
+ <SignInUpWorkspaceCreationForm />
)}
+ {signInUpStep !== SignInUpStep.WorkspaceSelection &&
+ signInUpStep !== SignInUpStep.WorkspaceCreation && (
+ <StyledOnboardingContentContainer>
+ {authProviders.google && (
+ <SignInUpWithGoogle
+ action="list-available-workspaces"
+ isGlobalScope
+ />
+ )}
+ {authProviders.microsoft && (
+ <SignInUpWithMicrosoft
+ action="list-available-workspaces"
+ isGlobalScope
+ />
+ )}
+ {(authProviders.google || authProviders.microsoft) && (
+ <HorizontalSeparator />
+ )}
+ {/* oxlint-disable-next-line react/jsx-props-no-spreading */}
+ <FormProvider {...form}>
+ <SignInUpWithCredentials isGlobalScope />
+ </FormProvider>
+ {signInUpStep === SignInUpStep.Password && (
+ <StyledForgotPasswordLinkContainer>
+ <ClickToActionLink
+ onClick={handleResetPassword(form.getValues('email'))}
+ >
+ <Trans>Forgot your password?</Trans>
+ </ClickToActionLink>
+ </StyledForgotPasswordLinkContainer>
+ )}
+ </StyledOnboardingContentContainer>
+ )}
</>
);
};
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/__tests__/SignInUpGlobalScopeForm.test.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/__tests__/SignInUpGlobalScopeForm.test.tsx
index 26b3fac4a16..18aaa420dc6 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/__tests__/SignInUpGlobalScopeForm.test.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/__tests__/SignInUpGlobalScopeForm.test.tsx
@@ -1,3 +1,4 @@
+import { MockedProvider } from '@apollo/client/testing/react';
import { i18n } from '@lingui/core';
import { I18nProvider } from '@lingui/react';
import { fireEvent, render, screen } from '@testing-library/react';
@@ -93,13 +94,15 @@ describe('SignInUpGlobalScopeForm', () => {
});
render(
- <JotaiProvider store={jotaiStore}>
- <ThemeProvider colorScheme="light">
- <I18nProvider i18n={i18n}>
- <SignInUpGlobalScopeForm />
- </I18nProvider>
- </ThemeProvider>
- </JotaiProvider>,
+ <MockedProvider mocks={[]}>
+ <JotaiProvider store={jotaiStore}>
+ <ThemeProvider colorScheme="light">
+ <I18nProvider i18n={i18n}>
+ <SignInUpGlobalScopeForm />
+ </I18nProvider>
+ </ThemeProvider>
+ </JotaiProvider>
+ </MockedProvider>,
);
const forgotPasswordLink = screen.getByText('Forgot your password?');
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpGlobalScopeFormEffect.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpGlobalScopeFormEffect.tsx
index f553de2cc57..1b26d640311 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpGlobalScopeFormEffect.tsx
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpGlobalScopeFormEffect.tsx
@@ -5,52 +5,49 @@ import {
signInUpStepState,
} from '@/auth/states/signInUpStepState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
-import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { useLoadCurrentUser } from '@/users/hooks/useLoadCurrentUser';
import { useEffect } from 'react';
import { useSearchParams } from 'react-router-dom';
import { isDefined } from 'twenty-shared/utils';
export const SignInUpGlobalScopeFormEffect = () => {
- const setSignInUpStep = useSetAtomState(signInUpStepState);
const signInUpStep = useAtomStateValue(signInUpStepState);
const [searchParams, setSearchParams] = useSearchParams();
- const { setAuthTokens } = useAuth();
+ const { setAuthTokens, navigateAfterMultiWorkspaceSignInUp } = useAuth();
const { loadCurrentUser } = useLoadCurrentUser();
const hasAccessTokenPair = useHasAccessTokenPair();
useEffect(() => {
- // Path 1: user just bounced back from social SSO with a workspace-agnostic
- // tokenPair in the URL. Honor it unconditionally.
+ const resumeOnCentralDomain = async () => {
+ const { user } = await loadCurrentUser();
+ await navigateAfterMultiWorkspaceSignInUp(
+ user.availableWorkspaces,
+ user.email,
+ { newTab: false },
+ );
+ };
+
const tokenPairFromUrl = searchParams.get('tokenPair');
if (isDefined(tokenPairFromUrl)) {
setAuthTokens(JSON.parse(tokenPairFromUrl));
searchParams.delete('tokenPair');
setSearchParams(searchParams);
- loadCurrentUser();
- setSignInUpStep(SignInUpStep.WorkspaceSelection);
+ void resumeOnCentralDomain();
return;
}
- // Path 2: user revisits /welcome with a still-valid workspace-agnostic
- // tokenPair cookie left over from a prior SSO landing. Resume straight
- // to workspace selection instead of forcing them through the sign-in
- // form again. The step transition gates re-entry; if the cookie is
- // stale, loadCurrentUser triggers Apollo's renewal -> onUnauthenticatedError
- // path which clears the cookie and falls back to the normal form.
if (signInUpStep !== SignInUpStep.Init) return;
if (!hasAccessTokenPair) return;
- loadCurrentUser();
- setSignInUpStep(SignInUpStep.WorkspaceSelection);
+ void resumeOnCentralDomain();
}, [
searchParams,
setSearchParams,
- setSignInUpStep,
loadCurrentUser,
setAuthTokens,
signInUpStep,
hasAccessTokenPair,
+ navigateAfterMultiWorkspaceSignInUp,
]);
return <></>;
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm.tsx
new file mode 100644
index 00000000000..2037ac00293
--- /dev/null
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm.tsx
@@ -0,0 +1,162 @@
+import { SubTitle } from '@/auth/components/SubTitle';
+import { StyledOnboardingContentContainer } from '@/auth/components/StyledOnboardingContentContainer';
+import { useSignUpInNewWorkspace } from '@/auth/sign-in-up/hooks/useSignUpInNewWorkspace';
+import { useWorkspaceSubdomainField } from '@/auth/sign-in-up/hooks/useWorkspaceSubdomainField';
+import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
+import { InputHint } from '@/ui/input/components/InputHint';
+import { TextInput } from '@/ui/input/components/TextInput';
+import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
+import { useLingui } from '@lingui/react/macro';
+import { styled } from '@linaria/react';
+import { isNonEmptyString } from '@sniptt/guards';
+import { useState } from 'react';
+import { Key } from 'ts-key-enum';
+import { isDefined } from 'twenty-shared/utils';
+import { Loader } from 'twenty-ui-deprecated/feedback';
+import { MainButton } from 'twenty-ui-deprecated/input';
+import { ClickToActionLink } from 'twenty-ui-deprecated/navigation';
+import { themeCssVariables } from 'twenty-ui-deprecated/theme-constants';
+
+const StyledSection = styled.div`
+ margin-top: ${themeCssVariables.spacing[4]};
+ width: 100%;
+`;
+
+const StyledButtonContainer = styled.div`
+ margin-top: ${themeCssVariables.spacing[6]};
+ width: 100%;
+`;
+
+const StyledAvailableHint = styled.div`
+ color: ${themeCssVariables.color.green};
+ font-size: ${themeCssVariables.font.size.xs};
+ font-weight: ${themeCssVariables.font.weight.regular};
+ margin-top: ${themeCssVariables.spacing[0.5]};
+`;
+
+const StyledUnavailableHint = styled.div`
+ color: ${themeCssVariables.color.red};
+ display: flex;
+ flex-direction: column;
+ font-size: ${themeCssVariables.font.size.xs};
+ gap: ${themeCssVariables.spacing[1]};
+ margin-top: ${themeCssVariables.spacing[0.5]};
+`;
+
+export const SignInUpWorkspaceCreationForm = () => {
+ const { t } = useLingui();
+ const { createWorkspace } = useSignUpInNewWorkspace();
+ const { frontDomain } = useAtomStateValue(domainConfigurationState);
+
+ const [isSubmitting, setIsSubmitting] = useState(false);
+
+ const {
+ workspaceName,
+ subdomain,
+ status,
+ errorMessage,
+ suggestion,
+ isAvailable,
+ handleWorkspaceNameChange,
+ handleSubdomainChange,
+ applySuggestion,
+ } = useWorkspaceSubdomainField();
+
+ const isContinueDisabled =
+ workspaceName.trim() === '' || !isAvailable || isSubmitting;
+
+ const handleSubmit = async () => {
+ if (isContinueDisabled) {
+ return;
+ }
+
+ setIsSubmitting(true);
+ try {
+ await createWorkspace({
+ displayName: workspaceName.trim(),
+ subdomain,
+ newTab: false,
+ });
+ } finally {
+ setIsSubmitting(false);
+ }
+ };
+
+ const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
+ if (event.nativeEvent.isComposing || event.keyCode === 229) {
+ return;
+ }
+ if (event.key === Key.Enter) {
+ event.preventDefault();
+ handleSubmit();
+ }
+ };
+
+ const subdomainError =
+ status === 'invalid'
+ ? errorMessage
+ : status === 'unavailable'
+ ? t`This address is already taken`
+ : status === 'error'
+ ? t`Couldn't check availability. Please try again.`
+ : undefined;
+
+ return (
+ <StyledOnboardingContentContainer>
+ <SubTitle>
+ {t`Pick a name and a web address for your new workspace.`}
+ </SubTitle>
+ <StyledSection>
+ <TextInput
+ autoFocus
+ label={t`Workspace name`}
+ value={workspaceName}
+ placeholder={t`Apple`}
+ onChange={handleWorkspaceNameChange}
+ onKeyDown={handleKeyDown}
+ fullWidth
+ />
+ </StyledSection>
+ <StyledSection>
+ <TextInput
+ label={t`Workspace address`}
+ value={subdomain}
+ placeholder={t`apple`}
+ onChange={handleSubdomainChange}
+ onKeyDown={handleKeyDown}
+ rightAdornment={
+ isNonEmptyString(frontDomain) ? `.${frontDomain}` : undefined
+ }
+ error={subdomainError}
+ noErrorHelper={status === 'unavailable' || !isDefined(subdomainError)}
+ fullWidth
+ />
+ {status === 'checking' && <InputHint>{t`Checking…`}</InputHint>}
+ {status === 'available' && (
+ <StyledAvailableHint>
+ {t`This address is available`}
+ </StyledAvailableHint>
+ )}
+ {status === 'unavailable' && (
+ <StyledUnavailableHint>
+ {subdomainError}
+ {isDefined(suggestion) && (
+ <ClickToActionLink onClick={applySuggestion}>
+ {t`Use ${suggestion} instead`}
+ </ClickToActionLink>
+ )}
+ </StyledUnavailableHint>
+ )}
+ </StyledSection>
+ <StyledButtonContainer>
+ <MainButton
+ title={t`Continue`}
+ onClick={handleSubmit}
+ disabled={isContinueDisabled}
+ Icon={() => (isSubmitting ? <Loader /> : null)}
+ fullWidth
+ />
+ </StyledButtonContainer>
+ </StyledOnboardingContentContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/__tests__/SignInUpWorkspaceCreationForm.test.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/__tests__/SignInUpWorkspaceCreationForm.test.tsx
new file mode 100644
index 00000000000..ca66736859e
--- /dev/null
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/components/internal/__tests__/SignInUpWorkspaceCreationForm.test.tsx
@@ -0,0 +1,128 @@
+import { i18n } from '@lingui/core';
+import { I18nProvider } from '@lingui/react';
+import { act, fireEvent, render, screen } from '@testing-library/react';
+import { Provider as JotaiProvider } from 'jotai';
+import { SOURCE_LOCALE } from 'twenty-shared/translations';
+import { ThemeProvider } from 'twenty-ui-deprecated/theme-constants';
+
+import { SignInUpWorkspaceCreationForm } from '@/auth/sign-in-up/components/internal/SignInUpWorkspaceCreationForm';
+import {
+ jotaiStore,
+ resetJotaiStore,
+} from '@/ui/utilities/state/jotai/jotaiStore';
+import { dynamicActivate } from '~/utils/i18n/dynamicActivate';
+
+const createWorkspaceMock = jest.fn();
+const applySuggestionMock = jest.fn();
+const handleSubdomainChangeMock = jest.fn();
+const handleWorkspaceNameChangeMock = jest.fn();
+const useWorkspaceSubdomainFieldMock = jest.fn();
+
+jest.mock('@/auth/sign-in-up/hooks/useSignUpInNewWorkspace', () => ({
+ useSignUpInNewWorkspace: () => ({ createWorkspace: createWorkspaceMock }),
+}));
+
+jest.mock('@/auth/sign-in-up/hooks/useWorkspaceSubdomainField', () => ({
+ useWorkspaceSubdomainField: () => useWorkspaceSubdomainFieldMock(),
+}));
+
+dynamicActivate(SOURCE_LOCALE);
+
+const renderForm = () =>
+ render(
+ <JotaiProvider store={jotaiStore}>
+ <ThemeProvider colorScheme="light">
+ <I18nProvider i18n={i18n}>
+ <SignInUpWorkspaceCreationForm />
+ </I18nProvider>
+ </ThemeProvider>
+ </JotaiProvider>,
+ );
+
+describe('SignInUpWorkspaceCreationForm', () => {
+ beforeEach(() => {
+ jest.clearAllMocks();
+ resetJotaiStore();
+ useWorkspaceSubdomainFieldMock.mockReturnValue({
+ workspaceName: 'Apple',
+ subdomain: 'apple',
+ status: 'available',
+ errorMessage: undefined,
+ suggestion: undefined,
+ isAvailable: true,
+ handleWorkspaceNameChange: handleWorkspaceNameChangeMock,
+ handleSubdomainChange: handleSubdomainChangeMock,
+ applySuggestion: applySuggestionMock,
+ });
+ });
+
+ it('keeps Continue disabled until a workspace name is entered', () => {
+ useWorkspaceSubdomainFieldMock.mockReturnValue({
+ workspaceName: '',
+ subdomain: '',
+ status: 'idle',
+ errorMessage: undefined,
+ suggestion: undefined,
+ isAvailable: false,
+ handleWorkspaceNameChange: handleWorkspaceNameChangeMock,
+ handleSubdomainChange: handleSubdomainChangeMock,
+ applySuggestion: applySuggestionMock,
+ });
+
+ renderForm();
+
+ expect(screen.getByRole('button', { name: 'Continue' })).toBeDisabled();
+ });
+
+ it('creates the workspace with the chosen name and address in the same tab', async () => {
+ createWorkspaceMock.mockResolvedValue(undefined);
+
+ renderForm();
+
+ const continueButton = screen.getByRole('button', { name: 'Continue' });
+
+ expect(continueButton).toBeEnabled();
+
+ await act(async () => {
+ fireEvent.click(continueButton);
+ });
+
+ expect(createWorkspaceMock).toHaveBeenCalledWith({
+ displayName: 'Apple',
+ subdomain: 'apple',
+ newTab: false,
+ });
+ });
+
+ it('routes name edits back through the field hook', () => {
+ renderForm();
+
+ fireEvent.change(screen.getByLabelText('Workspace name'), {
+ target: { value: 'Acme' },
+ });
+
+ expect(handleWorkspaceNameChangeMock).toHaveBeenCalledWith('Acme');
+ });
+
+ it('offers a one-click suggestion when the address is taken', () => {
+ useWorkspaceSubdomainFieldMock.mockReturnValue({
+ workspaceName: 'Apple',
+ subdomain: 'apple',
+ status: 'unavailable',
+ errorMessage: undefined,
+ suggestion: 'apple-2',
+ isAvailable: false,
+ handleWorkspaceNameChange: handleWorkspaceNameChangeMock,
+ handleSubdomainChange: handleSubdomainChangeMock,
+ applySuggestion: applySuggestionMock,
+ });
+
+ renderForm();
+
+ expect(screen.getByRole('button', { name: 'Continue' })).toBeDisabled();
+
+ fireEvent.click(screen.getByText('Use apple-2 instead'));
+
+ expect(applySuggestionMock).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useWorkspaceSubdomainField.test.tsx b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useWorkspaceSubdomainField.test.tsx
new file mode 100644
index 00000000000..1a45804a654
--- /dev/null
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/__tests__/useWorkspaceSubdomainField.test.tsx
@@ -0,0 +1,155 @@
+import { InMemoryCache } from '@apollo/client';
+import { MockedProvider } from '@apollo/client/testing/react';
+import { i18n } from '@lingui/core';
+import { I18nProvider } from '@lingui/react';
+import { act, renderHook, waitFor } from '@testing-library/react';
+import { type ReactNode } from 'react';
+import { SOURCE_LOCALE } from 'twenty-shared/translations';
+
+import { useWorkspaceSubdomainField } from '@/auth/sign-in-up/hooks/useWorkspaceSubdomainField';
+import {
+ CheckWorkspaceSubdomainAvailabilityDocument,
+ GetWorkspaceCreationDefaultsDocument,
+} from '~/generated-metadata/graphql';
+import { dynamicActivate } from '~/utils/i18n/dynamicActivate';
+
+dynamicActivate(SOURCE_LOCALE);
+
+const availabilityMock = (
+ subdomain: string,
+ result: { isValid: boolean; available: boolean; suggestedSubdomain: string },
+) => ({
+ request: {
+ query: CheckWorkspaceSubdomainAvailabilityDocument,
+ variables: { subdomain },
+ },
+ result: {
+ data: {
+ checkWorkspaceSubdomainAvailability: {
+ __typename: 'SubdomainAvailabilityDTO',
+ ...result,
+ },
+ },
+ },
+});
+
+const cacheWithDefaults = (displayName: string, subdomain: string) => {
+ const cache = new InMemoryCache();
+
+ cache.writeQuery({
+ query: GetWorkspaceCreationDefaultsDocument,
+ data: {
+ getWorkspaceCreationDefaults: {
+ __typename: 'WorkspaceCreationDefaultsDTO',
+ displayName,
+ subdomain,
+ },
+ },
+ });
+
+ return cache;
+};
+
+const createWrapper =
+ (mocks: ReturnType<typeof availabilityMock>[], cache?: InMemoryCache) =>
+ ({ children }: { children: ReactNode }) => (
+ <MockedProvider mocks={mocks} cache={cache}>
+ <I18nProvider i18n={i18n}>{children}</I18nProvider>
+ </MockedProvider>
+ );
+
+describe('useWorkspaceSubdomainField', () => {
+ it('seeds the name and address from the preloaded backend defaults', () => {
+ const { result } = renderHook(() => useWorkspaceSubdomainField(), {
+ wrapper: createWrapper([], cacheWithDefaults('Acme', 'acme')),
+ });
+
+ expect(result.current.workspaceName).toBe('Acme');
+ expect(result.current.subdomain).toBe('acme');
+ expect(result.current.status).toBe('available');
+ expect(result.current.isAvailable).toBe(true);
+ });
+
+ it('auto-fills an available address as the workspace name is typed', async () => {
+ const { result } = renderHook(() => useWorkspaceSubdomainField(), {
+ wrapper: createWrapper([
+ availabilityMock('apple', {
+ isValid: true,
+ available: true,
+ suggestedSubdomain: 'apple',
+ }),
+ ]),
+ });
+
+ act(() => {
+ result.current.handleWorkspaceNameChange('Apple');
+ });
+
+ expect(result.current.workspaceName).toBe('Apple');
+
+ await waitFor(() => expect(result.current.subdomain).toBe('apple'), {
+ timeout: 3000,
+ });
+ expect(result.current.status).toBe('available');
+ expect(result.current.isAvailable).toBe(true);
+ });
+
+ it('reports an unavailable manual address and offers a suggestion', async () => {
+ const { result } = renderHook(() => useWorkspaceSubdomainField(), {
+ wrapper: createWrapper([
+ availabilityMock('taken', {
+ isValid: true,
+ available: false,
+ suggestedSubdomain: 'taken-2',
+ }),
+ ]),
+ });
+
+ act(() => {
+ result.current.handleSubdomainChange('taken');
+ });
+
+ await waitFor(() => expect(result.current.status).toBe('unavailable'), {
+ timeout: 3000,
+ });
+ expect(result.current.suggestion).toBe('taken-2');
+ expect(result.current.isAvailable).toBe(false);
+ });
+
+ it('re-validates an applied suggestion before enabling submission', async () => {
+ const { result } = renderHook(() => useWorkspaceSubdomainField(), {
+ wrapper: createWrapper([
+ availabilityMock('taken', {
+ isValid: true,
+ available: false,
+ suggestedSubdomain: 'taken-2',
+ }),
+ availabilityMock('taken-2', {
+ isValid: true,
+ available: true,
+ suggestedSubdomain: 'taken-2',
+ }),
+ ]),
+ });
+
+ act(() => {
+ result.current.handleSubdomainChange('taken');
+ });
+
+ await waitFor(() => expect(result.current.suggestion).toBe('taken-2'), {
+ timeout: 3000,
+ });
+
+ act(() => {
+ result.current.applySuggestion();
+ });
+
+ // Continue stays disabled until the suggestion is re-confirmed available.
+ expect(result.current.isAvailable).toBe(false);
+
+ await waitFor(() => expect(result.current.status).toBe('available'), {
+ timeout: 3000,
+ });
+ expect(result.current.subdomain).toBe('taken-2');
+ });
+});
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts
index 8e1f333e847..26c6763be2e 100644
--- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignUpInNewWorkspace.ts
@@ -17,9 +17,19 @@ export const useSignUpInNewWorkspace = () => {
SignUpInNewWorkspaceDocument,
);
- const createWorkspace = async ({ newTab } = { newTab: true }) => {
+ const createWorkspace = async ({
+ displayName,
+ subdomain,
+ newTab = true,
+ }: {
+ displayName?: string;
+ subdomain?: string;
+ newTab?: boolean;
+ } = {}) => {
try {
- const { data } = await signUpInNewWorkspaceMutation();
+ const { data } = await signUpInNewWorkspaceMutation({
+ variables: { input: { displayName, subdomain } },
+ });
assertIsDefinedOrThrow(data?.signUpInNewWorkspace);
return await redirectToWorkspaceDomain(
getWorkspaceUrl(data.signUpInNewWorkspace.workspace.workspaceUrls),
diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceSubdomainField.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceSubdomainField.ts
new file mode 100644
index 00000000000..889c20e58fe
--- /dev/null
+++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useWorkspaceSubdomainField.ts
@@ -0,0 +1,182 @@
+import { getSubdomainValidationSchema } from '@/settings/domains/utils/getSubdomainValidationSchema';
+import { useApolloClient, useLazyQuery } from '@apollo/client/react';
+import { useMemo, useState } from 'react';
+import {
+ getSubdomainSlugFromDisplayName,
+ isDefined,
+} from 'twenty-shared/utils';
+import { useDebouncedCallback } from 'use-debounce';
+import {
+ CheckWorkspaceSubdomainAvailabilityDocument,
+ GetWorkspaceCreationDefaultsDocument,
+} from '~/generated-metadata/graphql';
+
+export type SubdomainFieldStatus =
+ | 'idle'
+ | 'checking'
+ | 'available'
+ | 'unavailable'
+ | 'invalid'
+ | 'error';
+
+const AVAILABILITY_CHECK_DEBOUNCE_MS = 400;
+
+export const useWorkspaceSubdomainField = () => {
+ const apolloClient = useApolloClient();
+ const subdomainSchema = useMemo(() => getSubdomainValidationSchema(), []);
+
+ const defaults = useMemo(
+ () =>
+ apolloClient.readQuery({
+ query: GetWorkspaceCreationDefaultsDocument,
+ })?.getWorkspaceCreationDefaults,
+ [apolloClient],
+ );
+
+ const seededSubdomain = defaults?.subdomain ?? '';
+
+ const [workspaceName, setWorkspaceName] = useState(
+ defaults?.displayName ?? '',
+ );
+ const [subdomain, setSubdomain] = useState(seededSubdomain);
+ const [isManuallyEdited, setIsManuallyEdited] = useState(false);
+ const [status, setStatus] = useState<SubdomainFieldStatus>(
+ seededSubdomain !== '' ? 'available' : 'idle',
+ );
+ const [errorMessage, setErrorMessage] = useState<string | undefined>();
+ const [suggestion, setSuggestion] = useState<string | undefined>();
+
+ const [checkAvailabilityQuery] = useLazyQuery(
+ CheckWorkspaceSubdomainAvailabilityDocument,
+ { fetchPolicy: 'no-cache' },
+ );
+
+ const runAvailabilityCheck = async (
+ value: string,
+ { adoptSuggestion }: { adoptSuggestion: boolean },
+ ) => {
+ try {
+ const { data } = await checkAvailabilityQuery({
+ variables: { subdomain: value },
+ });
+
+ const result = data?.checkWorkspaceSubdomainAvailability;
+
+ if (!isDefined(result)) {
+ setStatus('idle');
+ return;
+ }
+
+ if (adoptSuggestion) {
+ setSubdomain(result.suggestedSubdomain);
+ setStatus('available');
+ setErrorMessage(undefined);
+ setSuggestion(undefined);
+ return;
+ }
+
+ if (!result.isValid) {
+ setStatus('invalid');
+ setSuggestion(undefined);
+ return;
+ }
+
+ if (result.available) {
+ setStatus('available');
+ setSuggestion(undefined);
+ return;
+ }
+
+ setStatus('unavailable');
+ setSuggestion(result.suggestedSubdomain);
+ } catch {
+ setStatus('error');
+ setSuggestion(undefined);
+ }
+ };
+
+ const debouncedAvailabilityCheck = useDebouncedCallback(
+ runAvailabilityCheck,
+ AVAILABILITY_CHECK_DEBOUNCE_MS,
+ );
+
+ const autofillFromWorkspaceName = (name: string) => {
+ const slug = getSubdomainSlugFromDisplayName(name);
+
+ if (!isDefined(slug)) {
+ debouncedAvailabilityCheck.cancel();
+ setSubdomain('');
+ setStatus('idle');
+ setSuggestion(undefined);
+ return;
+ }
+
+ setStatus('checking');
+ debouncedAvailabilityCheck(slug, { adoptSuggestion: true });
+ };
+
+ const handleWorkspaceNameChange = (name: string) => {
+ setWorkspaceName(name);
+
+ if (isManuallyEdited) {
+ return;
+ }
+
+ autofillFromWorkspaceName(name);
+ };
+
+ const handleSubdomainChange = (value: string) => {
+ const normalized = value.trim().toLowerCase();
+
+ if (normalized === '') {
+ setIsManuallyEdited(false);
+ setSubdomain('');
+ setErrorMessage(undefined);
+ setSuggestion(undefined);
+ autofillFromWorkspaceName(workspaceName);
+ return;
+ }
+
+ setIsManuallyEdited(true);
+ setSubdomain(normalized);
+
+ const validation = subdomainSchema.safeParse(normalized);
+
+ if (!validation.success) {
+ debouncedAvailabilityCheck.cancel();
+ setStatus('invalid');
+ setErrorMessage(validation.error.issues[0].message);
+ setSuggestion(undefined);
+ return;
+ }
+
+ setErrorMessage(undefined);
+ setStatus('checking');
+ debouncedAvailabilityCheck(normalized, { adoptSuggestion: false });
+ };
+
+ const applySuggestion = () => {
+ if (!isDefined(suggestion)) {
+ return;
+ }
+
+ setIsManuallyEdited(true);
+ setSubdomain(suggestion);
+ setStatus('checking');
+ setErrorMessage(undefined);
+ setSuggestion(undefined);
+ debouncedAvailabilityCheck(suggestion, { adoptSuggestion: false });
+ };
+
+ return {
+ workspaceName,
+ subdomain,
+ status,
+ errorMessage,
+ suggestion,
+ isAvailable: status === 'available',
+ handleWorkspaceNameChange,
+ handleSubdomainChange,
+ applySuggestion,
+ };
+};
diff --git a/packages/twenty-front/src/modules/auth/states/signInUpStepState.ts b/packages/twenty-front/src/modules/auth/states/signInUpStepState.ts
index b997d33d8be..bca7a4ddefc 100644
--- a/packages/twenty-front/src/modules/auth/states/signInUpStepState.ts
+++ b/packages/twenty-front/src/modules/auth/states/signInUpStepState.ts
@@ -5,6 +5,7 @@ export enum SignInUpStep {
Password = 'password',
EmailVerification = 'emailVerification',
WorkspaceSelection = 'workspaceSelection',
+ WorkspaceCreation = 'workspaceCreation',
SSOIdentityProviderSelection = 'SSOIdentityProviderSelection',
TwoFactorAuthenticationVerification = 'TwoFactorAuthenticationVerification',
TwoFactorAuthenticationProvision = 'TwoFactorAuthenticationProvision',
diff --git a/packages/twenty-front/src/pages/auth/SignInUp.tsx b/packages/twenty-front/src/pages/auth/SignInUp.tsx
index f664932a384..e4391e32725 100644
--- a/packages/twenty-front/src/pages/auth/SignInUp.tsx
+++ b/packages/twenty-front/src/pages/auth/SignInUp.tsx
@@ -80,6 +80,7 @@ const StandardContent = ({
SignInUpStep.TwoFactorAuthenticationProvision,
SignInUpStep.TwoFactorAuthenticationVerification,
SignInUpStep.WorkspaceSelection,
+ SignInUpStep.WorkspaceCreation,
].includes(signInUpStep) && <FooterNote />}
</ModalContent>
);
@@ -121,6 +122,10 @@ export const SignInUp = () => {
return t`Choose a Workspace`;
}
+ if (signInUpStep === SignInUpStep.WorkspaceCreation) {
+ return t`Create your workspace`;
+ }
+
if (signInUpStep === SignInUpStep.TwoFactorAuthenticationProvision) {
return t`Setup your 2FA`;
}
diff --git a/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx b/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx
index 672b1dfef63..8d91193e048 100644
--- a/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx
+++ b/packages/twenty-front/src/pages/onboarding/CreateWorkspace.tsx
@@ -91,7 +91,7 @@ export const CreateWorkspace = () => {
} = useForm<Form>({
mode: 'onChange',
defaultValues: {
- name: '',
+ name: currentWorkspace?.displayName ?? '',
},
resolver: zodResolver(validationSchema),
});
diff --git a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.spec.ts b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.spec.ts
index c25636f9ce5..e8fc92398e2 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.spec.ts
@@ -10,6 +10,7 @@ import { AccessTokenService } from 'src/engine/core-modules/auth/token/services/
import { RefreshTokenService } from 'src/engine/core-modules/auth/token/services/refresh-token.service';
import { WorkspaceAgnosticTokenService } from 'src/engine/core-modules/auth/token/services/workspace-agnostic-token.service';
import { CaptchaGuard } from 'src/engine/core-modules/captcha/captcha.guard';
+import { SubdomainManagerService } from 'src/engine/core-modules/domain/subdomain-manager/services/subdomain-manager.service';
import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
import { EmailVerificationService } from 'src/engine/core-modules/email-verification/services/email-verification.service';
import { FeatureFlagService } from 'src/engine/core-modules/feature-flag/services/feature-flag.service';
@@ -71,6 +72,10 @@ describe('AuthResolver', () => {
.mockResolvedValue(new URL('http://localhost:3001')),
},
},
+ {
+ provide: SubdomainManagerService,
+ useValue: {},
+ },
{
provide: UserWorkspaceService,
useValue: {},
diff --git a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts
index 813e04e28f8..91a043c2283 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/auth.resolver.ts
@@ -50,6 +50,9 @@ import { JwtTokenTypeEnum } from 'src/engine/core-modules/auth/types/jwt-token-t
import { LoginTokenJwtPayload } from 'src/engine/core-modules/auth/types/login-token-jwt-payload.type';
import { CaptchaGuard } from 'src/engine/core-modules/captcha/captcha.guard';
import { CaptchaGraphqlApiExceptionFilter } from 'src/engine/core-modules/captcha/filters/captcha-graphql-api-exception.filter';
+import { SubdomainAvailabilityDTO } from 'src/engine/core-modules/domain/subdomain-manager/dtos/subdomain-availability.dto';
+import { WorkspaceCreationDefaultsDTO } from 'src/engine/core-modules/domain/subdomain-manager/dtos/workspace-creation-defaults.dto';
+import { SubdomainManagerService } from 'src/engine/core-modules/domain/subdomain-manager/services/subdomain-manager.service';
import { WorkspaceDomainsService } from 'src/engine/core-modules/domain/workspace-domains/services/workspace-domains.service';
import { EmailVerificationExceptionFilter } from 'src/engine/core-modules/email-verification/email-verification-exception-filter.util';
import { EmailVerificationTrigger } from 'src/engine/core-modules/email-verification/email-verification.constants';
@@ -66,6 +69,7 @@ import { UserWorkspaceService } from 'src/engine/core-modules/user-workspace/use
import { UserService } from 'src/engine/core-modules/user/services/user.service';
import { UserEntity } from 'src/engine/core-modules/user/user.entity';
import { AuthProviderEnum } from 'src/engine/core-modules/workspace/types/workspace.type';
+import { WorkspaceGraphqlApiExceptionFilter } from 'src/engine/core-modules/workspace/filters/workspace-graphql-api-exception.filter';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
import { AuthProvider } from 'src/engine/decorators/auth/auth-provider.decorator';
import { AuthUser } from 'src/engine/decorators/auth/auth-user.decorator';
@@ -84,6 +88,7 @@ import { AuthToken } from './dto/auth-token.dto';
import { AuthTokens } from './dto/auth-tokens.dto';
import { GetAuthTokensFromLoginTokenInput } from './dto/get-auth-tokens-from-login-token.input';
import { LoginTokenDTO } from './dto/login-token.dto';
+import { SignUpInNewWorkspaceInput } from './dto/sign-up-in-new-workspace.input';
import { SignUpInput } from './dto/sign-up.input';
import { UserCredentialsInput } from './dto/user-credentials.input';
import { CheckUserExistDTO } from './dto/user-exists.dto';
@@ -100,6 +105,7 @@ import { AuthService } from './services/auth.service';
PermissionsGraphqlApiExceptionFilter,
EmailVerificationExceptionFilter,
TwoFactorAuthenticationExceptionFilter,
+ WorkspaceGraphqlApiExceptionFilter,
PreventNestToAutoLogGraphqlErrorsFilter,
)
export class AuthResolver {
@@ -127,6 +133,7 @@ export class AuthResolver {
private ssoService: SSOService,
private readonly eventLogEmitterService: EventLogEmitterService,
private readonly permissionsService: PermissionsService,
+ private readonly subdomainManagerService: SubdomainManagerService,
) {}
@UseGuards(CaptchaGuard, PublicEndpointGuard, NoPermissionGuard)
@@ -499,16 +506,38 @@ export class AuthResolver {
};
}
+ @Query(() => SubdomainAvailabilityDTO)
+ @UseGuards(UserAuthGuard, NoPermissionGuard)
+ async checkWorkspaceSubdomainAvailability(
+ @Args('subdomain') subdomain: string,
+ ): Promise<SubdomainAvailabilityDTO> {
+ return this.subdomainManagerService.getSubdomainAvailability(subdomain);
+ }
+
+ @Query(() => WorkspaceCreationDefaultsDTO)
+ @UseGuards(UserAuthGuard, NoPermissionGuard)
+ async getWorkspaceCreationDefaults(
+ @AuthUser() currentUser: AuthContextUser,
+ ): Promise<WorkspaceCreationDefaultsDTO> {
+ const user = await this.userService.findUserByIdOrThrow(currentUser.id);
+
+ return this.subdomainManagerService.getWorkspaceCreationDefaults(
+ user.email,
+ );
+ }
+
@Mutation(() => SignUpDTO)
@UseGuards(UserAuthGuard, NoPermissionGuard)
async signUpInNewWorkspace(
@AuthUser() currentUser: AuthContextUser,
@AuthProvider() authProvider: AuthProviderEnum,
+ @Args('input', { nullable: true }) input?: SignUpInNewWorkspaceInput,
): Promise<SignUpDTO> {
const fullUser = await this.userService.findUserByIdOrThrow(currentUser.id);
const { user, workspace } = await this.signInUpService.signUpOnNewWorkspace(
{ type: 'existingUser', existingUser: fullUser },
+ { displayName: input?.displayName, subdomain: input?.subdomain },
);
const loginToken = await this.loginTokenService.generateLoginToken(
diff --git a/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up-in-new-workspace.input.ts b/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up-in-new-workspace.input.ts
new file mode 100644
index 00000000000..ac9b885cf1c
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/auth/dto/sign-up-in-new-workspace.input.ts
@@ -0,0 +1,17 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import { IsOptional, IsString, MaxLength } from 'class-validator';
+
+@InputType()
+export class SignUpInNewWorkspaceInput {
+ @Field(() => String, { nullable: true })
+ @IsString()
+ @IsOptional()
+ @MaxLength(100)
+ displayName?: string;
+
+ @Field(() => String, { nullable: true })
+ @IsString()
+ @IsOptional()
+ subdomain?: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts
index 5bdd73ccffe..fde5b5d08bc 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts
@@ -959,19 +959,15 @@ export class AuthService {
): Promise<string> {
const email = rawEmail.toLowerCase();
- const availableWorkspacesCount =
- action === 'list-available-workspaces'
- ? await this.countAvailableWorkspacesByEmail(email)
- : 0;
-
const existingUser =
await this.userService.findUserByEmailWithWorkspaces(email);
+ // Route SSO sign-ins through the same create-or-select flow as credentials
+ // instead of landing straight on a workspace subdomain.
if (
!workspaceId &&
!workspaceInviteHash &&
- action === 'list-available-workspaces' &&
- availableWorkspacesCount > 1
+ action === 'list-available-workspaces'
) {
const user =
existingUser ??
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
index 0023028ba4c..7ca84784638 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
@@ -5,10 +5,17 @@ import { msg } from '@lingui/core/macro';
import { TWENTY_ICONS_BASE_URL } from 'twenty-shared/constants';
import { isDefined } from 'twenty-shared/utils';
import { WorkspaceActivationStatus } from 'twenty-shared/workspace';
-import { Repository, type DataSource, type QueryRunner } from 'typeorm';
+import {
+ QueryFailedError,
+ Repository,
+ type DataSource,
+ type QueryRunner,
+} from 'typeorm';
import { v4 } from 'uuid';
+import { POSTGRESQL_ERROR_CODES } from 'src/engine/api/graphql/workspace-query-runner/constants/postgres-error-codes.constants';
import { USER_SIGNUP_EVENT_NAME } from 'src/engine/api/graphql/workspace-query-runner/constants/user-signup-event-name.constants';
+import { type QueryFailedErrorWithCode } from 'src/engine/api/graphql/workspace-query-runner/utils/workspace-query-runner-graphql-api-exception-handler.util';
import { EventLogEmitterService } from 'src/engine/core-modules/event-logs/emit/event-log-emitter.service';
import { USER_SIGNUP_EVENT } from 'src/engine/core-modules/event-logs/emit/events/workspace-event/user/user-signup';
import { WORKSPACE_CREATED_EVENT } from 'src/engine/core-modules/event-logs/emit/events/workspace-event/workspace/workspace-created';
@@ -45,6 +52,10 @@ import { UserEntity } from 'src/engine/core-modules/user/user.entity';
import { WorkspaceInvitationService } from 'src/engine/core-modules/workspace-invitation/services/workspace-invitation.service';
import { AuthProviderEnum } from 'src/engine/core-modules/workspace/types/workspace.type';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
+import {
+ WorkspaceException,
+ WorkspaceExceptionCode,
+} from 'src/engine/core-modules/workspace/workspace.exception';
import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
import { WorkspaceEventEmitter } from 'src/engine/workspace-event-emitter/workspace-event-emitter';
import { getDomainFromEmailOrThrow } from 'src/utils/get-domain-from-email-or-throw';
@@ -486,6 +497,7 @@ export class SignInUpService {
async signUpOnNewWorkspace(
userData: ExistingUserOrPartialUserWithPicture['userData'],
+ options?: { displayName?: string; subdomain?: string },
) {
const email =
userData.type === 'newUserWithPicture'
@@ -504,6 +516,14 @@ export class SignInUpService {
await this.assertWorkspaceCreationAllowed(userData);
+ const requestedSubdomain = options?.subdomain;
+
+ if (isDefined(requestedSubdomain)) {
+ await this.subdomainManagerService.validateSubdomainOrThrow(
+ requestedSubdomain,
+ );
+ }
+
const shouldGrantServerAdmin = !(await this.hasServerAdmin());
const isWorkEmailFound = isWorkEmail(email);
@@ -518,11 +538,13 @@ export class SignInUpService {
const workspaceToCreate = this.workspaceRepository.create({
id: workspaceId,
- subdomain: await this.subdomainManagerService.generateSubdomain(
- isWorkEmailFound ? { userEmail: email } : {},
- ),
+ subdomain: isDefined(requestedSubdomain)
+ ? requestedSubdomain
+ : await this.subdomainManagerService.generateSubdomain(
+ isWorkEmailFound ? { userEmail: email } : {},
+ ),
workspaceCustomApplicationId,
- displayName: '',
+ displayName: options?.displayName ?? '',
inviteHash: v4(),
activationStatus: WorkspaceActivationStatus.PENDING_CREATION,
});
@@ -613,6 +635,20 @@ export class SignInUpService {
.insertWorkspaceEvent(WORKSPACE_CREATED_EVENT, {});
return { user, workspace };
+ } catch (error) {
+ const isSubdomainConflict =
+ error instanceof QueryFailedError &&
+ (error as QueryFailedErrorWithCode).code ===
+ POSTGRESQL_ERROR_CODES.UNIQUE_VIOLATION;
+
+ if (isDefined(requestedSubdomain) && isSubdomainConflict) {
+ throw new WorkspaceException(
+ 'Subdomain already taken',
+ WorkspaceExceptionCode.SUBDOMAIN_ALREADY_TAKEN,
+ );
+ }
+
+ throw error;
} finally {
await this.workspaceCacheService.invalidateAndRecompute(workspaceId, [
'flatApplicationMaps',
diff --git a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/dtos/subdomain-availability.dto.ts b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/dtos/subdomain-availability.dto.ts
new file mode 100644
index 00000000000..a51ad3fb156
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/dtos/subdomain-availability.dto.ts
@@ -0,0 +1,13 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+@ObjectType()
+export class SubdomainAvailabilityDTO {
+ @Field(() => Boolean)
+ isValid: boolean;
+
+ @Field(() => Boolean)
+ available: boolean;
+
+ @Field(() => String)
+ suggestedSubdomain: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/dtos/workspace-creation-defaults.dto.ts b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/dtos/workspace-creation-defaults.dto.ts
new file mode 100644
index 00000000000..726fd138ddc
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/dtos/workspace-creation-defaults.dto.ts
@@ -0,0 +1,10 @@
+import { Field, ObjectType } from '@nestjs/graphql';
+
+@ObjectType()
+export class WorkspaceCreationDefaultsDTO {
+ @Field(() => String)
+ displayName: string;
+
+ @Field(() => String)
+ subdomain: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/services/subdomain-manager.service.ts b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/services/subdomain-manager.service.ts
index bf9a59df26a..ccbc3dfd882 100644
--- a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/services/subdomain-manager.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/services/subdomain-manager.service.ts
@@ -1,12 +1,17 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
-import { isDefined } from 'twenty-shared/utils';
+import {
+ capitalize,
+ getSubdomainSlugFromDisplayName,
+ isDefined,
+} from 'twenty-shared/utils';
import { Repository } from 'typeorm';
+import { type SubdomainAvailabilityDTO } from 'src/engine/core-modules/domain/subdomain-manager/dtos/subdomain-availability.dto';
+import { type WorkspaceCreationDefaultsDTO } from 'src/engine/core-modules/domain/subdomain-manager/dtos/workspace-creation-defaults.dto';
import { generateRandomSubdomain } from 'src/engine/core-modules/domain/subdomain-manager/utils/generate-random-subdomain.util';
import { getSubdomainFromEmail } from 'src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-from-email.util';
-import { getSubdomainNameFromDisplayName } from 'src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-name-from-display-name.util';
import { isSubdomainValid } from 'src/engine/core-modules/domain/subdomain-manager/utils/is-subdomain-valid.util';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
@@ -15,6 +20,10 @@ import {
WorkspaceExceptionCode,
} from 'src/engine/core-modules/workspace/workspace.exception';
+const SUBDOMAIN_MAX_LENGTH = 30;
+const MAX_NUMBERED_SUFFIX_ATTEMPTS = 50;
+const MAX_RANDOM_FALLBACK_ATTEMPTS = 10;
+
@Injectable()
export class SubdomainManagerService {
constructor(
@@ -30,27 +39,73 @@ export class SubdomainManagerService {
userEmail?: string;
workspaceDisplayName?: string;
}) {
- const subdomainFromUserEmail = getSubdomainFromEmail(userEmail);
- const subdomainFromWorkspaceDisplayName =
- getSubdomainNameFromDisplayName(workspaceDisplayName);
-
const extractedSubdomain =
- subdomainFromUserEmail || subdomainFromWorkspaceDisplayName;
+ getSubdomainFromEmail(userEmail) ||
+ getSubdomainSlugFromDisplayName(workspaceDisplayName);
- const isExtractedSubdomainValid = isDefined(extractedSubdomain)
- ? isSubdomainValid(extractedSubdomain)
- : false;
+ return this.findAvailableSubdomain(extractedSubdomain ?? '');
+ }
- const subdomain = isExtractedSubdomainValid
- ? extractedSubdomain
- : generateRandomSubdomain();
+ async getWorkspaceCreationDefaults(
+ email?: string,
+ ): Promise<WorkspaceCreationDefaultsDTO> {
+ const subdomainBase = getSubdomainFromEmail(email);
- const existingWorkspaceCount = await this.workspaceRepository.count({
- where: { subdomain },
- withDeleted: true,
- });
+ if (!isDefined(subdomainBase)) {
+ return { displayName: '', subdomain: '' };
+ }
- return `${subdomain}${existingWorkspaceCount > 0 ? `-${Math.random().toString(36).substring(2, 10)}` : ''}`;
+ return {
+ displayName: capitalize(subdomainBase),
+ subdomain: await this.findAvailableSubdomain(subdomainBase),
+ };
+ }
+
+ async findAvailableSubdomain(desired: string): Promise<string> {
+ const derivedBase = isSubdomainValid(desired)
+ ? desired
+ : getSubdomainSlugFromDisplayName(desired);
+
+ const base =
+ isDefined(derivedBase) && isSubdomainValid(derivedBase)
+ ? derivedBase
+ : generateRandomSubdomain();
+
+ if (await this.isSubdomainFreeToUse(base)) {
+ return base;
+ }
+
+ for (let suffix = 2; suffix <= MAX_NUMBERED_SUFFIX_ATTEMPTS; suffix++) {
+ const candidate = this.appendNumberedSuffix(base, suffix);
+
+ if (await this.isSubdomainFreeToUse(candidate)) {
+ return candidate;
+ }
+ }
+
+ for (let attempt = 0; attempt < MAX_RANDOM_FALLBACK_ATTEMPTS; attempt++) {
+ const candidate = generateRandomSubdomain();
+
+ if (await this.isSubdomainFreeToUse(candidate)) {
+ return candidate;
+ }
+ }
+
+ return generateRandomSubdomain();
+ }
+
+ async getSubdomainAvailability(
+ subdomain: string,
+ ): Promise<SubdomainAvailabilityDTO> {
+ const isValid = isSubdomainValid(subdomain);
+ const available = isValid && (await this.isSubdomainFreeToUse(subdomain));
+
+ // Autofill adopts this directly, so never echo an invalid input back.
+ const suggestedSubdomain = available
+ ? subdomain
+ : await this.findAvailableSubdomain(subdomain);
+
+ return { isValid, available, suggestedSubdomain };
}
async isSubdomainAvailable(subdomain: string) {
@@ -84,4 +139,23 @@ export class SubdomainManagerService {
);
}
}
+
+ private async isSubdomainFreeToUse(subdomain: string): Promise<boolean> {
+ return (
+ isSubdomainValid(subdomain) &&
+ this.twentyConfigService.get('DEFAULT_SUBDOMAIN') !== subdomain &&
+ (await this.isSubdomainAvailable(subdomain))
+ );
+ }
+
+ private appendNumberedSuffix(base: string, suffix: number): string {
+ const suffixPart = `-${suffix}`;
+ const maxBaseLength = SUBDOMAIN_MAX_LENGTH - suffixPart.length;
+ const trimmedBase =
+ base.length > maxBaseLength
+ ? base.slice(0, maxBaseLength).replace(/-+$/g, '')
+ : base;
+
+ return `${trimmedBase}${suffixPart}`;
+ }
}
diff --git a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/__test__/get-subdomain-name-from-display-name.util.spec.ts b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/__test__/get-subdomain-name-from-display-name.util.spec.ts
deleted file mode 100644
index 64ad4a9cce0..00000000000
--- a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/__test__/get-subdomain-name-from-display-name.util.spec.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { getSubdomainNameFromDisplayName } from 'src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-name-from-display-name.util';
-
-describe('getSubdomainNameFromDisplayName', () => {
- it('should return a hyphen-separated, lowercase subdomain name without spaces for a valid display name', () => {
- const result = getSubdomainNameFromDisplayName('My Display Name 123');
-
- expect(result).toBe('my-display-name-123');
- });
-
- it('should return undefined if displayName is undefined', () => {
- const result = getSubdomainNameFromDisplayName(undefined);
-
- expect(result).toBeUndefined();
- });
-
- it('should handle display names with special characters by removing them but keeping words and numbers', () => {
- const result = getSubdomainNameFromDisplayName('Hello!@# World$%^ 2023');
-
- expect(result).toBe('hello-world-2023');
- });
-
- it('should return a single word in lowercase if displayName consists of one valid word', () => {
- const result = getSubdomainNameFromDisplayName('SingleWord');
-
- expect(result).toBe('singleword');
- });
-
- it('should return undefined when displayName contains only special characters', () => {
- const result = getSubdomainNameFromDisplayName('!@#$%^&*()');
-
- expect(result).toBeUndefined();
- });
-
- it('should handle display names with multiple spaces by removing them', () => {
- const result = getSubdomainNameFromDisplayName(
- ' Spaced Out Name ',
- );
-
- expect(result).toBe('spaced-out-name');
- });
-});
diff --git a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-name-from-display-name.util.ts b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-name-from-display-name.util.ts
deleted file mode 100644
index 2225f703aa5..00000000000
--- a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-name-from-display-name.util.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { isDefined } from 'twenty-shared/utils';
-export const getSubdomainNameFromDisplayName = (displayName?: string) => {
- if (!isDefined(displayName)) return;
- const displayNameWords = displayName.match(/(\w|\d)+/g);
-
- if (displayNameWords) {
- return displayNameWords.join('-').replace(/ /g, '').toLowerCase();
- }
-};
diff --git a/packages/twenty-server/src/engine/core-modules/workspace/filters/workspace-graphql-api-exception.filter.ts b/packages/twenty-server/src/engine/core-modules/workspace/filters/workspace-graphql-api-exception.filter.ts
new file mode 100644
index 00000000000..555f7f9b450
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/workspace/filters/workspace-graphql-api-exception.filter.ts
@@ -0,0 +1,11 @@
+import { Catch, type ExceptionFilter } from '@nestjs/common';
+
+import { workspaceGraphqlApiExceptionHandler } from 'src/engine/core-modules/workspace/utils/workspace-graphql-api-exception-handler.util';
+import { WorkspaceException } from 'src/engine/core-modules/workspace/workspace.exception';
+
+@Catch(WorkspaceException)
+export class WorkspaceGraphqlApiExceptionFilter implements ExceptionFilter {
+ catch(exception: WorkspaceException) {
+ return workspaceGraphqlApiExceptionHandler(exception);
+ }
+}
diff --git a/packages/twenty-shared/src/utils/index.ts b/packages/twenty-shared/src/utils/index.ts
index 8fc434dd364..5402a801c2b 100644
--- a/packages/twenty-shared/src/utils/index.ts
+++ b/packages/twenty-shared/src/utils/index.ts
@@ -184,6 +184,7 @@ export { pascalCase } from './strings/pascalCase';
export { pascalToKebab } from './strings/pascalToKebab';
export { stringifySafely } from './strings/stringifySafely';
export { uncapitalize } from './strings/uncapitalize';
+export { getSubdomainSlugFromDisplayName } from './subdomain/getSubdomainSlugFromDisplayName';
export type {
TipTapMarkType,
TipTapNodeType,
diff --git a/packages/twenty-shared/src/utils/subdomain/__tests__/getSubdomainSlugFromDisplayName.test.ts b/packages/twenty-shared/src/utils/subdomain/__tests__/getSubdomainSlugFromDisplayName.test.ts
new file mode 100644
index 00000000000..b84f55d8ad8
--- /dev/null
+++ b/packages/twenty-shared/src/utils/subdomain/__tests__/getSubdomainSlugFromDisplayName.test.ts
@@ -0,0 +1,57 @@
+import { getSubdomainSlugFromDisplayName } from '@/utils/subdomain/getSubdomainSlugFromDisplayName';
+
+describe('getSubdomainSlugFromDisplayName', () => {
+ it('should slugify a multi-word name', () => {
+ expect(getSubdomainSlugFromDisplayName('My Display Name 123')).toBe(
+ 'my-display-name-123',
+ );
+ });
+
+ it('should collapse special characters and spaces into single hyphens', () => {
+ expect(getSubdomainSlugFromDisplayName('Hello!@# World$%^ 2023')).toBe(
+ 'hello-world-2023',
+ );
+ });
+
+ it('should lowercase a single word', () => {
+ expect(getSubdomainSlugFromDisplayName('SingleWord')).toBe('singleword');
+ });
+
+ it('should trim leading and trailing whitespace and hyphens', () => {
+ expect(getSubdomainSlugFromDisplayName(' Spaced Out Name ')).toBe(
+ 'spaced-out-name',
+ );
+ });
+
+ it('should strip diacritics from accented characters', () => {
+ expect(getSubdomainSlugFromDisplayName('Café Münchën Inc.')).toBe(
+ 'cafe-munchen-inc',
+ );
+ });
+
+ it('should return undefined for undefined input', () => {
+ expect(getSubdomainSlugFromDisplayName(undefined)).toBeUndefined();
+ });
+
+ it('should return undefined when nothing usable remains', () => {
+ expect(getSubdomainSlugFromDisplayName('!@#$%^&*()')).toBeUndefined();
+ });
+
+ it('should transliterate non-latin scripts', () => {
+ expect(getSubdomainSlugFromDisplayName('日本語')).toBe('ri-ben-yu');
+ });
+
+ it('should return undefined when the result is shorter than the minimum length', () => {
+ expect(getSubdomainSlugFromDisplayName('AB')).toBeUndefined();
+ });
+
+ it('should clamp long names to the maximum length without a trailing hyphen', () => {
+ const result = getSubdomainSlugFromDisplayName(
+ 'Acme Corporation International Holdings Group',
+ );
+
+ expect(result).toBe('acme-corporation-international');
+ expect(result?.length).toBeLessThanOrEqual(30);
+ expect(result?.endsWith('-')).toBe(false);
+ });
+});
diff --git a/packages/twenty-shared/src/utils/subdomain/getSubdomainSlugFromDisplayName.ts b/packages/twenty-shared/src/utils/subdomain/getSubdomainSlugFromDisplayName.ts
new file mode 100644
index 00000000000..d4206cdc397
--- /dev/null
+++ b/packages/twenty-shared/src/utils/subdomain/getSubdomainSlugFromDisplayName.ts
@@ -0,0 +1,24 @@
+import { slugify } from 'transliteration';
+
+import { isDefined } from '@/utils/validation/isDefined';
+
+const SUBDOMAIN_MIN_LENGTH = 3;
+const SUBDOMAIN_MAX_LENGTH = 30;
+
+export const getSubdomainSlugFromDisplayName = (
+ displayName?: string,
+): string | undefined => {
+ if (!isDefined(displayName)) {
+ return undefined;
+ }
+
+ const slug = slugify(displayName, {
+ trim: true,
+ separator: '-',
+ allowedChars: 'a-zA-Z0-9',
+ })
+ .slice(0, SUBDOMAIN_MAX_LENGTH)
+ .replace(/-+$/g, '');
+
+ return slug.length >= SUBDOMAIN_MIN_LENGTH ? slug : undefined;
+};