Browse Source

refactor(nocodb): import

pull/5269/head
Wing-Kam Wong 2 years ago
parent
commit
4c6aaa292f
  1. 3
      packages/nocodb/src/lib/Noco.ts
  2. 1
      packages/nocodb/src/lib/controllers/base.ctl.ts
  3. 3
      packages/nocodb/src/lib/controllers/dbData/helpers.ts
  4. 1
      packages/nocodb/src/lib/controllers/filter.ctl.ts
  5. 1
      packages/nocodb/src/lib/controllers/project.ctl.ts
  6. 1
      packages/nocodb/src/lib/controllers/sort.ctl.ts
  7. 12
      packages/nocodb/src/lib/controllers/user/initStrategies.ts
  8. 1
      packages/nocodb/src/lib/controllers/user/user.ctl.ts
  9. 1
      packages/nocodb/src/lib/controllers/util.ctl.ts
  10. 2
      packages/nocodb/src/lib/db/sql-client/lib/KnexClient.ts
  11. 3
      packages/nocodb/src/lib/db/sql-client/lib/mysql/MysqlClient.ts
  12. 3
      packages/nocodb/src/lib/db/sql-client/lib/mysql/TidbClient.ts
  13. 3
      packages/nocodb/src/lib/db/sql-client/lib/mysql/VitessClient.ts
  14. 2
      packages/nocodb/src/lib/db/sql-client/lib/pg/PgClient.ts
  15. 2
      packages/nocodb/src/lib/db/sql-client/lib/snowflake/SnowflakeClient.ts
  16. 5
      packages/nocodb/src/lib/db/sql-data-mapper/index.ts
  17. 1
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSql.ts
  18. 1
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts
  19. 1
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts
  20. 6
      packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts
  21. 13
      packages/nocodb/src/lib/db/sql-mgr/code/BaseRender.ts
  22. 2
      packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts
  23. 1
      packages/nocodb/src/lib/db/sql-mgr/code/policies/xc/ExpressXcPolicy.ts
  24. 1
      packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXc.ts
  25. 2
      packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigrator.ts
  26. 8
      packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2.ts
  27. 1
      packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2Tans.ts
  28. 1
      packages/nocodb/src/lib/db/util/FileCollection.ts
  29. 5
      packages/nocodb/src/lib/meta/NcMetaIOImpl.ts
  30. 4
      packages/nocodb/src/lib/meta/NcMetaMgr.ts
  31. 1
      packages/nocodb/src/lib/meta/NcMetaMgrEE.ts
  32. 2
      packages/nocodb/src/lib/meta/NcMetaMgrv2.ts
  33. 2
      packages/nocodb/src/lib/meta/api/index.ts
  34. 1
      packages/nocodb/src/lib/meta/helpers/extractProjectIdAndAuthenticate.ts
  35. 1
      packages/nocodb/src/lib/plugins/backblaze/BackblazePlugin.ts
  36. 1
      packages/nocodb/src/lib/plugins/discord/DiscordPlugin.ts
  37. 1
      packages/nocodb/src/lib/plugins/gcs/GcsPlugin.ts
  38. 1
      packages/nocodb/src/lib/plugins/linode/LinodeObjectStoragePlugin.ts
  39. 1
      packages/nocodb/src/lib/plugins/mailerSend/MailerSend.ts
  40. 1
      packages/nocodb/src/lib/plugins/mailerSend/MailerSendPlugin.ts
  41. 1
      packages/nocodb/src/lib/plugins/mattermost/MattermostPlugin.ts
  42. 1
      packages/nocodb/src/lib/plugins/mino/MinioPlugin.ts
  43. 1
      packages/nocodb/src/lib/plugins/ovhCloud/OvhCloudPlugin.ts
  44. 1
      packages/nocodb/src/lib/plugins/s3/S3Plugin.ts
  45. 1
      packages/nocodb/src/lib/plugins/scaleway/ScalewayObjectStoragePlugin.ts
  46. 1
      packages/nocodb/src/lib/plugins/ses/SESPlugin.ts
  47. 1
      packages/nocodb/src/lib/plugins/slack/SlackPlugin.ts
  48. 1
      packages/nocodb/src/lib/plugins/smtp/SMTP.ts
  49. 1
      packages/nocodb/src/lib/plugins/smtp/SMTPPlugin.ts
  50. 1
      packages/nocodb/src/lib/plugins/spaces/SpacesPlugin.ts
  51. 1
      packages/nocodb/src/lib/plugins/teams/TeamsPlugin.ts
  52. 1
      packages/nocodb/src/lib/plugins/twilio/TwilioPlugin.ts
  53. 1
      packages/nocodb/src/lib/plugins/twilioWhatsapp/TwilioWhatsappPlugin.ts
  54. 1
      packages/nocodb/src/lib/plugins/upcloud/UpCloudPlugin.ts
  55. 1
      packages/nocodb/src/lib/plugins/vultr/VultrPlugin.ts
  56. 1
      packages/nocodb/src/lib/services/column.svc.ts
  57. 1
      packages/nocodb/src/lib/services/hook.svc.ts
  58. 2
      packages/nocodb/src/lib/services/metaDiff.svc.ts
  59. 5
      packages/nocodb/src/lib/services/sync/helpers/job.ts
  60. 1
      packages/nocodb/src/lib/services/test/TestResetService/resetMysqlSakilaProject.ts
  61. 4
      packages/nocodb/src/lib/services/test/TestResetService/resetPgSakilaProject.ts
  62. 2
      packages/nocodb/src/lib/services/user/index.ts
  63. 2
      packages/nocodb/src/lib/services/user/initAdminFromEnv.ts
  64. 1
      packages/nocodb/src/lib/services/util.svc.ts
  65. 1
      packages/nocodb/src/lib/utils/Lang.ts
  66. 1
      packages/nocodb/src/lib/utils/NcConfigFactory.ts
  67. 12
      packages/nocodb/src/lib/utils/common/BaseApiBuilder.ts
  68. 1
      packages/nocodb/src/lib/utils/common/BaseProcedure.ts
  69. 1
      packages/nocodb/src/lib/utils/common/NcConnectionMgr.ts
  70. 4
      packages/nocodb/src/lib/utils/common/XcCron.ts
  71. 3
      packages/nocodb/src/lib/v1-legacy/NcProjectBuilder.ts
  72. 2
      packages/nocodb/src/lib/v1-legacy/gql/GqlApiBuilder.ts
  73. 6
      packages/nocodb/src/lib/v1-legacy/gql/GqlAuthResolver.ts
  74. 1
      packages/nocodb/src/lib/v1-legacy/gql/GqlMiddleware.ts
  75. 2
      packages/nocodb/src/lib/v1-legacy/gql/GqlProcedureResolver.ts
  76. 1
      packages/nocodb/src/lib/v1-legacy/gql/GqlResolver.ts
  77. 2
      packages/nocodb/src/lib/v1-legacy/nc.try.ts
  78. 2
      packages/nocodb/src/lib/v1-legacy/plugins/NcPluginMgr.ts
  79. 1
      packages/nocodb/src/lib/v1-legacy/plugins/adapters/email/SMTP.ts
  80. 2
      packages/nocodb/src/lib/v1-legacy/plugins/adapters/storage/Local.ts
  81. 1
      packages/nocodb/src/lib/v1-legacy/plugins/ses.ts
  82. 9
      packages/nocodb/src/lib/v1-legacy/rest/RestApiBuilder.ts
  83. 5
      packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts
  84. 2
      packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrlEE.ts
  85. 1
      packages/nocodb/src/lib/v1-legacy/rest/RestBaseCtrl.ts
  86. 2
      packages/nocodb/src/lib/v1-legacy/rest/RestCtrl.ts
  87. 1
      packages/nocodb/src/lib/v1-legacy/rest/RestCtrlBelongsTo.ts
  88. 1
      packages/nocodb/src/lib/v1-legacy/rest/RestCtrlCustom.ts
  89. 1
      packages/nocodb/src/lib/v1-legacy/rest/RestCtrlHasMany.ts
  90. 1
      packages/nocodb/src/lib/v1-legacy/rest/RestCtrlMin.ts
  91. 2
      packages/nocodb/src/lib/v1-legacy/rest/RestCtrlProcedure.ts
  92. 2
      packages/nocodb/src/lib/v1-legacy/rest/RestCtrlv2.ts
  93. 2
      packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts
  94. 1
      packages/nocodb/src/run/docker.ts
  95. 1
      packages/nocodb/src/run/dockerRunMysql.ts
  96. 1
      packages/nocodb/src/run/dockerRunPG.ts
  97. 1
      packages/nocodb/src/run/dockerRunPG_CyQuick.ts
  98. 2
      packages/nocodb/src/run/testDocker.ts
  99. 1
      packages/nocodb/src/run/try.ts
  100. 1
      packages/nocodb/tests/unit/index.test.ts
  101. Some files were not shown because too many files have changed in this diff Show More

3
packages/nocodb/src/lib/Noco.ts

@ -2,7 +2,6 @@
import fs from 'fs';
import path from 'path';
import { promisify } from 'util';
import * as Sentry from '@sentry/node';
import bodyParser from 'body-parser';
import clear from 'clear';
@ -14,14 +13,12 @@ import morgan from 'morgan';
import NcToolGui from 'nc-lib-gui';
import requestIp from 'request-ip';
import { v4 as uuidv4 } from 'uuid';
import { T } from 'nc-help';
import mkdirp from 'mkdirp';
import { NC_LICENSE_KEY } from './constants';
import Migrator from './db/sql-migrator/lib/KnexMigrator';
import Store from './models/Store';
import NcConfigFactory from './utils/NcConfigFactory';
import NcProjectBuilderCE from './v1-legacy/NcProjectBuilder';
import NcProjectBuilderEE from './v1-legacy/NcProjectBuilderEE';
import NcMetaImplCE from './meta/NcMetaIOImpl';

1
packages/nocodb/src/lib/controllers/base.ctl.ts

@ -1,7 +1,6 @@
import { PagedResponseImpl } from '../meta/helpers/PagedResponse';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics';
import { baseService } from '../services';
import type Base from '../models/Base';
import type { BaseListType } from 'nocodb-sdk';

3
packages/nocodb/src/lib/controllers/dbData/helpers.ts

@ -7,13 +7,12 @@ import Model from '../../models/Model';
import View from '../../models/View';
import Base from '../../models/Base';
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2';
import Column from '../../models/Column';
import { dataService } from '../../services';
import type LookupColumn from '../../models/LookupColumn';
import type LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn';
import type { Request } from 'express';
export async function getViewAndModelFromRequestByAliasOrId(
req:
| Request<{ projectName: string; tableName: string; viewName?: string }>

1
packages/nocodb/src/lib/controllers/filter.ctl.ts

@ -1,7 +1,6 @@
import { Router } from 'express';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics';
import { filterService } from '../services';
import type { FilterReqType } from 'nocodb-sdk';
import type { Request, Response } from 'express';

1
packages/nocodb/src/lib/controllers/project.ctl.ts

@ -9,7 +9,6 @@ import Noco from '../Noco';
import Project from '../models/Project';
import { metaApiMetrics } from '../meta/helpers/apiMetrics';
import Filter from '../models/Filter';
import { projectService } from '../services';
import type { ProjectListType } from 'nocodb-sdk';
import type { ProjectType } from 'nocodb-sdk';

1
packages/nocodb/src/lib/controllers/sort.ctl.ts

@ -2,7 +2,6 @@ import { Router } from 'express';
import { PagedResponseImpl } from '../meta/helpers/PagedResponse';
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw';
import { metaApiMetrics } from '../meta/helpers/apiMetrics';
import { sortService } from '../services';
import type { SortListType, SortReqType } from 'nocodb-sdk';
import type { Request, Response } from 'express';

12
packages/nocodb/src/lib/controllers/user/initStrategies.ts

@ -5,6 +5,12 @@ import passport from 'passport';
import passportJWT from 'passport-jwt';
import { Strategy as AuthTokenStrategy } from 'passport-auth-token';
import { Strategy as GoogleStrategy } from 'passport-google-oauth20';
import bcrypt from 'bcryptjs';
import NocoCache from '../../cache/NocoCache';
import { ApiToken, Plugin, Project, ProjectUser, User } from '../../models';
import Noco from '../../Noco';
import { CacheGetType, CacheScope } from '../../utils/globals';
import { userService } from '../../services';
const ExtractJwt = passportJWT.ExtractJwt;
const JwtStrategy = passportJWT.Strategy;
@ -13,12 +19,6 @@ const jwtOptions = {
jwtFromRequest: ExtractJwt.fromHeader('xc-auth'),
};
import bcrypt from 'bcryptjs';
import NocoCache from '../../cache/NocoCache';
import { ApiToken, Plugin, Project, ProjectUser, User } from '../../models';
import Noco from '../../Noco';
import { CacheGetType, CacheScope } from '../../utils/globals';
import { userService } from '../../services';
const PassportLocalStrategy = require('passport-local').Strategy;
export function initStrategies(router): void {

1
packages/nocodb/src/lib/controllers/user/user.ctl.ts

@ -1,6 +1,5 @@
import { promisify } from 'util';
import * as ejs from 'ejs';
import passport from 'passport';
import catchError, { NcError } from '../../meta/helpers/catchError';
import extractProjectIdAndAuthenticate from '../../meta/helpers/extractProjectIdAndAuthenticate';

1
packages/nocodb/src/lib/controllers/util.ctl.ts

@ -1,4 +1,3 @@
// // Project CRUD
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw';
import catchError from '../meta/helpers/catchError';
import { utilService } from '../services';

2
packages/nocodb/src/lib/db/sql-client/lib/KnexClient.ts

@ -4,7 +4,6 @@ import { promisify } from 'util';
import path from 'path';
import { knex } from 'knex';
import { T } from 'nc-help';
import findIndex from 'lodash/findIndex';
import find from 'lodash/find';
import jsonfile from 'jsonfile';
@ -15,6 +14,7 @@ import Debug from '../../util/Debug';
import * as dataHelp from './data.helper';
import SqlClient from './SqlClient';
import type { Knex } from 'knex';
const evt = new Emit();
const log = new Debug('KnexClient');

3
packages/nocodb/src/lib/db/sql-client/lib/mysql/MysqlClient.ts

@ -1,7 +1,6 @@
import path from 'path';
import { promisify } from 'util';
import knex from 'knex';
import isEmpty from 'lodash/isEmpty';
import mapKeys from 'lodash/mapKeys';
import find from 'lodash/find';
@ -12,10 +11,8 @@ import levenshtein from 'fast-levenshtein';
import Debug from '../../../util/Debug';
import Emit from '../../../util/emit';
import Result from '../../../util/Result';
import KnexClient from '../KnexClient';
import queries from './mysql.queries';
import fakerFunctionList from './fakerFunctionList';
import * as findDataType from './findDataTypeMapping';

3
packages/nocodb/src/lib/db/sql-client/lib/mysql/TidbClient.ts

@ -1,11 +1,10 @@
import _ from 'lodash';
import Debug from '../../../util/Debug';
import Result from '../../../util/Result';
import MysqlClient from './MysqlClient';
const log = new Debug('TidbClient');
import MysqlClient from './MysqlClient';
class Tidb extends MysqlClient {
/**
*

3
packages/nocodb/src/lib/db/sql-client/lib/mysql/VitessClient.ts

@ -1,11 +1,10 @@
import _ from 'lodash';
import Debug from '../../../util/Debug';
import Result from '../../../util/Result';
import MysqlClient from './MysqlClient';
const log = new Debug('VitessClient');
import MysqlClient from './MysqlClient';
class Vitess extends MysqlClient {
constructor(connectionConfig: any) {
super(connectionConfig);

2
packages/nocodb/src/lib/db/sql-client/lib/pg/PgClient.ts

@ -1,5 +1,4 @@
import { nanoid } from 'nanoid';
import knex from 'knex';
import isEmpty from 'lodash/isEmpty';
import mapKeys from 'lodash/mapKeys';
@ -8,6 +7,7 @@ import KnexClient from '../KnexClient';
import Debug from '../../../util/Debug';
import Result from '../../../util/Result';
import queries from './pg.queries';
const log = new Debug('PGClient');
class PGClient extends KnexClient {

2
packages/nocodb/src/lib/db/sql-client/lib/snowflake/SnowflakeClient.ts

@ -1,11 +1,11 @@
import { nanoid } from 'nanoid';
import _ from 'lodash';
import lodash from 'lodash';
import KnexClient from '../KnexClient';
import Debug from '../../../util/Debug';
import Result from '../../../util/Result';
import queries from './snowflake.queries';
const log = new Debug('SnowflakeClient');
const rowsToLower = (arr) => {

5
packages/nocodb/src/lib/db/sql-data-mapper/index.ts

@ -1,6 +1,5 @@
export { DbFactory } from './lib/DbFactory';
export { BaseModelSql } from './lib/sql/BaseModelSql';
import XKnex, { Knex } from './lib/sql/CustomKnex';
export { DbFactory } from './lib/DbFactory';
export { BaseModelSql } from './lib/sql/BaseModelSql';
export { XKnex, Knex };

1
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSql.ts

@ -1,7 +1,6 @@
import autoBind from 'auto-bind';
import _ from 'lodash';
import Validator from 'validator';
import Papaparse from 'papaparse';
import BaseModel from '../BaseModel';
import formulaQueryBuilder from './formulaQueryBuilderFromString';

1
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

@ -1,6 +1,5 @@
import autoBind from 'auto-bind';
import _ from 'lodash';
import DataLoader from 'dataloader';
import {
AuditOperationSubTypes,

1
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts

@ -2,7 +2,6 @@ import { Knex, knex } from 'knex';
import { SnowflakeClient } from 'nc-help';
import Filter from '../../../../models/Filter';
import type { FilterType } from 'nocodb-sdk';
import type { BaseModelSql } from './BaseModelSql';
const types = require('pg').types;

6
packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts

@ -2,7 +2,6 @@ import fs from 'fs';
import path from 'path';
import url from 'url';
import { promisify } from 'util';
import fsExtra from 'fs-extra';
import importFresh from 'import-fresh';
import inflection from 'inflection';
@ -10,14 +9,10 @@ import slash from 'slash';
import { T } from 'nc-help';
import { customAlphabet } from 'nanoid';
import SqlClientFactory from '../sql-client/lib/SqlClientFactory';
// import debug from 'debug';
import KnexMigrator from '../sql-migrator/lib/KnexMigrator';
// import {XKnex} from "../sql-data-mapper";
import NcConnectionMgr from '../../utils/common/NcConnectionMgr';
import Debug from '../util/Debug';
import Result from '../util/Result';
import type MssqlClient from '../sql-client/lib/mssql/MssqlClient';
import type MysqlClient from '../sql-client/lib/mysql/MysqlClient';
import type OracleClient from '../sql-client/lib/oracle/OracleClient';
@ -26,6 +21,7 @@ import type SnowflakeClient from '../sql-client/lib/snowflake/SnowflakeClient';
import type SqliteClient from '../sql-client/lib/sqlite/SqliteClient';
const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 20);
const log = new Debug('SqlMgr');
const ToolOps = {

13
packages/nocodb/src/lib/db/sql-mgr/code/BaseRender.ts

@ -1,16 +1,3 @@
// import path from "path";
// import mkdirp from "mkdirp";
// import {promisify} from "util";
//
// import ejs from "ejs";
// import fs from "fs";
// import js_beautify from "js-beautify";
// import fsExtra from "fs-extra";
// import md5 from "md5";
// import dayjs from "dayjs";import Emit from "../../sql-migrator/util/emit";
// const beautify = js_beautify.js;
import Debug from '../../util/Debug';
import Emit from '../../util/emit';

2
packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts

@ -1,7 +1,5 @@
import lodash from 'lodash';
import BaseRender from '../../BaseRender';
import { AGG_DEFAULT_COLS, GROUPBY_DEFAULT_COLS } from './schemaHelp';
abstract class BaseGqlXcTsSchema extends BaseRender {

1
packages/nocodb/src/lib/db/sql-mgr/code/policies/xc/ExpressXcPolicy.ts

@ -1,5 +1,4 @@
import lodash from 'lodash';
import BaseRender from '../../BaseRender';
import type { Acl } from '../../../../../../interface/config';

1
packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXc.ts

@ -1,5 +1,4 @@
import BaseRender from '../../BaseRender';
import SwaggerTypes from './SwaggerTypes';
class SwaggerXc extends BaseRender {

2
packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigrator.ts

@ -1,7 +1,6 @@
import fs from 'fs';
import path from 'path';
import { promisify } from 'util';
import glob from 'glob';
import Handlebars from 'handlebars';
import mkdirp from 'mkdirp';
@ -11,7 +10,6 @@ import Debug from '../../util/Debug';
import Emit from '../../util/emit';
import Result from '../../util/Result';
import * as fileHelp from '../../util/file.help';
import NcConfigFactory from '../../../utils/NcConfigFactory';
import SqlMigrator from './SqlMigrator';

8
packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2.ts

@ -1,17 +1,11 @@
import fs from 'fs';
import path from 'path';
import { promisify } from 'util';
import glob from 'glob';
import SqlClientFactory from '../../sql-client/lib/SqlClientFactory';
import Debug from '../../util/Debug';
import Emit from '../../util/emit';
// import Handlebars from 'handlebars';
// import mkdirp from 'mkdirp';
import * as fileHelp from '../../util/file.help';
// import SqlMigrator from './SqlMigrator';
// import NcConfigFactory from '../../../utils/NcConfigFactory';
import Noco from '../../../Noco';
import Project from '../../../models/Project';
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2';
@ -21,7 +15,9 @@ import type { XKnex } from '../../sql-data-mapper';
import type { Knex } from 'knex';
const evt = new Emit();
const log = new Debug('KnexMigrator');
const NC_MIGRATION = 'nc_migrations';
/**
* Class to create an instance of KnexMigrator

1
packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2Tans.ts

@ -10,7 +10,6 @@ import KnexMigratorv2 from './KnexMigratorv2';
import type Base from '../../../models/Base';
import type { XKnex } from '../../sql-data-mapper';
import type NcMetaIO from '../../../meta/NcMetaIO';
import type MssqlClient from '../../sql-client/lib/mssql/MssqlClient';
import type MysqlClient from '../../sql-client/lib/mysql/MysqlClient';
import type OracleClient from '../../sql-client/lib/oracle/OracleClient';

1
packages/nocodb/src/lib/db/util/FileCollection.ts

@ -1,6 +1,5 @@
import fs from 'fs';
import { promisify } from 'util';
import jsonfile from 'jsonfile';
export default class FileCollection {

5
packages/nocodb/src/lib/meta/NcMetaIOImpl.ts

@ -1,9 +1,7 @@
import CryptoJS from 'crypto-js';
import { customAlphabet } from 'nanoid';
import { XKnex } from '../db/sql-data-mapper';
import XcMigrationSource from '../migrations/XcMigrationSource';
import NcConnectionMgr from '../utils/common/NcConnectionMgr';
import { MetaTable } from '../utils/globals';
import XcMigrationSourcev2 from '../migrations/XcMigrationSourcev2';
@ -12,9 +10,8 @@ import type Noco from '../Noco';
import type { Knex } from '../db/sql-data-mapper';
import type { NcConfig } from '../../interface/config';
// import { nanoid } from 'nanoid';
/*import { v4 as uuidv4 } from 'uuid';*/
const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 4);
const nanoidv2 = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz', 14);
export default class NcMetaIOImpl extends NcMetaIO {

4
packages/nocodb/src/lib/meta/NcMetaMgr.ts

@ -3,7 +3,6 @@ import path from 'path';
import { promisify } from 'util';
import CryptoJS from 'crypto-js';
import mkdirp from 'mkdirp';
import archiver from 'archiver';
import axios from 'axios';
import bodyParser from 'body-parser';
@ -18,7 +17,6 @@ import { ncp } from 'ncp';
import { UITypes } from 'nocodb-sdk';
import { T } from 'nc-help';
import { Result } from '../../interface/config';
import SqlClientFactory from '../db/sql-client/lib/SqlClientFactory';
import { NcConfigFactory } from '../index';
import ProjectMgr from '../db/sql-mgr/ProjectMgr';
@ -46,7 +44,9 @@ import type IStorageAdapter from '../../interface/IStorageAdapter';
import type IEmailAdapter from '../../interface/IEmailAdapter';
import type express from 'express';
import type { Handler } from 'express';
const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 10);
const XC_PLUGIN_DET = 'XC_PLUGIN_DET';
const NOCO_RELEASE = 'NOCO_RELEASE';

1
packages/nocodb/src/lib/meta/NcMetaMgrEE.ts

@ -1,6 +1,5 @@
import { v4 as uuidv4 } from 'uuid';
import { T } from 'nc-help';
import NcMetaMgr from './NcMetaMgr';
export default class NcMetaMgrEE extends NcMetaMgr {

2
packages/nocodb/src/lib/meta/NcMetaMgrv2.ts

@ -1,7 +1,6 @@
import bodyParser from 'body-parser';
import { Router } from 'express';
import multer from 'multer';
import ProjectMgr from '../db/sql-mgr/ProjectMgr';
import { packageVersion } from '../utils/packageVersion';
import projectAcl from '../utils/projectAcl';
@ -13,7 +12,6 @@ import type NcMetaIO from './NcMetaIO';
import type Noco from '../Noco';
import type { NcConfig } from '../../interface/config';
import type { Handler } from 'express';
// import ncGetMeta from './handlersv2/ncGetMeta';
export default class NcMetaMgrv2 {
public projectConfigs = {};

2
packages/nocodb/src/lib/meta/api/index.ts

@ -25,7 +25,6 @@ import pluginController from '../../controllers/plugin.ctl';
import gridViewColumnController from '../../controllers/views/gridViewColumn.ctl';
import kanbanViewController from '../../controllers/views/kanbanView.ctl';
import { userController } from '../../controllers/user';
// import extractProjectIdAndAuthenticate from './helpers/extractProjectIdAndAuthenticate';
import utilController from '../../controllers/util.ctl';
import projectUserController from '../../controllers/projectUser.ctl';
import sharedBaseController from '../../controllers/sharedBase.ctl';
@ -49,7 +48,6 @@ import {
publicDataExportController,
publicMetaController,
} from '../../controllers/publicControllers';
import swaggerController from '../../controllers/apiDocs';
import { importController, syncSourceController } from '../../controllers/sync';
import mapViewController from '../../controllers/views/mapView.ctl';

1
packages/nocodb/src/lib/meta/helpers/extractProjectIdAndAuthenticate.ts

@ -1,5 +1,4 @@
import { promisify } from 'util';
import passport from 'passport';
import Model from '../../models/Model';
import View from '../../models/View';

1
packages/nocodb/src/lib/plugins/backblaze/BackblazePlugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import Backblaze from './Backblaze';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/discord/DiscordPlugin.ts

@ -1,5 +1,4 @@
import { XcWebhookNotificationPlugin } from 'nc-plugin';
import Discord from './Discord';
import type { IWebhookNotificationAdapter } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/gcs/GcsPlugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import Gcs from './Gcs';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/linode/LinodeObjectStoragePlugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import LinodeObjectStorage from './LinodeObjectStorage';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/mailerSend/MailerSend.ts

@ -1,6 +1,5 @@
import MailerSend, { EmailParams, Recipient } from 'mailersend';
import type { IEmailAdapter } from 'nc-plugin';
import type { XcEmail } from '../../../interface/IEmailAdapter';
export default class Mailer implements IEmailAdapter {

1
packages/nocodb/src/lib/plugins/mailerSend/MailerSendPlugin.ts

@ -1,5 +1,4 @@
import { XcEmailPlugin } from 'nc-plugin';
import MailerSend from './MailerSend';
import type { IEmailAdapter } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/mattermost/MattermostPlugin.ts

@ -1,5 +1,4 @@
import { XcWebhookNotificationPlugin } from 'nc-plugin';
import Mattermost from './Mattermost';
import type { IWebhookNotificationAdapter } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/mino/MinioPlugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import Minio from './Minio';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/ovhCloud/OvhCloudPlugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import OvhCloud from './OvhCloud';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/s3/S3Plugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import S3 from './S3';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/scaleway/ScalewayObjectStoragePlugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import ScalewayObjectStorage from './ScalewayObjectStorage';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/ses/SESPlugin.ts

@ -1,5 +1,4 @@
import { XcEmailPlugin } from 'nc-plugin';
import SES from './SES';
import type { IEmailAdapter } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/slack/SlackPlugin.ts

@ -1,5 +1,4 @@
import { XcWebhookNotificationPlugin } from 'nc-plugin';
import Slack from './Slack';
import type { IWebhookNotificationAdapter } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/smtp/SMTP.ts

@ -1,7 +1,6 @@
import nodemailer from 'nodemailer';
import type { IEmailAdapter } from 'nc-plugin';
import type Mail from 'nodemailer/lib/mailer';
import type { XcEmail } from '../../../interface/IEmailAdapter';
export default class SMTP implements IEmailAdapter {

1
packages/nocodb/src/lib/plugins/smtp/SMTPPlugin.ts

@ -1,5 +1,4 @@
import { XcEmailPlugin } from 'nc-plugin';
import SMTP from './SMTP';
import type { IEmailAdapter } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/spaces/SpacesPlugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import Spaces from './Spaces';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/teams/TeamsPlugin.ts

@ -1,5 +1,4 @@
import { XcWebhookNotificationPlugin } from 'nc-plugin';
import Teams from './Teams';
import type { IWebhookNotificationAdapter } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/twilio/TwilioPlugin.ts

@ -1,5 +1,4 @@
import { XcWebhookNotificationPlugin } from 'nc-plugin';
import Twilio from './Twilio';
import type { IWebhookNotificationAdapter } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/twilioWhatsapp/TwilioWhatsappPlugin.ts

@ -1,5 +1,4 @@
import { XcWebhookNotificationPlugin } from 'nc-plugin';
import TwilioWhatsapp from './TwilioWhatsapp';
import type { IWebhookNotificationAdapter } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/upcloud/UpCloudPlugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import UpoCloud from './UpoCloud';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/plugins/vultr/VultrPlugin.ts

@ -1,5 +1,4 @@
import { XcStoragePlugin } from 'nc-plugin';
import Vultr from './Vultr';
import type { IStorageAdapterV2 } from 'nc-plugin';

1
packages/nocodb/src/lib/services/column.svc.ts

@ -34,7 +34,6 @@ import KanbanView from '../models/KanbanView';
import Model from '../models/Model';
import Noco from '../Noco';
import NcConnectionMgrv2 from '../utils/common/NcConnectionMgrv2';
import { MetaTable } from '../utils/globals';
import type Project from '../models/Project';
import type LinkToAnotherRecordColumn from '../models/LinkToAnotherRecordColumn';

1
packages/nocodb/src/lib/services/hook.svc.ts

@ -1,7 +1,6 @@
import { T } from 'nc-help';
import { validatePayload } from '../meta/api/helpers';
import { Hook, Model } from '../models';
import { invokeWebhook } from '../meta/helpers/webhookHelpers';
import populateSamplePayload from '../meta/helpers/populateSamplePayload';
import type { HookReqType, HookTestReqType } from 'nocodb-sdk';

2
packages/nocodb/src/lib/services/metaDiff.svc.ts

@ -1,5 +1,3 @@
// // Project CRUD
import { T } from 'nc-help';
import { isVirtualCol, ModelTypes, RelationTypes, UITypes } from 'nocodb-sdk';
import NcConnectionMgrv2 from '../utils/common/NcConnectionMgrv2';

5
packages/nocodb/src/lib/services/sync/helpers/job.ts

@ -1,20 +1,15 @@
import { promisify } from 'util';
import { UITypes } from 'nocodb-sdk';
// import * as sMap from './syncMap';
import { Api } from 'nocodb-sdk';
import Airtable from 'airtable';
import jsonfile from 'jsonfile';
import hash from 'object-hash';
import { T } from 'nc-help';
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import tinycolor from 'tinycolor2';
import FetchAT from './fetchAT';
import { importData, importLTARData } from './readAndProcessData';
import EntityMap from './EntityMap';
const writeJsonFileAsync = promisify(jsonfile.writeFile);

1
packages/nocodb/src/lib/services/test/TestResetService/resetMysqlSakilaProject.ts

@ -1,7 +1,6 @@
import { promises as fs } from 'fs';
import axios from 'axios';
import { knex } from 'knex';
import Audit from '../../../models/Audit';
import type { Knex } from 'knex';
import type Project from '../../../models/Project';

4
packages/nocodb/src/lib/services/test/TestResetService/resetPgSakilaProject.ts

@ -1,10 +1,6 @@
import { promises as fs } from 'fs';
import axios from 'axios';
import { knex } from 'knex';
// const util = require('util');
// const exec = util.promisify(require('child_process').exec);
import Audit from '../../../models/Audit';
import type Project from '../../../models/Project';

2
packages/nocodb/src/lib/services/user/index.ts

@ -2,9 +2,7 @@ import { promisify } from 'util';
import { validatePassword } from 'nocodb-sdk';
import { OrgUserRoles } from 'nocodb-sdk';
import { T } from 'nc-help';
import * as ejs from 'ejs';
import bcrypt from 'bcryptjs';
import { NC_APP_SETTINGS } from '../../constants';
import { validatePayload } from '../../meta/api/helpers';

2
packages/nocodb/src/lib/services/user/initAdminFromEnv.ts

@ -1,6 +1,5 @@
import { promisify } from 'util';
import { v4 as uuidv4 } from 'uuid';
import bcrypt from 'bcryptjs';
import { validatePassword } from 'nocodb-sdk';
import boxen from 'boxen';
@ -11,6 +10,7 @@ import Noco from '../../Noco';
import { CacheScope, MetaTable } from '../../utils/globals';
const { isEmail } = require('validator');
const rolesLevel = { owner: 0, creator: 1, editor: 2, commenter: 3, viewer: 4 };
export default async function initAdminFromEnv(_ncMeta = Noco.ncMeta) {

1
packages/nocodb/src/lib/services/util.svc.ts

@ -1,5 +1,4 @@
import { compareVersions, validate } from 'compare-versions';
import { ViewTypes } from 'nocodb-sdk';
import axios from 'axios';
import { Project } from '../models';

1
packages/nocodb/src/lib/utils/Lang.ts

@ -1,5 +1,4 @@
import osLocale from 'os-locale';
import english from './english.json';
import translated from './translated.json';

1
packages/nocodb/src/lib/utils/NcConfigFactory.ts

@ -1,7 +1,6 @@
import fs from 'fs';
import { URL } from 'url';
import { promisify } from 'util';
import * as path from 'path';
import parseDbUrl from 'parse-database-url';
import SqlClientFactory from '../db/sql-client/lib/SqlClientFactory';

12
packages/nocodb/src/lib/utils/common/BaseApiBuilder.ts

@ -1,17 +1,12 @@
// import * as fs from "fs";
import debug from 'debug';
import { Router } from 'express';
import inflection from 'inflection';
// import Knex from "knex";
import { T } from 'nc-help';
import { UITypes } from 'nocodb-sdk';
import ModelXcMetaFactory from '../../db/sql-mgr/code/models/xc/ModelXcMetaFactory';
import ExpressXcPolicy from '../../db/sql-mgr/code/policies/xc/ExpressXcPolicy';
import NcHelp from '../NcHelp';
import XcCache from '../../v1-legacy/plugins/adapters/cache/XcCache';
import BaseModel from './BaseModel';
import { XcCron } from './XcCron';
import NcConnectionMgr from './NcConnectionMgr';
@ -27,12 +22,7 @@ import type NcProjectBuilder from '../../v1-legacy/NcProjectBuilder';
import type { BaseModelSql, XKnex } from '../../db/sql-data-mapper';
import type { Acls, DbConfig, NcConfig } from '../../../interface/config';
import type XcDynamicChanges from '../../../interface/XcDynamicChanges';
import type {
MysqlClient,
PgClient,
SqlClient,
// SqlClientFactory,
} from 'nc-help';
import type { MysqlClient, PgClient, SqlClient } from 'nc-help';
const log = debug('nc:api:base');

1
packages/nocodb/src/lib/utils/common/BaseProcedure.ts

@ -1,6 +1,5 @@
import type { GqlApiBuilder } from '../../v1-legacy/gql/GqlApiBuilder';
import type { RestApiBuilder } from '../../v1-legacy/rest/RestApiBuilder';
import type XcProcedure from './XcProcedure';
export default class BaseProcedure {

1
packages/nocodb/src/lib/utils/common/NcConnectionMgr.ts

@ -5,7 +5,6 @@ import { XKnex } from '../../db/sql-data-mapper';
import { defaultConnectionConfig } from '../NcConfigFactory';
import type { NcConfig } from '../../../interface/config';
import type { Knex } from 'knex';
import type NcMetaIO from '../../meta/NcMetaIO';
export default class NcConnectionMgr {

4
packages/nocodb/src/lib/utils/common/XcCron.ts

@ -1,12 +1,8 @@
import { CronJob } from 'cron';
import type { NcConfig } from '../../../interface/config';
import type Noco from '../../Noco';
import type BaseApiBuilder from './BaseApiBuilder';
// import * as tsc from "typescript";
export class XcCron {
// @ts-ignore
private app: Noco;

3
packages/nocodb/src/lib/v1-legacy/NcProjectBuilder.ts

@ -1,14 +1,11 @@
import fs from 'fs';
import path from 'path';
import { promisify } from 'util';
import axios from 'axios';
import { Router } from 'express';
import { T } from 'nc-help';
import SqlClientFactory from '../db/sql-client/lib/SqlClientFactory';
import Migrator from '../db/sql-migrator/lib/KnexMigrator';
import { XCEeError } from '../meta/NcMetaMgr';
import NcConnectionMgr from '../utils/common/NcConnectionMgr';
import { GqlApiBuilder } from './gql/GqlApiBuilder';

2
packages/nocodb/src/lib/v1-legacy/gql/GqlApiBuilder.ts

@ -5,13 +5,11 @@ import { execute } from 'graphql';
import { GraphQLJSON } from 'graphql-type-json';
import _ from 'lodash';
import { BaseType } from 'xc-core-ts';
import ExpressXcTsPolicyGql from '../../db/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql';
import GqlXcSchemaFactory from '../../db/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory';
import ModelXcMetaFactory from '../../db/sql-mgr/code/models/xc/ModelXcMetaFactory';
import NcHelp from '../../utils/NcHelp';
import BaseApiBuilder from '../../utils/common/BaseApiBuilder';
import { m2mNotChildren, m2mNotChildrenCount } from './GqlCommonResolvers';
import GqlMiddleware from './GqlMiddleware';
import { GqlProcedureResolver } from './GqlProcedureResolver';

6
packages/nocodb/src/lib/v1-legacy/gql/GqlAuthResolver.ts

@ -1,11 +1,9 @@
import { promisify } from 'util';
import bcrypt from 'bcryptjs';
import * as ejs from 'ejs';
import * as jwt from 'jsonwebtoken';
import passport from 'passport';
import { ExtractJwt, Strategy } from 'passport-jwt';
import authSchema from './auth/schema';
import type IEmailAdapter from '../../../interface/IEmailAdapter';
import type { DbConfig, NcConfig } from '../../../interface/config';
@ -13,10 +11,12 @@ import type { Knex, XKnex } from '../../db/sql-data-mapper';
import type Noco from '../../Noco';
const { v4: uuidv4 } = require('uuid');
const PassportLocalStrategy = require('passport-local').Strategy;
const autoBind = require('auto-bind');
const { isEmail } = require('validator');
// import swaggerUi from 'swagger-ui-express';
passport.serializeUser(function (
{ id, email, email_verified, roles, provider, firstname, lastname },

1
packages/nocodb/src/lib/v1-legacy/gql/GqlMiddleware.ts

@ -1,6 +1,5 @@
import autoBind from 'auto-bind';
import Handlebars from 'handlebars';
import type { Acls } from '../../../interface/config';
export default class GqlMiddleware {

2
packages/nocodb/src/lib/v1-legacy/gql/GqlProcedureResolver.ts

@ -1,8 +1,6 @@
import autoBind from 'auto-bind';
import BaseProcedure from '../../utils/common/BaseProcedure';
import XcProcedure from '../../utils/common/XcProcedure';
import GqlBaseResolver from './GqlBaseResolver';
import type { GqlApiBuilder } from './GqlApiBuilder';

1
packages/nocodb/src/lib/v1-legacy/gql/GqlResolver.ts

@ -1,5 +1,4 @@
import autoBind from 'auto-bind';
import GqlBaseResolver from './GqlBaseResolver';
import GqlMiddleware from './GqlMiddleware';
import type { Acls } from '../../../interface/config';

2
packages/nocodb/src/lib/v1-legacy/nc.try.ts

@ -1,8 +1,6 @@
import cors from 'cors';
import express from 'express';
import NcConfigFactory from '../utils/NcConfigFactory';
import Noco from '../Noco';
export default async function (dbUrl): Promise<void> {

2
packages/nocodb/src/lib/v1-legacy/plugins/NcPluginMgr.ts

@ -3,7 +3,6 @@ import {
XcStoragePlugin,
XcWebhookNotificationPlugin,
} from 'nc-plugin';
import BackblazePluginConfig from '../../plugins/backblaze';
import DiscordPluginConfig from '../../plugins/discord';
import GcsPluginConfig from '../../plugins/gcs';
@ -26,7 +25,6 @@ import SESPluginConfig from '../../plugins/ses';
import Local from './adapters/storage/Local';
import type Noco from '../../Noco';
import type NcMetaIO from '../../meta/NcMetaIO';
import type {
IEmailAdapter,
IStorageAdapter,

1
packages/nocodb/src/lib/v1-legacy/plugins/adapters/email/SMTP.ts

@ -1,7 +1,6 @@
// @ts-ignore
import nodemailer from 'nodemailer';
import type Mail from 'nodemailer/lib/mailer';
import type { XcEmail } from '../../../../../interface/IEmailAdapter';
import type IEmailAdapter from '../../../../../interface/IEmailAdapter';

2
packages/nocodb/src/lib/v1-legacy/plugins/adapters/storage/Local.ts

@ -1,9 +1,7 @@
import fs from 'fs';
import path from 'path';
import { promisify } from 'util';
import mkdirp from 'mkdirp';
import axios from 'axios';
import NcConfigFactory from '../../../../utils/NcConfigFactory';
import type { IStorageAdapterV2, XcFile } from 'nc-plugin';

1
packages/nocodb/src/lib/v1-legacy/plugins/ses.ts

@ -1,5 +1,4 @@
// @wingkwong: Deprecated. Moved to nocodb/packages/nocodb/src/plugins/ses instead. Keep this file for migration only.
import { XcActionType, XcType } from 'nocodb-sdk';
import type { XcForm } from 'nocodb-sdk';

9
packages/nocodb/src/lib/v1-legacy/rest/RestApiBuilder.ts

@ -1,13 +1,11 @@
import fs from 'fs';
import path from 'path';
import { promisify } from 'util';
import { URL } from 'url';
import * as ejs from 'ejs';
import { Router } from 'express';
import { glob } from 'glob';
import mkdirp from 'mkdirp';
import debug from 'debug';
import autoBind from 'auto-bind';
import ModelXcMetaFactory from '../../db/sql-mgr/code/models/xc/ModelXcMetaFactory';
@ -24,7 +22,6 @@ import BaseApiBuilder, {
import Column from '../../models/Column';
import { MetaTable } from '../../utils/globals';
import { RestCtrl } from './RestCtrl';
import { RestCtrlBelongsTo } from './RestCtrlBelongsTo';
import { RestCtrlCustom } from './RestCtrlCustom';
import { RestCtrlHasMany } from './RestCtrlHasMany';
@ -35,15 +32,11 @@ import type {
XcTablesPopulateParams,
} from '../../utils/common/BaseApiBuilder';
import type Noco from '../../Noco';
// import NocoTypeGenerator from '../v1-legacy-resolver/NocoTypeGenerator';
// import NocoResolverGenerator from '../v1-legacy-resolver/NocoResolverGenerator';
// import { RestCtrlv2 } from './RestCtrlv2';
// import registerRestCtrl from './registerRestCtrl';
import type { DbConfig, NcConfig } from '../../../interface/config';
import type NcProjectBuilder from '../NcProjectBuilder';
// import { BaseModelSqlv2 } from '../../sql-data-mapper/lib/sql/BaseModelSqlv2';
const log = debug('nc:api:rest');
const NC_CUSTOM_ROUTE_KEY = '__xc_custom';
export class RestApiBuilder extends BaseApiBuilder<Noco> {

5
packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts

@ -9,7 +9,6 @@ import { Strategy as GithubStrategy } from 'passport-github';
import { Strategy as GoogleStrategy } from 'passport-google-oauth20';
import { ExtractJwt, Strategy } from 'passport-jwt';
import validator from 'validator';
import { Strategy as CustomStrategy } from 'passport-custom';
import axios from 'axios';
import { T } from 'nc-help';
@ -17,13 +16,15 @@ import XcCache from '../plugins/adapters/cache/XcCache';
import type { DbConfig, NcConfig } from '../../../interface/config';
import type { Knex } from '../../db/sql-data-mapper';
import type Noco from '../../Noco';
import type NcMetaIO from '../../meta/NcMetaIO';
import type IEmailAdapter from '../../../interface/IEmailAdapter';
const autoBind = require('auto-bind');
const PassportLocalStrategy = require('passport-local').Strategy;
const { v4: uuidv4 } = require('uuid');
const { isEmail } = require('validator');
passport.serializeUser(function (

2
packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrlEE.ts

@ -3,9 +3,7 @@ import { Strategy } from 'passport-jwt';
import { v4 as uuidv4 } from 'uuid';
import validator from 'validator';
import { T } from 'nc-help';
import XcCache from '../plugins/adapters/cache/XcCache';
import RestAuthCtrl from './RestAuthCtrl';
export default class RestAuthCtrlEE extends RestAuthCtrl {

1
packages/nocodb/src/lib/v1-legacy/rest/RestBaseCtrl.ts

@ -1,6 +1,5 @@
import Handlebars from 'handlebars';
import type { Handler, NextFunction, Request, Response, Router } from 'express';
import type { Route } from '../../../interface/config';
export abstract class RestBaseCtrl {

2
packages/nocodb/src/lib/v1-legacy/rest/RestCtrl.ts

@ -2,10 +2,8 @@ import autoBind from 'auto-bind';
import { Router } from 'express';
import { RestBaseCtrl } from './RestBaseCtrl';
import type { NextFunction, Request, Response } from 'express';
import type { Acl, Acls, Route } from '../../../interface/config';
import type { BaseModelSql } from '../../db/sql-data-mapper';
import type { BaseModelSqlv2 } from '../../db/sql-data-mapper/lib/sql/BaseModelSqlv2';
function parseHrtimeToSeconds(hrtime) {

1
packages/nocodb/src/lib/v1-legacy/rest/RestCtrlBelongsTo.ts

@ -1,7 +1,6 @@
import autoBind from 'auto-bind';
import { RestBaseCtrl } from './RestBaseCtrl';
import type { NextFunction, Request, Response } from 'express';
import type { Acl, Acls, Route } from '../../../interface/config';
import type { BaseModelSql } from '../../db/sql-data-mapper';

1
packages/nocodb/src/lib/v1-legacy/rest/RestCtrlCustom.ts

@ -2,7 +2,6 @@ import autoBind from 'auto-bind';
import { Router } from 'express';
import { RestBaseCtrl } from './RestBaseCtrl';
import type { NextFunction, Request, Response } from 'express';
import type { Route } from '../../../interface/config';
import type { BaseModelSql } from '../../db/sql-data-mapper';

1
packages/nocodb/src/lib/v1-legacy/rest/RestCtrlHasMany.ts

@ -1,7 +1,6 @@
import autoBind from 'auto-bind';
import { RestBaseCtrl } from './RestBaseCtrl';
import type { NextFunction, Request, Response } from 'express';
import type { Acl, Acls, Route } from '../../../interface/config';
import type { BaseModelSql } from '../../db/sql-data-mapper';

1
packages/nocodb/src/lib/v1-legacy/rest/RestCtrlMin.ts

@ -1,6 +1,5 @@
import autoBind from 'auto-bind';
import type { Request, Response, Router } from 'express';
import type { Acls } from '../../../interface/config';
import type { BaseModelSql } from '../../db/sql-data-mapper';

2
packages/nocodb/src/lib/v1-legacy/rest/RestCtrlProcedure.ts

@ -1,9 +1,7 @@
import autoBind from 'auto-bind';
import BaseProcedure from '../../utils/common/BaseProcedure';
import XcProcedure from '../../utils/common/XcProcedure';
import type { Handler, NextFunction, Request, Response, Router } from 'express';
import type { RestApiBuilder } from './RestApiBuilder';
export class RestCtrlProcedure extends BaseProcedure {

2
packages/nocodb/src/lib/v1-legacy/rest/RestCtrlv2.ts

@ -1,9 +1,7 @@
import autoBind from 'auto-bind';
import type { Router } from 'express';
import type { Acls } from '../../../interface/config';
import type { BaseModelSql } from '../../db/sql-data-mapper';
import type { BaseModelSqlv2 } from '../../db/sql-data-mapper/lib/sql/BaseModelSqlv2';
// import { nocoExecute } from '../v1-legacy-resolver/NocoExecute';

2
packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts

@ -6,7 +6,6 @@ import ncAttachmentUpgrader_0104002 from './ncAttachmentUpgrader_0104002';
import ncStickyColumnUpgrader from './ncStickyColumnUpgrader';
import ncFilterUpgrader_0104004 from './ncFilterUpgrader_0104004';
import ncFilterUpgrader_0105003 from './ncFilterUpgrader_0105003';
import ncFilterUpgrader from './ncFilterUpgrader';
import ncProjectRolesUpgrader from './ncProjectRolesUpgrader';
import ncDataTypesUpgrader from './ncDataTypesUpgrader';
@ -15,6 +14,7 @@ import ncProjectEnvUpgrader0011045 from './ncProjectEnvUpgrader0011045';
import ncProjectEnvUpgrader from './ncProjectEnvUpgrader';
import type { NcConfig } from '../../interface/config';
import type NcMetaIO from '../meta/NcMetaIO';
const log = debug('nc:version-upgrader');
export interface NcUpgraderCtx {

1
packages/nocodb/src/run/docker.ts

@ -1,6 +1,5 @@
import cors from 'cors';
import express from 'express';
import Noco from '../lib/Noco';
const server = express();

1
packages/nocodb/src/run/dockerRunMysql.ts

@ -1,6 +1,5 @@
import cors from 'cors';
import express from 'express';
import Noco from '../lib/Noco';
const server = express();

1
packages/nocodb/src/run/dockerRunPG.ts

@ -1,6 +1,5 @@
import cors from 'cors';
import express from 'express';
import Noco from '../lib/Noco';
const server = express();

1
packages/nocodb/src/run/dockerRunPG_CyQuick.ts

@ -1,6 +1,5 @@
import cors from 'cors';
import express from 'express';
import Noco from '../lib/Noco';
const server = express();

2
packages/nocodb/src/run/testDocker.ts

@ -1,9 +1,9 @@
import axios from 'axios';
import cors from 'cors';
import express from 'express';
import Noco from '../lib/Noco';
import User from '../lib/models/User';
process.env.NC_VERSION = '0009044';
const server = express();

1
packages/nocodb/src/run/try.ts

@ -1,6 +1,5 @@
import cors from 'cors';
import express from 'express';
import { NcConfigFactory, Noco } from '../lib';
process.env.DATABASE_URL = 'mysql://root:password@localhost:3306/sakila';

1
packages/nocodb/tests/unit/index.test.ts

@ -1,5 +1,4 @@
import 'mocha';
import restTests from './rest/index.test';
import modelTests from './model/index.test';
import TestDbMngr from './TestDbMngr'

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save