diff --git a/packages/nocodb-nest/src/app.module.ts b/packages/nocodb-nest/src/app.module.ts index ab43f6201a..08a2fb7ff5 100644 --- a/packages/nocodb-nest/src/app.module.ts +++ b/packages/nocodb-nest/src/app.module.ts @@ -1,9 +1,4 @@ -import { - MiddlewareConsumer, - Module, - RequestMethod, - OnApplicationBootstrap, -} from '@nestjs/common'; +import { Module, RequestMethod } from '@nestjs/common'; import { APP_FILTER } from '@nestjs/core'; import { Connection } from './connection/connection'; import { GlobalExceptionFilter } from './filters/global-exception/global-exception.filter'; @@ -52,6 +47,10 @@ import { ImportModule } from './modules/import/import.module'; import { CachesModule } from './modules/caches/caches.module'; import { TestModule } from './modules/test/test.module'; import { PluginsModule } from './modules/plugins/plugins.module'; +import type { + MiddlewareConsumer, + OnApplicationBootstrap, +} from '@nestjs/common'; @Module({ imports: [ diff --git a/packages/nocodb-nest/src/connection/connection.spec.ts b/packages/nocodb-nest/src/connection/connection.spec.ts index dd5fc5dad6..0c14346a55 100644 --- a/packages/nocodb-nest/src/connection/connection.spec.ts +++ b/packages/nocodb-nest/src/connection/connection.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { Connection } from './knex'; +import type { TestingModule } from '@nestjs/testing'; describe('Knex', () => { let provider: Connection; diff --git a/packages/nocodb-nest/src/connection/connection.ts b/packages/nocodb-nest/src/connection/connection.ts index ebe2e5bcb4..a37f3c702e 100644 --- a/packages/nocodb-nest/src/connection/connection.ts +++ b/packages/nocodb-nest/src/connection/connection.ts @@ -1,8 +1,8 @@ import { Global, Injectable, OnModuleInit } from '@nestjs/common'; -import * as knex from 'knex'; import { XKnex } from '../db/CustomKnex'; import NcConfigFactory from '../utils/NcConfigFactory'; +import type * as knex from 'knex'; @Global() @Injectable() diff --git a/packages/nocodb-nest/src/db/BaseModelSqlv2.ts b/packages/nocodb-nest/src/db/BaseModelSqlv2.ts index 83b07423f4..d21ec8a709 100644 --- a/packages/nocodb-nest/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb-nest/src/db/BaseModelSqlv2.ts @@ -15,8 +15,6 @@ import ejs from 'ejs'; import Validator from 'validator'; import { customAlphabet } from 'nanoid'; import DOMPurify from 'isomorphic-dompurify'; -import type { SortType } from 'nocodb-sdk'; -import type { Knex } from 'knex'; const GROUP_COL = '__nc_group_id'; @@ -31,35 +29,42 @@ import { } from '../helpers/webhookHelpers'; import { Audit, - BarcodeColumn, Column, Filter, - FormulaColumn, FormView, - GridViewColumn, Hook, - LinkToAnotherRecordColumn, Model, Project, - QrCodeColumn, - RollupColumn, - SelectOption, Sort, View, } from '../models'; -import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; -import genRollupSelectv2 from './genRollupSelectv2'; -import { XcFilter, XcFilterWithAlias } from './sql-data-mapper/lib/BaseModel'; import { sanitize, unsanitize } from '../helpers/sqlSanitize'; -import conditionV2 from './conditionV2'; -import sortV2 from './sortV2'; -import { customValidators } from './util/customValidators'; import { COMPARISON_OPS, COMPARISON_SUB_OPS, IS_WITHIN_COMPARISON_SUB_OPS, } from '../models/Filter'; import formSubmissionEmailTemplate from '../utils/common/formSubmissionEmailTemplate'; +import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; +import genRollupSelectv2 from './genRollupSelectv2'; +import conditionV2 from './conditionV2'; +import sortV2 from './sortV2'; +import { customValidators } from './util/customValidators'; +import type { + XcFilter, + XcFilterWithAlias, +} from './sql-data-mapper/lib/BaseModel'; +import type { + BarcodeColumn, + FormulaColumn, + GridViewColumn, + LinkToAnotherRecordColumn, + QrCodeColumn, + RollupColumn, + SelectOption, +} from '../models'; +import type { Knex } from 'knex'; +import type { SortType } from 'nocodb-sdk'; export async function getViewAndModelByAliasOrId(param: { projectName: string; @@ -1399,7 +1404,7 @@ class BaseModelSqlv2 { return []; } }); - // eslint-disable-next-line @typescript-eslint/no-this-alias + const self: BaseModelSqlv2 = this; proto[column.title] = async function (args): Promise { diff --git a/packages/nocodb-nest/src/db/CustomKnex.ts b/packages/nocodb-nest/src/db/CustomKnex.ts index 2d1d6ab7f0..148024a84f 100644 --- a/packages/nocodb-nest/src/db/CustomKnex.ts +++ b/packages/nocodb-nest/src/db/CustomKnex.ts @@ -1,10 +1,10 @@ import { Knex, knex } from 'knex'; import { SnowflakeClient } from 'nc-help'; +import { types } from 'pg'; import Filter from '../models/Filter'; import type { FilterType } from 'nocodb-sdk'; import type { BaseModelSql } from './BaseModelSql'; -import { types } from 'pg'; // override parsing date column to Date() types.setTypeParser(1082, (val) => val); diff --git a/packages/nocodb-nest/src/db/conditionV2.ts b/packages/nocodb-nest/src/db/conditionV2.ts index 8ea5a6ae75..810c4ec05e 100644 --- a/packages/nocodb-nest/src/db/conditionV2.ts +++ b/packages/nocodb-nest/src/db/conditionV2.ts @@ -2,9 +2,9 @@ import { isNumericCol, RelationTypes, UITypes } from 'nocodb-sdk'; import dayjs, { extend } from 'dayjs'; // import customParseFormat from 'dayjs/plugin/customParseFormat.js'; import Filter from '../models/Filter'; +import { sanitize } from '../helpers/sqlSanitize'; import genRollupSelectv2 from './genRollupSelectv2'; import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; -import { sanitize } from '../helpers/sqlSanitize'; import type LinkToAnotherRecordColumn from '../models/LinkToAnotherRecordColumn'; import type { Knex } from 'knex'; import type Column from '../models/Column'; @@ -81,7 +81,6 @@ const parseConditionV2 = async ( }; } else { const column = await filter.getColumn(); - // eslint-disable-next-line @typescript-eslint/no-empty-function if (!column) return () => {}; if (column.uidt === UITypes.LinkToAnotherRecord) { const colOptions = @@ -273,7 +272,6 @@ const parseConditionV2 = async ( }; } - // eslint-disable-next-line @typescript-eslint/no-empty-function return (_qb) => {}; } else if (column.uidt === UITypes.Lookup) { return await generateLookupCondition(column, filter, knex, aliasCount); diff --git a/packages/nocodb-nest/src/db/formulav2/formulaQueryBuilderv2.ts b/packages/nocodb-nest/src/db/formulav2/formulaQueryBuilderv2.ts index 5c452624fd..b16594ed37 100644 --- a/packages/nocodb-nest/src/db/formulav2/formulaQueryBuilderv2.ts +++ b/packages/nocodb-nest/src/db/formulav2/formulaQueryBuilderv2.ts @@ -6,12 +6,12 @@ import FormulaColumn from '../../models/FormulaColumn'; import { validateDateWithUnknownFormat } from '../../helpers/formulaFnHelper'; import { CacheGetType, CacheScope } from '../../utils/globals'; import NocoCache from '../../cache/NocoCache'; +import type { XKnex } from '../CustomKnex'; import type Model from '../../models/Model'; import type Column from '../../models/Column'; import type RollupColumn from '../../models/RollupColumn'; import type LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; import type LookupColumn from '../../models/LookupColumn'; -import { XKnex } from '../CustomKnex'; // todo: switch function based on database diff --git a/packages/nocodb-nest/src/db/sortV2.ts b/packages/nocodb-nest/src/db/sortV2.ts index 9d44b3101f..7a98ed9983 100644 --- a/packages/nocodb-nest/src/db/sortV2.ts +++ b/packages/nocodb-nest/src/db/sortV2.ts @@ -1,15 +1,15 @@ import { RelationTypes, UITypes } from 'nocodb-sdk'; import { Sort } from '../models'; +import { sanitize } from '../helpers/sqlSanitize'; import genRollupSelectv2 from './genRollupSelectv2'; import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; -import { sanitize } from '../helpers/sqlSanitize'; import type { Knex } from 'knex'; import type { XKnex } from '../db/CustomKnex'; -import { +import type { + FormulaColumn, LinkToAnotherRecordColumn, - RollupColumn, LookupColumn, - FormulaColumn, + RollupColumn, } from '../models'; export default async function sortV2( diff --git a/packages/nocodb-nest/src/filters/global-exception/global-exception.filter.ts b/packages/nocodb-nest/src/filters/global-exception/global-exception.filter.ts index cc81ce13c0..214af2b8ca 100644 --- a/packages/nocodb-nest/src/filters/global-exception/global-exception.filter.ts +++ b/packages/nocodb-nest/src/filters/global-exception/global-exception.filter.ts @@ -1,10 +1,4 @@ -import { - ExceptionFilter, - Catch, - ArgumentsHost, - HttpException, -} from '@nestjs/common'; -import { Response } from 'express'; +import { Catch, HttpException } from '@nestjs/common'; import { AjvError, BadRequest, @@ -15,6 +9,8 @@ import { NotImplemented, Unauthorized, } from '../../helpers/catchError'; +import type { ArgumentsHost, ExceptionFilter } from '@nestjs/common'; +import type { Response } from 'express'; @Catch() export class GlobalExceptionFilter implements ExceptionFilter { diff --git a/packages/nocodb-nest/src/helpers/extractProjectIdAndAuthenticate.ts b/packages/nocodb-nest/src/helpers/extractProjectIdAndAuthenticate.ts index 88cb6687c6..e92ab96cee 100644 --- a/packages/nocodb-nest/src/helpers/extractProjectIdAndAuthenticate.ts +++ b/packages/nocodb-nest/src/helpers/extractProjectIdAndAuthenticate.ts @@ -2,16 +2,16 @@ import { promisify } from 'util'; import passport from 'passport'; import { - Model, - View, - Hook, - GridViewColumn, + Column, + Filter, FormViewColumn, GalleryViewColumn, + GridViewColumn, + Hook, + Model, Project, - Column, - Filter, Sort, + View, } from '../models'; export default async (req, res, next) => { diff --git a/packages/nocodb-nest/src/helpers/getColumnUiType.ts b/packages/nocodb-nest/src/helpers/getColumnUiType.ts index 893e4c77fc..2188624a85 100644 --- a/packages/nocodb-nest/src/helpers/getColumnUiType.ts +++ b/packages/nocodb-nest/src/helpers/getColumnUiType.ts @@ -1,7 +1,7 @@ +import ModelXcMetaFactory from '../db/sql-mgr/code/models/xc/ModelXcMetaFactory'; import type Base from '../models/Base'; import type Column from '../models/Column'; import type { ColumnType } from 'nocodb-sdk'; -import ModelXcMetaFactory from '../db/sql-mgr/code/models/xc/ModelXcMetaFactory'; export default function getColumnUiType( base: Base, diff --git a/packages/nocodb-nest/src/helpers/populateMeta.ts b/packages/nocodb-nest/src/helpers/populateMeta.ts index 44ee5da161..384acfa647 100644 --- a/packages/nocodb-nest/src/helpers/populateMeta.ts +++ b/packages/nocodb-nest/src/helpers/populateMeta.ts @@ -8,10 +8,10 @@ import View from '../models/View'; import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; import getColumnUiType from '../helpers/getColumnUiType'; import mapDefaultDisplayValue from '../helpers/mapDefaultDisplayValue'; +import { getUniqueColumnAliasName } from './getUniqueName'; import type LinkToAnotherRecordColumn from '../models/LinkToAnotherRecordColumn'; import type Base from '../models/Base'; import type Project from '../models/Project'; -import { getUniqueColumnAliasName } from './getUniqueName'; export const IGNORE_TABLES = [ 'nc_models', 'nc_roles', diff --git a/packages/nocodb-nest/src/helpers/populateSamplePayload.ts b/packages/nocodb-nest/src/helpers/populateSamplePayload.ts index bf4bf3e217..5cf819e9db 100644 --- a/packages/nocodb-nest/src/helpers/populateSamplePayload.ts +++ b/packages/nocodb-nest/src/helpers/populateSamplePayload.ts @@ -1,12 +1,10 @@ import { RelationTypes, UITypes } from 'nocodb-sdk'; import { v4 as uuidv4 } from 'uuid'; -import { - Column, +import { Column, Model, View } from '../models'; +import type { LinkToAnotherRecordColumn, LookupColumn, - Model, SelectOption, - View, } from '../models'; export async function populateSamplePayload( diff --git a/packages/nocodb-nest/src/helpers/syncMigration.ts b/packages/nocodb-nest/src/helpers/syncMigration.ts index a1a80f89ce..820d2e724e 100644 --- a/packages/nocodb-nest/src/helpers/syncMigration.ts +++ b/packages/nocodb-nest/src/helpers/syncMigration.ts @@ -1,5 +1,5 @@ import KnexMigratorv2 from '../db/sql-migrator/lib/KnexMigratorv2'; -import { Base, Project } from '../models'; +import type { Base, Project } from '../models'; export default async function syncMigration(project: Project): Promise { for (const base of await project.getBases()) { diff --git a/packages/nocodb-nest/src/helpers/webhookHelpers.ts b/packages/nocodb-nest/src/helpers/webhookHelpers.ts index ce9370736e..744e420d1a 100644 --- a/packages/nocodb-nest/src/helpers/webhookHelpers.ts +++ b/packages/nocodb-nest/src/helpers/webhookHelpers.ts @@ -1,16 +1,9 @@ import Handlebars from 'handlebars'; import { v4 as uuidv4 } from 'uuid'; -import type { HookLogType } from 'nocodb-sdk'; -import { - Column, - Filter, - FormView, - Hook, - HookLog, - Model, - View, -} from '../models'; +import { Filter, HookLog } from '../models'; import NcPluginMgrv2 from './NcPluginMgrv2'; +import type { Column, FormView, Hook, Model, View } from '../models'; +import type { HookLogType } from 'nocodb-sdk'; export function parseBody(template: string, data: any): string { if (!template) { diff --git a/packages/nocodb-nest/src/interceptors/is-upload-allowed/is-upload-allowed.interceptor.ts b/packages/nocodb-nest/src/interceptors/is-upload-allowed/is-upload-allowed.interceptor.ts index 5ec14d5b43..c3e8c75dcf 100644 --- a/packages/nocodb-nest/src/interceptors/is-upload-allowed/is-upload-allowed.interceptor.ts +++ b/packages/nocodb-nest/src/interceptors/is-upload-allowed/is-upload-allowed.interceptor.ts @@ -1,15 +1,16 @@ -import { - Injectable, - NestInterceptor, - ExecutionContext, - CallHandler, -} from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import { OrgUserRoles, ProjectRoles } from 'nocodb-sdk'; -import { Observable, throwError } from 'rxjs'; +import { throwError } from 'rxjs'; import { NcError } from '../../helpers/catchError'; import Noco from '../../Noco'; import extractRolesObj from '../../utils/extractRolesObj'; import { MetaTable } from '../../utils/globals'; +import type { Observable } from 'rxjs'; +import type { + CallHandler, + ExecutionContext, + NestInterceptor, +} from '@nestjs/common'; @Injectable() export class UploadAllowedInterceptor implements NestInterceptor { diff --git a/packages/nocodb-nest/src/main.ts b/packages/nocodb-nest/src/main.ts index ccaec824a5..cf6812daf7 100644 --- a/packages/nocodb-nest/src/main.ts +++ b/packages/nocodb-nest/src/main.ts @@ -1,6 +1,6 @@ import { NestFactory } from '@nestjs/core'; -import { AppModule } from './app.module'; import cors from 'cors'; +import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); diff --git a/packages/nocodb-nest/src/meta/meta.service.spec.ts b/packages/nocodb-nest/src/meta/meta.service.spec.ts index ceaafb9820..758f182995 100644 --- a/packages/nocodb-nest/src/meta/meta.service.spec.ts +++ b/packages/nocodb-nest/src/meta/meta.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { MetaService } from './meta.service'; +import type { TestingModule } from '@nestjs/testing'; describe('MetaService', () => { let service: MetaService; diff --git a/packages/nocodb-nest/src/meta/meta.service.ts b/packages/nocodb-nest/src/meta/meta.service.ts index 7169d1563c..0ad046a532 100644 --- a/packages/nocodb-nest/src/meta/meta.service.ts +++ b/packages/nocodb-nest/src/meta/meta.service.ts @@ -5,15 +5,15 @@ import { OnApplicationBootstrap, OnModuleInit, } from '@nestjs/common'; -import { Knex } from 'knex'; -import XcMigrationSource from './migrations/XcMigrationSource'; -import XcMigrationSourcev2 from './migrations/XcMigrationSourcev2'; -import { Connection } from '../connection/connection'; import { customAlphabet } from 'nanoid'; -import Noco from '../Noco'; import CryptoJS from 'crypto-js'; +import { Connection } from '../connection/connection'; +import Noco from '../Noco'; import NocoCache from '../cache/NocoCache'; +import XcMigrationSourcev2 from './migrations/XcMigrationSourcev2'; +import XcMigrationSource from './migrations/XcMigrationSource'; +import type { Knex } from 'knex'; const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 4); diff --git a/packages/nocodb-nest/src/middlewares/extract-project-id/extract-project-id.middleware.ts b/packages/nocodb-nest/src/middlewares/extract-project-id/extract-project-id.middleware.ts index bbc9768a14..56e3e56d50 100644 --- a/packages/nocodb-nest/src/middlewares/extract-project-id/extract-project-id.middleware.ts +++ b/packages/nocodb-nest/src/middlewares/extract-project-id/extract-project-id.middleware.ts @@ -1,19 +1,10 @@ -import { - CallHandler, - CanActivate, - ExecutionContext, - Injectable, - NestInterceptor, - NestMiddleware, - SetMetadata, - UseInterceptors, -} from '@nestjs/common'; +import { promisify } from 'util'; +import { Injectable, SetMetadata, UseInterceptors } from '@nestjs/common'; import { Reflector } from '@nestjs/core'; import { NextFunction, Request, Response } from 'express'; import { OrgUserRoles } from 'nocodb-sdk'; import passport from 'passport'; -import { map, Observable, throwError } from 'rxjs'; -import { promisify } from 'util'; +import { map, throwError } from 'rxjs'; import { Column, Filter, @@ -30,6 +21,14 @@ import extractRolesObj from '../../utils/extractRolesObj'; import projectAcl from '../../utils/projectAcl'; import catchError, { NcError } from '../catchError'; import extractProjectIdAndAuthenticate from '../extractProjectIdAndAuthenticate'; +import type { Observable } from 'rxjs'; +import type { + CallHandler, + CanActivate, + ExecutionContext, + NestInterceptor, + NestMiddleware, +} from '@nestjs/common'; @Injectable() export class ExtractProjectIdMiddleware implements NestMiddleware, CanActivate { diff --git a/packages/nocodb-nest/src/middlewares/extractProjectIdAndAuthenticate.ts b/packages/nocodb-nest/src/middlewares/extractProjectIdAndAuthenticate.ts index 88cb6687c6..e92ab96cee 100644 --- a/packages/nocodb-nest/src/middlewares/extractProjectIdAndAuthenticate.ts +++ b/packages/nocodb-nest/src/middlewares/extractProjectIdAndAuthenticate.ts @@ -2,16 +2,16 @@ import { promisify } from 'util'; import passport from 'passport'; import { - Model, - View, - Hook, - GridViewColumn, + Column, + Filter, FormViewColumn, GalleryViewColumn, + GridViewColumn, + Hook, + Model, Project, - Column, - Filter, Sort, + View, } from '../models'; export default async (req, res, next) => { diff --git a/packages/nocodb-nest/src/middlewares/global/global.middleware.ts b/packages/nocodb-nest/src/middlewares/global/global.middleware.ts index a7da404a36..4f30639bc8 100644 --- a/packages/nocodb-nest/src/middlewares/global/global.middleware.ts +++ b/packages/nocodb-nest/src/middlewares/global/global.middleware.ts @@ -1,5 +1,6 @@ -import { Injectable, NestMiddleware } from '@nestjs/common'; +import { Injectable } from '@nestjs/common'; import Noco from '../../Noco'; +import type { NestMiddleware } from '@nestjs/common'; @Injectable() export class GlobalMiddleware implements NestMiddleware { diff --git a/packages/nocodb-nest/src/modules/api-docs/api-docs.controller.spec.ts b/packages/nocodb-nest/src/modules/api-docs/api-docs.controller.spec.ts index 95eff6e83d..bc0f864432 100644 --- a/packages/nocodb-nest/src/modules/api-docs/api-docs.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/api-docs/api-docs.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ApiDocsController } from './api-docs.controller'; import { ApiDocsService } from './api-docs.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ApiDocsController', () => { let controller: ApiDocsController; diff --git a/packages/nocodb-nest/src/modules/api-docs/api-docs.service.spec.ts b/packages/nocodb-nest/src/modules/api-docs/api-docs.service.spec.ts index e0804aec32..b8d72f5b11 100644 --- a/packages/nocodb-nest/src/modules/api-docs/api-docs.service.spec.ts +++ b/packages/nocodb-nest/src/modules/api-docs/api-docs.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ApiDocsService } from './api-docs.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ApiDocsService', () => { let service: ApiDocsService; diff --git a/packages/nocodb-nest/src/modules/api-docs/swagger/getPaths.ts b/packages/nocodb-nest/src/modules/api-docs/swagger/getPaths.ts index cd18a0076a..dffe195c6c 100644 --- a/packages/nocodb-nest/src/modules/api-docs/swagger/getPaths.ts +++ b/packages/nocodb-nest/src/modules/api-docs/swagger/getPaths.ts @@ -1,6 +1,6 @@ -import { Model, Project } from '../../../models'; import Noco from '../../../Noco'; import { getModelPaths, getViewPaths } from './templates/paths'; +import type { Model, Project } from '../../../models'; import type { SwaggerColumn } from './getSwaggerColumnMetas'; import type { SwaggerView } from './getSwaggerJSON'; diff --git a/packages/nocodb-nest/src/modules/api-docs/swagger/getSchemas.ts b/packages/nocodb-nest/src/modules/api-docs/swagger/getSchemas.ts index e355e6733c..1dfa999e14 100644 --- a/packages/nocodb-nest/src/modules/api-docs/swagger/getSchemas.ts +++ b/packages/nocodb-nest/src/modules/api-docs/swagger/getSchemas.ts @@ -1,6 +1,6 @@ -import { Model, Project } from '../../../models'; import Noco from '../../../Noco'; import { getModelSchemas, getViewSchemas } from './templates/schemas'; +import type { Model, Project } from '../../../models'; import type { SwaggerColumn } from './getSwaggerColumnMetas'; import type { SwaggerView } from './getSwaggerJSON'; diff --git a/packages/nocodb-nest/src/modules/api-docs/swagger/getSwaggerColumnMetas.ts b/packages/nocodb-nest/src/modules/api-docs/swagger/getSwaggerColumnMetas.ts index 4eb76ca3ca..9a45b53ada 100644 --- a/packages/nocodb-nest/src/modules/api-docs/swagger/getSwaggerColumnMetas.ts +++ b/packages/nocodb-nest/src/modules/api-docs/swagger/getSwaggerColumnMetas.ts @@ -1,7 +1,11 @@ import { UITypes } from 'nocodb-sdk'; import SwaggerTypes from '../../../db/sql-mgr/code/routers/xc-ts/SwaggerTypes'; -import { Column, LinkToAnotherRecordColumn, Project } from '../../../models'; import Noco from '../../../Noco'; +import type { + Column, + LinkToAnotherRecordColumn, + Project, +} from '../../../models'; export default async ( columns: Column[], diff --git a/packages/nocodb-nest/src/modules/api-docs/swagger/getSwaggerJSON.ts b/packages/nocodb-nest/src/modules/api-docs/swagger/getSwaggerJSON.ts index 3762017ab1..6b717992ea 100644 --- a/packages/nocodb-nest/src/modules/api-docs/swagger/getSwaggerJSON.ts +++ b/packages/nocodb-nest/src/modules/api-docs/swagger/getSwaggerJSON.ts @@ -1,5 +1,10 @@ import { ViewTypes } from 'nocodb-sdk'; -import { +import Noco from '../../../Noco'; +import swaggerBase from './swagger-base.json'; +import getPaths from './getPaths'; +import getSchemas from './getSchemas'; +import getSwaggerColumnMetas from './getSwaggerColumnMetas'; +import type { FormViewColumn, GalleryViewColumn, GridViewColumn, @@ -7,11 +12,6 @@ import { Project, View, } from '../../../models'; -import Noco from '../../../Noco'; -import swaggerBase from './swagger-base.json'; -import getPaths from './getPaths'; -import getSchemas from './getSchemas'; -import getSwaggerColumnMetas from './getSwaggerColumnMetas'; export default async function getSwaggerJSON( project: Project, diff --git a/packages/nocodb-nest/src/modules/api-docs/swagger/templates/params.ts b/packages/nocodb-nest/src/modules/api-docs/swagger/templates/params.ts index d23c48fd5f..1f83df02d9 100644 --- a/packages/nocodb-nest/src/modules/api-docs/swagger/templates/params.ts +++ b/packages/nocodb-nest/src/modules/api-docs/swagger/templates/params.ts @@ -1,5 +1,5 @@ import { RelationTypes, UITypes } from 'nocodb-sdk'; -import { LinkToAnotherRecordColumn } from '../../../../models'; +import type { LinkToAnotherRecordColumn } from '../../../../models'; import type { SwaggerColumn } from '../getSwaggerColumnMetas'; export const rowIdParam = { diff --git a/packages/nocodb-nest/src/modules/api-tokens/api-tokens.controller.spec.ts b/packages/nocodb-nest/src/modules/api-tokens/api-tokens.controller.spec.ts index 6084000f5d..71d49c4687 100644 --- a/packages/nocodb-nest/src/modules/api-tokens/api-tokens.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/api-tokens/api-tokens.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ApiTokensController } from './api-tokens.controller'; import { ApiTokensService } from './api-tokens.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ApiTokensController', () => { let controller: ApiTokensController; diff --git a/packages/nocodb-nest/src/modules/api-tokens/api-tokens.controller.ts b/packages/nocodb-nest/src/modules/api-tokens/api-tokens.controller.ts index 31d76ea046..f8c6ea84af 100644 --- a/packages/nocodb-nest/src/modules/api-tokens/api-tokens.controller.ts +++ b/packages/nocodb-nest/src/modules/api-tokens/api-tokens.controller.ts @@ -1,20 +1,20 @@ import { + Body, Controller, Delete, Get, + Param, Post, - UseGuards, Request, - Body, - Param, + UseGuards, } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { ApiTokensService } from './api-tokens.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/api-tokens/api-tokens.service.spec.ts b/packages/nocodb-nest/src/modules/api-tokens/api-tokens.service.spec.ts index 3bea289c6e..ba9a332778 100644 --- a/packages/nocodb-nest/src/modules/api-tokens/api-tokens.service.spec.ts +++ b/packages/nocodb-nest/src/modules/api-tokens/api-tokens.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ApiTokensService } from './api-tokens.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ApiTokensService', () => { let service: ApiTokensService; diff --git a/packages/nocodb-nest/src/modules/api-tokens/api-tokens.service.ts b/packages/nocodb-nest/src/modules/api-tokens/api-tokens.service.ts index d055d8f53e..b051d508f1 100644 --- a/packages/nocodb-nest/src/modules/api-tokens/api-tokens.service.ts +++ b/packages/nocodb-nest/src/modules/api-tokens/api-tokens.service.ts @@ -1,9 +1,11 @@ import { Injectable } from '@nestjs/common'; import { T } from 'nc-help'; -import { ApiTokenReqType, OrgUserRoles } from 'nocodb-sdk'; +import { OrgUserRoles } from 'nocodb-sdk'; import { validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; -import { ApiToken, User } from '../../models'; +import { ApiToken } from '../../models'; +import type { User } from '../../models'; +import type { ApiTokenReqType } from 'nocodb-sdk'; @Injectable() export class ApiTokensService { diff --git a/packages/nocodb-nest/src/modules/attachments/attachments.controller.spec.ts b/packages/nocodb-nest/src/modules/attachments/attachments.controller.spec.ts index 0b50728435..5ca0fd5210 100644 --- a/packages/nocodb-nest/src/modules/attachments/attachments.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/attachments/attachments.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AttachmentsController } from './attachments.controller'; import { AttachmentsService } from './attachments.service'; +import type { TestingModule } from '@nestjs/testing'; describe('AttachmentsController', () => { let controller: AttachmentsController; diff --git a/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts b/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts index 848905ba75..eec60352dc 100644 --- a/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts +++ b/packages/nocodb-nest/src/modules/attachments/attachments.controller.ts @@ -1,3 +1,4 @@ +import path from 'path'; import { Body, Controller, @@ -14,7 +15,7 @@ import { import multer from 'multer'; import { FileInterceptor, FilesInterceptor } from '@nestjs/platform-express'; import { OrgUserRoles, ProjectRoles } from 'nocodb-sdk'; -import path from 'path'; +import { AuthGuard } from '@nestjs/passport'; import { NC_ATTACHMENT_FIELD_SIZE } from '../../constants'; import { NcError } from '../../helpers/catchError'; import { UploadAllowedInterceptor } from '../../interceptors/is-upload-allowed/is-upload-allowed.interceptor'; @@ -22,7 +23,6 @@ import { ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id import Noco from '../../Noco'; import { MetaTable } from '../../utils/globals'; import { AttachmentsService } from './attachments.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() export class AttachmentsController { diff --git a/packages/nocodb-nest/src/modules/attachments/attachments.service.spec.ts b/packages/nocodb-nest/src/modules/attachments/attachments.service.spec.ts index fc1e738e00..88ccd499ed 100644 --- a/packages/nocodb-nest/src/modules/attachments/attachments.service.spec.ts +++ b/packages/nocodb-nest/src/modules/attachments/attachments.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AttachmentsService } from './attachments.service'; +import type { TestingModule } from '@nestjs/testing'; describe('AttachmentsService', () => { let service: AttachmentsService; diff --git a/packages/nocodb-nest/src/modules/attachments/attachments.service.ts b/packages/nocodb-nest/src/modules/attachments/attachments.service.ts index 55c54cef1c..d918722066 100644 --- a/packages/nocodb-nest/src/modules/attachments/attachments.service.ts +++ b/packages/nocodb-nest/src/modules/attachments/attachments.service.ts @@ -1,11 +1,11 @@ +import path from 'path'; import { Injectable } from '@nestjs/common'; import { nanoid } from 'nanoid'; -import path from 'path'; import slash from 'slash'; +import { T } from 'nc-help'; import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; import Local from '../../plugins/storage/Local'; import mimetypes, { mimeIcons } from '../../utils/mimeTypes'; -import { T } from 'nc-help'; @Injectable() export class AttachmentsService { diff --git a/packages/nocodb-nest/src/modules/audits/audits.controller.spec.ts b/packages/nocodb-nest/src/modules/audits/audits.controller.spec.ts index b6f59cd606..1c94c9c3f3 100644 --- a/packages/nocodb-nest/src/modules/audits/audits.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/audits/audits.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AuditsController } from './audits.controller'; import { AuditsService } from './audits.service'; +import type { TestingModule } from '@nestjs/testing'; describe('AuditsController', () => { let controller: AuditsController; diff --git a/packages/nocodb-nest/src/modules/audits/audits.controller.ts b/packages/nocodb-nest/src/modules/audits/audits.controller.ts index e6deb38aaa..31768393b9 100644 --- a/packages/nocodb-nest/src/modules/audits/audits.controller.ts +++ b/packages/nocodb-nest/src/modules/audits/audits.controller.ts @@ -9,6 +9,7 @@ import { Request, UseGuards, } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { Acl, @@ -16,7 +17,6 @@ import { } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { Audit } from '../../models'; import { AuditsService } from './audits.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/audits/audits.service.spec.ts b/packages/nocodb-nest/src/modules/audits/audits.service.spec.ts index a6cd52d749..f274cdee78 100644 --- a/packages/nocodb-nest/src/modules/audits/audits.service.spec.ts +++ b/packages/nocodb-nest/src/modules/audits/audits.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AuditsService } from './audits.service'; +import type { TestingModule } from '@nestjs/testing'; describe('AuditsService', () => { let service: AuditsService; diff --git a/packages/nocodb-nest/src/modules/audits/audits.service.ts b/packages/nocodb-nest/src/modules/audits/audits.service.ts index 588195e732..da30782880 100644 --- a/packages/nocodb-nest/src/modules/audits/audits.service.ts +++ b/packages/nocodb-nest/src/modules/audits/audits.service.ts @@ -1,14 +1,10 @@ import { Injectable } from '@nestjs/common'; import DOMPurify from 'isomorphic-dompurify'; -import { - AuditOperationSubTypes, - AuditOperationTypes, - AuditRowUpdateReqType, - CommentUpdateReqType, -} from 'nocodb-sdk'; +import { AuditOperationSubTypes, AuditOperationTypes } from 'nocodb-sdk'; import { validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; import { Audit, Model } from '../../models'; +import type { AuditRowUpdateReqType, CommentUpdateReqType } from 'nocodb-sdk'; @Injectable() export class AuditsService { diff --git a/packages/nocodb-nest/src/modules/auth/auth.controller.spec.ts b/packages/nocodb-nest/src/modules/auth/auth.controller.spec.ts index 58dee31d5b..a8d5737fd5 100644 --- a/packages/nocodb-nest/src/modules/auth/auth.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/auth/auth.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AuthController } from './auth.controller'; import { AuthService } from './auth.service'; +import type { TestingModule } from '@nestjs/testing'; describe('AuthController', () => { let controller: AuthController; diff --git a/packages/nocodb-nest/src/modules/auth/auth.controller.ts b/packages/nocodb-nest/src/modules/auth/auth.controller.ts index b9b6884fe2..8c75bb2254 100644 --- a/packages/nocodb-nest/src/modules/auth/auth.controller.ts +++ b/packages/nocodb-nest/src/modules/auth/auth.controller.ts @@ -1,16 +1,15 @@ -import { ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id/extract-project-id.middleware'; -import extractRolesObj from '../../utils/extractRolesObj'; -import { AuthService } from './auth.service'; - import { + Body, Controller, - Request, + Get, Post, + Request, UseGuards, - Body, - Get, } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; +import { ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id/extract-project-id.middleware'; +import extractRolesObj from '../../utils/extractRolesObj'; +import { AuthService } from './auth.service'; export class CreateUserDto { readonly username: string; diff --git a/packages/nocodb-nest/src/modules/auth/auth.module.ts b/packages/nocodb-nest/src/modules/auth/auth.module.ts index 666926d12a..77e87a0086 100644 --- a/packages/nocodb-nest/src/modules/auth/auth.module.ts +++ b/packages/nocodb-nest/src/modules/auth/auth.module.ts @@ -1,10 +1,10 @@ import { Module } from '@nestjs/common'; +import { JwtModule } from '@nestjs/jwt'; +import { PassportModule } from '@nestjs/passport'; import { LocalStrategy } from '../../strategies/local.strategy'; +import { UsersModule } from '../users/users.module'; import { AuthService } from './auth.service'; import { AuthController } from './auth.controller'; -import { UsersModule } from '../users/users.module'; -import { JwtModule } from '@nestjs/jwt'; -import { PassportModule } from '@nestjs/passport'; import { jwtConstants } from './constants'; @Module({ diff --git a/packages/nocodb-nest/src/modules/auth/auth.service.spec.ts b/packages/nocodb-nest/src/modules/auth/auth.service.spec.ts index 800ab6626a..6da24af6e7 100644 --- a/packages/nocodb-nest/src/modules/auth/auth.service.spec.ts +++ b/packages/nocodb-nest/src/modules/auth/auth.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { AuthService } from './auth.service'; +import type { TestingModule } from '@nestjs/testing'; describe('AuthService', () => { let service: AuthService; diff --git a/packages/nocodb-nest/src/modules/auth/auth.service.ts b/packages/nocodb-nest/src/modules/auth/auth.service.ts index 6908205ac2..f5161c002d 100644 --- a/packages/nocodb-nest/src/modules/auth/auth.service.ts +++ b/packages/nocodb-nest/src/modules/auth/auth.service.ts @@ -1,13 +1,13 @@ -import { Injectable } from '@nestjs/common'; -import { OrgUserRoles } from 'nocodb-sdk'; -import { UsersService } from '../users/users.service'; import { promisify } from 'util'; +import { OrgUserRoles } from 'nocodb-sdk'; +import { Injectable } from '@nestjs/common'; import * as bcrypt from 'bcryptjs'; import { JwtService } from '@nestjs/jwt'; -import { CreateUserDto } from './auth.controller'; import { v4 as uuidv4 } from 'uuid'; +import { UsersService } from '../users/users.service'; import { Connection } from '../../connection/connection'; +import type { CreateUserDto } from './auth.controller'; @Injectable() export class AuthService { diff --git a/packages/nocodb-nest/src/modules/bases/bases.controller.spec.ts b/packages/nocodb-nest/src/modules/bases/bases.controller.spec.ts index f1f7b7038a..fd07fe639d 100644 --- a/packages/nocodb-nest/src/modules/bases/bases.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/bases/bases.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { BasesController } from './bases.controller'; import { BasesService } from './bases.service'; +import type { TestingModule } from '@nestjs/testing'; describe('BasesController', () => { let controller: BasesController; diff --git a/packages/nocodb-nest/src/modules/bases/bases.controller.ts b/packages/nocodb-nest/src/modules/bases/bases.controller.ts index 4cd82739e2..f3b8104e14 100644 --- a/packages/nocodb-nest/src/modules/bases/bases.controller.ts +++ b/packages/nocodb-nest/src/modules/bases/bases.controller.ts @@ -9,13 +9,13 @@ import { UseGuards, } from '@nestjs/common'; import { BaseReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { BasesService } from './bases.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/bases/bases.service.spec.ts b/packages/nocodb-nest/src/modules/bases/bases.service.spec.ts index e69392b015..bf50406021 100644 --- a/packages/nocodb-nest/src/modules/bases/bases.service.spec.ts +++ b/packages/nocodb-nest/src/modules/bases/bases.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { BasesService } from './bases.service'; +import type { TestingModule } from '@nestjs/testing'; describe('BasesService', () => { let service: BasesService; diff --git a/packages/nocodb-nest/src/modules/bases/bases.service.ts b/packages/nocodb-nest/src/modules/bases/bases.service.ts index fb4f2e2220..2634bae444 100644 --- a/packages/nocodb-nest/src/modules/bases/bases.service.ts +++ b/packages/nocodb-nest/src/modules/bases/bases.service.ts @@ -1,9 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { BaseReqType } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { populateMeta, validatePayload } from '../../helpers'; import { syncBaseMigration } from '../../helpers/syncMigration'; import { Base, Project } from '../../models'; -import { T } from 'nc-help'; +import type { BaseReqType } from 'nocodb-sdk'; @Injectable() export class BasesService { diff --git a/packages/nocodb-nest/src/modules/caches/caches.controller.spec.ts b/packages/nocodb-nest/src/modules/caches/caches.controller.spec.ts index 185c027f22..ed86caac26 100644 --- a/packages/nocodb-nest/src/modules/caches/caches.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/caches/caches.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { CachesController } from './caches.controller'; import { CachesService } from './caches.service'; +import type { TestingModule } from '@nestjs/testing'; describe('CachesController', () => { let controller: CachesController; diff --git a/packages/nocodb-nest/src/modules/caches/caches.service.spec.ts b/packages/nocodb-nest/src/modules/caches/caches.service.spec.ts index d5398c7bfa..615211bf1d 100644 --- a/packages/nocodb-nest/src/modules/caches/caches.service.spec.ts +++ b/packages/nocodb-nest/src/modules/caches/caches.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { CachesService } from './caches.service'; +import type { TestingModule } from '@nestjs/testing'; describe('CachesService', () => { let service: CachesService; diff --git a/packages/nocodb-nest/src/modules/columns/columns.controller.spec.ts b/packages/nocodb-nest/src/modules/columns/columns.controller.spec.ts index 5df3a7f406..c7fda0c40e 100644 --- a/packages/nocodb-nest/src/modules/columns/columns.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/columns/columns.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ColumnsController } from './columns.controller'; import { ColumnsService } from './columns.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ColumnsController', () => { let controller: ColumnsController; diff --git a/packages/nocodb-nest/src/modules/columns/columns.controller.ts b/packages/nocodb-nest/src/modules/columns/columns.controller.ts index 94f796fd18..e377584618 100644 --- a/packages/nocodb-nest/src/modules/columns/columns.controller.ts +++ b/packages/nocodb-nest/src/modules/columns/columns.controller.ts @@ -1,21 +1,21 @@ import { Body, Controller, + Delete, + Get, Param, + Patch, Post, - UseGuards, Request, - Patch, - Delete, - Get, + UseGuards, } from '@nestjs/common'; import { ColumnReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { ColumnsService } from './columns.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/columns/columns.service.spec.ts b/packages/nocodb-nest/src/modules/columns/columns.service.spec.ts index b04f864a70..7c8dc4dd3e 100644 --- a/packages/nocodb-nest/src/modules/columns/columns.service.spec.ts +++ b/packages/nocodb-nest/src/modules/columns/columns.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ColumnsService } from './columns.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ColumnsService', () => { let service: ColumnsService; diff --git a/packages/nocodb-nest/src/modules/columns/columns.service.ts b/packages/nocodb-nest/src/modules/columns/columns.service.ts index 0e2bb6c6b8..f4494642a7 100644 --- a/packages/nocodb-nest/src/modules/columns/columns.service.ts +++ b/packages/nocodb-nest/src/modules/columns/columns.service.ts @@ -2,18 +2,14 @@ import { Injectable } from '@nestjs/common'; import { AuditOperationSubTypes, AuditOperationTypes, - ColumnReqType, isVirtualCol, - LinkToAnotherColumnReqType, - LinkToAnotherRecordType, - RelationTypes, substituteColumnAliasWithIdInFormula, substituteColumnIdWithAliasInFormula, UITypes, } from 'nocodb-sdk'; +import { T } from 'nc-help'; import formulaQueryBuilderv2 from '../../db/formulav2/formulaQueryBuilderv2'; import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; -import SqlMgrv2 from '../../db/sql-mgr/v2/SqlMgrv2'; import { createHmAndBtColumn, generateFkName, @@ -31,21 +27,26 @@ import { } from '../../helpers/getUniqueName'; import mapDefaultDisplayValue from '../../helpers/mapDefaultDisplayValue'; import validateParams from '../../helpers/validateParams'; -import { MetaService } from '../../meta/meta.service'; import { Audit, Base, Column, FormulaColumn, KanbanView, - LinkToAnotherRecordColumn, Model, - Project, } from '../../models'; import Noco from '../../Noco'; import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; -import { T } from 'nc-help'; import { MetaTable } from '../../utils/globals'; +import type { LinkToAnotherRecordColumn, Project } from '../../models'; +import type { MetaService } from '../../meta/meta.service'; +import type SqlMgrv2 from '../../db/sql-mgr/v2/SqlMgrv2'; +import type { + ColumnReqType, + LinkToAnotherColumnReqType, + LinkToAnotherRecordType, + RelationTypes, +} from 'nocodb-sdk'; // todo: move export enum Altered { diff --git a/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.controller.spec.ts b/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.controller.spec.ts index fe0a2aa14f..a92650032a 100644 --- a/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.controller.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { BulkDataAliasController } from './bulk-data-alias.controller'; +import type { TestingModule } from '@nestjs/testing'; describe('BulkDataAliasController', () => { let controller: BulkDataAliasController; diff --git a/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.controller.ts b/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.controller.ts index 02d46124a8..39596e88aa 100644 --- a/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.controller.ts +++ b/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.controller.ts @@ -1,19 +1,19 @@ import { + Body, Controller, + Delete, Param, + Patch, Post, Request, - Body, - Patch, - Delete, UseGuards, } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../../middlewares/extract-project-id/extract-project-id.middleware'; import { BulkDataAliasService } from './bulk-data-alias.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.service.spec.ts b/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.service.spec.ts index a0657010f1..30a22e46b0 100644 --- a/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.service.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { BulkDataAliasService } from './bulk-data-alias.service'; +import type { TestingModule } from '@nestjs/testing'; describe('BulkDataAliasService', () => { let service: BulkDataAliasService; diff --git a/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.service.ts b/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.service.ts index 3d5bad0b84..c875519a33 100644 --- a/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.service.ts +++ b/packages/nocodb-nest/src/modules/datas/bulk-data-alias/bulk-data-alias.service.ts @@ -1,11 +1,12 @@ import { Injectable } from '@nestjs/common'; import { isSystemColumn, UITypes } from 'nocodb-sdk'; import * as XLSX from 'xlsx'; -import { BaseModelSqlv2 } from '../../../db/BaseModelSqlv2'; import { NcError } from '../../../helpers/catchError'; import { Base, Column, Model, Project, View } from '../../../models'; import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; -import { getViewAndModelByAliasOrId, PathParams } from '../helpers'; +import { getViewAndModelByAliasOrId } from '../helpers'; +import type { PathParams } from '../helpers'; +import type { BaseModelSqlv2 } from '../../../db/BaseModelSqlv2'; type BulkOperation = | 'bulkInsert' diff --git a/packages/nocodb-nest/src/modules/datas/data-alias-export/data-alias-export.controller.spec.ts b/packages/nocodb-nest/src/modules/datas/data-alias-export/data-alias-export.controller.spec.ts index 2ecc6e5e0a..7670b7a3c5 100644 --- a/packages/nocodb-nest/src/modules/datas/data-alias-export/data-alias-export.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/data-alias-export/data-alias-export.controller.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { DataAliasExportController } from './data-alias-export.controller'; +import type { TestingModule } from '@nestjs/testing'; describe('DataAliasExportController', () => { let controller: DataAliasExportController; diff --git a/packages/nocodb-nest/src/modules/datas/data-alias-export/data-alias-export.controller.ts b/packages/nocodb-nest/src/modules/datas/data-alias-export/data-alias-export.controller.ts index 8486b46fc6..41a8183f63 100644 --- a/packages/nocodb-nest/src/modules/datas/data-alias-export/data-alias-export.controller.ts +++ b/packages/nocodb-nest/src/modules/datas/data-alias-export/data-alias-export.controller.ts @@ -1,4 +1,6 @@ import { Controller, Get, Request, Response, UseGuards } from '@nestjs/common'; +import * as XLSX from 'xlsx'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, @@ -6,8 +8,6 @@ import { import { View } from '../../../models'; import { DatasService } from '../datas.service'; import { extractCsvData, extractXlsxData } from '../helpers'; -import * as XLSX from 'xlsx'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.controller.spec.ts b/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.controller.spec.ts index 8d076c5470..63eee30451 100644 --- a/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.controller.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { DataAliasNestedController } from './data-alias-nested.controller'; +import type { TestingModule } from '@nestjs/testing'; describe('DataAliasNestedController', () => { let controller: DataAliasNestedController; diff --git a/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.controller.ts b/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.controller.ts index 02ad08eeb1..d965c5ce22 100644 --- a/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.controller.ts +++ b/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.controller.ts @@ -7,12 +7,12 @@ import { Request, UseGuards, } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../../middlewares/extract-project-id/extract-project-id.middleware'; import { DataAliasNestedService } from './data-alias-nested.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.service.spec.ts b/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.service.spec.ts index 05b137a1ab..3f8343452b 100644 --- a/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.service.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { DataAliasNestedService } from './data-alias-nested.service'; +import type { TestingModule } from '@nestjs/testing'; describe('DataAliasNestedService', () => { let service: DataAliasNestedService; diff --git a/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.service.ts b/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.service.ts index 0ef4234387..bd62b3d828 100644 --- a/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.service.ts +++ b/packages/nocodb-nest/src/modules/datas/data-alias-nested/data-alias-nested.service.ts @@ -3,11 +3,8 @@ import { NcError } from '../../../helpers/catchError'; import { PagedResponseImpl } from '../../../helpers/PagedResponse'; import { Base, Model } from '../../../models'; import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; -import { - getColumnByIdOrName, - getViewAndModelByAliasOrId, - PathParams, -} from '../helpers'; +import { getColumnByIdOrName, getViewAndModelByAliasOrId } from '../helpers'; +import type { PathParams } from '../helpers'; @Injectable() export class DataAliasNestedService { diff --git a/packages/nocodb-nest/src/modules/datas/data-alias.controller.spec.ts b/packages/nocodb-nest/src/modules/datas/data-alias.controller.spec.ts index a642848e49..68e70183de 100644 --- a/packages/nocodb-nest/src/modules/datas/data-alias.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/data-alias.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { DataAliasController } from './data-alias.controller'; import { DatasService } from './datas.service'; +import type { TestingModule } from '@nestjs/testing'; describe('DataAliasController', () => { let controller: DataAliasController; diff --git a/packages/nocodb-nest/src/modules/datas/data-alias.controller.ts b/packages/nocodb-nest/src/modules/datas/data-alias.controller.ts index addbf64932..4dc0b9b146 100644 --- a/packages/nocodb-nest/src/modules/datas/data-alias.controller.ts +++ b/packages/nocodb-nest/src/modules/datas/data-alias.controller.ts @@ -10,13 +10,13 @@ import { Response, UseGuards, } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { parseHrtimeToSeconds } from '../../helpers'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { DatasService } from './datas.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/datas/datas.controller.spec.ts b/packages/nocodb-nest/src/modules/datas/datas.controller.spec.ts index 2136fd3b63..a9917662bc 100644 --- a/packages/nocodb-nest/src/modules/datas/datas.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/datas.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { DatasController } from './datas.controller'; import { DatasService } from './datas.service'; +import type { TestingModule } from '@nestjs/testing'; describe('DatasController', () => { let controller: DatasController; diff --git a/packages/nocodb-nest/src/modules/datas/datas.service.spec.ts b/packages/nocodb-nest/src/modules/datas/datas.service.spec.ts index 49bed22c25..fffeed688f 100644 --- a/packages/nocodb-nest/src/modules/datas/datas.service.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/datas.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { DatasService } from './datas.service'; +import type { TestingModule } from '@nestjs/testing'; describe('DatasService', () => { let service: DatasService; diff --git a/packages/nocodb-nest/src/modules/datas/datas.service.ts b/packages/nocodb-nest/src/modules/datas/datas.service.ts index 240804cdf5..47e3a21bc0 100644 --- a/packages/nocodb-nest/src/modules/datas/datas.service.ts +++ b/packages/nocodb-nest/src/modules/datas/datas.service.ts @@ -1,27 +1,20 @@ import { Injectable } from '@nestjs/common'; import { isSystemColumn, UITypes } from 'nocodb-sdk'; import * as XLSX from 'xlsx'; +import papaparse from 'papaparse'; +import { nocoExecute } from 'nc-help'; import { NcError } from '../../helpers/catchError'; import getAst from '../../helpers/getAst'; -import papaparse from 'papaparse'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; -import { - Base, - Column, - LinkToAnotherRecordColumn, - LookupColumn, - Model, - Project, - View, -} from '../../models'; +import { Base, Column, Model, Project, View } from '../../models'; import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; import { getDbRows, getViewAndModelByAliasOrId, - PathParams, serializeCellValue, } from './helpers'; -import { nocoExecute } from 'nc-help'; +import type { PathParams } from './helpers'; +import type { LinkToAnotherRecordColumn, LookupColumn } from '../../models'; @Injectable() export class DatasService { diff --git a/packages/nocodb-nest/src/modules/datas/helpers.ts b/packages/nocodb-nest/src/modules/datas/helpers.ts index 7834e08fb7..271535c9a6 100644 --- a/packages/nocodb-nest/src/modules/datas/helpers.ts +++ b/packages/nocodb-nest/src/modules/datas/helpers.ts @@ -2,7 +2,6 @@ import { nocoExecute } from 'nc-help'; import { isSystemColumn, UITypes } from 'nocodb-sdk'; import * as XLSX from 'xlsx'; import papaparse from 'papaparse'; -import { BaseModelSqlv2 } from '../../db/BaseModelSqlv2'; import { NcError } from '../../helpers/catchError'; import getAst from '../../helpers/getAst'; import { Model, View } from '../../models'; @@ -10,6 +9,7 @@ import Base from '../../models/Base'; import Column from '../../models/Column'; import Project from '../../models/Project'; import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; +import type { BaseModelSqlv2 } from '../../db/BaseModelSqlv2'; import type LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; import type LookupColumn from '../../models/LookupColumn'; import type { Request } from 'express'; diff --git a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.spec.ts b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.spec.ts index e54862246a..0b38871c71 100644 --- a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { OldDatasController } from './old-datas.controller'; +import type { TestingModule } from '@nestjs/testing'; describe('OldDatasController', () => { let controller: OldDatasController; diff --git a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.ts b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.ts index be6cd1b63c..26b9965664 100644 --- a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.ts +++ b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.controller.ts @@ -1,7 +1,6 @@ import { - Controller, - UseGuards, Body, + Controller, Delete, Get, Param, @@ -9,12 +8,13 @@ import { Post, Request, Response, + UseGuards, } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../../middlewares/extract-project-id/extract-project-id.middleware'; -import { AuthGuard } from '@nestjs/passport'; import { OldDatasService } from './old-datas.service'; @Controller() diff --git a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.service.spec.ts b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.service.spec.ts index 850634fce0..71788c8445 100644 --- a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.service.spec.ts +++ b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { OldDatasService } from './old-datas.service'; +import type { TestingModule } from '@nestjs/testing'; describe('OldDatasService', () => { let service: OldDatasService; diff --git a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.service.ts b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.service.ts index 3448c4f849..3eaba59f38 100644 --- a/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.service.ts +++ b/packages/nocodb-nest/src/modules/datas/old-datas/old-datas.service.ts @@ -1,10 +1,10 @@ import { Injectable } from '@nestjs/common'; -import { OldPathParams } from '../helpers'; +import { nocoExecute } from 'nc-help'; import getAst from '../../../helpers/getAst'; import { NcError } from '../../../helpers/catchError'; import { Base, Model, Project, View } from '../../../models'; import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; -import { nocoExecute } from 'nc-help'; +import type { OldPathParams } from '../helpers'; @Injectable() export class OldDatasService { diff --git a/packages/nocodb-nest/src/modules/filters/filters.controller.spec.ts b/packages/nocodb-nest/src/modules/filters/filters.controller.spec.ts index 3d1a7f3548..ef4e8212d9 100644 --- a/packages/nocodb-nest/src/modules/filters/filters.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/filters/filters.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { FiltersController } from './filters.controller'; import { FiltersService } from './filters.service'; +import type { TestingModule } from '@nestjs/testing'; describe('FiltersController', () => { let controller: FiltersController; diff --git a/packages/nocodb-nest/src/modules/filters/filters.controller.ts b/packages/nocodb-nest/src/modules/filters/filters.controller.ts index 0e1177111c..b187840bc4 100644 --- a/packages/nocodb-nest/src/modules/filters/filters.controller.ts +++ b/packages/nocodb-nest/src/modules/filters/filters.controller.ts @@ -1,12 +1,12 @@ import { + Body, Controller, + Delete, Get, Param, + Patch, Post, UseGuards, - Body, - Patch, - Delete, } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import { FilterReqType } from 'nocodb-sdk'; diff --git a/packages/nocodb-nest/src/modules/filters/filters.service.spec.ts b/packages/nocodb-nest/src/modules/filters/filters.service.spec.ts index 6ea7488076..0b1dab0ec7 100644 --- a/packages/nocodb-nest/src/modules/filters/filters.service.spec.ts +++ b/packages/nocodb-nest/src/modules/filters/filters.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { FiltersService } from './filters.service'; +import type { TestingModule } from '@nestjs/testing'; describe('FiltersService', () => { let service: FiltersService; diff --git a/packages/nocodb-nest/src/modules/filters/filters.service.ts b/packages/nocodb-nest/src/modules/filters/filters.service.ts index 4e747d46bf..6369e4f8e3 100644 --- a/packages/nocodb-nest/src/modules/filters/filters.service.ts +++ b/packages/nocodb-nest/src/modules/filters/filters.service.ts @@ -1,8 +1,8 @@ import { Injectable } from '@nestjs/common'; -import { FilterReqType } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { Filter } from '../../models'; -import { T } from 'nc-help'; +import type { FilterReqType } from 'nocodb-sdk'; @Injectable() export class FiltersService { diff --git a/packages/nocodb-nest/src/modules/form-columns/form-columns.controller.spec.ts b/packages/nocodb-nest/src/modules/form-columns/form-columns.controller.spec.ts index 8bb2be4dc6..bb057930fa 100644 --- a/packages/nocodb-nest/src/modules/form-columns/form-columns.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/form-columns/form-columns.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { FormColumnsController } from './form-columns.controller'; import { FormColumnsService } from './form-columns.service'; +import type { TestingModule } from '@nestjs/testing'; describe('FormColumnsController', () => { let controller: FormColumnsController; diff --git a/packages/nocodb-nest/src/modules/form-columns/form-columns.controller.ts b/packages/nocodb-nest/src/modules/form-columns/form-columns.controller.ts index 12620e60d8..88e12c9e71 100644 --- a/packages/nocodb-nest/src/modules/form-columns/form-columns.controller.ts +++ b/packages/nocodb-nest/src/modules/form-columns/form-columns.controller.ts @@ -1,10 +1,10 @@ import { Body, Controller, Param, Patch, UseGuards } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { FormColumnsService } from './form-columns.service'; -import { AuthGuard } from '@nestjs/passport'; class FormColumnUpdateReqType {} diff --git a/packages/nocodb-nest/src/modules/form-columns/form-columns.service.spec.ts b/packages/nocodb-nest/src/modules/form-columns/form-columns.service.spec.ts index 13d6587592..b97876b68a 100644 --- a/packages/nocodb-nest/src/modules/form-columns/form-columns.service.spec.ts +++ b/packages/nocodb-nest/src/modules/form-columns/form-columns.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { FormColumnsService } from './form-columns.service'; +import type { TestingModule } from '@nestjs/testing'; describe('FormColumnsService', () => { let service: FormColumnsService; diff --git a/packages/nocodb-nest/src/modules/form-columns/form-columns.service.ts b/packages/nocodb-nest/src/modules/form-columns/form-columns.service.ts index 58aafd5cc4..6749b811c4 100644 --- a/packages/nocodb-nest/src/modules/form-columns/form-columns.service.ts +++ b/packages/nocodb-nest/src/modules/form-columns/form-columns.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { FormViewColumn } from '../../models'; -import { T } from 'nc-help'; @Injectable() export class FormColumnsService { diff --git a/packages/nocodb-nest/src/modules/forms/forms.controller.spec.ts b/packages/nocodb-nest/src/modules/forms/forms.controller.spec.ts index 103e763fa3..fe26e57419 100644 --- a/packages/nocodb-nest/src/modules/forms/forms.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/forms/forms.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { FormsController } from './forms.controller'; import { FormsService } from './forms.service'; +import type { TestingModule } from '@nestjs/testing'; describe('FormsController', () => { let controller: FormsController; diff --git a/packages/nocodb-nest/src/modules/forms/forms.controller.ts b/packages/nocodb-nest/src/modules/forms/forms.controller.ts index 1363fc038d..13b6a261cb 100644 --- a/packages/nocodb-nest/src/modules/forms/forms.controller.ts +++ b/packages/nocodb-nest/src/modules/forms/forms.controller.ts @@ -8,12 +8,12 @@ import { UseGuards, } from '@nestjs/common'; import { ViewCreateReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { FormsService } from './forms.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/forms/forms.service.spec.ts b/packages/nocodb-nest/src/modules/forms/forms.service.spec.ts index 9694c9ee42..a10c67212c 100644 --- a/packages/nocodb-nest/src/modules/forms/forms.service.spec.ts +++ b/packages/nocodb-nest/src/modules/forms/forms.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { FormsService } from './forms.service'; +import type { TestingModule } from '@nestjs/testing'; describe('FormsService', () => { let service: FormsService; diff --git a/packages/nocodb-nest/src/modules/forms/forms.service.ts b/packages/nocodb-nest/src/modules/forms/forms.service.ts index 7cc64e8335..5bbb6b17d8 100644 --- a/packages/nocodb-nest/src/modules/forms/forms.service.ts +++ b/packages/nocodb-nest/src/modules/forms/forms.service.ts @@ -1,9 +1,10 @@ import { Injectable } from '@nestjs/common'; import { T } from 'nc-help'; -import { FormUpdateReqType, ViewCreateReqType, ViewTypes } from 'nocodb-sdk'; +import { ViewTypes } from 'nocodb-sdk'; import { validatePayload } from '../../helpers'; import { FormView, View } from '../../models'; +import type { FormUpdateReqType, ViewCreateReqType } from 'nocodb-sdk'; @Injectable() export class FormsService { diff --git a/packages/nocodb-nest/src/modules/galleries/galleries.controller.spec.ts b/packages/nocodb-nest/src/modules/galleries/galleries.controller.spec.ts index fe45be2aa0..ca053d47f6 100644 --- a/packages/nocodb-nest/src/modules/galleries/galleries.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/galleries/galleries.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { GalleriesController } from './galleries.controller'; import { GalleriesService } from './galleries.service'; +import type { TestingModule } from '@nestjs/testing'; describe('GalleriesController', () => { let controller: GalleriesController; diff --git a/packages/nocodb-nest/src/modules/galleries/galleries.controller.ts b/packages/nocodb-nest/src/modules/galleries/galleries.controller.ts index f07e93b21b..0a3fbb7be5 100644 --- a/packages/nocodb-nest/src/modules/galleries/galleries.controller.ts +++ b/packages/nocodb-nest/src/modules/galleries/galleries.controller.ts @@ -8,12 +8,12 @@ import { UseGuards, } from '@nestjs/common'; import { GalleryUpdateReqType, ViewCreateReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { GalleriesService } from './galleries.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/galleries/galleries.service.spec.ts b/packages/nocodb-nest/src/modules/galleries/galleries.service.spec.ts index 4294d0cf21..cd578d835e 100644 --- a/packages/nocodb-nest/src/modules/galleries/galleries.service.spec.ts +++ b/packages/nocodb-nest/src/modules/galleries/galleries.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { GalleriesService } from './galleries.service'; +import type { TestingModule } from '@nestjs/testing'; describe('GalleriesService', () => { let service: GalleriesService; diff --git a/packages/nocodb-nest/src/modules/galleries/galleries.service.ts b/packages/nocodb-nest/src/modules/galleries/galleries.service.ts index d7f648c216..85a3dd5ac8 100644 --- a/packages/nocodb-nest/src/modules/galleries/galleries.service.ts +++ b/packages/nocodb-nest/src/modules/galleries/galleries.service.ts @@ -1,8 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { GalleryUpdateReqType, ViewCreateReqType, ViewTypes } from 'nocodb-sdk'; +import { ViewTypes } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { GalleryView, View } from '../../models'; -import { T } from 'nc-help'; +import type { GalleryUpdateReqType, ViewCreateReqType } from 'nocodb-sdk'; @Injectable() export class GalleriesService { diff --git a/packages/nocodb-nest/src/modules/grid-columns/grid-columns.controller.spec.ts b/packages/nocodb-nest/src/modules/grid-columns/grid-columns.controller.spec.ts index a3a12cce35..942a2c5085 100644 --- a/packages/nocodb-nest/src/modules/grid-columns/grid-columns.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/grid-columns/grid-columns.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { GridColumnsController } from './grid-columns.controller'; import { GridColumnsService } from './grid-columns.service'; +import type { TestingModule } from '@nestjs/testing'; describe('GridColumnsController', () => { let controller: GridColumnsController; diff --git a/packages/nocodb-nest/src/modules/grid-columns/grid-columns.controller.ts b/packages/nocodb-nest/src/modules/grid-columns/grid-columns.controller.ts index ce6a22b530..97eef741d6 100644 --- a/packages/nocodb-nest/src/modules/grid-columns/grid-columns.controller.ts +++ b/packages/nocodb-nest/src/modules/grid-columns/grid-columns.controller.ts @@ -1,11 +1,11 @@ import { Body, Controller, Get, Param, Patch, UseGuards } from '@nestjs/common'; import { GridColumnReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { GridColumnsService } from './grid-columns.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/grid-columns/grid-columns.service.spec.ts b/packages/nocodb-nest/src/modules/grid-columns/grid-columns.service.spec.ts index 953cd69927..1438eec305 100644 --- a/packages/nocodb-nest/src/modules/grid-columns/grid-columns.service.spec.ts +++ b/packages/nocodb-nest/src/modules/grid-columns/grid-columns.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { GridColumnsService } from './grid-columns.service'; +import type { TestingModule } from '@nestjs/testing'; describe('GridColumnsService', () => { let service: GridColumnsService; diff --git a/packages/nocodb-nest/src/modules/grid-columns/grid-columns.service.ts b/packages/nocodb-nest/src/modules/grid-columns/grid-columns.service.ts index 560e42a842..ca7098a9a1 100644 --- a/packages/nocodb-nest/src/modules/grid-columns/grid-columns.service.ts +++ b/packages/nocodb-nest/src/modules/grid-columns/grid-columns.service.ts @@ -1,8 +1,8 @@ import { Injectable } from '@nestjs/common'; -import { GridColumnReqType } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { GridViewColumn } from '../../models'; -import { T } from 'nc-help'; +import type { GridColumnReqType } from 'nocodb-sdk'; @Injectable() export class GridColumnsService { diff --git a/packages/nocodb-nest/src/modules/grids/grids.controller.spec.ts b/packages/nocodb-nest/src/modules/grids/grids.controller.spec.ts index e3e35d21e3..3555c5892e 100644 --- a/packages/nocodb-nest/src/modules/grids/grids.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/grids/grids.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { GridsController } from './grids.controller'; import { GridsService } from './grids.service'; +import type { TestingModule } from '@nestjs/testing'; describe('GridsController', () => { let controller: GridsController; diff --git a/packages/nocodb-nest/src/modules/grids/grids.controller.ts b/packages/nocodb-nest/src/modules/grids/grids.controller.ts index 7223a5a445..60acf4be42 100644 --- a/packages/nocodb-nest/src/modules/grids/grids.controller.ts +++ b/packages/nocodb-nest/src/modules/grids/grids.controller.ts @@ -7,12 +7,12 @@ import { UseGuards, } from '@nestjs/common'; import { ViewCreateReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { GridsService } from './grids.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/grids/grids.service.spec.ts b/packages/nocodb-nest/src/modules/grids/grids.service.spec.ts index dbf57dec20..01eb6101cb 100644 --- a/packages/nocodb-nest/src/modules/grids/grids.service.spec.ts +++ b/packages/nocodb-nest/src/modules/grids/grids.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { GridsService } from './grids.service'; +import type { TestingModule } from '@nestjs/testing'; describe('GridsService', () => { let service: GridsService; diff --git a/packages/nocodb-nest/src/modules/grids/grids.service.ts b/packages/nocodb-nest/src/modules/grids/grids.service.ts index 373a812076..25bcda842c 100644 --- a/packages/nocodb-nest/src/modules/grids/grids.service.ts +++ b/packages/nocodb-nest/src/modules/grids/grids.service.ts @@ -1,8 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { GridUpdateReqType, ViewCreateReqType, ViewTypes } from 'nocodb-sdk'; +import { ViewTypes } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { GridView, View } from '../../models'; -import { T } from 'nc-help'; +import type { GridUpdateReqType, ViewCreateReqType } from 'nocodb-sdk'; @Injectable() export class GridsService { diff --git a/packages/nocodb-nest/src/modules/hook-filters/hook-filters.controller.spec.ts b/packages/nocodb-nest/src/modules/hook-filters/hook-filters.controller.spec.ts index 68bee3f0a2..9b9d4840f4 100644 --- a/packages/nocodb-nest/src/modules/hook-filters/hook-filters.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/hook-filters/hook-filters.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { HookFiltersController } from './hook-filters.controller'; import { HookFiltersService } from './hook-filters.service'; +import type { TestingModule } from '@nestjs/testing'; describe('HookFiltersController', () => { let controller: HookFiltersController; diff --git a/packages/nocodb-nest/src/modules/hook-filters/hook-filters.service.spec.ts b/packages/nocodb-nest/src/modules/hook-filters/hook-filters.service.spec.ts index a29cb5ab66..121c47bc29 100644 --- a/packages/nocodb-nest/src/modules/hook-filters/hook-filters.service.spec.ts +++ b/packages/nocodb-nest/src/modules/hook-filters/hook-filters.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { HookFiltersService } from './hook-filters.service'; +import type { TestingModule } from '@nestjs/testing'; describe('HookFiltersService', () => { let service: HookFiltersService; diff --git a/packages/nocodb-nest/src/modules/hooks/hooks.controller.spec.ts b/packages/nocodb-nest/src/modules/hooks/hooks.controller.spec.ts index 530f67901f..f7bb18ec75 100644 --- a/packages/nocodb-nest/src/modules/hooks/hooks.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/hooks/hooks.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { HooksController } from './hooks.controller'; import { HooksService } from './hooks.service'; +import type { TestingModule } from '@nestjs/testing'; describe('HooksController', () => { let controller: HooksController; diff --git a/packages/nocodb-nest/src/modules/hooks/hooks.controller.ts b/packages/nocodb-nest/src/modules/hooks/hooks.controller.ts index c1b466b053..c593677191 100644 --- a/packages/nocodb-nest/src/modules/hooks/hooks.controller.ts +++ b/packages/nocodb-nest/src/modules/hooks/hooks.controller.ts @@ -1,22 +1,23 @@ import { Body, Controller, - Request, Delete, Get, Param, Patch, Post, + Request, UseGuards, } from '@nestjs/common'; -import { HookReqType, HookTestReqType, HookType } from 'nocodb-sdk'; +import { HookReqType, HookTestReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { HooksService } from './hooks.service'; -import { AuthGuard } from '@nestjs/passport'; +import type { HookType } from 'nocodb-sdk'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/hooks/hooks.service.spec.ts b/packages/nocodb-nest/src/modules/hooks/hooks.service.spec.ts index c9d9221fad..a4efb2915e 100644 --- a/packages/nocodb-nest/src/modules/hooks/hooks.service.spec.ts +++ b/packages/nocodb-nest/src/modules/hooks/hooks.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { HooksService } from './hooks.service'; +import type { TestingModule } from '@nestjs/testing'; describe('HooksService', () => { let service: HooksService; diff --git a/packages/nocodb-nest/src/modules/hooks/hooks.service.ts b/packages/nocodb-nest/src/modules/hooks/hooks.service.ts index 057bc94809..0ca308d29a 100644 --- a/packages/nocodb-nest/src/modules/hooks/hooks.service.ts +++ b/packages/nocodb-nest/src/modules/hooks/hooks.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@nestjs/common'; -import { HookReqType, HookTestReqType, HookType } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; import { @@ -8,7 +8,7 @@ import { } from '../../helpers/populateSamplePayload'; import { invokeWebhook } from '../../helpers/webhookHelpers'; import { Hook, HookLog, Model } from '../../models'; -import { T } from 'nc-help'; +import type { HookReqType, HookTestReqType, HookType } from 'nocodb-sdk'; @Injectable() export class HooksService { diff --git a/packages/nocodb-nest/src/modules/import/import.controller.spec.ts b/packages/nocodb-nest/src/modules/import/import.controller.spec.ts index 85db7c3b05..7c7f1d48db 100644 --- a/packages/nocodb-nest/src/modules/import/import.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/import/import.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ImportController } from './import.controller'; import { ImportService } from './import.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ImportController', () => { let controller: ImportController; diff --git a/packages/nocodb-nest/src/modules/import/import.controller.ts b/packages/nocodb-nest/src/modules/import/import.controller.ts index 6369e3f604..24ea69247a 100644 --- a/packages/nocodb-nest/src/modules/import/import.controller.ts +++ b/packages/nocodb-nest/src/modules/import/import.controller.ts @@ -1,14 +1,14 @@ import { Controller, Post, Request } from '@nestjs/common'; -import type { Server } from 'socket.io'; +import { forwardRef, Inject } from '@nestjs/common'; +import { ModuleRef } from '@nestjs/core'; import { NcError } from '../../helpers/catchError'; import { SyncSource } from '../../models'; -import { AirtableSyncConfig } from '../sync/helpers/job'; -import { ImportService } from './import.service'; -import { Router } from 'express'; import NocoJobs from '../../jobs/NocoJobs'; +import { ImportService } from './import.service'; +import type { AirtableSyncConfig } from '../sync/helpers/job'; -import { Inject, forwardRef } from '@nestjs/common'; -import { ModuleRef } from '@nestjs/core'; +import type { Router } from 'express'; +import type { Server } from 'socket.io'; const AIRTABLE_IMPORT_JOB = 'AIRTABLE_IMPORT_JOB'; const AIRTABLE_PROGRESS_JOB = 'AIRTABLE_PROGRESS_JOB'; diff --git a/packages/nocodb-nest/src/modules/import/import.service.spec.ts b/packages/nocodb-nest/src/modules/import/import.service.spec.ts index 96ac7b2e4c..21b2a54c50 100644 --- a/packages/nocodb-nest/src/modules/import/import.service.spec.ts +++ b/packages/nocodb-nest/src/modules/import/import.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ImportService } from './import.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ImportService', () => { let service: ImportService; diff --git a/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.spec.ts b/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.spec.ts index db50315539..1aa9f8a8d0 100644 --- a/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { KanbansController } from './kanbans.controller'; import { KanbansService } from './kanbans.service'; +import type { TestingModule } from '@nestjs/testing'; describe('KanbansController', () => { let controller: KanbansController; diff --git a/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.ts b/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.ts index a4754542e2..96a9921a2d 100644 --- a/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.ts +++ b/packages/nocodb-nest/src/modules/kanbans/kanbans.controller.ts @@ -8,12 +8,12 @@ import { UseGuards, } from '@nestjs/common'; import { ViewCreateReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { KanbansService } from './kanbans.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/kanbans/kanbans.service.spec.ts b/packages/nocodb-nest/src/modules/kanbans/kanbans.service.spec.ts index e6ebc6efd4..735b76628f 100644 --- a/packages/nocodb-nest/src/modules/kanbans/kanbans.service.spec.ts +++ b/packages/nocodb-nest/src/modules/kanbans/kanbans.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { KanbansService } from './kanbans.service'; +import type { TestingModule } from '@nestjs/testing'; describe('KanbansService', () => { let service: KanbansService; diff --git a/packages/nocodb-nest/src/modules/kanbans/kanbans.service.ts b/packages/nocodb-nest/src/modules/kanbans/kanbans.service.ts index c0ccd36a96..eee39898ae 100644 --- a/packages/nocodb-nest/src/modules/kanbans/kanbans.service.ts +++ b/packages/nocodb-nest/src/modules/kanbans/kanbans.service.ts @@ -1,8 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { KanbanUpdateReqType, ViewCreateReqType, ViewTypes } from 'nocodb-sdk'; +import { ViewTypes } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { KanbanView, View } from '../../models'; -import { T } from 'nc-help'; +import type { KanbanUpdateReqType, ViewCreateReqType } from 'nocodb-sdk'; @Injectable() export class KanbansService { diff --git a/packages/nocodb-nest/src/modules/maps/maps.controller.spec.ts b/packages/nocodb-nest/src/modules/maps/maps.controller.spec.ts index 4f262bb9a5..d1464e8a95 100644 --- a/packages/nocodb-nest/src/modules/maps/maps.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/maps/maps.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { MapsController } from './maps.controller'; import { MapsService } from './maps.service'; +import type { TestingModule } from '@nestjs/testing'; describe('MapsController', () => { let controller: MapsController; diff --git a/packages/nocodb-nest/src/modules/maps/maps.controller.ts b/packages/nocodb-nest/src/modules/maps/maps.controller.ts index a3be956667..6bfde0275f 100644 --- a/packages/nocodb-nest/src/modules/maps/maps.controller.ts +++ b/packages/nocodb-nest/src/modules/maps/maps.controller.ts @@ -8,12 +8,12 @@ import { UseGuards, } from '@nestjs/common'; import { MapUpdateReqType, ViewCreateReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { MapsService } from './maps.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/maps/maps.service.spec.ts b/packages/nocodb-nest/src/modules/maps/maps.service.spec.ts index 0974a652c7..6622ce5f58 100644 --- a/packages/nocodb-nest/src/modules/maps/maps.service.spec.ts +++ b/packages/nocodb-nest/src/modules/maps/maps.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { MapsService } from './maps.service'; +import type { TestingModule } from '@nestjs/testing'; describe('MapsService', () => { let service: MapsService; diff --git a/packages/nocodb-nest/src/modules/maps/maps.service.ts b/packages/nocodb-nest/src/modules/maps/maps.service.ts index a7e1f07138..962651cfcc 100644 --- a/packages/nocodb-nest/src/modules/maps/maps.service.ts +++ b/packages/nocodb-nest/src/modules/maps/maps.service.ts @@ -1,8 +1,9 @@ import { Injectable } from '@nestjs/common'; import { T } from 'nc-help'; -import { MapUpdateReqType, ViewCreateReqType, ViewTypes } from 'nocodb-sdk'; +import { ViewTypes } from 'nocodb-sdk'; import { validatePayload } from '../../helpers'; import { MapView, View } from '../../models'; +import type { MapUpdateReqType, ViewCreateReqType } from 'nocodb-sdk'; @Injectable() export class MapsService { diff --git a/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.controller.spec.ts b/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.controller.spec.ts index 56a42a1e8a..3071ad3742 100644 --- a/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { MetaDiffsController } from './meta-diffs.controller'; import { MetaDiffsService } from './meta-diffs.service'; +import type { TestingModule } from '@nestjs/testing'; describe('MetaDiffsController', () => { let controller: MetaDiffsController; diff --git a/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.controller.ts b/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.controller.ts index 25a39e5d42..49f6bd8785 100644 --- a/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.controller.ts +++ b/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.controller.ts @@ -1,10 +1,10 @@ import { Controller, Get, Param, Post, UseGuards } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { MetaDiffsService } from './meta-diffs.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.service.spec.ts b/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.service.spec.ts index dd9c5165ca..b09044613d 100644 --- a/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.service.spec.ts +++ b/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { MetaDiffsService } from './meta-diffs.service'; +import type { TestingModule } from '@nestjs/testing'; describe('MetaDiffsService', () => { let service: MetaDiffsService; diff --git a/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.service.ts b/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.service.ts index de65c4db4f..d3d7d5e85e 100644 --- a/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.service.ts +++ b/packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.service.ts @@ -1,12 +1,7 @@ import { Injectable } from '@nestjs/common'; import { isVirtualCol, ModelTypes, RelationTypes, UITypes } from 'nocodb-sdk'; -import { - Model, - Column, - Project, - LinkToAnotherRecordColumn, - Base, -} from '../../models'; +import { T } from 'nc-help'; +import { Base, Column, Model, Project } from '../../models'; import ModelXcMetaFactory from '../../db/sql-mgr/code/models/xc/ModelXcMetaFactory'; import getColumnUiType from '../../helpers/getColumnUiType'; import getTableNameAlias, { @@ -16,7 +11,7 @@ import { getUniqueColumnAliasName } from '../../helpers/getUniqueName'; import mapDefaultDisplayValue from '../../helpers/mapDefaultDisplayValue'; import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; import NcHelp from '../../utils/NcHelp'; -import { T } from 'nc-help'; +import type { LinkToAnotherRecordColumn } from '../../models'; // todo:move enum and types export enum MetaDiffType { diff --git a/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.controller.spec.ts b/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.controller.spec.ts index 1324a8f96a..23178d354f 100644 --- a/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ModelVisibilitiesController } from './model-visibilities.controller'; import { ModelVisibilitiesService } from './model-visibilities.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ModelVisibilitiesController', () => { let controller: ModelVisibilitiesController; diff --git a/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.controller.ts b/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.controller.ts index 3f65ae8b79..e50ee6ebd8 100644 --- a/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.controller.ts +++ b/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.controller.ts @@ -7,12 +7,12 @@ import { Query, UseGuards, } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { ModelVisibilitiesService } from './model-visibilities.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.service.spec.ts b/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.service.spec.ts index 9ea100d0ac..6e05c057dd 100644 --- a/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.service.spec.ts +++ b/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ModelVisibilitiesService } from './model-visibilities.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ModelVisibilitiesService', () => { let service: ModelVisibilitiesService; diff --git a/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.service.ts b/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.service.ts index 3c0863cdb9..1753514884 100644 --- a/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.service.ts +++ b/packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.service.ts @@ -1,9 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { VisibilityRuleReqType } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; import { Model, ModelRoleVisibility, View } from '../../models'; -import { T } from 'nc-help'; +import type { VisibilityRuleReqType } from 'nocodb-sdk'; @Injectable() export class ModelVisibilitiesService { diff --git a/packages/nocodb-nest/src/modules/org-lcense/org-lcense.controller.spec.ts b/packages/nocodb-nest/src/modules/org-lcense/org-lcense.controller.spec.ts index 1e3b5488ec..6364a1b30c 100644 --- a/packages/nocodb-nest/src/modules/org-lcense/org-lcense.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/org-lcense/org-lcense.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { OrgLcenseController } from './org-lcense.controller'; import { OrgLcenseService } from './org-lcense.service'; +import type { TestingModule } from '@nestjs/testing'; describe('OrgLcenseController', () => { let controller: OrgLcenseController; diff --git a/packages/nocodb-nest/src/modules/org-lcense/org-lcense.service.spec.ts b/packages/nocodb-nest/src/modules/org-lcense/org-lcense.service.spec.ts index f4c1e76b32..a8789be5a4 100644 --- a/packages/nocodb-nest/src/modules/org-lcense/org-lcense.service.spec.ts +++ b/packages/nocodb-nest/src/modules/org-lcense/org-lcense.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { OrgLcenseService } from './org-lcense.service'; +import type { TestingModule } from '@nestjs/testing'; describe('OrgLcenseService', () => { let service: OrgLcenseService; diff --git a/packages/nocodb-nest/src/modules/org-tokens/ee/org-tokens/org-tokens-ee.service.spec.ts b/packages/nocodb-nest/src/modules/org-tokens/ee/org-tokens/org-tokens-ee.service.spec.ts index 1d7cb8c1d1..3cfcfc0956 100644 --- a/packages/nocodb-nest/src/modules/org-tokens/ee/org-tokens/org-tokens-ee.service.spec.ts +++ b/packages/nocodb-nest/src/modules/org-tokens/ee/org-tokens/org-tokens-ee.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { OrgTokensEeService } from './org-tokens.service'; +import type { TestingModule } from '@nestjs/testing'; describe('OrgTokensService', () => { let service: OrgTokensEeService; diff --git a/packages/nocodb-nest/src/modules/org-tokens/ee/org-tokens/org-tokens-ee.service.ts b/packages/nocodb-nest/src/modules/org-tokens/ee/org-tokens/org-tokens-ee.service.ts index 06f4a340c2..fb9a1da1b0 100644 --- a/packages/nocodb-nest/src/modules/org-tokens/ee/org-tokens/org-tokens-ee.service.ts +++ b/packages/nocodb-nest/src/modules/org-tokens/ee/org-tokens/org-tokens-ee.service.ts @@ -1,7 +1,8 @@ import { Injectable } from '@nestjs/common'; -import { OrgUserRoles, UserType } from 'nocodb-sdk'; +import { OrgUserRoles } from 'nocodb-sdk'; import { PagedResponseImpl } from '../../../../helpers/PagedResponse'; import { ApiToken } from '../../../../models'; +import type { UserType } from 'nocodb-sdk'; @Injectable() export class OrgTokensEeService { diff --git a/packages/nocodb-nest/src/modules/org-tokens/org-tokens.controller.spec.ts b/packages/nocodb-nest/src/modules/org-tokens/org-tokens.controller.spec.ts index 264f3d570e..cb3590fb07 100644 --- a/packages/nocodb-nest/src/modules/org-tokens/org-tokens.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/org-tokens/org-tokens.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { OrgTokensController } from './org-tokens.controller'; import { OrgTokensService } from './org-tokens.service'; +import type { TestingModule } from '@nestjs/testing'; describe('OrgTokensController', () => { let controller: OrgTokensController; diff --git a/packages/nocodb-nest/src/modules/org-tokens/org-tokens.controller.ts b/packages/nocodb-nest/src/modules/org-tokens/org-tokens.controller.ts index abc04dd801..06c0570216 100644 --- a/packages/nocodb-nest/src/modules/org-tokens/org-tokens.controller.ts +++ b/packages/nocodb-nest/src/modules/org-tokens/org-tokens.controller.ts @@ -9,6 +9,7 @@ import { UseGuards, } from '@nestjs/common'; import { ApiTokenReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { getConditionalHandler } from '../../helpers/getHandler'; import { Acl, @@ -16,7 +17,6 @@ import { } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { OrgTokensEeService } from './ee/org-tokens/org-tokens-ee.service'; import { OrgTokensService } from './org-tokens.service'; -import { AuthGuard } from '@nestjs/passport'; @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) @Controller() diff --git a/packages/nocodb-nest/src/modules/org-tokens/org-tokens.service.spec.ts b/packages/nocodb-nest/src/modules/org-tokens/org-tokens.service.spec.ts index 10fbf006be..ca1f229d4d 100644 --- a/packages/nocodb-nest/src/modules/org-tokens/org-tokens.service.spec.ts +++ b/packages/nocodb-nest/src/modules/org-tokens/org-tokens.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { OrgTokensService } from './org-tokens.service'; +import type { TestingModule } from '@nestjs/testing'; describe('OrgTokensService', () => { let service: OrgTokensService; diff --git a/packages/nocodb-nest/src/modules/org-tokens/org-tokens.service.ts b/packages/nocodb-nest/src/modules/org-tokens/org-tokens.service.ts index 31bc2cb377..1bb2f79fc0 100644 --- a/packages/nocodb-nest/src/modules/org-tokens/org-tokens.service.ts +++ b/packages/nocodb-nest/src/modules/org-tokens/org-tokens.service.ts @@ -1,10 +1,12 @@ import { Injectable } from '@nestjs/common'; -import { ApiTokenReqType, OrgUserRoles } from 'nocodb-sdk'; +import { OrgUserRoles } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; -import { ApiToken, User } from '../../models'; -import { T } from 'nc-help'; +import { ApiToken } from '../../models'; +import type { User } from '../../models'; +import type { ApiTokenReqType } from 'nocodb-sdk'; @Injectable() export class OrgTokensService { diff --git a/packages/nocodb-nest/src/modules/org-users/org-users.controller.spec.ts b/packages/nocodb-nest/src/modules/org-users/org-users.controller.spec.ts index 94f5d4e53f..73fbda7633 100644 --- a/packages/nocodb-nest/src/modules/org-users/org-users.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/org-users/org-users.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { OrgUsersController } from './org-users.controller'; import { OrgUsersService } from './org-users.service'; +import type { TestingModule } from '@nestjs/testing'; describe('OrgUsersController', () => { let controller: OrgUsersController; diff --git a/packages/nocodb-nest/src/modules/org-users/org-users.service.spec.ts b/packages/nocodb-nest/src/modules/org-users/org-users.service.spec.ts index 35f53132b1..5c84962393 100644 --- a/packages/nocodb-nest/src/modules/org-users/org-users.service.spec.ts +++ b/packages/nocodb-nest/src/modules/org-users/org-users.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { OrgUsersService } from './org-users.service'; +import type { TestingModule } from '@nestjs/testing'; describe('OrgUsersService', () => { let service: OrgUsersService; diff --git a/packages/nocodb-nest/src/modules/org-users/org-users.service.ts b/packages/nocodb-nest/src/modules/org-users/org-users.service.ts index dd07f5f17a..9fd49c7d79 100644 --- a/packages/nocodb-nest/src/modules/org-users/org-users.service.ts +++ b/packages/nocodb-nest/src/modules/org-users/org-users.service.ts @@ -4,21 +4,21 @@ import { AuditOperationTypes, OrgUserRoles, PluginCategory, - UserType, } from 'nocodb-sdk'; +import validator from 'validator'; +import { v4 as uuidv4 } from 'uuid'; +import { T } from 'nc-help'; import { NC_APP_SETTINGS } from '../../constants'; import { validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; import { extractProps } from '../../helpers/extractProps'; import { randomTokenString } from '../../helpers/stringHelpers'; import { Audit, ProjectUser, Store, SyncSource, User } from '../../models'; -import validator from 'validator'; -import { v4 as uuidv4 } from 'uuid'; import Noco from '../../Noco'; import { MetaTable } from '../../utils/globals'; -import { T } from 'nc-help'; import { ProjectUsersService } from '../project-users/project-users.service'; +import type { UserType } from 'nocodb-sdk'; @Injectable() export class OrgUsersService { diff --git a/packages/nocodb-nest/src/modules/plugins/plugins.controller.spec.ts b/packages/nocodb-nest/src/modules/plugins/plugins.controller.spec.ts index 139f2bdf39..b9c5a62b46 100644 --- a/packages/nocodb-nest/src/modules/plugins/plugins.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/plugins/plugins.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PluginsController } from './plugins.controller'; import { PluginsService } from './plugins.service'; +import type { TestingModule } from '@nestjs/testing'; describe('PluginsController', () => { let controller: PluginsController; diff --git a/packages/nocodb-nest/src/modules/plugins/plugins.service.spec.ts b/packages/nocodb-nest/src/modules/plugins/plugins.service.spec.ts index a6ffe5c5c1..4edfcf44b0 100644 --- a/packages/nocodb-nest/src/modules/plugins/plugins.service.spec.ts +++ b/packages/nocodb-nest/src/modules/plugins/plugins.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PluginsService } from './plugins.service'; +import type { TestingModule } from '@nestjs/testing'; describe('PluginsService', () => { let service: PluginsService; diff --git a/packages/nocodb-nest/src/modules/plugins/plugins.service.ts b/packages/nocodb-nest/src/modules/plugins/plugins.service.ts index 98d6bc4937..5d49ab8347 100644 --- a/packages/nocodb-nest/src/modules/plugins/plugins.service.ts +++ b/packages/nocodb-nest/src/modules/plugins/plugins.service.ts @@ -1,9 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { PluginTestReqType, PluginType } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; import { Plugin } from '../../models'; -import { T } from 'nc-help'; +import type { PluginTestReqType, PluginType } from 'nocodb-sdk'; @Injectable() export class PluginsService { diff --git a/packages/nocodb-nest/src/modules/project-users/project-users.controller.spec.ts b/packages/nocodb-nest/src/modules/project-users/project-users.controller.spec.ts index 30933a4829..b7f3bc7003 100644 --- a/packages/nocodb-nest/src/modules/project-users/project-users.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/project-users/project-users.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ProjectUsersController } from './project-users.controller'; import { ProjectUsersService } from './project-users.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ProjectUsersController', () => { let controller: ProjectUsersController; diff --git a/packages/nocodb-nest/src/modules/project-users/project-users.controller.ts b/packages/nocodb-nest/src/modules/project-users/project-users.controller.ts index df71ec566c..db125388b2 100644 --- a/packages/nocodb-nest/src/modules/project-users/project-users.controller.ts +++ b/packages/nocodb-nest/src/modules/project-users/project-users.controller.ts @@ -1,21 +1,21 @@ import { + Body, Controller, + Delete, Get, Param, + Patch, Post, - UseGuards, Request, - Body, - Patch, - Delete, + UseGuards, } from '@nestjs/common'; import { ProjectUserReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { ProjectUsersService } from './project-users.service'; -import { AuthGuard } from '@nestjs/passport'; @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) @Controller() diff --git a/packages/nocodb-nest/src/modules/project-users/project-users.service.spec.ts b/packages/nocodb-nest/src/modules/project-users/project-users.service.spec.ts index ca69aaa21c..6c18767371 100644 --- a/packages/nocodb-nest/src/modules/project-users/project-users.service.spec.ts +++ b/packages/nocodb-nest/src/modules/project-users/project-users.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ProjectUsersService } from './project-users.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ProjectUsersService', () => { let service: ProjectUsersService; diff --git a/packages/nocodb-nest/src/modules/project-users/project-users.service.ts b/packages/nocodb-nest/src/modules/project-users/project-users.service.ts index 72f835f3ce..5054d4d754 100644 --- a/packages/nocodb-nest/src/modules/project-users/project-users.service.ts +++ b/packages/nocodb-nest/src/modules/project-users/project-users.service.ts @@ -1,5 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { OrgUserRoles, PluginCategory, ProjectUserReqType } from 'nocodb-sdk'; +import { OrgUserRoles, PluginCategory } from 'nocodb-sdk'; +import { T } from 'nc-help'; +import { v4 as uuidv4 } from 'uuid'; +import * as ejs from 'ejs'; +import validator from 'validator'; import NocoCache from '../../cache/NocoCache'; import { validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; @@ -7,13 +11,10 @@ import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { randomTokenString } from '../../helpers/stringHelpers'; import { Audit, ProjectUser, User } from '../../models'; -import { T } from 'nc-help'; -import { v4 as uuidv4 } from 'uuid'; -import * as ejs from 'ejs'; -import validator from 'validator'; import Noco from '../../Noco'; import { CacheGetType, CacheScope, MetaTable } from '../../utils/globals'; +import type { ProjectUserReqType } from 'nocodb-sdk'; @Injectable() export class ProjectUsersService { diff --git a/packages/nocodb-nest/src/modules/projects/projects.controller.spec.ts b/packages/nocodb-nest/src/modules/projects/projects.controller.spec.ts index fc37f961f3..3e34344a95 100644 --- a/packages/nocodb-nest/src/modules/projects/projects.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/projects/projects.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ProjectsController } from './projects.controller'; import { ProjectsService } from './projects.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ProjectsController', () => { let controller: ProjectsController; diff --git a/packages/nocodb-nest/src/modules/projects/projects.controller.ts b/packages/nocodb-nest/src/modules/projects/projects.controller.ts index 4a5616feea..788f1d82b9 100644 --- a/packages/nocodb-nest/src/modules/projects/projects.controller.ts +++ b/packages/nocodb-nest/src/modules/projects/projects.controller.ts @@ -14,7 +14,6 @@ import { AuthGuard } from '@nestjs/passport'; import isDocker from 'is-docker'; import { ProjectReqType } from 'nocodb-sdk'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; -import { ProjectType } from 'nocodb-sdk'; import { ExtractProjectIdMiddleware, UseAclMiddleware, @@ -23,6 +22,7 @@ import { import Noco from '../../Noco'; import { packageVersion } from '../../utils/packageVersion'; import { ProjectsService } from './projects.service'; +import type { ProjectType } from 'nocodb-sdk'; @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) @Controller() diff --git a/packages/nocodb-nest/src/modules/projects/projects.service.spec.ts b/packages/nocodb-nest/src/modules/projects/projects.service.spec.ts index d3b3101890..3f99f78453 100644 --- a/packages/nocodb-nest/src/modules/projects/projects.service.spec.ts +++ b/packages/nocodb-nest/src/modules/projects/projects.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ProjectsService } from './projects.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ProjectsService', () => { let service: ProjectsService; diff --git a/packages/nocodb-nest/src/modules/projects/projects.service.ts b/packages/nocodb-nest/src/modules/projects/projects.service.ts index 152c707fa6..ab8ff3e0e1 100644 --- a/packages/nocodb-nest/src/modules/projects/projects.service.ts +++ b/packages/nocodb-nest/src/modules/projects/projects.service.ts @@ -1,19 +1,20 @@ +import { promisify } from 'util'; import { Injectable } from '@nestjs/common'; import * as DOMPurify from 'isomorphic-dompurify'; import { customAlphabet } from 'nanoid'; -import { ProjectReqType } from 'nocodb-sdk'; -import { promisify } from 'util'; -import { OrgUserRoles, ProjectUpdateReqType } from '../../../../nocodb-sdk'; +import { T } from 'nc-help'; +import { OrgUserRoles } from '../../../../nocodb-sdk'; import { projectList } from '../../../../nocodb/src/lib/services/project.svc'; import { populateMeta, validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; import { extractPropsAndSanitize } from '../../helpers/extractProps'; import syncMigration from '../../helpers/syncMigration'; import { Project, ProjectUser } from '../../models'; -import { T } from 'nc-help'; import Noco from '../../Noco'; import extractRolesObj from '../../utils/extractRolesObj'; import NcConfigFactory from '../../utils/NcConfigFactory'; +import type { ProjectUpdateReqType } from '../../../../nocodb-sdk'; +import type { ProjectReqType } from 'nocodb-sdk'; const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 4); diff --git a/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.controller.spec.ts b/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.controller.spec.ts index 8fd9f68971..14afb5bf12 100644 --- a/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PublicDatasExportController } from './public-datas-export.controller'; import { PublicDatasExportService } from './public-datas-export.service'; +import type { TestingModule } from '@nestjs/testing'; describe('PublicDatasExportController', () => { let controller: PublicDatasExportController; diff --git a/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.controller.ts b/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.controller.ts index fba631708b..cc64d102a4 100644 --- a/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.controller.ts +++ b/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.controller.ts @@ -1,21 +1,15 @@ -import { Controller, Get, Request, Param, Response } from '@nestjs/common'; +import { Controller, Get, Param, Request, Response } from '@nestjs/common'; import { ErrorMessages, isSystemColumn, UITypes, ViewTypes } from 'nocodb-sdk'; -import { NcError } from '../../helpers/catchError'; -import getAst from '../../helpers/getAst'; -import { - Base, - Column, - LinkToAnotherRecordColumn, - LookupColumn, - Model, - View, -} from '../../models'; -import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; -import { PublicDatasExportService } from './public-datas-export.service'; import * as XLSX from 'xlsx'; import { nocoExecute } from 'nc-help'; import papaparse from 'papaparse'; +import { NcError } from '../../helpers/catchError'; +import getAst from '../../helpers/getAst'; +import { Base, Column, Model, View } from '../../models'; +import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; import { serializeCellValue } from '../datas/helpers'; +import { PublicDatasExportService } from './public-datas-export.service'; +import type { LinkToAnotherRecordColumn, LookupColumn } from '../../models'; @Controller() export class PublicDatasExportController { diff --git a/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.service.spec.ts b/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.service.spec.ts index 3e82b58297..89bc8cee88 100644 --- a/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.service.spec.ts +++ b/packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PublicDatasExportService } from './public-datas-export.service'; +import type { TestingModule } from '@nestjs/testing'; describe('PublicDatasExportService', () => { let service: PublicDatasExportService; diff --git a/packages/nocodb-nest/src/modules/public-datas/public-datas.controller.spec.ts b/packages/nocodb-nest/src/modules/public-datas/public-datas.controller.spec.ts index 6bd3ab6dfb..052926a7c3 100644 --- a/packages/nocodb-nest/src/modules/public-datas/public-datas.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/public-datas/public-datas.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PublicDatasController } from './public-datas.controller'; import { PublicDatasService } from './public-datas.service'; +import type { TestingModule } from '@nestjs/testing'; describe('PublicDatasController', () => { let controller: PublicDatasController; diff --git a/packages/nocodb-nest/src/modules/public-datas/public-datas.service.spec.ts b/packages/nocodb-nest/src/modules/public-datas/public-datas.service.spec.ts index 645d7275f6..9f747f0363 100644 --- a/packages/nocodb-nest/src/modules/public-datas/public-datas.service.spec.ts +++ b/packages/nocodb-nest/src/modules/public-datas/public-datas.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PublicDatasService } from './public-datas.service'; +import type { TestingModule } from '@nestjs/testing'; describe('PublicDatasService', () => { let service: PublicDatasService; diff --git a/packages/nocodb-nest/src/modules/public-datas/public-datas.service.ts b/packages/nocodb-nest/src/modules/public-datas/public-datas.service.ts index c155e1e571..973ee3e32a 100644 --- a/packages/nocodb-nest/src/modules/public-datas/public-datas.service.ts +++ b/packages/nocodb-nest/src/modules/public-datas/public-datas.service.ts @@ -1,24 +1,19 @@ +import path from 'path'; import { Injectable } from '@nestjs/common'; import { nanoid } from 'nanoid'; import { ErrorMessages, UITypes, ViewTypes } from 'nocodb-sdk'; -import path from 'path'; import slash from 'slash'; -import { - Base, - Column, - LinkToAnotherRecordColumn, - Model, - View, -} from '../../models'; +import { nocoExecute } from 'nc-help'; +import { Base, Column, Model, View } from '../../models'; import { NcError } from '../../helpers/catchError'; import getAst from '../../helpers/getAst'; import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; -import { nocoExecute } from 'nc-help'; import { mimeIcons } from '../../utils/mimeTypes'; import { getColumnByIdOrName } from '../datas/helpers'; +import type { LinkToAnotherRecordColumn } from '../../models'; // todo: move to utils export function sanitizeUrlPath(paths) { diff --git a/packages/nocodb-nest/src/modules/public-metas/public-metas.controller.spec.ts b/packages/nocodb-nest/src/modules/public-metas/public-metas.controller.spec.ts index f182488233..4da851a1ec 100644 --- a/packages/nocodb-nest/src/modules/public-metas/public-metas.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/public-metas/public-metas.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PublicMetasController } from './public-metas.controller'; import { PublicMetasService } from './public-metas.service'; +import type { TestingModule } from '@nestjs/testing'; describe('PublicMetasController', () => { let controller: PublicMetasController; diff --git a/packages/nocodb-nest/src/modules/public-metas/public-metas.controller.ts b/packages/nocodb-nest/src/modules/public-metas/public-metas.controller.ts index b09e7bcc8b..9ba19f40bd 100644 --- a/packages/nocodb-nest/src/modules/public-metas/public-metas.controller.ts +++ b/packages/nocodb-nest/src/modules/public-metas/public-metas.controller.ts @@ -1,4 +1,4 @@ -import { Controller, Get, Request, Param } from '@nestjs/common'; +import { Controller, Get, Param, Request } from '@nestjs/common'; import { PublicMetasService } from './public-metas.service'; @Controller() diff --git a/packages/nocodb-nest/src/modules/public-metas/public-metas.service.spec.ts b/packages/nocodb-nest/src/modules/public-metas/public-metas.service.spec.ts index 4b7f9dc37b..977f4b4a41 100644 --- a/packages/nocodb-nest/src/modules/public-metas/public-metas.service.spec.ts +++ b/packages/nocodb-nest/src/modules/public-metas/public-metas.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { PublicMetasService } from './public-metas.service'; +import type { TestingModule } from '@nestjs/testing'; describe('PublicMetasService', () => { let service: PublicMetasService; diff --git a/packages/nocodb-nest/src/modules/public-metas/public-metas.service.ts b/packages/nocodb-nest/src/modules/public-metas/public-metas.service.ts index dd32aff976..b9ca5088e7 100644 --- a/packages/nocodb-nest/src/modules/public-metas/public-metas.service.ts +++ b/packages/nocodb-nest/src/modules/public-metas/public-metas.service.ts @@ -1,19 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { - ErrorMessages, - LinkToAnotherRecordType, - RelationTypes, - UITypes, -} from 'nocodb-sdk'; +import { ErrorMessages, RelationTypes, UITypes } from 'nocodb-sdk'; import { NcError } from '../../helpers/catchError'; -import { - Base, - Column, - LinkToAnotherRecordColumn, - Model, - Project, - View, -} from '../../models'; +import { Base, Column, Model, Project, View } from '../../models'; +import type { LinkToAnotherRecordColumn } from '../../models'; +import type { LinkToAnotherRecordType } from 'nocodb-sdk'; @Injectable() export class PublicMetasService { diff --git a/packages/nocodb-nest/src/modules/shared-bases/shared-bases.controller.spec.ts b/packages/nocodb-nest/src/modules/shared-bases/shared-bases.controller.spec.ts index 8d0fdf7528..06b42801c6 100644 --- a/packages/nocodb-nest/src/modules/shared-bases/shared-bases.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/shared-bases/shared-bases.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { SharedBasesController } from './shared-bases.controller'; import { SharedBasesService } from './shared-bases.service'; +import type { TestingModule } from '@nestjs/testing'; describe('SharedBasesController', () => { let controller: SharedBasesController; diff --git a/packages/nocodb-nest/src/modules/shared-bases/shared-bases.controller.ts b/packages/nocodb-nest/src/modules/shared-bases/shared-bases.controller.ts index f0b753005f..41417894d7 100644 --- a/packages/nocodb-nest/src/modules/shared-bases/shared-bases.controller.ts +++ b/packages/nocodb-nest/src/modules/shared-bases/shared-bases.controller.ts @@ -1,20 +1,20 @@ import { + Body, Controller, Delete, Get, + Param, Patch, Post, - UseGuards, Request, - Body, - Param, + UseGuards, } from '@nestjs/common'; +import { AuthGuard } from '@nestjs/passport'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { SharedBasesService } from './shared-bases.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/shared-bases/shared-bases.service.spec.ts b/packages/nocodb-nest/src/modules/shared-bases/shared-bases.service.spec.ts index 30a5ecc6cf..d028211ad4 100644 --- a/packages/nocodb-nest/src/modules/shared-bases/shared-bases.service.spec.ts +++ b/packages/nocodb-nest/src/modules/shared-bases/shared-bases.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { SharedBasesService } from './shared-bases.service'; +import type { TestingModule } from '@nestjs/testing'; describe('SharedBasesService', () => { let service: SharedBasesService; diff --git a/packages/nocodb-nest/src/modules/shared-bases/shared-bases.service.ts b/packages/nocodb-nest/src/modules/shared-bases/shared-bases.service.ts index a5736de11e..21c5a10245 100644 --- a/packages/nocodb-nest/src/modules/shared-bases/shared-bases.service.ts +++ b/packages/nocodb-nest/src/modules/shared-bases/shared-bases.service.ts @@ -1,11 +1,10 @@ import { Injectable } from '@nestjs/common'; import { T } from 'nc-help'; +import { v4 as uuidv4 } from 'uuid'; import { validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; import { Project } from '../../models'; -import { v4 as uuidv4 } from 'uuid'; - // todo: load from config const config = { dashboardPath: '/nc', diff --git a/packages/nocodb-nest/src/modules/sorts/sorts.controller.spec.ts b/packages/nocodb-nest/src/modules/sorts/sorts.controller.spec.ts index 3255c7fba6..ab4d4771e0 100644 --- a/packages/nocodb-nest/src/modules/sorts/sorts.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/sorts/sorts.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { SortsController } from './sorts.controller'; import { SortsService } from './sorts.service'; +import type { TestingModule } from '@nestjs/testing'; describe('SortsController', () => { let controller: SortsController; diff --git a/packages/nocodb-nest/src/modules/sorts/sorts.service.spec.ts b/packages/nocodb-nest/src/modules/sorts/sorts.service.spec.ts index 711c36f406..b2e3a64fd8 100644 --- a/packages/nocodb-nest/src/modules/sorts/sorts.service.spec.ts +++ b/packages/nocodb-nest/src/modules/sorts/sorts.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { SortsService } from './sorts.service'; +import type { TestingModule } from '@nestjs/testing'; describe('SortsService', () => { let service: SortsService; diff --git a/packages/nocodb-nest/src/modules/sorts/sorts.service.ts b/packages/nocodb-nest/src/modules/sorts/sorts.service.ts index 62a0c67948..e738dff95f 100644 --- a/packages/nocodb-nest/src/modules/sorts/sorts.service.ts +++ b/packages/nocodb-nest/src/modules/sorts/sorts.service.ts @@ -1,8 +1,8 @@ import { Injectable } from '@nestjs/common'; -import { SortReqType } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { Sort } from '../../models'; -import { T } from 'nc-help'; +import type { SortReqType } from 'nocodb-sdk'; @Injectable() export class SortsService { diff --git a/packages/nocodb-nest/src/modules/sync/helpers/fetchAT.ts b/packages/nocodb-nest/src/modules/sync/helpers/fetchAT.ts index 4c2aea6475..1a9a8151bb 100644 --- a/packages/nocodb-nest/src/modules/sync/helpers/fetchAT.ts +++ b/packages/nocodb-nest/src/modules/sync/helpers/fetchAT.ts @@ -27,7 +27,6 @@ async function initialize(shareId) { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36', }, - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore referrerPolicy: 'strict-origin-when-cross-origin', body: null, @@ -102,7 +101,6 @@ async function read() { cookie: info.cookie, ...info.headers, }, - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore referrerPolicy: 'no-referrer', body: null, @@ -163,7 +161,6 @@ async function readView(viewId) { cookie: info.cookie, ...info.headers, }, - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore referrerPolicy: 'no-referrer', body: null, @@ -210,7 +207,6 @@ async function readTemplate(templateId) { cookie: info.cookie, ...info.headers, }, - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore referrer: 'https://www.airtable.com/', referrerPolicy: 'same-origin', diff --git a/packages/nocodb-nest/src/modules/sync/helpers/job.ts b/packages/nocodb-nest/src/modules/sync/helpers/job.ts index df52b0b15b..d06c0272c8 100644 --- a/packages/nocodb-nest/src/modules/sync/helpers/job.ts +++ b/packages/nocodb-nest/src/modules/sync/helpers/job.ts @@ -1,4 +1,3 @@ -import { ModuleRef } from '@nestjs/core'; import { promisify } from 'util'; import { UITypes } from 'nocodb-sdk'; import Airtable from 'airtable'; @@ -38,11 +37,12 @@ import { ViewsService } from '../../views/views.service'; // // eslint-disable-next-line @typescript-eslint/ban-ts-comment // // @ts-ignore // } from '../..'; +import { FormsService } from '../../../modules/forms/forms.service'; import FetchAT from './fetchAT'; import { importData, importLTARData } from './readAndProcessData'; import EntityMap from './EntityMap'; +import type { ModuleRef } from '@nestjs/core'; import type { UserType } from 'nocodb-sdk'; -import { FormsService } from '../../../modules/forms/forms.service'; const writeJsonFileAsync = promisify(jsonfile.writeFile); diff --git a/packages/nocodb-nest/src/modules/sync/sync.controller.spec.ts b/packages/nocodb-nest/src/modules/sync/sync.controller.spec.ts index de758dd9a7..21b88416fd 100644 --- a/packages/nocodb-nest/src/modules/sync/sync.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/sync/sync.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { SyncController } from './sync.controller'; import { SyncService } from './sync.service'; +import type { TestingModule } from '@nestjs/testing'; describe('SyncController', () => { let controller: SyncController; diff --git a/packages/nocodb-nest/src/modules/sync/sync.service.spec.ts b/packages/nocodb-nest/src/modules/sync/sync.service.spec.ts index fd1d96394a..18f34d80ad 100644 --- a/packages/nocodb-nest/src/modules/sync/sync.service.spec.ts +++ b/packages/nocodb-nest/src/modules/sync/sync.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { SyncService } from './sync.service'; +import type { TestingModule } from '@nestjs/testing'; describe('SyncService', () => { let service: SyncService; diff --git a/packages/nocodb-nest/src/modules/sync/sync.service.ts b/packages/nocodb-nest/src/modules/sync/sync.service.ts index c573a34b33..b591803625 100644 --- a/packages/nocodb-nest/src/modules/sync/sync.service.ts +++ b/packages/nocodb-nest/src/modules/sync/sync.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; +import { T } from 'nc-help'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { Project, SyncSource } from '../../models'; -import { T } from 'nc-help'; @Injectable() export class SyncService { diff --git a/packages/nocodb-nest/src/modules/tables/tables.controller.spec.ts b/packages/nocodb-nest/src/modules/tables/tables.controller.spec.ts index 71a90573c2..39b0fbb6c3 100644 --- a/packages/nocodb-nest/src/modules/tables/tables.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/tables/tables.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { TablesController } from './tables.controller'; import { TablesService } from './tables.service'; +import type { TestingModule } from '@nestjs/testing'; describe('TablesController', () => { let controller: TablesController; diff --git a/packages/nocodb-nest/src/modules/tables/tables.controller.ts b/packages/nocodb-nest/src/modules/tables/tables.controller.ts index 6279aaf0d8..37a5a38ae7 100644 --- a/packages/nocodb-nest/src/modules/tables/tables.controller.ts +++ b/packages/nocodb-nest/src/modules/tables/tables.controller.ts @@ -1,14 +1,14 @@ import { + Body, Controller, + Delete, Get, Param, + Patch, + Post, Query, - UseGuards, Request, - Post, - Body, - Patch, - Delete, + UseGuards, } from '@nestjs/common'; import { AuthGuard } from '@nestjs/passport'; import { TableReqType } from 'nocodb-sdk'; diff --git a/packages/nocodb-nest/src/modules/tables/tables.service.spec.ts b/packages/nocodb-nest/src/modules/tables/tables.service.spec.ts index e6bc6eb987..9e8d0b87cc 100644 --- a/packages/nocodb-nest/src/modules/tables/tables.service.spec.ts +++ b/packages/nocodb-nest/src/modules/tables/tables.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { TablesService } from './tables.service'; +import type { TestingModule } from '@nestjs/testing'; describe('TablesService', () => { let service: TablesService; diff --git a/packages/nocodb-nest/src/modules/tables/tables.service.ts b/packages/nocodb-nest/src/modules/tables/tables.service.ts index 1c4650a8bd..c3c85fdd5f 100644 --- a/packages/nocodb-nest/src/modules/tables/tables.service.ts +++ b/packages/nocodb-nest/src/modules/tables/tables.service.ts @@ -3,13 +3,11 @@ import DOMPurify from 'isomorphic-dompurify'; import { AuditOperationSubTypes, AuditOperationTypes, - ColumnType, isVirtualCol, ModelTypes, - NormalColumnRequestType, - TableReqType, UITypes, } from 'nocodb-sdk'; +import { T } from 'nc-help'; import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; import { NcError } from '../../helpers/catchError'; import getColumnPropsFromUIDT from '../../helpers/getColumnPropsFromUIDT'; @@ -21,16 +19,18 @@ import mapDefaultDisplayValue from '../../helpers/mapDefaultDisplayValue'; import { Audit, Column, - LinkToAnotherRecordColumn, Model, ModelRoleVisibility, Project, - User, - View, } from '../../models'; import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; -import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; +import type { LinkToAnotherRecordColumn, User, View } from '../../models'; +import type { + ColumnType, + NormalColumnRequestType, + TableReqType, +} from 'nocodb-sdk'; @Injectable() export class TablesService { diff --git a/packages/nocodb-nest/src/modules/test/test.controller.spec.ts b/packages/nocodb-nest/src/modules/test/test.controller.spec.ts index c3bc16d6b7..36ed3ecc7a 100644 --- a/packages/nocodb-nest/src/modules/test/test.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/test/test.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { TestController } from './test.controller'; import { TestService } from './test.service'; +import type { TestingModule } from '@nestjs/testing'; describe('TestController', () => { let controller: TestController; diff --git a/packages/nocodb-nest/src/modules/test/test.service.spec.ts b/packages/nocodb-nest/src/modules/test/test.service.spec.ts index 1aacbe5d55..e389db9efe 100644 --- a/packages/nocodb-nest/src/modules/test/test.service.spec.ts +++ b/packages/nocodb-nest/src/modules/test/test.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { TestService } from './test.service'; +import type { TestingModule } from '@nestjs/testing'; describe('TestService', () => { let service: TestService; diff --git a/packages/nocodb-nest/src/modules/users/users.controller.spec.ts b/packages/nocodb-nest/src/modules/users/users.controller.spec.ts index a76d310344..a61fbe1849 100644 --- a/packages/nocodb-nest/src/modules/users/users.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/users/users.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { UsersController } from './users.controller'; import { UsersService } from './users.service'; +import type { TestingModule } from '@nestjs/testing'; describe('UsersController', () => { let controller: UsersController; diff --git a/packages/nocodb-nest/src/modules/users/users.controller.ts b/packages/nocodb-nest/src/modules/users/users.controller.ts index 19bdbbe37e..6306776b43 100644 --- a/packages/nocodb-nest/src/modules/users/users.controller.ts +++ b/packages/nocodb-nest/src/modules/users/users.controller.ts @@ -1,3 +1,4 @@ +import { promisify } from 'util'; import { Body, Controller, @@ -8,7 +9,8 @@ import { Response, UseGuards, } from '@nestjs/common'; -import { promisify } from 'util'; +import * as ejs from 'ejs'; +import { AuthGuard } from '@nestjs/passport'; import { NcError } from '../../helpers/catchError'; import { Acl, @@ -16,12 +18,10 @@ import { } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import Noco from '../../Noco'; import extractRolesObj from '../../utils/extractRolesObj'; +import { Audit, User } from '../../models'; import { genJwt, randomTokenString, setTokenCookie } from './helpers'; import { UsersService } from './users.service'; -import * as ejs from 'ejs'; -import { Audit, User } from '../../models'; -import { AuthGuard } from '@nestjs/passport'; @Controller() export class UsersController { constructor(private readonly usersService: UsersService) {} diff --git a/packages/nocodb-nest/src/modules/users/users.service.spec.ts b/packages/nocodb-nest/src/modules/users/users.service.spec.ts index 62815ba641..0eb813f503 100644 --- a/packages/nocodb-nest/src/modules/users/users.service.spec.ts +++ b/packages/nocodb-nest/src/modules/users/users.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { UsersService } from './users.service'; +import type { TestingModule } from '@nestjs/testing'; describe('UsersService', () => { let service: UsersService; diff --git a/packages/nocodb-nest/src/modules/users/users.service.ts b/packages/nocodb-nest/src/modules/users/users.service.ts index 105fe42a5e..496bebb534 100644 --- a/packages/nocodb-nest/src/modules/users/users.service.ts +++ b/packages/nocodb-nest/src/modules/users/users.service.ts @@ -1,15 +1,12 @@ +import { promisify } from 'util'; import { Injectable } from '@nestjs/common'; import { JwtService } from '@nestjs/jwt'; -import { - OrgUserRoles, - PasswordChangeReqType, - PasswordForgotReqType, - PasswordResetReqType, - SignUpReqType, - UserType, - validatePassword, -} from 'nocodb-sdk'; -import { promisify } from 'util'; +import { OrgUserRoles, validatePassword } from 'nocodb-sdk'; +import { v4 as uuidv4 } from 'uuid'; +import { isEmail } from 'validator'; +import { T } from 'nc-help'; +import * as ejs from 'ejs'; +import bcrypt from 'bcryptjs'; import { NC_APP_SETTINGS } from '../../constants'; import { validatePayload } from '../../helpers'; import { NcError } from '../../helpers/catchError'; @@ -17,13 +14,15 @@ import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; import { randomTokenString } from '../../helpers/stringHelpers'; import { MetaService, MetaTable } from '../../meta/meta.service'; import { Audit, Store, User } from '../../models'; -import { v4 as uuidv4 } from 'uuid'; -import { isEmail } from 'validator'; -import { T } from 'nc-help'; -import * as ejs from 'ejs'; -import bcrypt from 'bcryptjs'; import Noco from '../../Noco'; import { genJwt, setTokenCookie } from './helpers'; +import type { + PasswordChangeReqType, + PasswordForgotReqType, + PasswordResetReqType, + SignUpReqType, + UserType, +} from 'nocodb-sdk'; @Injectable() export class UsersService { diff --git a/packages/nocodb-nest/src/modules/utils/utils.controller.spec.ts b/packages/nocodb-nest/src/modules/utils/utils.controller.spec.ts index 66d7042929..979c5407a0 100644 --- a/packages/nocodb-nest/src/modules/utils/utils.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/utils/utils.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { UtilsController } from './utils.controller'; import { UtilsService } from './utils.service'; +import type { TestingModule } from '@nestjs/testing'; describe('UtilsController', () => { let controller: UtilsController; diff --git a/packages/nocodb-nest/src/modules/utils/utils.service.spec.ts b/packages/nocodb-nest/src/modules/utils/utils.service.spec.ts index 9d1b05a263..d7494255cc 100644 --- a/packages/nocodb-nest/src/modules/utils/utils.service.spec.ts +++ b/packages/nocodb-nest/src/modules/utils/utils.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { UtilsService } from './utils.service'; +import type { TestingModule } from '@nestjs/testing'; describe('UtilsService', () => { let service: UtilsService; diff --git a/packages/nocodb-nest/src/modules/view-columns/view-columns.controller.spec.ts b/packages/nocodb-nest/src/modules/view-columns/view-columns.controller.spec.ts index 71182e27f1..02c22ed586 100644 --- a/packages/nocodb-nest/src/modules/view-columns/view-columns.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/view-columns/view-columns.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ViewColumnsController } from './view-columns.controller'; import { ViewColumnsService } from './view-columns.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ViewColumnsController', () => { let controller: ViewColumnsController; diff --git a/packages/nocodb-nest/src/modules/view-columns/view-columns.controller.ts b/packages/nocodb-nest/src/modules/view-columns/view-columns.controller.ts index 3c86314e7c..9bddc18937 100644 --- a/packages/nocodb-nest/src/modules/view-columns/view-columns.controller.ts +++ b/packages/nocodb-nest/src/modules/view-columns/view-columns.controller.ts @@ -8,13 +8,13 @@ import { UseGuards, } from '@nestjs/common'; import { ColumnReqType, ViewColumnReqType } from 'nocodb-sdk'; +import { AuthGuard } from '@nestjs/passport'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { Acl, ExtractProjectIdMiddleware, } from '../../middlewares/extract-project-id/extract-project-id.middleware'; import { ViewColumnsService } from './view-columns.service'; -import { AuthGuard } from '@nestjs/passport'; @Controller() @UseGuards(ExtractProjectIdMiddleware, AuthGuard('jwt')) diff --git a/packages/nocodb-nest/src/modules/view-columns/view-columns.service.spec.ts b/packages/nocodb-nest/src/modules/view-columns/view-columns.service.spec.ts index 7d7aaecebe..9ee497df28 100644 --- a/packages/nocodb-nest/src/modules/view-columns/view-columns.service.spec.ts +++ b/packages/nocodb-nest/src/modules/view-columns/view-columns.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ViewColumnsService } from './view-columns.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ViewColumnsService', () => { let service: ViewColumnsService; diff --git a/packages/nocodb-nest/src/modules/view-columns/view-columns.service.ts b/packages/nocodb-nest/src/modules/view-columns/view-columns.service.ts index 50c245cdd9..c36fd281f2 100644 --- a/packages/nocodb-nest/src/modules/view-columns/view-columns.service.ts +++ b/packages/nocodb-nest/src/modules/view-columns/view-columns.service.ts @@ -1,9 +1,8 @@ import { Injectable } from '@nestjs/common'; -import { ViewColumnReqType, ViewColumnUpdateReqType } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { View } from '../../models'; - -import { T } from 'nc-help'; +import type { ViewColumnReqType, ViewColumnUpdateReqType } from 'nocodb-sdk'; @Injectable() export class ViewColumnsService { diff --git a/packages/nocodb-nest/src/modules/views/views.controller.spec.ts b/packages/nocodb-nest/src/modules/views/views.controller.spec.ts index 3539939e4e..2f034c1ea4 100644 --- a/packages/nocodb-nest/src/modules/views/views.controller.spec.ts +++ b/packages/nocodb-nest/src/modules/views/views.controller.spec.ts @@ -1,6 +1,7 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ViewsController } from './views.controller'; import { ViewsService } from './views.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ViewsController', () => { let controller: ViewsController; diff --git a/packages/nocodb-nest/src/modules/views/views.service.spec.ts b/packages/nocodb-nest/src/modules/views/views.service.spec.ts index 469b6a8005..462d4f00ea 100644 --- a/packages/nocodb-nest/src/modules/views/views.service.spec.ts +++ b/packages/nocodb-nest/src/modules/views/views.service.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { ViewsService } from './views.service'; +import type { TestingModule } from '@nestjs/testing'; describe('ViewsService', () => { let service: ViewsService; diff --git a/packages/nocodb-nest/src/modules/views/views.service.ts b/packages/nocodb-nest/src/modules/views/views.service.ts index c120d8bc2a..bba179d1f2 100644 --- a/packages/nocodb-nest/src/modules/views/views.service.ts +++ b/packages/nocodb-nest/src/modules/views/views.service.ts @@ -1,9 +1,9 @@ import { Injectable } from '@nestjs/common'; -import { SharedViewReqType, ViewUpdateReqType } from 'nocodb-sdk'; +import { T } from 'nc-help'; import { validatePayload } from '../../helpers'; import { Model, ModelRoleVisibility, View } from '../../models'; -import { T } from 'nc-help'; import { TablesService } from '../tables/tables.service'; +import type { SharedViewReqType, ViewUpdateReqType } from 'nocodb-sdk'; // todo: move async function xcVisibilityMetaGet(param: { diff --git a/packages/nocodb-nest/src/nocobuild.ts b/packages/nocodb-nest/src/nocobuild.ts index 33e67a43c6..f4dfee52ac 100644 --- a/packages/nocodb-nest/src/nocobuild.ts +++ b/packages/nocodb-nest/src/nocobuild.ts @@ -1,6 +1,6 @@ import { NestFactory } from '@nestjs/core'; -import { AppModule } from './app.module'; import express from 'express'; +import { AppModule } from './app.module'; export default async function (app = express()) { const nestApp = await NestFactory.create(AppModule); diff --git a/packages/nocodb-nest/src/plugins/storage/Local.ts b/packages/nocodb-nest/src/plugins/storage/Local.ts index 9005d3893d..0028430ed5 100644 --- a/packages/nocodb-nest/src/plugins/storage/Local.ts +++ b/packages/nocodb-nest/src/plugins/storage/Local.ts @@ -3,8 +3,8 @@ import path from 'path'; import { promisify } from 'util'; import mkdirp from 'mkdirp'; import axios from 'axios'; -import type { IStorageAdapterV2, XcFile } from 'nc-plugin'; import NcConfigFactory from '../../utils/NcConfigFactory'; +import type { IStorageAdapterV2, XcFile } from 'nc-plugin'; export default class Local implements IStorageAdapterV2 { constructor() {} diff --git a/packages/nocodb-nest/src/strategies/jwt.strategy.spec.ts b/packages/nocodb-nest/src/strategies/jwt.strategy.spec.ts index 6d04e18970..2111b45d93 100644 --- a/packages/nocodb-nest/src/strategies/jwt.strategy.spec.ts +++ b/packages/nocodb-nest/src/strategies/jwt.strategy.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { JwtStrategy } from './jwt.strategy'; +import type { TestingModule } from '@nestjs/testing'; describe('JwtStrategy', () => { let provider: JwtStrategy; diff --git a/packages/nocodb-nest/src/strategies/jwt.strategy.ts b/packages/nocodb-nest/src/strategies/jwt.strategy.ts index a0777ae864..5b7b5672b0 100644 --- a/packages/nocodb-nest/src/strategies/jwt.strategy.ts +++ b/packages/nocodb-nest/src/strategies/jwt.strategy.ts @@ -1,6 +1,6 @@ import { Injectable, UnauthorizedException } from '@nestjs/common'; import { PassportStrategy } from '@nestjs/passport'; -import { Strategy, ExtractJwt } from 'passport-jwt'; +import { ExtractJwt, Strategy } from 'passport-jwt'; import { OrgUserRoles } from '../../../nocodb-sdk'; import NocoCache from '../cache/NocoCache'; import { ProjectUser, User } from '../models'; diff --git a/packages/nocodb-nest/src/strategies/local.strategy.spec.ts b/packages/nocodb-nest/src/strategies/local.strategy.spec.ts index cc98ff3ea9..c174f25712 100644 --- a/packages/nocodb-nest/src/strategies/local.strategy.spec.ts +++ b/packages/nocodb-nest/src/strategies/local.strategy.spec.ts @@ -1,5 +1,6 @@ -import { Test, TestingModule } from '@nestjs/testing'; +import { Test } from '@nestjs/testing'; import { LocalStrategy } from './local.strategy'; +import type { TestingModule } from '@nestjs/testing'; describe('LocalStrategy', () => { let provider: LocalStrategy; diff --git a/packages/nocodb-nest/test/app.e2e-spec.ts b/packages/nocodb-nest/test/app.e2e-spec.ts index 50cda62332..5f25ec07d6 100644 --- a/packages/nocodb-nest/test/app.e2e-spec.ts +++ b/packages/nocodb-nest/test/app.e2e-spec.ts @@ -1,7 +1,8 @@ -import { Test, TestingModule } from '@nestjs/testing'; -import { INestApplication } from '@nestjs/common'; +import { Test } from '@nestjs/testing'; import * as request from 'supertest'; import { AppModule } from './../src/app.module'; +import type { INestApplication } from '@nestjs/common'; +import type { TestingModule } from '@nestjs/testing'; describe('AppController (e2e)', () => { let app: INestApplication;