Browse Source

fix: remove duplicate appinfo api

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
3128299953
  1. 7
      packages/nocodb-nest/src/modules/utils/utils.controller.ts
  2. 41
      packages/nocodb-nest/src/modules/utils/utils.service.ts

7
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();

41
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 ||

Loading…
Cancel
Save