Skip to content

Commit

Permalink
feat(server): fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
AMoreaux committed Nov 7, 2024
1 parent e4cd67c commit d6b17ee
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { HttpModule } from '@nestjs/axios';
import { Module } from '@nestjs/common';

import { RecordPositionBackfillJob } from 'src/engine/api/graphql/workspace-query-runner/jobs/record-position-backfill.job';
import { RecordPositionBackfillModule } from 'src/engine/api/graphql/workspace-query-runner/services/record-position-backfill-module';
import { AnalyticsModule } from 'src/engine/core-modules/analytics/analytics.module';
import { DataSourceModule } from 'src/engine/metadata-modules/data-source/data-source.module';
import { WorkspaceDataSourceModule } from 'src/engine/workspace-datasource/workspace-datasource.module';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
AuthExceptionCode,
} from 'src/engine/core-modules/auth/auth.exception';
import { OriginHeader } from 'src/engine/decorators/auth/origin-header.decorator';
import { getWorkspaceSubdomainByOrigin } from 'src/engine/utils/get-workspace-subdomain-by-origin';

import { ChallengeInput } from './dto/challenge.input';
import { ImpersonateInput } from './dto/impersonate.input';
Expand All @@ -51,7 +52,6 @@ import { VerifyInput } from './dto/verify.input';
import { WorkspaceInviteHashValid } from './dto/workspace-invite-hash-valid.entity';
import { WorkspaceInviteHashValidInput } from './dto/workspace-invite-hash.input';
import { AuthService } from './services/auth.service';
import { getWorkspaceSubdomainByOrigin } from 'src/engine/utils/get-workspace-subdomain-by-origin';

@Resolver()
@UseFilters(AuthGraphqlApiExceptionFilter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { SAMLAuthGuard } from 'src/engine/core-modules/auth/guards/saml-auth.gua
import { SSOProviderEnabledGuard } from 'src/engine/core-modules/auth/guards/sso-provider-enabled.guard';
import { AuthService } from 'src/engine/core-modules/auth/services/auth.service';
import { LoginTokenService } from 'src/engine/core-modules/auth/token/services/login-token.service';
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
import { SSOService } from 'src/engine/core-modules/sso/services/sso.service';
import {
IdentityProviderType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { TypeOrmQueryService } from '@ptc-org/nestjs-query-typeorm';
import { Repository } from 'typeorm';

import { TypeORMService } from 'src/database/typeorm/typeorm.service';
import {
AppToken,
AppTokenType,
} from 'src/engine/core-modules/app-token/app-token.entity';
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
import { ObjectRecordCreateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-create.event';
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
import { User } from 'src/engine/core-modules/user/user.entity';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorat
import { DemoEnvGuard } from 'src/engine/guards/demo.env.guard';
import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
import { streamToBuffer } from 'src/utils/stream-to-buffer';
import { isDefined } from 'src/utils/is-defined';

const getHMACKey = (email?: string, key?: string | null) => {
if (!email || !key) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import { WorkspaceResolver } from 'src/engine/core-modules/workspace/workspace.r
import { DataSourceModule } from 'src/engine/metadata-modules/data-source/data-source.module';
import { WorkspaceMetadataCacheModule } from 'src/engine/metadata-modules/workspace-metadata-cache/workspace-metadata-cache.module';
import { WorkspaceManagerModule } from 'src/engine/workspace-manager/workspace-manager.module';
import { WorkspaceInvitationModule } from 'src/engine/core-modules/workspace-invitation/workspace-invitation.module';

import { workspaceAutoResolverOpts } from './workspace.auto-resolver-opts';
import { Workspace } from './workspace.entity';

import { WorkspaceService } from './services/workspace.service';
import { WorkspaceInvitationModule } from 'src/engine/core-modules/workspace-invitation/workspace-invitation.module';

@Module({
imports: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import {
WorkspaceExceptionCode,
} from 'src/engine/core-modules/workspace/workspace.exception';
import { PublicWorkspaceDataOutput } from 'src/engine/core-modules/workspace/dtos/public-workspace-data.output';

import { OriginHeader } from 'src/engine/decorators/auth/origin-header.decorator';

import { Workspace } from './workspace.entity';

import { WorkspaceService } from './services/workspace.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ describe('getWorkspaceSubdomainByOrigin', () => {
it('should return subdomain from origin', () => {
const origin = 'https://subdomain.example.com';
const result = getWorkspaceSubdomainByOrigin(origin);

expect(result).toBe('subdomain');
});
it('should return undefined if origin is not a subdomain', () => {
const origin = 'https://example.com';
const result = getWorkspaceSubdomainByOrigin(origin);

expect(result).toBe(undefined);
});
it('should return undefined if subdomain is app', () => {
const origin = 'https://app.example.com';
const result = getWorkspaceSubdomainByOrigin(origin);

expect(result).toBe(undefined);
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { buildWorkspaceURL } from '../workspace-url.utils';
import { buildWorkspaceURL } from 'src/utils/workspace-url.utils';

describe('buildWorkspaceURL', () => {
it('should build workspace URL with subdomain', () => {
Expand Down
63 changes: 0 additions & 63 deletions packages/twenty-server/test/utils/createTestingService.utils.ts

This file was deleted.

0 comments on commit d6b17ee

Please sign in to comment.