chore(backend): cleanup code quality issues (#5466)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
parent
1b0a21a3b2
commit
dd8744f292
4 changed files with 6 additions and 12 deletions
|
|
@ -22,7 +22,7 @@ import { RTCookie } from 'src/decorators/rt-cookie.decorator';
|
||||||
import { AuthProvider, authCookieHandler, authProviderCheck } from './helper';
|
import { AuthProvider, authCookieHandler, authProviderCheck } from './helper';
|
||||||
import { GoogleSSOGuard } from './guards/google-sso.guard';
|
import { GoogleSSOGuard } from './guards/google-sso.guard';
|
||||||
import { GithubSSOGuard } from './guards/github-sso.guard';
|
import { GithubSSOGuard } from './guards/github-sso.guard';
|
||||||
import { MicrosoftSSOGuard } from './guards/microsoft-sso-.guard';
|
import { MicrosoftSSOGuard } from './guards/microsoft-sso.guard';
|
||||||
import { ThrottlerBehindProxyGuard } from 'src/guards/throttler-behind-proxy.guard';
|
import { ThrottlerBehindProxyGuard } from 'src/guards/throttler-behind-proxy.guard';
|
||||||
import { SkipThrottle } from '@nestjs/throttler';
|
import { SkipThrottle } from '@nestjs/throttler';
|
||||||
import { AUTH_PROVIDER_NOT_SPECIFIED } from 'src/errors';
|
import { AUTH_PROVIDER_NOT_SPECIFIED } from 'src/errors';
|
||||||
|
|
|
||||||
|
|
@ -22,19 +22,19 @@ export const ADMIN_CAN_NOT_BE_DELETED =
|
||||||
* Token Authorization failed (Check 'Authorization' Header)
|
* Token Authorization failed (Check 'Authorization' Header)
|
||||||
* (GqlAuthGuard)
|
* (GqlAuthGuard)
|
||||||
*/
|
*/
|
||||||
export const AUTH_FAIL = 'auth/fail';
|
export const AUTH_FAIL = 'auth/fail' as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalid JSON
|
* Invalid JSON
|
||||||
* (Utils)
|
* (Utils)
|
||||||
*/
|
*/
|
||||||
export const JSON_INVALID = 'json_invalid';
|
export const JSON_INVALID = 'json_invalid' as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auth Provider not specified
|
* Auth Provider not specified
|
||||||
* (Auth)
|
* (Auth)
|
||||||
*/
|
*/
|
||||||
export const AUTH_PROVIDER_NOT_SPECIFIED = 'auth/provider_not_specified';
|
export const AUTH_PROVIDER_NOT_SPECIFIED = 'auth/provider_not_specified' as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Email not provided by OAuth provider
|
* Email not provided by OAuth provider
|
||||||
|
|
@ -168,7 +168,7 @@ export const TEAM_NOT_REQUIRED_ROLE = 'team/not_required_role' as const;
|
||||||
* Team name validation failure
|
* Team name validation failure
|
||||||
* (TeamService)
|
* (TeamService)
|
||||||
*/
|
*/
|
||||||
export const TEAM_NAME_INVALID = 'team/name_invalid';
|
export const TEAM_NAME_INVALID = 'team/name_invalid' as const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Couldn't find the sync data from the user
|
* Couldn't find the sync data from the user
|
||||||
|
|
@ -432,7 +432,6 @@ export const USER_ENVIRONMENT_GLOBAL_ENV_DOES_NOT_EXISTS =
|
||||||
*/
|
*/
|
||||||
export const USER_ENVIRONMENT_GLOBAL_ENV_EXISTS =
|
export const USER_ENVIRONMENT_GLOBAL_ENV_EXISTS =
|
||||||
'user_environment/global_env_already_exists' as const;
|
'user_environment/global_env_already_exists' as const;
|
||||||
/*
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User environment doesn't exist for the user
|
* User environment doesn't exist for the user
|
||||||
|
|
@ -440,7 +439,6 @@ export const USER_ENVIRONMENT_GLOBAL_ENV_EXISTS =
|
||||||
*/
|
*/
|
||||||
export const USER_ENVIRONMENT_ENV_DOES_NOT_EXISTS =
|
export const USER_ENVIRONMENT_ENV_DOES_NOT_EXISTS =
|
||||||
'user_environment/user_env_does_not_exists' as const;
|
'user_environment/user_env_does_not_exists' as const;
|
||||||
/*
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cannot delete the global user environment
|
* Cannot delete the global user environment
|
||||||
|
|
@ -448,7 +446,6 @@ export const USER_ENVIRONMENT_ENV_DOES_NOT_EXISTS =
|
||||||
*/
|
*/
|
||||||
export const USER_ENVIRONMENT_GLOBAL_ENV_DELETION_FAILED =
|
export const USER_ENVIRONMENT_GLOBAL_ENV_DELETION_FAILED =
|
||||||
'user_environment/user_env_global_env_deletion_failed' as const;
|
'user_environment/user_env_global_env_deletion_failed' as const;
|
||||||
/*
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User environment is not a global environment
|
* User environment is not a global environment
|
||||||
|
|
@ -456,7 +453,6 @@ export const USER_ENVIRONMENT_GLOBAL_ENV_DELETION_FAILED =
|
||||||
*/
|
*/
|
||||||
export const USER_ENVIRONMENT_IS_NOT_GLOBAL =
|
export const USER_ENVIRONMENT_IS_NOT_GLOBAL =
|
||||||
'user_environment/user_env_is_not_global' as const;
|
'user_environment/user_env_is_not_global' as const;
|
||||||
/*
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User environment update failed
|
* User environment update failed
|
||||||
|
|
@ -464,7 +460,6 @@ export const USER_ENVIRONMENT_IS_NOT_GLOBAL =
|
||||||
*/
|
*/
|
||||||
export const USER_ENVIRONMENT_UPDATE_FAILED =
|
export const USER_ENVIRONMENT_UPDATE_FAILED =
|
||||||
'user_environment/user_env_update_failed' as const;
|
'user_environment/user_env_update_failed' as const;
|
||||||
/*
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User environment invalid environment name
|
* User environment invalid environment name
|
||||||
|
|
@ -472,7 +467,6 @@ export const USER_ENVIRONMENT_UPDATE_FAILED =
|
||||||
*/
|
*/
|
||||||
export const USER_ENVIRONMENT_INVALID_ENVIRONMENT_NAME =
|
export const USER_ENVIRONMENT_INVALID_ENVIRONMENT_NAME =
|
||||||
'user_environment/user_env_invalid_env_name' as const;
|
'user_environment/user_env_invalid_env_name' as const;
|
||||||
/*
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User history not found
|
* User history not found
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||||
import { InfraTokenModule } from './infra-token/infra-token.module';
|
import { InfraTokenModule } from './infra-token/infra-token.module';
|
||||||
import { NestExpressApplication } from '@nestjs/platform-express';
|
import { NestExpressApplication } from '@nestjs/platform-express';
|
||||||
|
|
||||||
function setupSwagger(app, isProduction: boolean) {
|
function setupSwagger(app: NestExpressApplication, isProduction: boolean): void {
|
||||||
const swaggerDocPath = '/api-docs';
|
const swaggerDocPath = '/api-docs';
|
||||||
|
|
||||||
const config = new DocumentBuilder()
|
const config = new DocumentBuilder()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue