Browse Source

chore(nocodb): lint

pull/6177/head
Wing-Kam Wong 1 year ago
parent
commit
3721fc316e
  1. 3
      packages/nocodb/src/controllers/data-table.controller.spec.ts
  2. 2
      packages/nocodb/src/db/sql-mgr/v2/SqlMgrv2Trans.ts
  3. 9
      packages/nocodb/src/gateways/socket.gateway.ts
  4. 1
      packages/nocodb/src/interface/XcMetaMgr.ts
  5. 2
      packages/nocodb/src/modules/event-emitter/nestjs-event-emitter.ts
  6. 9
      packages/nocodb/src/modules/jobs/jobs.gateway.ts
  7. 3
      packages/nocodb/src/services/data-table.service.spec.ts
  8. 4
      packages/nocodb/src/version-upgrader/v1-legacy/BaseApiBuilder.ts
  9. 4
      packages/nocodb/src/version-upgrader/v1-legacy/NcProjectBuilder.ts
  10. 8
      packages/nocodb/src/version-upgrader/v1-legacy/gql/GqlApiBuilder.ts
  11. 8
      packages/nocodb/src/version-upgrader/v1-legacy/rest/RestApiBuilder.ts

3
packages/nocodb/src/controllers/data-table.controller.spec.ts

@ -1,5 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing';
import { Test } from '@nestjs/testing';
import { DataTableController } from './data-table.controller';
import type { TestingModule } from '@nestjs/testing';
describe('DataTableController', () => {
let controller: DataTableController;

2
packages/nocodb/src/db/sql-mgr/v2/SqlMgrv2Trans.ts

@ -1,7 +1,7 @@
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2';
import KnexMigratorv2Tans from '../../sql-migrator/lib/KnexMigratorv2Tans';
import Base from '../../../models/Base';
import SqlMgrv2 from './SqlMgrv2';
import type Base from '../../../models/Base';
import type { Knex } from 'knex';
import type { XKnex } from '../../CustomKnex';

9
packages/nocodb/src/gateways/socket.gateway.ts

@ -14,9 +14,12 @@ function getHash(str) {
return crypto.createHash('md5').update(str).digest('hex');
}
const url = new URL(process.env.NC_PUBLIC_URL || `http://localhost:${process.env.PORT || '8080'}/`)
let namespace = url.pathname
namespace += namespace.endsWith("/") ? "" : "/"
const url = new URL(
process.env.NC_PUBLIC_URL ||
`http://localhost:${process.env.PORT || '8080'}/`,
);
let namespace = url.pathname;
namespace += namespace.endsWith('/') ? '' : '/';
@WebSocketGateway({
cors: {

1
packages/nocodb/src/interface/XcMetaMgr.ts

@ -1,2 +1 @@
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export default interface XcMetaMgr {}

2
packages/nocodb/src/modules/event-emitter/nestjs-event-emitter.ts

@ -1,4 +1,4 @@
import type { EventEmitter2 } from '@nestjs/event-emitter';
import { EventEmitter2 } from '@nestjs/event-emitter';
import type { IEventEmitter } from './event-emitter.interface';
export class NestjsEventEmitter implements IEventEmitter {

9
packages/nocodb/src/modules/jobs/jobs.gateway.ts

@ -14,9 +14,12 @@ import { JobEvents } from '../../interface/Jobs';
import type { OnModuleInit } from '@nestjs/common';
import type { JobStatus } from '../../interface/Jobs';
const url = new URL(process.env.NC_PUBLIC_URL || `http://localhost:${process.env.PORT || '8080'}/`)
let namespace = url.pathname
namespace += namespace.endsWith("/") ? "jobs" : "/jobs"
const url = new URL(
process.env.NC_PUBLIC_URL ||
`http://localhost:${process.env.PORT || '8080'}/`,
);
let namespace = url.pathname;
namespace += namespace.endsWith('/') ? 'jobs' : '/jobs';
@WebSocketGateway({
cors: {

3
packages/nocodb/src/services/data-table.service.spec.ts

@ -1,5 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing';
import { Test } from '@nestjs/testing';
import { DataTableService } from './data-table.service';
import type { TestingModule } from '@nestjs/testing';
describe('DataTableService', () => {
let service: DataTableService;

4
packages/nocodb/src/version-upgrader/v1-legacy/BaseApiBuilder.ts

@ -3,15 +3,15 @@ import { Router } from 'express';
import inflection from 'inflection';
import ModelXcMetaFactory from '../../db/sql-mgr/code/models/xc/ModelXcMetaFactory';
import NcConnectionMgr from '../../utils/common/NcConnectionMgr';
import { DbConfig, NcConfig } from '../../interface/config';
import ncModelsOrderUpgrader from './jobs/ncModelsOrderUpgrader';
import ncParentModelTitleUpgrader from './jobs/ncParentModelTitleUpgrader';
import ncRemoveDuplicatedRelationRows from './jobs/ncRemoveDuplicatedRelationRows';
import type { DbConfig, NcConfig } from '../../interface/config';
import NcProjectBuilder from './NcProjectBuilder';
import type { XKnex } from '../../db/CustomKnex';
import type { BaseModelSql } from '../../db/BaseModelSql';
import type { MetaService } from '../../meta/meta.service';
import type Noco from '../../Noco';
import type NcProjectBuilder from './NcProjectBuilder';
import type { MysqlClient, PgClient, SqlClient } from 'nc-help';
const log = debug('nc:api:base');

4
packages/nocodb/src/version-upgrader/v1-legacy/NcProjectBuilder.ts

@ -1,9 +1,9 @@
import { Router } from 'express';
import { SqlClientFactory } from '../../db/sql-client/lib/SqlClientFactory';
import Noco from '../../Noco';
import { NcConfig } from '../../interface/config';
import { GqlApiBuilder } from './gql/GqlApiBuilder';
import { RestApiBuilder } from './rest/RestApiBuilder';
import type Noco from '../../Noco';
import type { NcConfig } from '../../interface/config';
export default class NcProjectBuilder {
public readonly id: string;

8
packages/nocodb/src/version-upgrader/v1-legacy/gql/GqlApiBuilder.ts

@ -1,10 +1,10 @@
import { Router } from 'express';
import GqlXcSchemaFactory from '../../../db/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory';
import BaseApiBuilder from '../BaseApiBuilder';
import type { MetaService } from '../../../meta/meta.service';
import type Noco from '../../../Noco';
import type NcProjectBuilder from '../NcProjectBuilder';
import type { DbConfig, NcConfig } from '../../../interface/config';
import { MetaService } from '../../../meta/meta.service';
import Noco from '../../../Noco';
import NcProjectBuilder from '../NcProjectBuilder';
import { DbConfig, NcConfig } from '../../../interface/config';
import type XcMetaMgr from '../../../interface/XcMetaMgr';
export class GqlApiBuilder extends BaseApiBuilder<Noco> implements XcMetaMgr {

8
packages/nocodb/src/version-upgrader/v1-legacy/rest/RestApiBuilder.ts

@ -3,11 +3,11 @@ import SwaggerXc from '../../../db/sql-mgr/code/routers/xc-ts/SwaggerXc';
import ExpressXcTsRoutes from '../../../db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes';
import NcHelp from '../../../utils/NcHelp';
import BaseApiBuilder from '../BaseApiBuilder';
import type { MetaService } from '../../../meta/meta.service';
import type Noco from '../../../Noco';
import { MetaService } from '../../../meta/meta.service';
import Noco from '../../../Noco';
import { DbConfig, NcConfig } from '../../../interface/config';
import NcProjectBuilder from '../NcProjectBuilder';
import type { Router } from 'express';
import type { DbConfig, NcConfig } from '../../../interface/config';
import type NcProjectBuilder from '../NcProjectBuilder';
export class RestApiBuilder extends BaseApiBuilder<Noco> {
public readonly type = 'rest';

Loading…
Cancel
Save