refacto(*): rename hostname to custom domain (#10100)
This commit is contained in:
@ -109,7 +109,6 @@ export type AuthorizeApp = {
|
|||||||
export type AvailableWorkspaceOutput = {
|
export type AvailableWorkspaceOutput = {
|
||||||
__typename?: 'AvailableWorkspaceOutput';
|
__typename?: 'AvailableWorkspaceOutput';
|
||||||
displayName?: Maybe<Scalars['String']['output']>;
|
displayName?: Maybe<Scalars['String']['output']>;
|
||||||
hostname?: Maybe<Scalars['String']['output']>;
|
|
||||||
id: Scalars['String']['output'];
|
id: Scalars['String']['output'];
|
||||||
logo?: Maybe<Scalars['String']['output']>;
|
logo?: Maybe<Scalars['String']['output']>;
|
||||||
sso: Array<SsoConnection>;
|
sso: Array<SsoConnection>;
|
||||||
@ -385,15 +384,15 @@ export type CursorPaging = {
|
|||||||
last?: InputMaybe<Scalars['Int']['input']>;
|
last?: InputMaybe<Scalars['Int']['input']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CustomHostnameDetails = {
|
export type CustomDomainDetails = {
|
||||||
__typename?: 'CustomHostnameDetails';
|
__typename?: 'CustomDomainDetails';
|
||||||
hostname: Scalars['String']['output'];
|
customDomain: Scalars['String']['output'];
|
||||||
id: Scalars['String']['output'];
|
id: Scalars['String']['output'];
|
||||||
records: Array<CustomHostnameVerification>;
|
records: Array<CustomDomainVerification>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CustomHostnameVerification = {
|
export type CustomDomainVerification = {
|
||||||
__typename?: 'CustomHostnameVerification';
|
__typename?: 'CustomDomainVerification';
|
||||||
key: Scalars['String']['output'];
|
key: Scalars['String']['output'];
|
||||||
status: Scalars['String']['output'];
|
status: Scalars['String']['output'];
|
||||||
type: Scalars['String']['output'];
|
type: Scalars['String']['output'];
|
||||||
@ -1105,6 +1104,7 @@ export type MutationSendInvitationsArgs = {
|
|||||||
export type MutationSignUpArgs = {
|
export type MutationSignUpArgs = {
|
||||||
captchaToken?: InputMaybe<Scalars['String']['input']>;
|
captchaToken?: InputMaybe<Scalars['String']['input']>;
|
||||||
email: Scalars['String']['input'];
|
email: Scalars['String']['input'];
|
||||||
|
locale?: InputMaybe<Scalars['String']['input']>;
|
||||||
password: Scalars['String']['input'];
|
password: Scalars['String']['input'];
|
||||||
workspaceId?: InputMaybe<Scalars['String']['input']>;
|
workspaceId?: InputMaybe<Scalars['String']['input']>;
|
||||||
workspaceInviteHash?: InputMaybe<Scalars['String']['input']>;
|
workspaceInviteHash?: InputMaybe<Scalars['String']['input']>;
|
||||||
@ -1373,8 +1373,8 @@ export type Query = {
|
|||||||
findWorkspaceFromInviteHash: Workspace;
|
findWorkspaceFromInviteHash: Workspace;
|
||||||
findWorkspaceInvitations: Array<WorkspaceInvitation>;
|
findWorkspaceInvitations: Array<WorkspaceInvitation>;
|
||||||
getAvailablePackages: Scalars['JSON']['output'];
|
getAvailablePackages: Scalars['JSON']['output'];
|
||||||
|
getCustomDomainDetails?: Maybe<CustomDomainDetails>;
|
||||||
getEnvironmentVariablesGrouped: EnvironmentVariablesOutput;
|
getEnvironmentVariablesGrouped: EnvironmentVariablesOutput;
|
||||||
getHostnameDetails?: Maybe<CustomHostnameDetails>;
|
|
||||||
getPostgresCredentials?: Maybe<PostgresCredentials>;
|
getPostgresCredentials?: Maybe<PostgresCredentials>;
|
||||||
getProductPrices: BillingProductPricesOutput;
|
getProductPrices: BillingProductPricesOutput;
|
||||||
getPublicWorkspaceDataByDomain: PublicWorkspaceDataOutput;
|
getPublicWorkspaceDataByDomain: PublicWorkspaceDataOutput;
|
||||||
@ -1971,8 +1971,8 @@ export type UpdateWorkflowVersionStepInput = {
|
|||||||
|
|
||||||
export type UpdateWorkspaceInput = {
|
export type UpdateWorkspaceInput = {
|
||||||
allowImpersonation?: InputMaybe<Scalars['Boolean']['input']>;
|
allowImpersonation?: InputMaybe<Scalars['Boolean']['input']>;
|
||||||
|
customDomain?: InputMaybe<Scalars['String']['input']>;
|
||||||
displayName?: InputMaybe<Scalars['String']['input']>;
|
displayName?: InputMaybe<Scalars['String']['input']>;
|
||||||
hostname?: InputMaybe<Scalars['String']['input']>;
|
|
||||||
inviteHash?: InputMaybe<Scalars['String']['input']>;
|
inviteHash?: InputMaybe<Scalars['String']['input']>;
|
||||||
isGoogleAuthEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
isGoogleAuthEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
||||||
isMicrosoftAuthEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
isMicrosoftAuthEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
||||||
@ -1997,6 +1997,7 @@ export type User = {
|
|||||||
id: Scalars['UUID']['output'];
|
id: Scalars['UUID']['output'];
|
||||||
isEmailVerified: Scalars['Boolean']['output'];
|
isEmailVerified: Scalars['Boolean']['output'];
|
||||||
lastName: Scalars['String']['output'];
|
lastName: Scalars['String']['output'];
|
||||||
|
locale: Scalars['String']['output'];
|
||||||
onboardingStatus?: Maybe<OnboardingStatus>;
|
onboardingStatus?: Maybe<OnboardingStatus>;
|
||||||
passwordHash?: Maybe<Scalars['String']['output']>;
|
passwordHash?: Maybe<Scalars['String']['output']>;
|
||||||
supportUserHash?: Maybe<Scalars['String']['output']>;
|
supportUserHash?: Maybe<Scalars['String']['output']>;
|
||||||
@ -2103,13 +2104,13 @@ export type Workspace = {
|
|||||||
billingSubscriptions: Array<BillingSubscription>;
|
billingSubscriptions: Array<BillingSubscription>;
|
||||||
createdAt: Scalars['DateTime']['output'];
|
createdAt: Scalars['DateTime']['output'];
|
||||||
currentBillingSubscription?: Maybe<BillingSubscription>;
|
currentBillingSubscription?: Maybe<BillingSubscription>;
|
||||||
|
customDomain?: Maybe<Scalars['String']['output']>;
|
||||||
databaseSchema: Scalars['String']['output'];
|
databaseSchema: Scalars['String']['output'];
|
||||||
databaseUrl: Scalars['String']['output'];
|
databaseUrl: Scalars['String']['output'];
|
||||||
deletedAt?: Maybe<Scalars['DateTime']['output']>;
|
deletedAt?: Maybe<Scalars['DateTime']['output']>;
|
||||||
displayName?: Maybe<Scalars['String']['output']>;
|
displayName?: Maybe<Scalars['String']['output']>;
|
||||||
featureFlags?: Maybe<Array<FeatureFlag>>;
|
featureFlags?: Maybe<Array<FeatureFlag>>;
|
||||||
hasValidEnterpriseKey: Scalars['Boolean']['output'];
|
hasValidEnterpriseKey: Scalars['Boolean']['output'];
|
||||||
hostname?: Maybe<Scalars['String']['output']>;
|
|
||||||
id: Scalars['UUID']['output'];
|
id: Scalars['UUID']['output'];
|
||||||
inviteHash?: Maybe<Scalars['String']['output']>;
|
inviteHash?: Maybe<Scalars['String']['output']>;
|
||||||
isGoogleAuthEnabled: Scalars['Boolean']['output'];
|
isGoogleAuthEnabled: Scalars['Boolean']['output'];
|
||||||
@ -2198,18 +2199,18 @@ export type WorkspaceNameAndId = {
|
|||||||
id: Scalars['String']['output'];
|
id: Scalars['String']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type WorkspaceUrlsAndId = {
|
||||||
|
__typename?: 'WorkspaceUrlsAndId';
|
||||||
|
id: Scalars['String']['output'];
|
||||||
|
workspaceUrls: WorkspaceUrls;
|
||||||
|
};
|
||||||
|
|
||||||
export type WorkspaceUrls = {
|
export type WorkspaceUrls = {
|
||||||
__typename?: 'workspaceUrls';
|
__typename?: 'workspaceUrls';
|
||||||
customUrl?: Maybe<Scalars['String']['output']>;
|
customUrl?: Maybe<Scalars['String']['output']>;
|
||||||
subdomainUrl: Scalars['String']['output'];
|
subdomainUrl: Scalars['String']['output'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type WorkspaceUrlsAndId = {
|
|
||||||
__typename?: 'workspaceUrlsAndId';
|
|
||||||
id: Scalars['String']['output'];
|
|
||||||
workspaceUrls: WorkspaceUrls;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type RemoteServerFieldsFragment = { __typename?: 'RemoteServer', id: string, createdAt: any, foreignDataWrapperId: string, foreignDataWrapperOptions?: any | null, foreignDataWrapperType: string, updatedAt: any, schema?: string | null, label: string, userMappingOptions?: { __typename?: 'UserMappingOptionsUser', user?: string | null } | null };
|
export type RemoteServerFieldsFragment = { __typename?: 'RemoteServer', id: string, createdAt: any, foreignDataWrapperId: string, foreignDataWrapperOptions?: any | null, foreignDataWrapperType: string, updatedAt: any, schema?: string | null, label: string, userMappingOptions?: { __typename?: 'UserMappingOptionsUser', user?: string | null } | null };
|
||||||
|
|
||||||
export type RemoteTableFieldsFragment = { __typename?: 'RemoteTable', id?: any | null, name: string, schema?: string | null, status: RemoteTableStatus, schemaPendingUpdates?: Array<DistantTableUpdate> | null };
|
export type RemoteTableFieldsFragment = { __typename?: 'RemoteTable', id?: any | null, name: string, schema?: string | null, status: RemoteTableStatus, schemaPendingUpdates?: Array<DistantTableUpdate> | null };
|
||||||
|
|||||||
@ -102,7 +102,6 @@ export type AuthorizeApp = {
|
|||||||
export type AvailableWorkspaceOutput = {
|
export type AvailableWorkspaceOutput = {
|
||||||
__typename?: 'AvailableWorkspaceOutput';
|
__typename?: 'AvailableWorkspaceOutput';
|
||||||
displayName?: Maybe<Scalars['String']>;
|
displayName?: Maybe<Scalars['String']>;
|
||||||
hostname?: Maybe<Scalars['String']>;
|
|
||||||
id: Scalars['String'];
|
id: Scalars['String'];
|
||||||
logo?: Maybe<Scalars['String']>;
|
logo?: Maybe<Scalars['String']>;
|
||||||
sso: Array<SsoConnection>;
|
sso: Array<SsoConnection>;
|
||||||
@ -322,15 +321,15 @@ export type CursorPaging = {
|
|||||||
last?: InputMaybe<Scalars['Int']>;
|
last?: InputMaybe<Scalars['Int']>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CustomHostnameDetails = {
|
export type CustomDomainDetails = {
|
||||||
__typename?: 'CustomHostnameDetails';
|
__typename?: 'CustomDomainDetails';
|
||||||
hostname: Scalars['String'];
|
customDomain: Scalars['String'];
|
||||||
id: Scalars['String'];
|
id: Scalars['String'];
|
||||||
records: Array<CustomHostnameVerification>;
|
records: Array<CustomDomainVerification>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CustomHostnameVerification = {
|
export type CustomDomainVerification = {
|
||||||
__typename?: 'CustomHostnameVerification';
|
__typename?: 'CustomDomainVerification';
|
||||||
key: Scalars['String'];
|
key: Scalars['String'];
|
||||||
status: Scalars['String'];
|
status: Scalars['String'];
|
||||||
type: Scalars['String'];
|
type: Scalars['String'];
|
||||||
@ -1238,7 +1237,7 @@ export type Query = {
|
|||||||
findWorkspaceFromInviteHash: Workspace;
|
findWorkspaceFromInviteHash: Workspace;
|
||||||
findWorkspaceInvitations: Array<WorkspaceInvitation>;
|
findWorkspaceInvitations: Array<WorkspaceInvitation>;
|
||||||
getAvailablePackages: Scalars['JSON'];
|
getAvailablePackages: Scalars['JSON'];
|
||||||
getCustomHostnameDetails?: Maybe<CustomHostnameDetails>;
|
getCustomDomainDetails?: Maybe<CustomDomainDetails>;
|
||||||
getEnvironmentVariablesGrouped: EnvironmentVariablesOutput;
|
getEnvironmentVariablesGrouped: EnvironmentVariablesOutput;
|
||||||
getPostgresCredentials?: Maybe<PostgresCredentials>;
|
getPostgresCredentials?: Maybe<PostgresCredentials>;
|
||||||
getProductPrices: BillingProductPricesOutput;
|
getProductPrices: BillingProductPricesOutput;
|
||||||
@ -1760,8 +1759,8 @@ export type UpdateWorkflowVersionStepInput = {
|
|||||||
|
|
||||||
export type UpdateWorkspaceInput = {
|
export type UpdateWorkspaceInput = {
|
||||||
allowImpersonation?: InputMaybe<Scalars['Boolean']>;
|
allowImpersonation?: InputMaybe<Scalars['Boolean']>;
|
||||||
|
customDomain?: InputMaybe<Scalars['String']>;
|
||||||
displayName?: InputMaybe<Scalars['String']>;
|
displayName?: InputMaybe<Scalars['String']>;
|
||||||
hostname?: InputMaybe<Scalars['String']>;
|
|
||||||
inviteHash?: InputMaybe<Scalars['String']>;
|
inviteHash?: InputMaybe<Scalars['String']>;
|
||||||
isGoogleAuthEnabled?: InputMaybe<Scalars['Boolean']>;
|
isGoogleAuthEnabled?: InputMaybe<Scalars['Boolean']>;
|
||||||
isMicrosoftAuthEnabled?: InputMaybe<Scalars['Boolean']>;
|
isMicrosoftAuthEnabled?: InputMaybe<Scalars['Boolean']>;
|
||||||
@ -1786,6 +1785,7 @@ export type User = {
|
|||||||
id: Scalars['UUID'];
|
id: Scalars['UUID'];
|
||||||
isEmailVerified: Scalars['Boolean'];
|
isEmailVerified: Scalars['Boolean'];
|
||||||
lastName: Scalars['String'];
|
lastName: Scalars['String'];
|
||||||
|
locale: Scalars['String'];
|
||||||
onboardingStatus?: Maybe<OnboardingStatus>;
|
onboardingStatus?: Maybe<OnboardingStatus>;
|
||||||
passwordHash?: Maybe<Scalars['String']>;
|
passwordHash?: Maybe<Scalars['String']>;
|
||||||
supportUserHash?: Maybe<Scalars['String']>;
|
supportUserHash?: Maybe<Scalars['String']>;
|
||||||
@ -1882,13 +1882,13 @@ export type Workspace = {
|
|||||||
billingSubscriptions: Array<BillingSubscription>;
|
billingSubscriptions: Array<BillingSubscription>;
|
||||||
createdAt: Scalars['DateTime'];
|
createdAt: Scalars['DateTime'];
|
||||||
currentBillingSubscription?: Maybe<BillingSubscription>;
|
currentBillingSubscription?: Maybe<BillingSubscription>;
|
||||||
|
customDomain?: Maybe<Scalars['String']>;
|
||||||
databaseSchema: Scalars['String'];
|
databaseSchema: Scalars['String'];
|
||||||
databaseUrl: Scalars['String'];
|
databaseUrl: Scalars['String'];
|
||||||
deletedAt?: Maybe<Scalars['DateTime']>;
|
deletedAt?: Maybe<Scalars['DateTime']>;
|
||||||
displayName?: Maybe<Scalars['String']>;
|
displayName?: Maybe<Scalars['String']>;
|
||||||
featureFlags?: Maybe<Array<FeatureFlag>>;
|
featureFlags?: Maybe<Array<FeatureFlag>>;
|
||||||
hasValidEnterpriseKey: Scalars['Boolean'];
|
hasValidEnterpriseKey: Scalars['Boolean'];
|
||||||
hostname?: Maybe<Scalars['String']>;
|
|
||||||
id: Scalars['UUID'];
|
id: Scalars['UUID'];
|
||||||
inviteHash?: Maybe<Scalars['String']>;
|
inviteHash?: Maybe<Scalars['String']>;
|
||||||
isGoogleAuthEnabled: Scalars['Boolean'];
|
isGoogleAuthEnabled: Scalars['Boolean'];
|
||||||
@ -1977,18 +1977,18 @@ export type WorkspaceNameAndId = {
|
|||||||
id: Scalars['String'];
|
id: Scalars['String'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type WorkspaceUrlsAndId = {
|
||||||
|
__typename?: 'WorkspaceUrlsAndId';
|
||||||
|
id: Scalars['String'];
|
||||||
|
workspaceUrls: WorkspaceUrls;
|
||||||
|
};
|
||||||
|
|
||||||
export type WorkspaceUrls = {
|
export type WorkspaceUrls = {
|
||||||
__typename?: 'workspaceUrls';
|
__typename?: 'workspaceUrls';
|
||||||
customUrl?: Maybe<Scalars['String']>;
|
customUrl?: Maybe<Scalars['String']>;
|
||||||
subdomainUrl: Scalars['String'];
|
subdomainUrl: Scalars['String'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type WorkspaceUrlsAndId = {
|
|
||||||
__typename?: 'workspaceUrlsAndId';
|
|
||||||
id: Scalars['String'];
|
|
||||||
workspaceUrls: WorkspaceUrls;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TimelineCalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: any, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: CalendarChannelVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
|
export type TimelineCalendarEventFragmentFragment = { __typename?: 'TimelineCalendarEvent', id: any, title: string, description: string, location: string, startsAt: string, endsAt: string, isFullDay: boolean, visibility: CalendarChannelVisibility, participants: Array<{ __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string }> };
|
||||||
|
|
||||||
export type TimelineCalendarEventParticipantFragmentFragment = { __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
|
export type TimelineCalendarEventParticipantFragmentFragment = { __typename?: 'TimelineCalendarEventParticipant', personId?: any | null, workspaceMemberId?: any | null, firstName: string, lastName: string, displayName: string, avatarUrl: string, handle: string };
|
||||||
@ -2133,7 +2133,7 @@ export type ImpersonateMutationVariables = Exact<{
|
|||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'ImpersonateOutput', workspace: { __typename?: 'workspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } }, loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } };
|
export type ImpersonateMutation = { __typename?: 'Mutation', impersonate: { __typename?: 'ImpersonateOutput', workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } }, loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string } } };
|
||||||
|
|
||||||
export type RenewTokenMutationVariables = Exact<{
|
export type RenewTokenMutationVariables = Exact<{
|
||||||
appToken: Scalars['String'];
|
appToken: Scalars['String'];
|
||||||
@ -2160,7 +2160,7 @@ export type SignUpMutationVariables = Exact<{
|
|||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: 'SignUpOutput', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspace: { __typename?: 'workspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } } };
|
export type SignUpMutation = { __typename?: 'Mutation', signUp: { __typename?: 'SignUpOutput', loginToken: { __typename?: 'AuthToken', token: string, expiresAt: string }, workspace: { __typename?: 'WorkspaceUrlsAndId', id: string, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } } };
|
||||||
|
|
||||||
export type UpdatePasswordViaResetTokenMutationVariables = Exact<{
|
export type UpdatePasswordViaResetTokenMutationVariables = Exact<{
|
||||||
token: Scalars['String'];
|
token: Scalars['String'];
|
||||||
@ -2295,7 +2295,7 @@ export type ListSsoIdentityProvidersByWorkspaceIdQueryVariables = Exact<{ [key:
|
|||||||
|
|
||||||
export type ListSsoIdentityProvidersByWorkspaceIdQuery = { __typename?: 'Query', listSSOIdentityProvidersByWorkspaceId: Array<{ __typename?: 'FindAvailableSSOIDPOutput', type: IdentityProviderType, id: string, name: string, issuer: string, status: SsoIdentityProviderStatus }> };
|
export type ListSsoIdentityProvidersByWorkspaceIdQuery = { __typename?: 'Query', listSSOIdentityProvidersByWorkspaceId: Array<{ __typename?: 'FindAvailableSSOIDPOutput', type: IdentityProviderType, id: string, name: string, issuer: string, status: SsoIdentityProviderStatus }> };
|
||||||
|
|
||||||
export type UserQueryFragmentFragment = { __typename?: 'User', id: any, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars: any, analyticsTinybirdJwts?: { __typename?: 'AnalyticsTinybirdJwtMap', getWebhookAnalytics: string, getPageviewsAnalytics: string, getUsersAnalytics: string, getServerlessFunctionDuration: string, getServerlessFunctionSuccessRate: string, getServerlessFunctionErrorCount: string } | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', settingsPermissions?: Array<SettingsFeatures> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: any, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, subdomain: string, hasValidEnterpriseKey: boolean, hostname?: string | null, metadataVersion: number, workspaceMembersCount?: number | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: any, key: FeatureFlagKey, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus, interval?: SubscriptionInterval | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus }> } | null, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: any, logo?: string | null, displayName?: string | null, subdomain: string, hostname?: string | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } | null }> };
|
export type UserQueryFragmentFragment = { __typename?: 'User', id: any, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars: any, analyticsTinybirdJwts?: { __typename?: 'AnalyticsTinybirdJwtMap', getWebhookAnalytics: string, getPageviewsAnalytics: string, getUsersAnalytics: string, getServerlessFunctionDuration: string, getServerlessFunctionSuccessRate: string, getServerlessFunctionErrorCount: string } | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', settingsPermissions?: Array<SettingsFeatures> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: any, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, subdomain: string, hasValidEnterpriseKey: boolean, customDomain?: string | null, metadataVersion: number, workspaceMembersCount?: number | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: any, key: FeatureFlagKey, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus, interval?: SubscriptionInterval | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus }> } | null, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: any, logo?: string | null, displayName?: string | null, subdomain: string, customDomain?: string | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } | null }> };
|
||||||
|
|
||||||
export type DeleteUserAccountMutationVariables = Exact<{ [key: string]: never; }>;
|
export type DeleteUserAccountMutationVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
@ -2312,7 +2312,7 @@ export type UploadProfilePictureMutation = { __typename?: 'Mutation', uploadProf
|
|||||||
export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>;
|
export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: any, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars: any, analyticsTinybirdJwts?: { __typename?: 'AnalyticsTinybirdJwtMap', getWebhookAnalytics: string, getPageviewsAnalytics: string, getUsersAnalytics: string, getServerlessFunctionDuration: string, getServerlessFunctionSuccessRate: string, getServerlessFunctionErrorCount: string } | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', settingsPermissions?: Array<SettingsFeatures> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: any, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, subdomain: string, hasValidEnterpriseKey: boolean, hostname?: string | null, metadataVersion: number, workspaceMembersCount?: number | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: any, key: FeatureFlagKey, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus, interval?: SubscriptionInterval | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus }> } | null, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: any, logo?: string | null, displayName?: string | null, subdomain: string, hostname?: string | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } | null }> } };
|
export type GetCurrentUserQuery = { __typename?: 'Query', currentUser: { __typename?: 'User', id: any, firstName: string, lastName: string, email: string, canImpersonate: boolean, supportUserHash?: string | null, onboardingStatus?: OnboardingStatus | null, userVars: any, analyticsTinybirdJwts?: { __typename?: 'AnalyticsTinybirdJwtMap', getWebhookAnalytics: string, getPageviewsAnalytics: string, getUsersAnalytics: string, getServerlessFunctionDuration: string, getServerlessFunctionSuccessRate: string, getServerlessFunctionErrorCount: string } | null, workspaceMember?: { __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } } | null, workspaceMembers?: Array<{ __typename?: 'WorkspaceMember', id: any, colorScheme: string, avatarUrl?: string | null, locale?: string | null, timeZone?: string | null, dateFormat?: WorkspaceMemberDateFormatEnum | null, timeFormat?: WorkspaceMemberTimeFormatEnum | null, name: { __typename?: 'FullName', firstName: string, lastName: string } }> | null, currentUserWorkspace?: { __typename?: 'UserWorkspace', settingsPermissions?: Array<SettingsFeatures> | null } | null, currentWorkspace?: { __typename?: 'Workspace', id: any, displayName?: string | null, logo?: string | null, inviteHash?: string | null, allowImpersonation: boolean, activationStatus: WorkspaceActivationStatus, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean, subdomain: string, hasValidEnterpriseKey: boolean, customDomain?: string | null, metadataVersion: number, workspaceMembersCount?: number | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null }, featureFlags?: Array<{ __typename?: 'FeatureFlag', id: any, key: FeatureFlagKey, value: boolean, workspaceId: string }> | null, currentBillingSubscription?: { __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus, interval?: SubscriptionInterval | null } | null, billingSubscriptions: Array<{ __typename?: 'BillingSubscription', id: any, status: SubscriptionStatus }> } | null, workspaces: Array<{ __typename?: 'UserWorkspace', workspace?: { __typename?: 'Workspace', id: any, logo?: string | null, displayName?: string | null, subdomain: string, customDomain?: string | null, workspaceUrls: { __typename?: 'workspaceUrls', subdomainUrl: string, customUrl?: string | null } } | null }> } };
|
||||||
|
|
||||||
export type ActivateWorkflowVersionMutationVariables = Exact<{
|
export type ActivateWorkflowVersionMutationVariables = Exact<{
|
||||||
workflowVersionId: Scalars['String'];
|
workflowVersionId: Scalars['String'];
|
||||||
@ -2415,7 +2415,7 @@ export type UpdateWorkspaceMutationVariables = Exact<{
|
|||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type UpdateWorkspaceMutation = { __typename?: 'Mutation', updateWorkspace: { __typename?: 'Workspace', id: any, hostname?: string | null, subdomain: string, displayName?: string | null, logo?: string | null, allowImpersonation: boolean, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean } };
|
export type UpdateWorkspaceMutation = { __typename?: 'Mutation', updateWorkspace: { __typename?: 'Workspace', id: any, customDomain?: string | null, subdomain: string, displayName?: string | null, logo?: string | null, allowImpersonation: boolean, isPublicInviteLinkEnabled: boolean, isGoogleAuthEnabled: boolean, isMicrosoftAuthEnabled: boolean, isPasswordAuthEnabled: boolean } };
|
||||||
|
|
||||||
export type UploadWorkspaceLogoMutationVariables = Exact<{
|
export type UploadWorkspaceLogoMutationVariables = Exact<{
|
||||||
file: Scalars['Upload'];
|
file: Scalars['Upload'];
|
||||||
@ -2424,10 +2424,10 @@ export type UploadWorkspaceLogoMutationVariables = Exact<{
|
|||||||
|
|
||||||
export type UploadWorkspaceLogoMutation = { __typename?: 'Mutation', uploadWorkspaceLogo: string };
|
export type UploadWorkspaceLogoMutation = { __typename?: 'Mutation', uploadWorkspaceLogo: string };
|
||||||
|
|
||||||
export type GetCustomHostnameDetailsQueryVariables = Exact<{ [key: string]: never; }>;
|
export type GetCustomDomainDetailsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
export type GetCustomHostnameDetailsQuery = { __typename?: 'Query', getCustomHostnameDetails?: { __typename?: 'CustomHostnameDetails', hostname: string, records: Array<{ __typename?: 'CustomHostnameVerification', type: string, key: string, value: string, validationType: string, status: string }> } | null };
|
export type GetCustomDomainDetailsQuery = { __typename?: 'Query', getCustomDomainDetails?: { __typename?: 'CustomDomainDetails', customDomain: string, records: Array<{ __typename?: 'CustomDomainVerification', type: string, key: string, value: string, validationType: string, status: string }> } | null };
|
||||||
|
|
||||||
export type GetWorkspaceFromInviteHashQueryVariables = Exact<{
|
export type GetWorkspaceFromInviteHashQueryVariables = Exact<{
|
||||||
inviteHash: Scalars['String'];
|
inviteHash: Scalars['String'];
|
||||||
@ -2589,7 +2589,7 @@ export const UserQueryFragmentFragmentDoc = gql`
|
|||||||
isPasswordAuthEnabled
|
isPasswordAuthEnabled
|
||||||
subdomain
|
subdomain
|
||||||
hasValidEnterpriseKey
|
hasValidEnterpriseKey
|
||||||
hostname
|
customDomain
|
||||||
workspaceUrls {
|
workspaceUrls {
|
||||||
subdomainUrl
|
subdomainUrl
|
||||||
customUrl
|
customUrl
|
||||||
@ -2618,7 +2618,7 @@ export const UserQueryFragmentFragmentDoc = gql`
|
|||||||
logo
|
logo
|
||||||
displayName
|
displayName
|
||||||
subdomain
|
subdomain
|
||||||
hostname
|
customDomain
|
||||||
workspaceUrls {
|
workspaceUrls {
|
||||||
subdomainUrl
|
subdomainUrl
|
||||||
customUrl
|
customUrl
|
||||||
@ -4791,7 +4791,7 @@ export const UpdateWorkspaceDocument = gql`
|
|||||||
mutation UpdateWorkspace($input: UpdateWorkspaceInput!) {
|
mutation UpdateWorkspace($input: UpdateWorkspaceInput!) {
|
||||||
updateWorkspace(data: $input) {
|
updateWorkspace(data: $input) {
|
||||||
id
|
id
|
||||||
hostname
|
customDomain
|
||||||
subdomain
|
subdomain
|
||||||
displayName
|
displayName
|
||||||
logo
|
logo
|
||||||
@ -4860,10 +4860,10 @@ export function useUploadWorkspaceLogoMutation(baseOptions?: Apollo.MutationHook
|
|||||||
export type UploadWorkspaceLogoMutationHookResult = ReturnType<typeof useUploadWorkspaceLogoMutation>;
|
export type UploadWorkspaceLogoMutationHookResult = ReturnType<typeof useUploadWorkspaceLogoMutation>;
|
||||||
export type UploadWorkspaceLogoMutationResult = Apollo.MutationResult<UploadWorkspaceLogoMutation>;
|
export type UploadWorkspaceLogoMutationResult = Apollo.MutationResult<UploadWorkspaceLogoMutation>;
|
||||||
export type UploadWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions<UploadWorkspaceLogoMutation, UploadWorkspaceLogoMutationVariables>;
|
export type UploadWorkspaceLogoMutationOptions = Apollo.BaseMutationOptions<UploadWorkspaceLogoMutation, UploadWorkspaceLogoMutationVariables>;
|
||||||
export const GetCustomHostnameDetailsDocument = gql`
|
export const GetCustomDomainDetailsDocument = gql`
|
||||||
query GetCustomHostnameDetails {
|
query GetCustomDomainDetails {
|
||||||
getCustomHostnameDetails {
|
getCustomDomainDetails {
|
||||||
hostname
|
customDomain
|
||||||
records {
|
records {
|
||||||
type
|
type
|
||||||
key
|
key
|
||||||
@ -4876,31 +4876,31 @@ export const GetCustomHostnameDetailsDocument = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __useGetCustomHostnameDetailsQuery__
|
* __useGetCustomDomainDetailsQuery__
|
||||||
*
|
*
|
||||||
* To run a query within a React component, call `useGetCustomHostnameDetailsQuery` and pass it any options that fit your needs.
|
* To run a query within a React component, call `useGetCustomDomainDetailsQuery` and pass it any options that fit your needs.
|
||||||
* When your component renders, `useGetCustomHostnameDetailsQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
* When your component renders, `useGetCustomDomainDetailsQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
||||||
* you can use to render your UI.
|
* you can use to render your UI.
|
||||||
*
|
*
|
||||||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* const { data, loading, error } = useGetCustomHostnameDetailsQuery({
|
* const { data, loading, error } = useGetCustomDomainDetailsQuery({
|
||||||
* variables: {
|
* variables: {
|
||||||
* },
|
* },
|
||||||
* });
|
* });
|
||||||
*/
|
*/
|
||||||
export function useGetCustomHostnameDetailsQuery(baseOptions?: Apollo.QueryHookOptions<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>) {
|
export function useGetCustomDomainDetailsQuery(baseOptions?: Apollo.QueryHookOptions<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>) {
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
return Apollo.useQuery<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>(GetCustomHostnameDetailsDocument, options);
|
return Apollo.useQuery<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>(GetCustomDomainDetailsDocument, options);
|
||||||
}
|
}
|
||||||
export function useGetCustomHostnameDetailsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>) {
|
export function useGetCustomDomainDetailsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>) {
|
||||||
const options = {...defaultOptions, ...baseOptions}
|
const options = {...defaultOptions, ...baseOptions}
|
||||||
return Apollo.useLazyQuery<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>(GetCustomHostnameDetailsDocument, options);
|
return Apollo.useLazyQuery<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>(GetCustomDomainDetailsDocument, options);
|
||||||
}
|
}
|
||||||
export type GetCustomHostnameDetailsQueryHookResult = ReturnType<typeof useGetCustomHostnameDetailsQuery>;
|
export type GetCustomDomainDetailsQueryHookResult = ReturnType<typeof useGetCustomDomainDetailsQuery>;
|
||||||
export type GetCustomHostnameDetailsLazyQueryHookResult = ReturnType<typeof useGetCustomHostnameDetailsLazyQuery>;
|
export type GetCustomDomainDetailsLazyQueryHookResult = ReturnType<typeof useGetCustomDomainDetailsLazyQuery>;
|
||||||
export type GetCustomHostnameDetailsQueryResult = Apollo.QueryResult<GetCustomHostnameDetailsQuery, GetCustomHostnameDetailsQueryVariables>;
|
export type GetCustomDomainDetailsQueryResult = Apollo.QueryResult<GetCustomDomainDetailsQuery, GetCustomDomainDetailsQueryVariables>;
|
||||||
export const GetWorkspaceFromInviteHashDocument = gql`
|
export const GetWorkspaceFromInviteHashDocument = gql`
|
||||||
query GetWorkspaceFromInviteHash($inviteHash: String!) {
|
query GetWorkspaceFromInviteHash($inviteHash: String!) {
|
||||||
findWorkspaceFromInviteHash(inviteHash: $inviteHash) {
|
findWorkspaceFromInviteHash(inviteHash: $inviteHash) {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export type CurrentWorkspace = Pick<
|
|||||||
| 'isPasswordAuthEnabled'
|
| 'isPasswordAuthEnabled'
|
||||||
| 'hasValidEnterpriseKey'
|
| 'hasValidEnterpriseKey'
|
||||||
| 'subdomain'
|
| 'subdomain'
|
||||||
| 'hostname'
|
| 'customDomain'
|
||||||
| 'workspaceUrls'
|
| 'workspaceUrls'
|
||||||
| 'metadataVersion'
|
| 'metadataVersion'
|
||||||
>;
|
>;
|
||||||
|
|||||||
@ -161,7 +161,7 @@ export const queries = {
|
|||||||
isPasswordAuthEnabled
|
isPasswordAuthEnabled
|
||||||
subdomain
|
subdomain
|
||||||
hasValidEnterpriseKey
|
hasValidEnterpriseKey
|
||||||
hostname
|
customDomain
|
||||||
workspaceUrls {
|
workspaceUrls {
|
||||||
subdomainUrl
|
subdomainUrl
|
||||||
customUrl
|
customUrl
|
||||||
@ -190,7 +190,7 @@ export const queries = {
|
|||||||
logo
|
logo
|
||||||
displayName
|
displayName
|
||||||
subdomain
|
subdomain
|
||||||
hostname
|
customDomain
|
||||||
workspaceUrls {
|
workspaceUrls {
|
||||||
subdomainUrl
|
subdomainUrl
|
||||||
customUrl
|
customUrl
|
||||||
@ -308,7 +308,7 @@ export const responseData = {
|
|||||||
},
|
},
|
||||||
workspaceMembers: [],
|
workspaceMembers: [],
|
||||||
currentUserWorkspace: {
|
currentUserWorkspace: {
|
||||||
settingsPermissions: ['DATA_MODEL']
|
settingsPermissions: ['DATA_MODEL'],
|
||||||
},
|
},
|
||||||
currentWorkspace: {
|
currentWorkspace: {
|
||||||
id: 'test-workspace-id',
|
id: 'test-workspace-id',
|
||||||
@ -323,7 +323,7 @@ export const responseData = {
|
|||||||
isMicrosoftAuthEnabled: false,
|
isMicrosoftAuthEnabled: false,
|
||||||
isPasswordAuthEnabled: true,
|
isPasswordAuthEnabled: true,
|
||||||
subdomain: 'test',
|
subdomain: 'test',
|
||||||
hostname: null,
|
customDomain: null,
|
||||||
workspaceUrls: {
|
workspaceUrls: {
|
||||||
customUrl: undefined,
|
customUrl: undefined,
|
||||||
subdomainUrl: 'https://test.twenty.com/',
|
subdomainUrl: 'https://test.twenty.com/',
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { ExpandableList } from '@/ui/layout/expandable-list/components/Expandabl
|
|||||||
import { isDefined } from 'twenty-shared';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { checkUrlType } from '~/utils/checkUrlType';
|
import { checkUrlType } from '~/utils/checkUrlType';
|
||||||
import { getAbsoluteUrl } from '~/utils/url/getAbsoluteUrl';
|
import { getAbsoluteUrl } from '~/utils/url/getAbsoluteUrl';
|
||||||
import { getUrlHostName } from '~/utils/url/getUrlHostName';
|
import { getUrlHostname } from '~/utils/url/getUrlHostname';
|
||||||
|
|
||||||
type LinksDisplayProps = {
|
type LinksDisplayProps = {
|
||||||
value?: FieldLinksValue;
|
value?: FieldLinksValue;
|
||||||
@ -29,7 +29,7 @@ export const LinksDisplay = ({ value }: LinksDisplayProps) => {
|
|||||||
const absoluteUrl = getAbsoluteUrl(url);
|
const absoluteUrl = getAbsoluteUrl(url);
|
||||||
return {
|
return {
|
||||||
url: absoluteUrl,
|
url: absoluteUrl,
|
||||||
label: label || getUrlHostName(absoluteUrl),
|
label: label || getUrlHostname(absoluteUrl),
|
||||||
type: checkUrlType(absoluteUrl),
|
type: checkUrlType(absoluteUrl),
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -40,7 +40,7 @@ export const USER_QUERY_FRAGMENT = gql`
|
|||||||
isPasswordAuthEnabled
|
isPasswordAuthEnabled
|
||||||
subdomain
|
subdomain
|
||||||
hasValidEnterpriseKey
|
hasValidEnterpriseKey
|
||||||
hostname
|
customDomain
|
||||||
workspaceUrls {
|
workspaceUrls {
|
||||||
subdomainUrl
|
subdomainUrl
|
||||||
customUrl
|
customUrl
|
||||||
@ -69,7 +69,7 @@ export const USER_QUERY_FRAGMENT = gql`
|
|||||||
logo
|
logo
|
||||||
displayName
|
displayName
|
||||||
subdomain
|
subdomain
|
||||||
hostname
|
customDomain
|
||||||
workspaceUrls {
|
workspaceUrls {
|
||||||
subdomainUrl
|
subdomainUrl
|
||||||
customUrl
|
customUrl
|
||||||
|
|||||||
@ -4,7 +4,7 @@ export const UPDATE_WORKSPACE = gql`
|
|||||||
mutation UpdateWorkspace($input: UpdateWorkspaceInput!) {
|
mutation UpdateWorkspace($input: UpdateWorkspaceInput!) {
|
||||||
updateWorkspace(data: $input) {
|
updateWorkspace(data: $input) {
|
||||||
id
|
id
|
||||||
hostname
|
customDomain
|
||||||
subdomain
|
subdomain
|
||||||
displayName
|
displayName
|
||||||
logo
|
logo
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { gql } from '@apollo/client';
|
import { gql } from '@apollo/client';
|
||||||
|
|
||||||
export const GET_CUSTOM_HOSTNAME_DETAILS = gql`
|
export const GET_CUSTOM_DOMAIN_DETAILS = gql`
|
||||||
query GetCustomHostnameDetails {
|
query GetCustomDomainDetails {
|
||||||
getCustomHostnameDetails {
|
getCustomDomainDetails {
|
||||||
hostname
|
customDomain
|
||||||
records {
|
records {
|
||||||
type
|
type
|
||||||
key
|
key
|
||||||
@ -3,29 +3,29 @@ import styled from '@emotion/styled';
|
|||||||
import { useLingui } from '@lingui/react/macro';
|
import { useLingui } from '@lingui/react/macro';
|
||||||
import { Controller, useFormContext } from 'react-hook-form';
|
import { Controller, useFormContext } from 'react-hook-form';
|
||||||
import { H2Title, Section } from 'twenty-ui';
|
import { H2Title, Section } from 'twenty-ui';
|
||||||
import { useGetCustomHostnameDetailsQuery } from '~/generated/graphql';
|
import { useGetCustomDomainDetailsQuery } from '~/generated/graphql';
|
||||||
import { SettingsHostnameRecords } from '~/pages/settings/workspace/SettingsHostnameRecords';
|
import { SettingsCustomDomainRecords } from '~/pages/settings/workspace/SettingsCustomDomainRecords';
|
||||||
|
|
||||||
const StyledDomainFromWrapper = styled.div`
|
const StyledDomainFormWrapper = styled.div`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const SettingsHostname = () => {
|
export const SettingsCustomDomain = () => {
|
||||||
const { data: getHostnameDetailsData } = useGetCustomHostnameDetailsQuery();
|
const { data: getCustomDomainDetailsData } = useGetCustomDomainDetailsQuery();
|
||||||
|
|
||||||
const { t } = useLingui();
|
const { t } = useLingui();
|
||||||
|
|
||||||
const { control, getValues } = useFormContext<{
|
const { control, getValues } = useFormContext<{
|
||||||
hostname: string;
|
customDomain: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section>
|
<Section>
|
||||||
<H2Title title={t`Domain`} description={t`Set the name of your domain`} />
|
<H2Title title={t`Domain`} description={t`Set the name of your domain`} />
|
||||||
<StyledDomainFromWrapper>
|
<StyledDomainFormWrapper>
|
||||||
<Controller
|
<Controller
|
||||||
name="hostname"
|
name="customDomain"
|
||||||
control={control}
|
control={control}
|
||||||
render={({ field: { onChange, value }, fieldState: { error } }) => (
|
render={({ field: { onChange, value }, fieldState: { error } }) => (
|
||||||
<TextInputV2
|
<TextInputV2
|
||||||
@ -37,12 +37,12 @@ export const SettingsHostname = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
</StyledDomainFromWrapper>
|
</StyledDomainFormWrapper>
|
||||||
{getHostnameDetailsData?.getCustomHostnameDetails &&
|
{getCustomDomainDetailsData?.getCustomDomainDetails &&
|
||||||
getValues('hostname') ===
|
getValues('customDomain') ===
|
||||||
getHostnameDetailsData?.getCustomHostnameDetails?.hostname && (
|
getCustomDomainDetailsData?.getCustomDomainDetails?.customDomain && (
|
||||||
<SettingsHostnameRecords
|
<SettingsCustomDomainRecords
|
||||||
records={getHostnameDetailsData.getCustomHostnameDetails.records}
|
records={getCustomDomainDetailsData.getCustomDomainDetails.records}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
@ -2,16 +2,16 @@ import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-shared';
|
import { isDefined } from 'twenty-shared';
|
||||||
import { useGetCustomHostnameDetailsQuery } from '~/generated/graphql';
|
import { useGetCustomDomainDetailsQuery } from '~/generated/graphql';
|
||||||
|
|
||||||
export const SettingsHostnameEffect = () => {
|
export const SettingsCustomDomainEffect = () => {
|
||||||
const { refetch } = useGetCustomHostnameDetailsQuery();
|
const { refetch } = useGetCustomDomainDetailsQuery();
|
||||||
|
|
||||||
const currentWorkspace = useRecoilValue(currentWorkspaceState);
|
const currentWorkspace = useRecoilValue(currentWorkspaceState);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let pollIntervalFn: null | ReturnType<typeof setInterval> = null;
|
let pollIntervalFn: null | ReturnType<typeof setInterval> = null;
|
||||||
if (isDefined(currentWorkspace?.hostname)) {
|
if (isDefined(currentWorkspace?.customDomain)) {
|
||||||
pollIntervalFn = setInterval(async () => {
|
pollIntervalFn = setInterval(async () => {
|
||||||
refetch();
|
refetch();
|
||||||
}, 3000);
|
}, 3000);
|
||||||
@ -22,7 +22,7 @@ export const SettingsHostnameEffect = () => {
|
|||||||
clearInterval(pollIntervalFn);
|
clearInterval(pollIntervalFn);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [currentWorkspace?.hostname, refetch]);
|
}, [currentWorkspace?.customDomain, refetch]);
|
||||||
|
|
||||||
return <></>;
|
return <></>;
|
||||||
};
|
};
|
||||||
@ -5,12 +5,12 @@ import { TableBody } from '@/ui/layout/table/components/TableBody';
|
|||||||
import { TableCell } from '@/ui/layout/table/components/TableCell';
|
import { TableCell } from '@/ui/layout/table/components/TableCell';
|
||||||
import { TextInputV2 } from '@/ui/input/components/TextInputV2';
|
import { TextInputV2 } from '@/ui/input/components/TextInputV2';
|
||||||
import { Table } from '@/ui/layout/table/components/Table';
|
import { Table } from '@/ui/layout/table/components/Table';
|
||||||
import { CustomHostnameDetails } from '~/generated/graphql';
|
import { CustomDomainDetails } from '~/generated/graphql';
|
||||||
|
|
||||||
export const SettingsHostnameRecords = ({
|
export const SettingsCustomDomainRecords = ({
|
||||||
records,
|
records,
|
||||||
}: {
|
}: {
|
||||||
records: CustomHostnameDetails['records'];
|
records: CustomDomainDetails['records'];
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<Table>
|
<Table>
|
||||||
@ -12,7 +12,7 @@ import {
|
|||||||
useUpdateWorkspaceMutation,
|
useUpdateWorkspaceMutation,
|
||||||
} from '~/generated/graphql';
|
} from '~/generated/graphql';
|
||||||
import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
|
import { useRedirectToWorkspaceDomain } from '@/domain-manager/hooks/useRedirectToWorkspaceDomain';
|
||||||
import { SettingsHostname } from '~/pages/settings/workspace/SettingsHostname';
|
import { SettingsCustomDomain } from '~/pages/settings/workspace/SettingsCustomDomain';
|
||||||
import { SettingsSubdomain } from '~/pages/settings/workspace/SettingsSubdomain';
|
import { SettingsSubdomain } from '~/pages/settings/workspace/SettingsSubdomain';
|
||||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||||
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
|
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
|
||||||
@ -24,7 +24,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|||||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
|
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
|
||||||
import { SettingsPath } from '@/types/SettingsPath';
|
import { SettingsPath } from '@/types/SettingsPath';
|
||||||
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
import { SettingsHostnameEffect } from '~/pages/settings/workspace/SettingsHostnameEffect';
|
import { SettingsCustomDomainEffect } from '~/pages/settings/workspace/SettingsCustomDomainEffect';
|
||||||
import { isDefined } from 'twenty-shared';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
|
||||||
export const SettingsDomain = () => {
|
export const SettingsDomain = () => {
|
||||||
@ -40,12 +40,12 @@ export const SettingsDomain = () => {
|
|||||||
.regex(/^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$/, {
|
.regex(/^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$/, {
|
||||||
message: t`Use letter, number and dash only. Start and finish with a letter or a number`,
|
message: t`Use letter, number and dash only. Start and finish with a letter or a number`,
|
||||||
}),
|
}),
|
||||||
hostname: z
|
customDomain: z
|
||||||
.string()
|
.string()
|
||||||
.regex(
|
.regex(
|
||||||
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/,
|
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/,
|
||||||
{
|
{
|
||||||
message: t`Invalid custom hostname. Custom hostnames have to be smaller than 256 characters in length, cannot be IP addresses, cannot contain spaces, cannot contain any special characters such as _~\`!@#$%^*()=+{}[]|\\;:'",<>/? and cannot begin or end with a '-' character.`,
|
message: t`Invalid custom domain. Custom domains have to be smaller than 256 characters in length, cannot be IP addresses, cannot contain spaces, cannot contain any special characters such as _~\`!@#$%^*()=+{}[]|\\;:'",<>/? and cannot begin or end with a '-' character.`,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.max(256)
|
.max(256)
|
||||||
@ -68,35 +68,37 @@ export const SettingsDomain = () => {
|
|||||||
|
|
||||||
const form = useForm<{
|
const form = useForm<{
|
||||||
subdomain: string;
|
subdomain: string;
|
||||||
hostname: string | null;
|
customDomain: string | null;
|
||||||
}>({
|
}>({
|
||||||
mode: 'onChange',
|
mode: 'onChange',
|
||||||
delayError: 500,
|
delayError: 500,
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
subdomain: currentWorkspace?.subdomain ?? '',
|
subdomain: currentWorkspace?.subdomain ?? '',
|
||||||
hostname: currentWorkspace?.hostname ?? null,
|
customDomain: currentWorkspace?.customDomain ?? null,
|
||||||
},
|
},
|
||||||
resolver: zodResolver(validationSchema),
|
resolver: zodResolver(validationSchema),
|
||||||
});
|
});
|
||||||
|
|
||||||
const subdomainValue = form.watch('subdomain');
|
const subdomainValue = form.watch('subdomain');
|
||||||
const hostnameValue = form.watch('hostname');
|
const customDomainValue = form.watch('customDomain');
|
||||||
|
|
||||||
const updateHostname = (
|
const updateCustomDomain = (
|
||||||
hostname: string | null | undefined,
|
customDomain: string | null | undefined,
|
||||||
currentWorkspace: CurrentWorkspace,
|
currentWorkspace: CurrentWorkspace,
|
||||||
) => {
|
) => {
|
||||||
updateWorkspace({
|
updateWorkspace({
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
hostname:
|
customDomain:
|
||||||
isDefined(hostname) && hostname.length > 0 ? hostname : null,
|
isDefined(customDomain) && customDomain.length > 0
|
||||||
|
? customDomain
|
||||||
|
: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onCompleted: () => {
|
onCompleted: () => {
|
||||||
setCurrentWorkspace({
|
setCurrentWorkspace({
|
||||||
...currentWorkspace,
|
...currentWorkspace,
|
||||||
hostname: hostname,
|
customDomain,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
@ -173,8 +175,8 @@ export const SettingsDomain = () => {
|
|||||||
return updateSubdomain(values.subdomain, currentWorkspace);
|
return updateSubdomain(values.subdomain, currentWorkspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (values.hostname !== currentWorkspace.hostname) {
|
if (values.customDomain !== currentWorkspace.customDomain) {
|
||||||
return updateHostname(values.hostname, currentWorkspace);
|
return updateCustomDomain(values.customDomain, currentWorkspace);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -197,7 +199,7 @@ export const SettingsDomain = () => {
|
|||||||
isSaveDisabled={
|
isSaveDisabled={
|
||||||
!form.formState.isValid ||
|
!form.formState.isValid ||
|
||||||
(subdomainValue === currentWorkspace?.subdomain &&
|
(subdomainValue === currentWorkspace?.subdomain &&
|
||||||
hostnameValue === currentWorkspace?.hostname)
|
customDomainValue === currentWorkspace?.customDomain)
|
||||||
}
|
}
|
||||||
onCancel={() => navigate(SettingsPath.Workspace)}
|
onCancel={() => navigate(SettingsPath.Workspace)}
|
||||||
onSave={handleSave}
|
onSave={handleSave}
|
||||||
@ -207,13 +209,13 @@ export const SettingsDomain = () => {
|
|||||||
<SettingsPageContainer>
|
<SettingsPageContainer>
|
||||||
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
||||||
<FormProvider {...form}>
|
<FormProvider {...form}>
|
||||||
{(!currentWorkspace?.hostname || !isCustomDomainEnabled) && (
|
{(!currentWorkspace?.customDomain || !isCustomDomainEnabled) && (
|
||||||
<SettingsSubdomain />
|
<SettingsSubdomain />
|
||||||
)}
|
)}
|
||||||
{isCustomDomainEnabled && (
|
{isCustomDomainEnabled && (
|
||||||
<>
|
<>
|
||||||
<SettingsHostnameEffect />
|
<SettingsCustomDomainEffect />
|
||||||
<SettingsHostname />
|
<SettingsCustomDomain />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</FormProvider>
|
</FormProvider>
|
||||||
|
|||||||
@ -1,25 +1,25 @@
|
|||||||
import { getUrlHostName } from '~/utils/url/getUrlHostName';
|
import { getUrlHostname } from '~/utils/url/getUrlHostname';
|
||||||
|
|
||||||
describe('getUrlHostName', () => {
|
describe('getUrlHostname', () => {
|
||||||
it("returns the URL's hostname", () => {
|
it("returns the URL's hostname", () => {
|
||||||
expect(getUrlHostName('https://www.example.com')).toBe('example.com');
|
expect(getUrlHostname('https://www.example.com')).toBe('example.com');
|
||||||
expect(getUrlHostName('http://subdomain.example.com')).toBe(
|
expect(getUrlHostname('http://subdomain.example.com')).toBe(
|
||||||
'subdomain.example.com',
|
'subdomain.example.com',
|
||||||
);
|
);
|
||||||
expect(getUrlHostName('https://www.example.com/path')).toBe('example.com');
|
expect(getUrlHostname('https://www.example.com/path')).toBe('example.com');
|
||||||
expect(getUrlHostName('https://www.example.com?query=123')).toBe(
|
expect(getUrlHostname('https://www.example.com?query=123')).toBe(
|
||||||
'example.com',
|
'example.com',
|
||||||
);
|
);
|
||||||
expect(getUrlHostName('http://localhost:3000')).toBe('localhost');
|
expect(getUrlHostname('http://localhost:3000')).toBe('localhost');
|
||||||
expect(getUrlHostName('example.com')).toBe('example.com');
|
expect(getUrlHostname('example.com')).toBe('example.com');
|
||||||
expect(getUrlHostName('www.subdomain.example.com')).toBe(
|
expect(getUrlHostname('www.subdomain.example.com')).toBe(
|
||||||
'subdomain.example.com',
|
'subdomain.example.com',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns an empty string for invalid URLs', () => {
|
it('returns an empty string for invalid URLs', () => {
|
||||||
expect(getUrlHostName('?o')).toBe('');
|
expect(getUrlHostname('?o')).toBe('');
|
||||||
expect(getUrlHostName('')).toBe('');
|
expect(getUrlHostname('')).toBe('');
|
||||||
expect(getUrlHostName('\\')).toBe('');
|
expect(getUrlHostname('\\')).toBe('');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { getAbsoluteUrl } from '~/utils/url/getAbsoluteUrl';
|
import { getAbsoluteUrl } from '~/utils/url/getAbsoluteUrl';
|
||||||
|
|
||||||
export const getUrlHostName = (url: string) => {
|
export const getUrlHostname = (url: string) => {
|
||||||
try {
|
try {
|
||||||
const absoluteUrl = getAbsoluteUrl(url);
|
const absoluteUrl = getAbsoluteUrl(url);
|
||||||
return new URL(absoluteUrl).hostname.replace(/^www\./i, '');
|
return new URL(absoluteUrl).hostname.replace(/^www\./i, '');
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
|
export class RenameHostnameToCustomDomain1739178177820
|
||||||
|
implements MigrationInterface
|
||||||
|
{
|
||||||
|
name = 'RenameHostnameToCustomDomain1739178177820';
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "core"."workspace" RENAME COLUMN "hostname" TO "customDomain"`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "core"."workspace" RENAME CONSTRAINT "UQ_e6fa363bdaf45cbf8ce97bcebf0" TO "UQ_900f0a3eb789159c26c8bcb39cd"`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "core"."workspace" RENAME CONSTRAINT "UQ_900f0a3eb789159c26c8bcb39cd" TO "UQ_e6fa363bdaf45cbf8ce97bcebf0"`,
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
`ALTER TABLE "core"."workspace" RENAME COLUMN "customDomain" TO "hostname"`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -99,7 +99,7 @@ describe('AdminPanelService', () => {
|
|||||||
{
|
{
|
||||||
provide: DomainManagerService,
|
provide: DomainManagerService,
|
||||||
useValue: {
|
useValue: {
|
||||||
getworkspaceUrls: jest.fn().mockReturnValue({
|
getWorkspaceUrls: jest.fn().mockReturnValue({
|
||||||
customUrl: undefined,
|
customUrl: undefined,
|
||||||
subdomainUrl: 'https://twenty.twenty.com',
|
subdomainUrl: 'https://twenty.twenty.com',
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -74,7 +74,7 @@ export class AdminPanelService {
|
|||||||
return {
|
return {
|
||||||
workspace: {
|
workspace: {
|
||||||
id: user.workspaces[0].workspace.id,
|
id: user.workspaces[0].workspace.id,
|
||||||
workspaceUrls: this.domainManagerService.getworkspaceUrls(
|
workspaceUrls: this.domainManagerService.getWorkspaceUrls(
|
||||||
user.workspaces[0].workspace,
|
user.workspaces[0].workspace,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { AuthToken } from 'src/engine/core-modules/auth/dto/token.entity';
|
import { AuthToken } from 'src/engine/core-modules/auth/dto/token.entity';
|
||||||
import { workspaceUrlsAndId } from 'src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto';
|
import { WorkspaceUrlsAndId } from 'src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class ImpersonateOutput {
|
export class ImpersonateOutput {
|
||||||
@Field(() => AuthToken)
|
@Field(() => AuthToken)
|
||||||
loginToken: AuthToken;
|
loginToken: AuthToken;
|
||||||
|
|
||||||
@Field(() => workspaceUrlsAndId)
|
@Field(() => WorkspaceUrlsAndId)
|
||||||
workspace: workspaceUrlsAndId;
|
workspace: WorkspaceUrlsAndId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -234,7 +234,7 @@ export class AuthResolver {
|
|||||||
loginToken,
|
loginToken,
|
||||||
workspace: {
|
workspace: {
|
||||||
id: workspace.id,
|
id: workspace.id,
|
||||||
workspaceUrls: this.domainManagerService.getworkspaceUrls(workspace),
|
workspaceUrls: this.domainManagerService.getWorkspaceUrls(workspace),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,7 +118,7 @@ export class GoogleAuthController {
|
|||||||
return res.redirect(
|
return res.redirect(
|
||||||
this.guardRedirectService.getRedirectErrorUrlAndCaptureExceptions(
|
this.guardRedirectService.getRedirectErrorUrlAndCaptureExceptions(
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromWorkspace(
|
this.guardRedirectService.getSubdomainAndCustomDomainFromWorkspace(
|
||||||
currentWorkspace,
|
currentWorkspace,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -119,7 +119,7 @@ export class MicrosoftAuthController {
|
|||||||
return res.redirect(
|
return res.redirect(
|
||||||
this.guardRedirectService.getRedirectErrorUrlAndCaptureExceptions(
|
this.guardRedirectService.getRedirectErrorUrlAndCaptureExceptions(
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromWorkspace(
|
this.guardRedirectService.getSubdomainAndCustomDomainFromWorkspace(
|
||||||
currentWorkspace,
|
currentWorkspace,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -157,7 +157,7 @@ export class SSOAuthController {
|
|||||||
return res.redirect(
|
return res.redirect(
|
||||||
this.guardRedirectService.getRedirectErrorUrlAndCaptureExceptions(
|
this.guardRedirectService.getRedirectErrorUrlAndCaptureExceptions(
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromWorkspace(
|
this.guardRedirectService.getSubdomainAndCustomDomainFromWorkspace(
|
||||||
workspaceIdentityProvider?.workspace,
|
workspaceIdentityProvider?.workspace,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
IdentityProviderType,
|
IdentityProviderType,
|
||||||
SSOIdentityProviderStatus,
|
SSOIdentityProviderStatus,
|
||||||
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||||
import { workspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-endpoints.dto';
|
import { workspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
class SSOConnection {
|
class SSOConnection {
|
||||||
@ -38,9 +38,6 @@ export class AvailableWorkspaceOutput {
|
|||||||
@Field(() => workspaceUrls)
|
@Field(() => workspaceUrls)
|
||||||
workspaceUrls: workspaceUrls;
|
workspaceUrls: workspaceUrls;
|
||||||
|
|
||||||
@Field(() => String, { nullable: true })
|
|
||||||
hostname?: string;
|
|
||||||
|
|
||||||
@Field(() => String, { nullable: true })
|
@Field(() => String, { nullable: true })
|
||||||
logo?: string;
|
logo?: string;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { workspaceUrlsAndId } from 'src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto';
|
import { WorkspaceUrlsAndId } from 'src/engine/core-modules/workspace/dtos/workspace-subdomain-id.dto';
|
||||||
|
|
||||||
import { AuthToken } from './token.entity';
|
import { AuthToken } from './token.entity';
|
||||||
|
|
||||||
@ -9,6 +9,6 @@ export class SignUpOutput {
|
|||||||
@Field(() => AuthToken)
|
@Field(() => AuthToken)
|
||||||
loginToken: AuthToken;
|
loginToken: AuthToken;
|
||||||
|
|
||||||
@Field(() => workspaceUrlsAndId)
|
@Field(() => WorkspaceUrlsAndId)
|
||||||
workspace: workspaceUrlsAndId;
|
workspace: WorkspaceUrlsAndId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,9 @@ export class EnterpriseFeaturesEnabledGuard implements CanActivate {
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromContext(context),
|
this.guardRedirectService.getSubdomainAndCustomDomainFromContext(
|
||||||
|
context,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -53,7 +53,9 @@ export class GoogleAPIsOauthExchangeCodeForTokenGuard extends AuthGuard(
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromContext(context),
|
this.guardRedirectService.getSubdomainAndCustomDomainFromContext(
|
||||||
|
context,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -71,7 +71,7 @@ export class GoogleAPIsOauthRequestCodeGuard extends AuthGuard('google-apis') {
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromWorkspace(
|
this.guardRedirectService.getSubdomainAndCustomDomainFromWorkspace(
|
||||||
workspace,
|
workspace,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -51,7 +51,7 @@ export class GoogleOauthGuard extends AuthGuard('google') {
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromWorkspace(
|
this.guardRedirectService.getSubdomainAndCustomDomainFromWorkspace(
|
||||||
workspace,
|
workspace,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -31,7 +31,9 @@ export class GoogleProviderEnabledGuard implements CanActivate {
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromContext(context),
|
this.guardRedirectService.getSubdomainAndCustomDomainFromContext(
|
||||||
|
context,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -57,7 +57,9 @@ export class MicrosoftAPIsOauthExchangeCodeForTokenGuard extends AuthGuard(
|
|||||||
AuthExceptionCode.INSUFFICIENT_SCOPES,
|
AuthExceptionCode.INSUFFICIENT_SCOPES,
|
||||||
)
|
)
|
||||||
: error,
|
: error,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromContext(context),
|
this.guardRedirectService.getSubdomainAndCustomDomainFromContext(
|
||||||
|
context,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -72,7 +72,7 @@ export class MicrosoftAPIsOauthRequestCodeGuard extends AuthGuard(
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromWorkspace(
|
this.guardRedirectService.getSubdomainAndCustomDomainFromWorkspace(
|
||||||
workspace,
|
workspace,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -39,7 +39,7 @@ export class MicrosoftOAuthGuard extends AuthGuard('microsoft') {
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromWorkspace(
|
this.guardRedirectService.getSubdomainAndCustomDomainFromWorkspace(
|
||||||
workspace,
|
workspace,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -31,7 +31,9 @@ export class MicrosoftProviderEnabledGuard implements CanActivate {
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromContext(context),
|
this.guardRedirectService.getSubdomainAndCustomDomainFromContext(
|
||||||
|
context,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -80,7 +80,7 @@ export class OIDCAuthGuard extends AuthGuard('openidconnect') {
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromWorkspace(
|
this.guardRedirectService.getSubdomainAndCustomDomainFromWorkspace(
|
||||||
identityProvider?.workspace,
|
identityProvider?.workspace,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -14,30 +14,16 @@ import { SSOService } from 'src/engine/core-modules/sso/services/sso.service';
|
|||||||
import { GuardRedirectService } from 'src/engine/core-modules/guard-redirect/services/guard-redirect.service';
|
import { GuardRedirectService } from 'src/engine/core-modules/guard-redirect/services/guard-redirect.service';
|
||||||
import { SSOConfiguration } from 'src/engine/core-modules/sso/types/SSOConfigurations.type';
|
import { SSOConfiguration } from 'src/engine/core-modules/sso/types/SSOConfigurations.type';
|
||||||
import { WorkspaceSSOIdentityProvider } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
import { WorkspaceSSOIdentityProvider } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||||
import { ExceptionHandlerService } from 'src/engine/core-modules/exception-handler/exception-handler.service';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class SAMLAuthGuard extends AuthGuard('saml') {
|
export class SAMLAuthGuard extends AuthGuard('saml') {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly sSOService: SSOService,
|
private readonly sSOService: SSOService,
|
||||||
private readonly guardRedirectService: GuardRedirectService,
|
private readonly guardRedirectService: GuardRedirectService,
|
||||||
private readonly exceptionHandlerService: ExceptionHandlerService,
|
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
private getRelayStateByRequest(request: Request) {
|
|
||||||
try {
|
|
||||||
const relayStateRaw = request.body.RelayState || request.query.RelayState;
|
|
||||||
|
|
||||||
if (relayStateRaw) {
|
|
||||||
return JSON.parse(relayStateRaw);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
this.exceptionHandlerService.captureExceptions(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async canActivate(context: ExecutionContext) {
|
async canActivate(context: ExecutionContext) {
|
||||||
const request = context.switchToHttp().getRequest<Request>();
|
const request = context.switchToHttp().getRequest<Request>();
|
||||||
|
|
||||||
@ -63,7 +49,7 @@ export class SAMLAuthGuard extends AuthGuard('saml') {
|
|||||||
this.guardRedirectService.dispatchErrorFromGuard(
|
this.guardRedirectService.dispatchErrorFromGuard(
|
||||||
context,
|
context,
|
||||||
err,
|
err,
|
||||||
this.guardRedirectService.getSubdomainAndHostnameFromWorkspace(
|
this.guardRedirectService.getSubdomainAndCustomDomainFromWorkspace(
|
||||||
identityProvider?.workspace,
|
identityProvider?.workspace,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -459,7 +459,7 @@ export class AuthService {
|
|||||||
billingCheckoutSessionState,
|
billingCheckoutSessionState,
|
||||||
}: {
|
}: {
|
||||||
loginToken: string;
|
loginToken: string;
|
||||||
workspace: Pick<Workspace, 'subdomain' | 'hostname'>;
|
workspace: Pick<Workspace, 'subdomain' | 'customDomain'>;
|
||||||
billingCheckoutSessionState?: string;
|
billingCheckoutSessionState?: string;
|
||||||
}) {
|
}) {
|
||||||
const url = this.domainManagerService.buildWorkspaceURL({
|
const url = this.domainManagerService.buildWorkspaceURL({
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
class CustomHostnameVerification {
|
class CustomDomainVerification {
|
||||||
@Field(() => String)
|
@Field(() => String)
|
||||||
validationType: 'ownership' | 'ssl' | 'redirection';
|
validationType: 'ownership' | 'ssl' | 'redirection';
|
||||||
|
|
||||||
@ -19,13 +19,13 @@ class CustomHostnameVerification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class CustomHostnameDetails {
|
export class CustomDomainDetails {
|
||||||
@Field(() => String)
|
@Field(() => String)
|
||||||
id: string;
|
id: string;
|
||||||
|
|
||||||
@Field(() => String)
|
@Field(() => String)
|
||||||
hostname: string;
|
customDomain: string;
|
||||||
|
|
||||||
@Field(() => [CustomHostnameVerification])
|
@Field(() => [CustomDomainVerification])
|
||||||
records: Array<CustomHostnameVerification>;
|
records: Array<CustomDomainVerification>;
|
||||||
}
|
}
|
||||||
@ -9,8 +9,8 @@ import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
|
|||||||
import { DomainManagerService } from './domain-manager.service';
|
import { DomainManagerService } from './domain-manager.service';
|
||||||
|
|
||||||
describe('DomainManagerService', () => {
|
describe('DomainManagerService', () => {
|
||||||
describe('getworkspaceUrls', () => {
|
describe('getWorkspaceUrls', () => {
|
||||||
it('should return a URL containing the correct hostname if hostname is provided', () => {
|
it('should return a URL containing the correct customDomain if customDomain is provided', () => {
|
||||||
jest
|
jest
|
||||||
.spyOn(environmentService, 'get')
|
.spyOn(environmentService, 'get')
|
||||||
.mockImplementation((key: string) => {
|
.mockImplementation((key: string) => {
|
||||||
@ -22,9 +22,9 @@ describe('DomainManagerService', () => {
|
|||||||
return env[key];
|
return env[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = domainManagerService.getworkspaceUrls({
|
const result = domainManagerService.getWorkspaceUrls({
|
||||||
subdomain: 'subdomain',
|
subdomain: 'subdomain',
|
||||||
hostname: 'custom-host.com',
|
customDomain: 'custom-host.com',
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
@ -33,7 +33,7 @@ describe('DomainManagerService', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return a URL containing the correct subdomain if hostname is not provided but subdomain is', () => {
|
it('should return a URL containing the correct subdomain if customDomain is not provided but subdomain is', () => {
|
||||||
jest
|
jest
|
||||||
.spyOn(environmentService, 'get')
|
.spyOn(environmentService, 'get')
|
||||||
.mockImplementation((key: string) => {
|
.mockImplementation((key: string) => {
|
||||||
@ -45,9 +45,9 @@ describe('DomainManagerService', () => {
|
|||||||
return env[key];
|
return env[key];
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = domainManagerService.getworkspaceUrls({
|
const result = domainManagerService.getWorkspaceUrls({
|
||||||
subdomain: 'subdomain',
|
subdomain: 'subdomain',
|
||||||
hostname: undefined,
|
customDomain: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toEqual({
|
expect(result).toEqual({
|
||||||
@ -155,7 +155,7 @@ describe('DomainManagerService', () => {
|
|||||||
const result = domainManagerService.buildWorkspaceURL({
|
const result = domainManagerService.buildWorkspaceURL({
|
||||||
workspace: {
|
workspace: {
|
||||||
subdomain: 'test',
|
subdomain: 'test',
|
||||||
hostname: undefined,
|
customDomain: undefined,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ describe('DomainManagerService', () => {
|
|||||||
const result = domainManagerService.buildWorkspaceURL({
|
const result = domainManagerService.buildWorkspaceURL({
|
||||||
workspace: {
|
workspace: {
|
||||||
subdomain: 'test',
|
subdomain: 'test',
|
||||||
hostname: undefined,
|
customDomain: undefined,
|
||||||
},
|
},
|
||||||
pathname: '/path/to/resource',
|
pathname: '/path/to/resource',
|
||||||
});
|
});
|
||||||
@ -200,7 +200,7 @@ describe('DomainManagerService', () => {
|
|||||||
const result = domainManagerService.buildWorkspaceURL({
|
const result = domainManagerService.buildWorkspaceURL({
|
||||||
workspace: {
|
workspace: {
|
||||||
subdomain: 'test',
|
subdomain: 'test',
|
||||||
hostname: undefined,
|
customDomain: undefined,
|
||||||
},
|
},
|
||||||
searchParams: {
|
searchParams: {
|
||||||
foo: 'bar',
|
foo: 'bar',
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
DomainManagerException,
|
DomainManagerException,
|
||||||
DomainManagerExceptionCode,
|
DomainManagerExceptionCode,
|
||||||
} from 'src/engine/core-modules/domain-manager/domain-manager.exception';
|
} from 'src/engine/core-modules/domain-manager/domain-manager.exception';
|
||||||
import { CustomHostnameDetails } from 'src/engine/core-modules/domain-manager/dtos/custom-hostname-details';
|
import { CustomDomainDetails } from 'src/engine/core-modules/domain-manager/dtos/custom-domain-details';
|
||||||
import { generateRandomSubdomain } from 'src/engine/core-modules/domain-manager/utils/generate-random-subdomain';
|
import { generateRandomSubdomain } from 'src/engine/core-modules/domain-manager/utils/generate-random-subdomain';
|
||||||
import { getSubdomainFromEmail } from 'src/engine/core-modules/domain-manager/utils/get-subdomain-from-email';
|
import { getSubdomainFromEmail } from 'src/engine/core-modules/domain-manager/utils/get-subdomain-from-email';
|
||||||
import { getSubdomainNameFromDisplayName } from 'src/engine/core-modules/domain-manager/utils/get-subdomain-name-from-display-name';
|
import { getSubdomainNameFromDisplayName } from 'src/engine/core-modules/domain-manager/utils/get-subdomain-name-from-display-name';
|
||||||
@ -78,7 +78,7 @@ export class DomainManagerService {
|
|||||||
}: {
|
}: {
|
||||||
emailVerificationToken: string;
|
emailVerificationToken: string;
|
||||||
email: string;
|
email: string;
|
||||||
workspace: Pick<Workspace, 'subdomain' | 'hostname'>;
|
workspace: Pick<Workspace, 'subdomain' | 'customDomain'>;
|
||||||
}) {
|
}) {
|
||||||
return this.buildWorkspaceURL({
|
return this.buildWorkspaceURL({
|
||||||
workspace,
|
workspace,
|
||||||
@ -92,11 +92,11 @@ export class DomainManagerService {
|
|||||||
pathname,
|
pathname,
|
||||||
searchParams,
|
searchParams,
|
||||||
}: {
|
}: {
|
||||||
workspace: Pick<Workspace, 'subdomain' | 'hostname'>;
|
workspace: Pick<Workspace, 'subdomain' | 'customDomain'>;
|
||||||
pathname?: string;
|
pathname?: string;
|
||||||
searchParams?: Record<string, string | number>;
|
searchParams?: Record<string, string | number>;
|
||||||
}) {
|
}) {
|
||||||
const workspaceUrls = this.getworkspaceUrls(workspace);
|
const workspaceUrls = this.getWorkspaceUrls(workspace);
|
||||||
|
|
||||||
const url = new URL(workspaceUrls.customUrl ?? workspaceUrls.subdomainUrl);
|
const url = new URL(workspaceUrls.customUrl ?? workspaceUrls.subdomainUrl);
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ export class DomainManagerService {
|
|||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
getSubdomainAndHostnameFromUrl = (url: string) => {
|
getSubdomainAndCustomDomainFromUrl = (url: string) => {
|
||||||
const { hostname: originHostname } = new URL(url);
|
const { hostname: originHostname } = new URL(url);
|
||||||
|
|
||||||
const frontDomain = this.getFrontUrl().hostname;
|
const frontDomain = this.getFrontUrl().hostname;
|
||||||
@ -129,7 +129,7 @@ export class DomainManagerService {
|
|||||||
isFrontdomain && !this.isDefaultSubdomain(subdomain)
|
isFrontdomain && !this.isDefaultSubdomain(subdomain)
|
||||||
? subdomain
|
? subdomain
|
||||||
: undefined,
|
: undefined,
|
||||||
hostname: isFrontdomain ? undefined : originHostname,
|
customDomain: isFrontdomain ? undefined : originHostname,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ export class DomainManagerService {
|
|||||||
|
|
||||||
computeRedirectErrorUrl(
|
computeRedirectErrorUrl(
|
||||||
errorMessage: string,
|
errorMessage: string,
|
||||||
workspace: Pick<Workspace, 'subdomain' | 'hostname'>,
|
workspace: Pick<Workspace, 'subdomain' | 'customDomain'>,
|
||||||
) {
|
) {
|
||||||
const url = this.buildWorkspaceURL({
|
const url = this.buildWorkspaceURL({
|
||||||
workspace,
|
workspace,
|
||||||
@ -201,11 +201,12 @@ export class DomainManagerService {
|
|||||||
return this.getDefaultWorkspace();
|
return this.getDefaultWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
const { subdomain, hostname } = this.getSubdomainAndHostnameFromUrl(origin);
|
const { subdomain, customDomain } =
|
||||||
|
this.getSubdomainAndCustomDomainFromUrl(origin);
|
||||||
|
|
||||||
if (!hostname && !subdomain) return;
|
if (!customDomain && !subdomain) return;
|
||||||
|
|
||||||
const where = isDefined(hostname) ? { hostname } : { subdomain };
|
const where = isDefined(customDomain) ? { customDomain } : { subdomain };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
(await this.workspaceRepository.findOne({
|
(await this.workspaceRepository.findOne({
|
||||||
@ -236,10 +237,10 @@ export class DomainManagerService {
|
|||||||
return `${subdomain}${existingWorkspaceCount > 0 ? `-${Math.random().toString(36).substring(2, 10)}` : ''}`;
|
return `${subdomain}${existingWorkspaceCount > 0 ? `-${Math.random().toString(36).substring(2, 10)}` : ''}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
async registerCustomHostname(hostname: string) {
|
async registerCustomDomain(customDomain: string) {
|
||||||
domainManagerValidator.isCloudflareInstanceDefined(this.cloudflareClient);
|
domainManagerValidator.isCloudflareInstanceDefined(this.cloudflareClient);
|
||||||
|
|
||||||
if (await this.getCustomHostnameDetails(hostname)) {
|
if (await this.getCustomDomainDetails(customDomain)) {
|
||||||
throw new DomainManagerException(
|
throw new DomainManagerException(
|
||||||
'Hostname already registered',
|
'Hostname already registered',
|
||||||
DomainManagerExceptionCode.HOSTNAME_ALREADY_REGISTERED,
|
DomainManagerExceptionCode.HOSTNAME_ALREADY_REGISTERED,
|
||||||
@ -248,7 +249,7 @@ export class DomainManagerService {
|
|||||||
|
|
||||||
return await this.cloudflareClient.customHostnames.create({
|
return await this.cloudflareClient.customHostnames.create({
|
||||||
zone_id: this.environmentService.get('CLOUDFLARE_ZONE_ID'),
|
zone_id: this.environmentService.get('CLOUDFLARE_ZONE_ID'),
|
||||||
hostname,
|
hostname: customDomain,
|
||||||
ssl: {
|
ssl: {
|
||||||
method: 'txt',
|
method: 'txt',
|
||||||
type: 'dv',
|
type: 'dv',
|
||||||
@ -265,14 +266,14 @@ export class DomainManagerService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCustomHostnameDetails(
|
async getCustomDomainDetails(
|
||||||
hostname: string,
|
customDomain: string,
|
||||||
): Promise<CustomHostnameDetails | undefined> {
|
): Promise<CustomDomainDetails | undefined> {
|
||||||
domainManagerValidator.isCloudflareInstanceDefined(this.cloudflareClient);
|
domainManagerValidator.isCloudflareInstanceDefined(this.cloudflareClient);
|
||||||
|
|
||||||
const response = await this.cloudflareClient.customHostnames.list({
|
const response = await this.cloudflareClient.customHostnames.list({
|
||||||
zone_id: this.environmentService.get('CLOUDFLARE_ZONE_ID'),
|
zone_id: this.environmentService.get('CLOUDFLARE_ZONE_ID'),
|
||||||
hostname,
|
hostname: customDomain,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.result.length === 0) {
|
if (response.result.length === 0) {
|
||||||
@ -282,12 +283,12 @@ export class DomainManagerService {
|
|||||||
if (response.result.length === 1) {
|
if (response.result.length === 1) {
|
||||||
return {
|
return {
|
||||||
id: response.result[0].id,
|
id: response.result[0].id,
|
||||||
hostname: response.result[0].hostname,
|
customDomain: response.result[0].hostname,
|
||||||
records: [
|
records: [
|
||||||
response.result[0].ownership_verification,
|
response.result[0].ownership_verification,
|
||||||
...(response.result[0].ssl?.validation_records ?? []),
|
...(response.result[0].ssl?.validation_records ?? []),
|
||||||
]
|
]
|
||||||
.map<CustomHostnameDetails['records'][0] | undefined>(
|
.map<CustomDomainDetails['records'][0] | undefined>(
|
||||||
(record: Record<string, string>) => {
|
(record: Record<string, string>) => {
|
||||||
if (!record) return;
|
if (!record) return;
|
||||||
|
|
||||||
@ -343,24 +344,23 @@ export class DomainManagerService {
|
|||||||
throw new Error('More than one custom hostname found in cloudflare');
|
throw new Error('More than one custom hostname found in cloudflare');
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateCustomHostname(fromHostname: string, toHostname: string) {
|
async updateCustomDomain(fromHostname: string, toHostname: string) {
|
||||||
domainManagerValidator.isCloudflareInstanceDefined(this.cloudflareClient);
|
domainManagerValidator.isCloudflareInstanceDefined(this.cloudflareClient);
|
||||||
|
|
||||||
const fromCustomHostname =
|
const fromCustomHostname = await this.getCustomDomainDetails(fromHostname);
|
||||||
await this.getCustomHostnameDetails(fromHostname);
|
|
||||||
|
|
||||||
if (fromCustomHostname) {
|
if (fromCustomHostname) {
|
||||||
await this.deleteCustomHostname(fromCustomHostname.id);
|
await this.deleteCustomHostname(fromCustomHostname.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.registerCustomHostname(toHostname);
|
return this.registerCustomDomain(toHostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteCustomHostnameByHostnameSilently(hostname: string) {
|
async deleteCustomHostnameByHostnameSilently(customDomain: string) {
|
||||||
domainManagerValidator.isCloudflareInstanceDefined(this.cloudflareClient);
|
domainManagerValidator.isCloudflareInstanceDefined(this.cloudflareClient);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const customHostname = await this.getCustomHostnameDetails(hostname);
|
const customHostname = await this.getCustomDomainDetails(customDomain);
|
||||||
|
|
||||||
if (customHostname) {
|
if (customHostname) {
|
||||||
await this.cloudflareClient.customHostnames.delete(customHostname.id, {
|
await this.cloudflareClient.customHostnames.delete(customHostname.id, {
|
||||||
@ -380,15 +380,15 @@ export class DomainManagerService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private getCustomWorkspaceEndpoint(hostname: string) {
|
private getCustomWorkspaceUrl(customDomain: string) {
|
||||||
const url = this.getFrontUrl();
|
const url = this.getFrontUrl();
|
||||||
|
|
||||||
url.hostname = hostname;
|
url.hostname = customDomain;
|
||||||
|
|
||||||
return url.toString();
|
return url.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private getTwentyWorkspaceEndpoint(subdomain: string) {
|
private getTwentyWorkspaceUrl(subdomain: string) {
|
||||||
const url = this.getFrontUrl();
|
const url = this.getFrontUrl();
|
||||||
|
|
||||||
url.hostname = `${subdomain}.${url.hostname}`;
|
url.hostname = `${subdomain}.${url.hostname}`;
|
||||||
@ -396,15 +396,15 @@ export class DomainManagerService {
|
|||||||
return url.toString();
|
return url.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
getworkspaceUrls({
|
getWorkspaceUrls({
|
||||||
subdomain,
|
subdomain,
|
||||||
hostname,
|
customDomain,
|
||||||
}: Pick<Workspace, 'subdomain' | 'hostname'>) {
|
}: Pick<Workspace, 'subdomain' | 'customDomain'>) {
|
||||||
return {
|
return {
|
||||||
customUrl: hostname
|
customUrl: customDomain
|
||||||
? this.getCustomWorkspaceEndpoint(hostname)
|
? this.getCustomWorkspaceUrl(customDomain)
|
||||||
: undefined,
|
: undefined,
|
||||||
subdomainUrl: this.getTwentyWorkspaceEndpoint(subdomain),
|
subdomainUrl: this.getTwentyWorkspaceUrl(subdomain),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,7 @@ export class EmailVerificationService {
|
|||||||
async sendVerificationEmail(
|
async sendVerificationEmail(
|
||||||
userId: string,
|
userId: string,
|
||||||
email: string,
|
email: string,
|
||||||
workspace: Pick<Workspace, 'subdomain' | 'hostname'>,
|
workspace: Pick<Workspace, 'subdomain' | 'customDomain'>,
|
||||||
) {
|
) {
|
||||||
if (!this.environmentService.get('IS_EMAIL_VERIFICATION_REQUIRED')) {
|
if (!this.environmentService.get('IS_EMAIL_VERIFICATION_REQUIRED')) {
|
||||||
return { success: false };
|
return { success: false };
|
||||||
@ -83,7 +83,7 @@ export class EmailVerificationService {
|
|||||||
|
|
||||||
async resendEmailVerificationToken(
|
async resendEmailVerificationToken(
|
||||||
email: string,
|
email: string,
|
||||||
workspace: Pick<Workspace, 'subdomain' | 'hostname'>,
|
workspace: Pick<Workspace, 'subdomain' | 'customDomain'>,
|
||||||
) {
|
) {
|
||||||
if (!this.environmentService.get('IS_EMAIL_VERIFICATION_REQUIRED')) {
|
if (!this.environmentService.get('IS_EMAIL_VERIFICATION_REQUIRED')) {
|
||||||
throw new EmailVerificationException(
|
throw new EmailVerificationException(
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export class GuardRedirectService {
|
|||||||
dispatchErrorFromGuard(
|
dispatchErrorFromGuard(
|
||||||
context: ExecutionContext,
|
context: ExecutionContext,
|
||||||
error: Error | CustomException,
|
error: Error | CustomException,
|
||||||
workspace: { id?: string; subdomain: string; hostname?: string },
|
workspace: { id?: string; subdomain: string; customDomain?: string },
|
||||||
) {
|
) {
|
||||||
if ('contextType' in context && context.contextType === 'graphql') {
|
if ('contextType' in context && context.contextType === 'graphql') {
|
||||||
throw error;
|
throw error;
|
||||||
@ -32,8 +32,8 @@ export class GuardRedirectService {
|
|||||||
.redirect(this.getRedirectErrorUrlAndCaptureExceptions(error, workspace));
|
.redirect(this.getRedirectErrorUrlAndCaptureExceptions(error, workspace));
|
||||||
}
|
}
|
||||||
|
|
||||||
getSubdomainAndHostnameFromWorkspace(
|
getSubdomainAndCustomDomainFromWorkspace(
|
||||||
workspace?: Pick<Workspace, 'subdomain' | 'hostname'> | null,
|
workspace?: Pick<Workspace, 'subdomain' | 'customDomain'> | null,
|
||||||
) {
|
) {
|
||||||
if (!workspace) {
|
if (!workspace) {
|
||||||
return {
|
return {
|
||||||
@ -44,23 +44,23 @@ export class GuardRedirectService {
|
|||||||
return workspace;
|
return workspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
getSubdomainAndHostnameFromContext(context: ExecutionContext): {
|
getSubdomainAndCustomDomainFromContext(context: ExecutionContext): {
|
||||||
subdomain: string;
|
subdomain: string;
|
||||||
hostname?: string;
|
customDomain?: string;
|
||||||
} {
|
} {
|
||||||
const request = context.switchToHttp().getRequest<Request>();
|
const request = context.switchToHttp().getRequest<Request>();
|
||||||
|
|
||||||
const subdomainAndHostnameFromReferer = request.headers.referer
|
const subdomainAndCustomDomainFromReferer = request.headers.referer
|
||||||
? this.domainManagerService.getSubdomainAndHostnameFromUrl(
|
? this.domainManagerService.getSubdomainAndCustomDomainFromUrl(
|
||||||
request.headers.referer,
|
request.headers.referer,
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
subdomain:
|
subdomain:
|
||||||
subdomainAndHostnameFromReferer?.subdomain ??
|
subdomainAndCustomDomainFromReferer?.subdomain ??
|
||||||
this.environmentService.get('DEFAULT_SUBDOMAIN'),
|
this.environmentService.get('DEFAULT_SUBDOMAIN'),
|
||||||
hostname: subdomainAndHostnameFromReferer?.hostname,
|
customDomain: subdomainAndCustomDomainFromReferer?.customDomain,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ export class GuardRedirectService {
|
|||||||
|
|
||||||
getRedirectErrorUrlAndCaptureExceptions(
|
getRedirectErrorUrlAndCaptureExceptions(
|
||||||
err: Error | CustomException,
|
err: Error | CustomException,
|
||||||
workspace: { id?: string; subdomain: string; hostname?: string },
|
workspace: { id?: string; subdomain: string; customDomain?: string },
|
||||||
) {
|
) {
|
||||||
this.captureException(err, workspace.id);
|
this.captureException(err, workspace.id);
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -182,7 +182,7 @@ export class UserWorkspaceService extends TypeOrmQueryService<UserWorkspace> {
|
|||||||
return user.workspaces.map<AvailableWorkspaceOutput>((userWorkspace) => ({
|
return user.workspaces.map<AvailableWorkspaceOutput>((userWorkspace) => ({
|
||||||
id: userWorkspace.workspaceId,
|
id: userWorkspace.workspaceId,
|
||||||
displayName: userWorkspace.workspace.displayName,
|
displayName: userWorkspace.workspace.displayName,
|
||||||
workspaceUrls: this.domainManagerService.getworkspaceUrls(
|
workspaceUrls: this.domainManagerService.getWorkspaceUrls(
|
||||||
userWorkspace.workspace,
|
userWorkspace.workspace,
|
||||||
),
|
),
|
||||||
logo: userWorkspace.workspace.logo,
|
logo: userWorkspace.workspace.logo,
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import {
|
|||||||
IdentityProviderType,
|
IdentityProviderType,
|
||||||
SSOIdentityProviderStatus,
|
SSOIdentityProviderStatus,
|
||||||
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
} from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||||
import { workspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-endpoints.dto';
|
import { workspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class SSOIdentityProvider {
|
export class SSOIdentityProvider {
|
||||||
|
|||||||
@ -143,7 +143,7 @@ export class UpdateWorkspaceInput {
|
|||||||
@Matches(
|
@Matches(
|
||||||
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/,
|
/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/,
|
||||||
)
|
)
|
||||||
hostname?: string;
|
customDomain?: string;
|
||||||
|
|
||||||
@Field({ nullable: true })
|
@Field({ nullable: true })
|
||||||
@IsString()
|
@IsString()
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { Field, ObjectType } from '@nestjs/graphql';
|
import { Field, ObjectType } from '@nestjs/graphql';
|
||||||
|
|
||||||
import { workspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-endpoints.dto';
|
import { workspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
|
||||||
|
|
||||||
@ObjectType()
|
@ObjectType()
|
||||||
export class workspaceUrlsAndId {
|
export class WorkspaceUrlsAndId {
|
||||||
@Field(() => workspaceUrls)
|
@Field(() => workspaceUrls)
|
||||||
workspaceUrls: workspaceUrls;
|
workspaceUrls: workspaceUrls;
|
||||||
|
|
||||||
|
|||||||
@ -80,11 +80,11 @@ export class WorkspaceService extends TypeOrmQueryService<Workspace> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async setCustomDomain(workspace: Workspace, hostname: string) {
|
private async setCustomDomain(workspace: Workspace, customDomain: string) {
|
||||||
await this.isCustomDomainEnabled(workspace.id);
|
await this.isCustomDomainEnabled(workspace.id);
|
||||||
|
|
||||||
const existingWorkspace = await this.workspaceRepository.findOne({
|
const existingWorkspace = await this.workspaceRepository.findOne({
|
||||||
where: { hostname },
|
where: { customDomain },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (existingWorkspace && existingWorkspace.id !== workspace.id) {
|
if (existingWorkspace && existingWorkspace.id !== workspace.id) {
|
||||||
@ -95,22 +95,22 @@ export class WorkspaceService extends TypeOrmQueryService<Workspace> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
hostname &&
|
customDomain &&
|
||||||
workspace.hostname !== hostname &&
|
workspace.customDomain !== customDomain &&
|
||||||
isDefined(workspace.hostname)
|
isDefined(workspace.customDomain)
|
||||||
) {
|
) {
|
||||||
await this.domainManagerService.updateCustomHostname(
|
await this.domainManagerService.updateCustomDomain(
|
||||||
workspace.hostname,
|
workspace.customDomain,
|
||||||
hostname,
|
customDomain,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
hostname &&
|
customDomain &&
|
||||||
workspace.hostname !== hostname &&
|
workspace.customDomain !== customDomain &&
|
||||||
!isDefined(workspace.hostname)
|
!isDefined(workspace.customDomain)
|
||||||
) {
|
) {
|
||||||
await this.domainManagerService.registerCustomHostname(hostname);
|
await this.domainManagerService.registerCustomDomain(customDomain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,14 +127,17 @@ export class WorkspaceService extends TypeOrmQueryService<Workspace> {
|
|||||||
|
|
||||||
let customDomainRegistered = false;
|
let customDomainRegistered = false;
|
||||||
|
|
||||||
if (payload.hostname === null && isDefined(workspace.hostname)) {
|
if (payload.customDomain === null && isDefined(workspace.customDomain)) {
|
||||||
await this.domainManagerService.deleteCustomHostnameByHostnameSilently(
|
await this.domainManagerService.deleteCustomHostnameByHostnameSilently(
|
||||||
workspace.hostname,
|
workspace.customDomain,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload.hostname && workspace.hostname !== payload.hostname) {
|
if (
|
||||||
await this.setCustomDomain(workspace, payload.hostname);
|
payload.customDomain &&
|
||||||
|
workspace.customDomain !== payload.customDomain
|
||||||
|
) {
|
||||||
|
await this.setCustomDomain(workspace, payload.customDomain);
|
||||||
customDomainRegistered = true;
|
customDomainRegistered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,9 +148,9 @@ export class WorkspaceService extends TypeOrmQueryService<Workspace> {
|
|||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// revert custom domain registration on error
|
// revert custom domain registration on error
|
||||||
if (payload.hostname && customDomainRegistered) {
|
if (payload.customDomain && customDomainRegistered) {
|
||||||
this.domainManagerService
|
this.domainManagerService
|
||||||
.deleteCustomHostnameByHostnameSilently(payload.hostname)
|
.deleteCustomHostnameByHostnameSilently(payload.customDomain)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.exceptionHandlerService.captureExceptions([err]);
|
this.exceptionHandlerService.captureExceptions([err]);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -124,7 +124,7 @@ export class Workspace {
|
|||||||
|
|
||||||
@Field({ nullable: true })
|
@Field({ nullable: true })
|
||||||
@Column({ unique: true, nullable: true })
|
@Column({ unique: true, nullable: true })
|
||||||
hostname?: string;
|
customDomain?: string;
|
||||||
|
|
||||||
@Field()
|
@Field()
|
||||||
@Column({ default: true })
|
@Column({ default: true })
|
||||||
|
|||||||
@ -43,8 +43,8 @@ import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
|
|||||||
import { GraphqlValidationExceptionFilter } from 'src/filters/graphql-validation-exception.filter';
|
import { GraphqlValidationExceptionFilter } from 'src/filters/graphql-validation-exception.filter';
|
||||||
import { assert } from 'src/utils/assert';
|
import { assert } from 'src/utils/assert';
|
||||||
import { streamToBuffer } from 'src/utils/stream-to-buffer';
|
import { streamToBuffer } from 'src/utils/stream-to-buffer';
|
||||||
import { CustomHostnameDetails } from 'src/engine/core-modules/domain-manager/dtos/custom-hostname-details';
|
import { CustomDomainDetails } from 'src/engine/core-modules/domain-manager/dtos/custom-domain-details';
|
||||||
import { workspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-endpoints.dto';
|
import { workspaceUrls } from 'src/engine/core-modules/workspace/dtos/workspace-urls.dto';
|
||||||
|
|
||||||
import { Workspace } from './workspace.entity';
|
import { Workspace } from './workspace.entity';
|
||||||
|
|
||||||
@ -217,17 +217,17 @@ export class WorkspaceResolver {
|
|||||||
|
|
||||||
@ResolveField(() => workspaceUrls)
|
@ResolveField(() => workspaceUrls)
|
||||||
workspaceUrls(@Parent() workspace: Workspace) {
|
workspaceUrls(@Parent() workspace: Workspace) {
|
||||||
return this.domainManagerService.getworkspaceUrls(workspace);
|
return this.domainManagerService.getWorkspaceUrls(workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Query(() => CustomHostnameDetails, { nullable: true })
|
@Query(() => CustomDomainDetails, { nullable: true })
|
||||||
@UseGuards(WorkspaceAuthGuard)
|
@UseGuards(WorkspaceAuthGuard)
|
||||||
async getCustomHostnameDetails(
|
async getCustomDomainDetails(
|
||||||
@AuthWorkspace() { hostname }: Workspace,
|
@AuthWorkspace() { customDomain }: Workspace,
|
||||||
): Promise<CustomHostnameDetails | undefined> {
|
): Promise<CustomDomainDetails | undefined> {
|
||||||
if (!hostname) return undefined;
|
if (!customDomain) return undefined;
|
||||||
|
|
||||||
return await this.domainManagerService.getCustomHostnameDetails(hostname);
|
return await this.domainManagerService.getCustomDomainDetails(customDomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Query(() => PublicWorkspaceDataOutput)
|
@Query(() => PublicWorkspaceDataOutput)
|
||||||
@ -268,7 +268,7 @@ export class WorkspaceResolver {
|
|||||||
id: workspace.id,
|
id: workspace.id,
|
||||||
logo: workspaceLogoWithToken,
|
logo: workspaceLogoWithToken,
|
||||||
displayName: workspace.displayName,
|
displayName: workspace.displayName,
|
||||||
workspaceUrls: this.domainManagerService.getworkspaceUrls(workspace),
|
workspaceUrls: this.domainManagerService.getWorkspaceUrls(workspace),
|
||||||
authProviders: getAuthProvidersByWorkspace({
|
authProviders: getAuthProvidersByWorkspace({
|
||||||
workspace,
|
workspace,
|
||||||
systemEnabledProviders,
|
systemEnabledProviders,
|
||||||
|
|||||||
Reference in New Issue
Block a user