From 4615a23d636545a23de2a8ad1604ea7d08ca9323 Mon Sep 17 00:00:00 2001 From: nael Date: Thu, 11 Apr 2024 20:00:18 +0200 Subject: [PATCH] :coffin: Remove validation from environment service in api --- .../environment/environement.validation.ts | 93 ------------------- 1 file changed, 93 deletions(-) delete mode 100644 packages/api/src/@core/environment/environement.validation.ts diff --git a/packages/api/src/@core/environment/environement.validation.ts b/packages/api/src/@core/environment/environement.validation.ts deleted file mode 100644 index 38f974736..000000000 --- a/packages/api/src/@core/environment/environement.validation.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { plainToClass } from 'class-transformer'; -import { IsOptional, IsString, validateSync } from 'class-validator'; - -export class EnvVars { - @IsString() - @IsOptional() - ENV?: string; - - @IsString() - @IsOptional() - DISTRIBUTION?: string; - - @IsString() - DATABASE_URL: string; - - @IsString() - JWT_SECRET: string; - - @IsString() - @IsOptional() - SENTRY_DSN?: string; - - //CRM - @IsString() - HUBSPOT_CLIENT_ID: string; - - @IsString() - HUBSPOT_CLIENT_SECRET: string; - - @IsString() - ZOHOCRM_CLIENT_ID: string; - - @IsString() - ZOHOCRM_CLIENT_SECRET: string; - - @IsString() - PIPEDRIVE_CLIENT_ID: string; - - @IsString() - PIPEDRIVE_CLIENT_SECRET: string; - - @IsString() - @IsOptional() - FRESHSALES_CLIENT_ID?: string; - - @IsString() - @IsOptional() - FRESHSALES_CLIENT_SECRET?: string; - - @IsString() - ZENDESK_SELL_CLIENT_ID: string; - - @IsString() - ZENDESK_SELL_CLIENT_SECRET: string; - - @IsString() - ZENDESK_TICKETING_CLIENT_ID: string; - - @IsString() - ZENDESK_TICKETING_CLIENT_SECRET: string; - - @IsString() - OAUTH_REDIRECT_BASE: string; - - @IsString() - ENCRYPT_CRYPTO_SECRET_KEY: string; - - @IsString() - REDIS_HOST: string; - - @IsString() - @IsOptional() - THROTTLER_TTL?: string; - - @IsString() - @IsOptional() - THROTTLER_LIMIT?: string; -} - -export const validate = (config: Record) => { - const validatedConfig = plainToClass(EnvVars, config); - - const errors = validateSync(validatedConfig); - - - //TODO - Resolve this - // if (errors.length) throw new Error(errors.toString()); - if (errors.length) { - - } - - return validatedConfig; -};