From 31282999536215a5b9d27b46abf02c2b563f6025 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 14 Apr 2023 01:00:03 +0530 Subject: [PATCH] fix: remove duplicate appinfo api Signed-off-by: Pranav C --- .../src/modules/utils/utils.controller.ts | 7 ---- .../src/modules/utils/utils.service.ts | 41 ------------------- 2 files changed, 48 deletions(-) diff --git a/packages/nocodb-nest/src/modules/utils/utils.controller.ts b/packages/nocodb-nest/src/modules/utils/utils.controller.ts index bcdd24ce1a..8b2f3f7ac4 100644 --- a/packages/nocodb-nest/src/modules/utils/utils.controller.ts +++ b/packages/nocodb-nest/src/modules/utils/utils.controller.ts @@ -17,13 +17,6 @@ import { UtilsService } from './utils.service'; export class UtilsController { constructor(private readonly utilsService: UtilsService) {} - @Get('/api/v1/db/meta/nocodb/info') - info(@Request() req) { - return this.utilsService.info({ - ncSiteUrl: req.ncSiteUrl, - }); - } - @Get('/api/v1/version') version() { return this.utilsService.versionInfo(); diff --git a/packages/nocodb-nest/src/modules/utils/utils.service.ts b/packages/nocodb-nest/src/modules/utils/utils.service.ts index 050ab47ff5..7dd89e2a4c 100644 --- a/packages/nocodb-nest/src/modules/utils/utils.service.ts +++ b/packages/nocodb-nest/src/modules/utils/utils.service.ts @@ -61,47 +61,6 @@ interface AllMeta { @Injectable() export class UtilsService { - async info({ ncSiteUrl }: { ncSiteUrl: string }) { - const projectHasAdmin = !(await User.isFirst()); - const result = { - authType: 'jwt', - projectHasAdmin, - firstUser: !projectHasAdmin, - type: 'rest', - env: process.env.NODE_ENV, - googleAuthEnabled: !!( - process.env.NC_GOOGLE_CLIENT_ID && process.env.NC_GOOGLE_CLIENT_SECRET - ), - githubAuthEnabled: !!( - process.env.NC_GITHUB_CLIENT_ID && process.env.NC_GITHUB_CLIENT_SECRET - ), - oneClick: !!process.env.NC_ONE_CLICK, - connectToExternalDB: !process.env.NC_CONNECT_TO_EXTERNAL_DB_DISABLED, - version: packageVersion, - defaultLimit: Math.max( - Math.min( - +process.env.DB_QUERY_LIMIT_DEFAULT || 25, - +process.env.DB_QUERY_LIMIT_MAX || 100, - ), - +process.env.DB_QUERY_LIMIT_MIN || 1, - ), - timezone: defaultConnectionConfig.timezone, - ncMin: !!process.env.NC_MIN, - teleEnabled: process.env.NC_DISABLE_TELE !== 'true', - auditEnabled: process.env.NC_DISABLE_AUDIT !== 'true', - // todo: tobe done - ncSiteUrl, - // todo: tobe done - ee: false, // Noco.isEE(), - ncAttachmentFieldSize: NC_ATTACHMENT_FIELD_SIZE, - ncMaxAttachmentsAllowed: +(process.env.NC_MAX_ATTACHMENTS_ALLOWED || 10), - isCloud: process.env.NC_CLOUD === 'true', - automationLogLevel: process.env.NC_AUTOMATION_LOG_LEVEL || 'OFF', - }; - - return result; - } - async versionInfo() { if ( !versionCache.lastFetched ||