Browse Source

refactor: folder structure

pull/2250/head
Naveen MR 3 years ago
parent
commit
17fd6fe724
  1. 2
      packages/nocodb/src/__tests__/TemplateParser.test.ts
  2. 4
      packages/nocodb/src/__tests__/formula.test.ts
  3. 0
      packages/nocodb/src/lib/cache/CacheMgr.ts
  4. 0
      packages/nocodb/src/lib/cache/NocoCache.ts
  5. 0
      packages/nocodb/src/lib/cache/RedisCacheMgr.ts
  6. 0
      packages/nocodb/src/lib/cache/RedisMockCacheMgr.ts
  7. 0
      packages/nocodb/src/lib/jobs/EmitteryJobsMgr.ts
  8. 0
      packages/nocodb/src/lib/jobs/JobsMgr.ts
  9. 0
      packages/nocodb/src/lib/jobs/NocoJobs.ts
  10. 0
      packages/nocodb/src/lib/jobs/RedisJobsMgr.ts
  11. 6
      packages/nocodb/src/lib/migrations/nc_001_init.ts
  12. 0
      packages/nocodb/src/lib/migrations/nc_002_add_m2m.ts
  13. 0
      packages/nocodb/src/lib/migrations/nc_003_add_fkn_column.ts
  14. 0
      packages/nocodb/src/lib/migrations/nc_004_add_view_type_column.ts
  15. 0
      packages/nocodb/src/lib/migrations/nc_005_add_view_name_column.ts
  16. 0
      packages/nocodb/src/lib/migrations/nc_006_alter_nc_shared_views.ts
  17. 0
      packages/nocodb/src/lib/migrations/nc_007_alter_nc_shared_views_1.ts
  18. 0
      packages/nocodb/src/lib/migrations/nc_008_add_nc_shared_bases.ts
  19. 0
      packages/nocodb/src/lib/migrations/nc_009_add_model_order.ts
  20. 0
      packages/nocodb/src/lib/migrations/nc_010_add_parent_title_column.ts
  21. 2
      packages/nocodb/src/lib/migrations/nc_011_remove_old_ses_plugin.ts
  22. 2
      packages/nocodb/src/lib/migrationsv2/nc_011.ts
  23. 2
      packages/nocodb/src/lib/migrationsv2/nc_012_alter_column_data_types.ts
  24. 2
      packages/nocodb/src/lib/migrationsv2/nc_013_sync_source.ts
  25. 2
      packages/nocodb/src/lib/migrationsv2/nc_014_alter_column_data_types.ts
  26. 2
      packages/nocodb/src/lib/migrationsv2/nc_015_add_meta_col_in_column_table.ts
  27. 2
      packages/nocodb/src/lib/migrationsv2/nc_016_alter_hooklog_payload_types.ts
  28. 2
      packages/nocodb/src/lib/models/ApiToken.ts
  29. 0
      packages/nocodb/src/lib/models/Audit.ts
  30. 2
      packages/nocodb/src/lib/models/Base.ts
  31. 2
      packages/nocodb/src/lib/models/Column.ts
  32. 2
      packages/nocodb/src/lib/models/Filter.ts
  33. 2
      packages/nocodb/src/lib/models/FormView.ts
  34. 2
      packages/nocodb/src/lib/models/FormViewColumn.ts
  35. 2
      packages/nocodb/src/lib/models/FormulaColumn.ts
  36. 2
      packages/nocodb/src/lib/models/GalleryView.ts
  37. 2
      packages/nocodb/src/lib/models/GalleryViewColumn.ts
  38. 2
      packages/nocodb/src/lib/models/GridView.ts
  39. 2
      packages/nocodb/src/lib/models/GridViewColumn.ts
  40. 2
      packages/nocodb/src/lib/models/Hook.ts
  41. 2
      packages/nocodb/src/lib/models/HookFilter.ts
  42. 0
      packages/nocodb/src/lib/models/HookLog.ts
  43. 0
      packages/nocodb/src/lib/models/KanbanView.ts
  44. 4
      packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts
  45. 4
      packages/nocodb/src/lib/models/LookupColumn.ts
  46. 6
      packages/nocodb/src/lib/models/Model.ts
  47. 2
      packages/nocodb/src/lib/models/ModelRoleVisibility.ts
  48. 2
      packages/nocodb/src/lib/models/MultiSelectColumn.ts
  49. 2
      packages/nocodb/src/lib/models/Plugin.ts
  50. 4
      packages/nocodb/src/lib/models/Project.ts
  51. 2
      packages/nocodb/src/lib/models/ProjectUser.ts
  52. 2
      packages/nocodb/src/lib/models/RollupColumn.ts
  53. 2
      packages/nocodb/src/lib/models/SingleSelectColumn.ts
  54. 2
      packages/nocodb/src/lib/models/Sort.ts
  55. 0
      packages/nocodb/src/lib/models/SyncLogs.ts
  56. 0
      packages/nocodb/src/lib/models/SyncSource.ts
  57. 2
      packages/nocodb/src/lib/models/User.ts
  58. 2
      packages/nocodb/src/lib/models/View.ts
  59. 8
      packages/nocodb/src/lib/noco/NcProjectBuilder.ts
  60. 6
      packages/nocodb/src/lib/noco/Noco.ts
  61. 6
      packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts
  62. 2
      packages/nocodb/src/lib/noco/common/BaseModel.ts
  63. 2
      packages/nocodb/src/lib/noco/common/NcConnectionMgr.ts
  64. 4
      packages/nocodb/src/lib/noco/common/NcConnectionMgrv2.ts
  65. 22
      packages/nocodb/src/lib/noco/common/XcMigrationSource.ts
  66. 12
      packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts
  67. 6
      packages/nocodb/src/lib/noco/gql/GqlApiBuilder.ts
  68. 2
      packages/nocodb/src/lib/noco/gql/GqlAuthResolver.ts
  69. 2
      packages/nocodb/src/lib/noco/gql/GqlCommonResolvers.ts
  70. 2
      packages/nocodb/src/lib/noco/gql/GqlResolver.ts
  71. 2
      packages/nocodb/src/lib/noco/meta/MetaAPILogger.ts
  72. 2
      packages/nocodb/src/lib/noco/meta/NcMetaIO.ts
  73. 2
      packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts
  74. 10
      packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts
  75. 2
      packages/nocodb/src/lib/noco/meta/NcMetaMgrv2.ts
  76. 2
      packages/nocodb/src/lib/noco/meta/api/apiTokenApis.ts
  77. 4
      packages/nocodb/src/lib/noco/meta/api/auditApis.ts
  78. 2
      packages/nocodb/src/lib/noco/meta/api/cacheApis.ts
  79. 22
      packages/nocodb/src/lib/noco/meta/api/columnApis.ts
  80. 4
      packages/nocodb/src/lib/noco/meta/api/dataApis/bulkDataAliasApis.ts
  81. 8
      packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts
  82. 4
      packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasNestedApis.ts
  83. 8
      packages/nocodb/src/lib/noco/meta/api/dataApis/dataApis.ts
  84. 16
      packages/nocodb/src/lib/noco/meta/api/dataApis/helpers.ts
  85. 10
      packages/nocodb/src/lib/noco/meta/api/dataApis/oldDataApis.ts
  86. 2
      packages/nocodb/src/lib/noco/meta/api/exportApis.ts
  87. 8
      packages/nocodb/src/lib/noco/meta/api/filterApis.ts
  88. 10
      packages/nocodb/src/lib/noco/meta/api/formViewApis.ts
  89. 2
      packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts
  90. 4
      packages/nocodb/src/lib/noco/meta/api/galleryViewApis.ts
  91. 8
      packages/nocodb/src/lib/noco/meta/api/gridViewApis.ts
  92. 2
      packages/nocodb/src/lib/noco/meta/api/gridViewColumnApis.ts
  93. 4
      packages/nocodb/src/lib/noco/meta/api/hookApis.ts
  94. 8
      packages/nocodb/src/lib/noco/meta/api/hookFilterApis.ts
  95. 12
      packages/nocodb/src/lib/noco/meta/api/metaDiffApis.ts
  96. 6
      packages/nocodb/src/lib/noco/meta/api/modelVisibilityApis.ts
  97. 2
      packages/nocodb/src/lib/noco/meta/api/pluginApis.ts
  98. 12
      packages/nocodb/src/lib/noco/meta/api/projectApis.ts
  99. 8
      packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts
  100. 12
      packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataApis.ts
  101. Some files were not shown because too many files have changed in this diff Show More

2
packages/nocodb/src/__tests__/TemplateParser.test.ts

@ -1,6 +1,6 @@
import { expect } from 'chai'; import { expect } from 'chai';
import 'mocha'; import 'mocha';
import NcTemplateParser from '../lib/templateParser/NcTemplateParser'; import NcTemplateParser from '../lib/template-parser/NcTemplateParser';
import template from './template'; import template from './template';
describe('Template parser', () => { describe('Template parser', () => {

4
packages/nocodb/src/__tests__/formula.test.ts

@ -1,7 +1,7 @@
import { expect } from 'chai'; import { expect } from 'chai';
import 'mocha'; import 'mocha';
import knex from '../lib/dataMapper/lib/sql/CustomKnex'; import knex from '../lib/sql-data-mapper/lib/sql/CustomKnex';
import formulaQueryBuilderFromString from '../lib/dataMapper/lib/sql/formulaQueryBuilderFromString'; import formulaQueryBuilderFromString from '../lib/sql-data-mapper/lib/sql/formulaQueryBuilderFromString';
process.env.TEST = 'test'; process.env.TEST = 'test';

0
packages/nocodb/src/lib/noco-cache/CacheMgr.ts → packages/nocodb/src/lib/cache/CacheMgr.ts vendored

0
packages/nocodb/src/lib/noco-cache/NocoCache.ts → packages/nocodb/src/lib/cache/NocoCache.ts vendored

0
packages/nocodb/src/lib/noco-cache/RedisCacheMgr.ts → packages/nocodb/src/lib/cache/RedisCacheMgr.ts vendored

0
packages/nocodb/src/lib/noco-cache/RedisMockCacheMgr.ts → packages/nocodb/src/lib/cache/RedisMockCacheMgr.ts vendored

0
packages/nocodb/src/lib/noco-jobs/EmitteryJobsMgr.ts → packages/nocodb/src/lib/jobs/EmitteryJobsMgr.ts

0
packages/nocodb/src/lib/noco-jobs/JobsMgr.ts → packages/nocodb/src/lib/jobs/JobsMgr.ts

0
packages/nocodb/src/lib/noco-jobs/NocoJobs.ts → packages/nocodb/src/lib/jobs/NocoJobs.ts

0
packages/nocodb/src/lib/noco-jobs/RedisJobsMgr.ts → packages/nocodb/src/lib/jobs/RedisJobsMgr.ts

6
packages/nocodb/src/lib/noco/migrations/nc_001_init.ts → packages/nocodb/src/lib/migrations/nc_001_init.ts

@ -1,6 +1,6 @@
import cache from '../plugins/cache'; import cache from '../noco/plugins/cache';
import googleAuth from '../plugins/googleAuth'; import googleAuth from '../noco/plugins/googleAuth';
import ses from '../plugins/ses'; import ses from '../noco/plugins/ses';
const up = async knex => { const up = async knex => {
await knex.schema.createTable('nc_projects', table => { await knex.schema.createTable('nc_projects', table => {

0
packages/nocodb/src/lib/noco/migrations/nc_002_add_m2m.ts → packages/nocodb/src/lib/migrations/nc_002_add_m2m.ts

0
packages/nocodb/src/lib/noco/migrations/nc_003_add_fkn_column.ts → packages/nocodb/src/lib/migrations/nc_003_add_fkn_column.ts

0
packages/nocodb/src/lib/noco/migrations/nc_004_add_view_type_column.ts → packages/nocodb/src/lib/migrations/nc_004_add_view_type_column.ts

0
packages/nocodb/src/lib/noco/migrations/nc_005_add_view_name_column.ts → packages/nocodb/src/lib/migrations/nc_005_add_view_name_column.ts

0
packages/nocodb/src/lib/noco/migrations/nc_006_alter_nc_shared_views.ts → packages/nocodb/src/lib/migrations/nc_006_alter_nc_shared_views.ts

0
packages/nocodb/src/lib/noco/migrations/nc_007_alter_nc_shared_views_1.ts → packages/nocodb/src/lib/migrations/nc_007_alter_nc_shared_views_1.ts

0
packages/nocodb/src/lib/noco/migrations/nc_008_add_nc_shared_bases.ts → packages/nocodb/src/lib/migrations/nc_008_add_nc_shared_bases.ts

0
packages/nocodb/src/lib/noco/migrations/nc_009_add_model_order.ts → packages/nocodb/src/lib/migrations/nc_009_add_model_order.ts

0
packages/nocodb/src/lib/noco/migrations/nc_010_add_parent_title_column.ts → packages/nocodb/src/lib/migrations/nc_010_add_parent_title_column.ts

2
packages/nocodb/src/lib/noco/migrations/nc_011_remove_old_ses_plugin.ts → packages/nocodb/src/lib/migrations/nc_011_remove_old_ses_plugin.ts

@ -1,5 +1,5 @@
import Knex from 'knex'; import Knex from 'knex';
import ses from '../plugins/ses'; import ses from '../noco/plugins/ses';
const up = async (knex: Knex) => { const up = async (knex: Knex) => {
await knex('nc_plugins').del().where({title: "SES"}); await knex('nc_plugins').del().where({title: "SES"});

2
packages/nocodb/src/lib/noco/migrationsv2/nc_011.ts → packages/nocodb/src/lib/migrationsv2/nc_011.ts

@ -1,4 +1,4 @@
import { MetaTable } from '../../utils/globals'; import { MetaTable } from '../utils/globals';
// import googleAuth from '../plugins/googleAuth'; // import googleAuth from '../plugins/googleAuth';
// import ses from '../plugins/ses'; // import ses from '../plugins/ses';
// import cache from '../plugins/cache'; // import cache from '../plugins/cache';

2
packages/nocodb/src/lib/noco/migrationsv2/nc_012_alter_column_data_types.ts → packages/nocodb/src/lib/migrationsv2/nc_012_alter_column_data_types.ts

@ -1,5 +1,5 @@
import Knex from 'knex'; import Knex from 'knex';
import { MetaTable } from '../../utils/globals'; import { MetaTable } from '../utils/globals';
const up = async (knex: Knex) => { const up = async (knex: Knex) => {
if (knex.client.config.client !== 'sqlite3') { if (knex.client.config.client !== 'sqlite3') {

2
packages/nocodb/src/lib/noco/migrationsv2/nc_013_sync_source.ts → packages/nocodb/src/lib/migrationsv2/nc_013_sync_source.ts

@ -1,5 +1,5 @@
import Knex from 'knex'; import Knex from 'knex';
import { MetaTable } from '../../utils/globals'; import { MetaTable } from '../utils/globals';
const up = async (knex: Knex) => { const up = async (knex: Knex) => {
await knex.schema.createTable(MetaTable.SYNC_SOURCE, table => { await knex.schema.createTable(MetaTable.SYNC_SOURCE, table => {

2
packages/nocodb/src/lib/noco/migrationsv2/nc_014_alter_column_data_types.ts → packages/nocodb/src/lib/migrationsv2/nc_014_alter_column_data_types.ts

@ -1,5 +1,5 @@
import Knex from 'knex'; import Knex from 'knex';
import { MetaTable } from '../../utils/globals'; import { MetaTable } from '../utils/globals';
const up = async (knex: Knex) => { const up = async (knex: Knex) => {
if (knex.client.config.client !== 'sqlite3') { if (knex.client.config.client !== 'sqlite3') {

2
packages/nocodb/src/lib/noco/migrationsv2/nc_015_add_meta_col_in_column_table.ts → packages/nocodb/src/lib/migrationsv2/nc_015_add_meta_col_in_column_table.ts

@ -1,5 +1,5 @@
import Knex from 'knex'; import Knex from 'knex';
import { MetaTable } from '../../utils/globals'; import { MetaTable } from '../utils/globals';
const up = async (knex: Knex) => { const up = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.COLUMNS, table => { await knex.schema.alterTable(MetaTable.COLUMNS, table => {

2
packages/nocodb/src/lib/noco/migrationsv2/nc_016_alter_hooklog_payload_types.ts → packages/nocodb/src/lib/migrationsv2/nc_016_alter_hooklog_payload_types.ts

@ -1,5 +1,5 @@
import Knex from 'knex'; import Knex from 'knex';
import { MetaTable } from '../../utils/globals'; import { MetaTable } from '../utils/globals';
const up = async (knex: Knex) => { const up = async (knex: Knex) => {
if (knex.client.config.client !== 'sqlite3') { if (knex.client.config.client !== 'sqlite3') {

2
packages/nocodb/src/lib/noco-models/ApiToken.ts → packages/nocodb/src/lib/models/ApiToken.ts

@ -6,7 +6,7 @@ import {
} from '../utils/globals'; } from '../utils/globals';
import Noco from '../noco/Noco'; import Noco from '../noco/Noco';
import { nanoid } from 'nanoid'; import { nanoid } from 'nanoid';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class ApiToken { export default class ApiToken {
project_id?: string; project_id?: string;

0
packages/nocodb/src/lib/noco-models/Audit.ts → packages/nocodb/src/lib/models/Audit.ts

2
packages/nocodb/src/lib/noco-models/Base.ts → packages/nocodb/src/lib/models/Base.ts

@ -8,7 +8,7 @@ import {
} from '../utils/globals'; } from '../utils/globals';
import Model from './Model'; import Model from './Model';
import { BaseType } from 'nocodb-sdk'; import { BaseType } from 'nocodb-sdk';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import CryptoJS from 'crypto-js'; import CryptoJS from 'crypto-js';
import extractProps from '../noco/meta/helpers/extractProps'; import extractProps from '../noco/meta/helpers/extractProps';

2
packages/nocodb/src/lib/noco-models/Column.ts → packages/nocodb/src/lib/models/Column.ts

@ -5,7 +5,7 @@ import RollupColumn from './RollupColumn';
import SingleSelectColumn from './SingleSelectColumn'; import SingleSelectColumn from './SingleSelectColumn';
import MultiSelectColumn from './MultiSelectColumn'; import MultiSelectColumn from './MultiSelectColumn';
import Model from './Model'; import Model from './Model';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import { ColumnType, UITypes } from 'nocodb-sdk'; import { ColumnType, UITypes } from 'nocodb-sdk';
import { import {
CacheDelDirection, CacheDelDirection,

2
packages/nocodb/src/lib/noco-models/Filter.ts → packages/nocodb/src/lib/models/Filter.ts

@ -9,7 +9,7 @@ import {
} from '../utils/globals'; } from '../utils/globals';
import View from './View'; import View from './View';
import { FilterType, UITypes } from 'nocodb-sdk'; import { FilterType, UITypes } from 'nocodb-sdk';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class Filter { export default class Filter {
id: string; id: string;

2
packages/nocodb/src/lib/noco-models/FormView.ts → packages/nocodb/src/lib/models/FormView.ts

@ -3,7 +3,7 @@ import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import { FormType } from 'nocodb-sdk'; import { FormType } from 'nocodb-sdk';
import FormViewColumn from './FormViewColumn'; import FormViewColumn from './FormViewColumn';
import View from './View'; import View from './View';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class FormView implements FormType { export default class FormView implements FormType {
show: boolean; show: boolean;

2
packages/nocodb/src/lib/noco-models/FormViewColumn.ts → packages/nocodb/src/lib/models/FormViewColumn.ts

@ -2,7 +2,7 @@ import Noco from '../noco/Noco';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import { FormColumnType } from 'nocodb-sdk'; import { FormColumnType } from 'nocodb-sdk';
import View from './View'; import View from './View';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import extractProps from '../noco/meta/helpers/extractProps'; import extractProps from '../noco/meta/helpers/extractProps';
export default class FormViewColumn implements FormColumnType { export default class FormViewColumn implements FormColumnType {

2
packages/nocodb/src/lib/noco-models/FormulaColumn.ts → packages/nocodb/src/lib/models/FormulaColumn.ts

@ -1,6 +1,6 @@
import Noco from '../../lib/noco/Noco'; import Noco from '../../lib/noco/Noco';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import extractProps from '../noco/meta/helpers/extractProps'; import extractProps from '../noco/meta/helpers/extractProps';
export default class FormulaColumn { export default class FormulaColumn {

2
packages/nocodb/src/lib/noco-models/GalleryView.ts → packages/nocodb/src/lib/models/GalleryView.ts

@ -2,7 +2,7 @@ import Noco from '../noco/Noco';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import { GalleryColumnType, GalleryType, UITypes } from 'nocodb-sdk'; import { GalleryColumnType, GalleryType, UITypes } from 'nocodb-sdk';
import View from './View'; import View from './View';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class GalleryView implements GalleryType { export default class GalleryView implements GalleryType {
fk_view_id?: string; fk_view_id?: string;

2
packages/nocodb/src/lib/noco-models/GalleryViewColumn.ts → packages/nocodb/src/lib/models/GalleryViewColumn.ts

@ -1,7 +1,7 @@
import Noco from '../noco/Noco'; import Noco from '../noco/Noco';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import View from './View'; import View from './View';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class GalleryViewColumn { export default class GalleryViewColumn {
id: string; id: string;

2
packages/nocodb/src/lib/noco-models/GridView.ts → packages/nocodb/src/lib/models/GridView.ts

@ -2,7 +2,7 @@ import Noco from '../noco/Noco';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import GridViewColumn from './GridViewColumn'; import GridViewColumn from './GridViewColumn';
import View from './View'; import View from './View';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class GridView { export default class GridView {
title: string; title: string;

2
packages/nocodb/src/lib/noco-models/GridViewColumn.ts → packages/nocodb/src/lib/models/GridViewColumn.ts

@ -3,7 +3,7 @@ import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import { GridColumnType } from 'nocodb-sdk'; import { GridColumnType } from 'nocodb-sdk';
import extractProps from '../noco/meta/helpers/extractProps'; import extractProps from '../noco/meta/helpers/extractProps';
import View from './View'; import View from './View';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class GridViewColumn implements GridColumnType { export default class GridViewColumn implements GridColumnType {
id: string; id: string;

2
packages/nocodb/src/lib/noco-models/Hook.ts → packages/nocodb/src/lib/models/Hook.ts

@ -7,7 +7,7 @@ import {
} from '../utils/globals'; } from '../utils/globals';
import Noco from '../noco/Noco'; import Noco from '../noco/Noco';
import Model from './Model'; import Model from './Model';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import Filter from './Filter'; import Filter from './Filter';
import HookFilter from './HookFilter'; import HookFilter from './HookFilter';

2
packages/nocodb/src/lib/noco-models/HookFilter.ts → packages/nocodb/src/lib/models/HookFilter.ts

@ -9,7 +9,7 @@ import {
} from '../utils/globals'; } from '../utils/globals';
import View from './View'; import View from './View';
import { FilterType, UITypes } from 'nocodb-sdk'; import { FilterType, UITypes } from 'nocodb-sdk';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class Filter { export default class Filter {
id: string; id: string;

0
packages/nocodb/src/lib/noco-models/HookLog.ts → packages/nocodb/src/lib/models/HookLog.ts

0
packages/nocodb/src/lib/noco-models/KanbanView.ts → packages/nocodb/src/lib/models/KanbanView.ts

4
packages/nocodb/src/lib/noco-models/LinkToAnotherRecordColumn.ts → packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts

@ -1,9 +1,9 @@
import Noco from '../../lib/noco/Noco'; import Noco from '../../lib/noco/Noco';
import Column from './Column'; import Column from './Column';
import Model from './Model'; import Model from './Model';
// import NocoCache from '../noco-cache/NocoCache'; // import NocoCache from '../cache/NocoCache';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class LinkToAnotherRecordColumn { export default class LinkToAnotherRecordColumn {
fk_column_id?: string; fk_column_id?: string;

4
packages/nocodb/src/lib/noco-models/LookupColumn.ts → packages/nocodb/src/lib/models/LookupColumn.ts

@ -1,8 +1,8 @@
import Noco from '../../lib/noco/Noco'; import Noco from '../../lib/noco/Noco';
// import NocoCache from '../noco-cache/NocoCache'; // import NocoCache from '../cache/NocoCache';
import Column from './Column'; import Column from './Column';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class LookupColumn { export default class LookupColumn {
fk_relation_column_id: string; fk_relation_column_id: string;

6
packages/nocodb/src/lib/noco-models/Model.ts → packages/nocodb/src/lib/models/Model.ts

@ -1,8 +1,8 @@
import Noco from '../../lib/noco/Noco'; import Noco from '../../lib/noco/Noco';
import Column from './Column'; import Column from './Column';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import { XKnex } from '../dataMapper'; import { XKnex } from '../sql-data-mapper';
import { BaseModelSqlv2 } from '../dataMapper/lib/sql/BaseModelSqlv2'; import { BaseModelSqlv2 } from '../sql-data-mapper/lib/sql/BaseModelSqlv2';
import { import {
isVirtualCol, isVirtualCol,
ModelTypes, ModelTypes,

2
packages/nocodb/src/lib/noco-models/ModelRoleVisibility.ts → packages/nocodb/src/lib/models/ModelRoleVisibility.ts

@ -6,7 +6,7 @@ import {
CacheScope, CacheScope,
MetaTable MetaTable
} from '../utils/globals'; } from '../utils/globals';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import View from './View'; import View from './View';
export default class ModelRoleVisibility implements ModelRoleVisibilityType { export default class ModelRoleVisibility implements ModelRoleVisibilityType {

2
packages/nocodb/src/lib/noco-models/MultiSelectColumn.ts → packages/nocodb/src/lib/models/MultiSelectColumn.ts

@ -1,5 +1,5 @@
import Noco from '../../lib/noco/Noco'; import Noco from '../../lib/noco/Noco';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
export default class MultiSelectColumn { export default class MultiSelectColumn {

2
packages/nocodb/src/lib/noco-models/Plugin.ts → packages/nocodb/src/lib/models/Plugin.ts

@ -1,7 +1,7 @@
import { PluginType } from 'nocodb-sdk'; import { PluginType } from 'nocodb-sdk';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import Noco from '../noco/Noco'; import Noco from '../noco/Noco';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class Plugin implements PluginType { export default class Plugin implements PluginType {
id?: string; id?: string;

4
packages/nocodb/src/lib/noco-models/Project.ts → packages/nocodb/src/lib/models/Project.ts

@ -1,4 +1,4 @@
import Base from '../noco-models/Base'; import Base from './/Base';
import Noco from '../noco/Noco'; import Noco from '../noco/Noco';
import { ProjectType } from 'nocodb-sdk'; import { ProjectType } from 'nocodb-sdk';
import { import {
@ -8,7 +8,7 @@ import {
MetaTable MetaTable
} from '../utils/globals'; } from '../utils/globals';
import extractProps from '../noco/meta/helpers/extractProps'; import extractProps from '../noco/meta/helpers/extractProps';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class Project implements ProjectType { export default class Project implements ProjectType {
public id: string; public id: string;

2
packages/nocodb/src/lib/noco-models/ProjectUser.ts → packages/nocodb/src/lib/models/ProjectUser.ts

@ -5,7 +5,7 @@ import {
MetaTable MetaTable
} from '../utils/globals'; } from '../utils/globals';
import Noco from '../noco/Noco'; import Noco from '../noco/Noco';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import User from './User'; import User from './User';
export default class ProjectUser { export default class ProjectUser {

2
packages/nocodb/src/lib/noco-models/RollupColumn.ts → packages/nocodb/src/lib/models/RollupColumn.ts

@ -1,7 +1,7 @@
import Noco from '../../lib/noco/Noco'; import Noco from '../../lib/noco/Noco';
import Column from './Column'; import Column from './Column';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class RollupColumn { export default class RollupColumn {
fk_column_id; fk_column_id;

2
packages/nocodb/src/lib/noco-models/SingleSelectColumn.ts → packages/nocodb/src/lib/models/SingleSelectColumn.ts

@ -1,5 +1,5 @@
import Noco from '../../lib/noco/Noco'; import Noco from '../../lib/noco/Noco';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
export default class SingleSelectColumn { export default class SingleSelectColumn {

2
packages/nocodb/src/lib/noco-models/Sort.ts → packages/nocodb/src/lib/models/Sort.ts

@ -7,7 +7,7 @@ import {
CacheScope, CacheScope,
MetaTable MetaTable
} from '../utils/globals'; } from '../utils/globals';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import { SortType } from 'nocodb-sdk'; import { SortType } from 'nocodb-sdk';
export default class Sort { export default class Sort {

0
packages/nocodb/src/lib/noco-models/SyncLogs.ts → packages/nocodb/src/lib/models/SyncLogs.ts

0
packages/nocodb/src/lib/noco-models/SyncSource.ts → packages/nocodb/src/lib/models/SyncSource.ts

2
packages/nocodb/src/lib/noco-models/User.ts → packages/nocodb/src/lib/models/User.ts

@ -2,7 +2,7 @@ import { UserType } from 'nocodb-sdk';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import Noco from '../noco/Noco'; import Noco from '../noco/Noco';
import extractProps from '../noco/meta/helpers/extractProps'; import extractProps from '../noco/meta/helpers/extractProps';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
export default class User implements UserType { export default class User implements UserType {
id: number; id: number;

2
packages/nocodb/src/lib/noco-models/View.ts → packages/nocodb/src/lib/models/View.ts

@ -17,7 +17,7 @@ import { isSystemColumn, ViewType, ViewTypes } from 'nocodb-sdk';
import GalleryViewColumn from './GalleryViewColumn'; import GalleryViewColumn from './GalleryViewColumn';
import FormViewColumn from './FormViewColumn'; import FormViewColumn from './FormViewColumn';
import Column from './Column'; import Column from './Column';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import extractProps from '../noco/meta/helpers/extractProps'; import extractProps from '../noco/meta/helpers/extractProps';
const { v4: uuidv4 } = require('uuid'); const { v4: uuidv4 } = require('uuid');

8
packages/nocodb/src/lib/noco/NcProjectBuilder.ts

@ -6,7 +6,7 @@ import { Router } from 'express';
import { SqlClientFactory, Tele } from 'nc-help'; import { SqlClientFactory, Tele } from 'nc-help';
import { NcConfig } from '../../interface/config'; import { NcConfig } from '../../interface/config';
import Migrator from '../migrator/SqlMigrator/lib/KnexMigrator'; import Migrator from '../sql-migrator/lib/KnexMigrator';
import Noco from './Noco'; import Noco from './Noco';
import { GqlApiBuilder } from './gql/GqlApiBuilder'; import { GqlApiBuilder } from './gql/GqlApiBuilder';
@ -702,14 +702,14 @@ export default class NcProjectBuilder {
config: this.config, config: this.config,
projectId: this.id projectId: this.id
}); });
/* create migrator */ /* create sql-migrator */
const migrator = new Migrator({ const migrator = new Migrator({
project_id: this.id, project_id: this.id,
config: this.config, config: this.config,
metaDb: this.app?.ncMeta?.knex metaDb: this.app?.ncMeta?.knex
}); });
/* if migrator folder doesn't exist for project - call migratior init */ /* if sql-migrator folder doesn't exist for project - call migratior init */
const migrationFolder = path.join( const migrationFolder = path.join(
this.app.getToolDir(), this.app.getToolDir(),
'nc', 'nc',
@ -725,7 +725,7 @@ export default class NcProjectBuilder {
}); });
} }
/* migrator : sync & up */ /* sql-migrator : sync & up */
await migrator.sync({ await migrator.sync({
folder: this.app.getToolDir(), folder: this.app.getToolDir(),
env: this.appConfig.workingEnv, env: this.appConfig.workingEnv,

6
packages/nocodb/src/lib/noco/Noco.ts

@ -16,7 +16,7 @@ import requestIp from 'request-ip';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import { NcConfig } from '../../interface/config'; import { NcConfig } from '../../interface/config';
import Migrator from '../migrator/SqlMigrator/lib/KnexMigrator'; import Migrator from '../sql-migrator/lib/KnexMigrator';
import NcConfigFactory from '../utils/NcConfigFactory'; import NcConfigFactory from '../utils/NcConfigFactory';
import NcProjectBuilderCE from './NcProjectBuilder'; import NcProjectBuilderCE from './NcProjectBuilder';
@ -34,10 +34,10 @@ import mkdirp from 'mkdirp';
import MetaAPILogger from './meta/MetaAPILogger'; import MetaAPILogger from './meta/MetaAPILogger';
import NcUpgrader from './upgrader/NcUpgrader'; import NcUpgrader from './upgrader/NcUpgrader';
import NcMetaMgrv2 from './meta/NcMetaMgrv2'; import NcMetaMgrv2 from './meta/NcMetaMgrv2';
import NocoCache from '../noco-cache/NocoCache'; import NocoCache from '../cache/NocoCache';
import registerMetaApis from './meta/api'; import registerMetaApis from './meta/api';
import NcPluginMgrv2 from './meta/helpers/NcPluginMgrv2'; import NcPluginMgrv2 from './meta/helpers/NcPluginMgrv2';
import User from '../noco-models/User'; import User from '../models/User';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import * as http from 'http'; import * as http from 'http';
import weAreHiring from '../utils/weAreHiring'; import weAreHiring from '../utils/weAreHiring';

6
packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts

@ -14,9 +14,9 @@ import {
import XcDynamicChanges from '../../../interface/XcDynamicChanges'; import XcDynamicChanges from '../../../interface/XcDynamicChanges';
import { Acls, DbConfig, NcConfig } from '../../../interface/config'; import { Acls, DbConfig, NcConfig } from '../../../interface/config';
import { BaseModelSql, XKnex } from '../../dataMapper'; import { BaseModelSql, XKnex } from '../../sql-data-mapper';
import ModelXcMetaFactory from '../../sqlMgr/code/models/xc/ModelXcMetaFactory'; import ModelXcMetaFactory from '../../sql-mgr/code/models/xc/ModelXcMetaFactory';
import ExpressXcPolicy from '../../sqlMgr/code/policies/xc/ExpressXcPolicy'; import ExpressXcPolicy from '../../sql-mgr/code/policies/xc/ExpressXcPolicy';
import NcHelp from '../../utils/NcHelp'; import NcHelp from '../../utils/NcHelp';
import NcProjectBuilder from '../NcProjectBuilder'; import NcProjectBuilder from '../NcProjectBuilder';
import Noco from '../Noco'; import Noco from '../Noco';

2
packages/nocodb/src/lib/noco/common/BaseModel.ts

@ -2,7 +2,7 @@ import Handlebars from 'handlebars';
import { IWebhookNotificationAdapter } from 'nc-plugin'; import { IWebhookNotificationAdapter } from 'nc-plugin';
import ejs from 'ejs'; import ejs from 'ejs';
import IEmailAdapter from '../../../interface/IEmailAdapter'; import IEmailAdapter from '../../../interface/IEmailAdapter';
import { BaseModelSql } from '../../dataMapper'; import { BaseModelSql } from '../../sql-data-mapper';
// import axios from "axios"; // import axios from "axios";
import BaseApiBuilder from './BaseApiBuilder'; import BaseApiBuilder from './BaseApiBuilder';

2
packages/nocodb/src/lib/noco/common/NcConnectionMgr.ts

@ -1,4 +1,4 @@
import { XKnex } from '../../dataMapper'; import { XKnex } from '../../sql-data-mapper';
import { NcConfig } from '../../../interface/config'; import { NcConfig } from '../../../interface/config';
import fs from 'fs'; import fs from 'fs';
import Knex from 'knex'; import Knex from 'knex';

4
packages/nocodb/src/lib/noco/common/NcConnectionMgrv2.ts

@ -1,4 +1,4 @@
import { XKnex } from '../../dataMapper'; import { XKnex } from '../../sql-data-mapper';
// import { NcConfig } from '../../../interface/config'; // import { NcConfig } from '../../../interface/config';
// import fs from 'fs'; // import fs from 'fs';
// import Knex from 'knex'; // import Knex from 'knex';
@ -6,7 +6,7 @@ import { XKnex } from '../../dataMapper';
import { SqlClientFactory } from 'nc-help'; import { SqlClientFactory } from 'nc-help';
// import NcMetaIO from '../meta/NcMetaIO'; // import NcMetaIO from '../meta/NcMetaIO';
import { defaultConnectionConfig } from '../../utils/NcConfigFactory'; import { defaultConnectionConfig } from '../../utils/NcConfigFactory';
import Base from '../../noco-models/Base'; import Base from '../../models/Base';
import Noco from '../Noco'; import Noco from '../Noco';
export default class NcConnectionMgrv2 { export default class NcConnectionMgrv2 {

22
packages/nocodb/src/lib/noco/common/XcMigrationSource.ts

@ -1,14 +1,14 @@
import * as project from '../migrations/nc_001_init'; import * as project from '../../migrations/nc_001_init';
import * as m2m from '../migrations/nc_002_add_m2m'; import * as m2m from '../../migrations/nc_002_add_m2m';
import * as fkn from '../migrations/nc_003_add_fkn_column'; import * as fkn from '../../migrations/nc_003_add_fkn_column';
import * as viewType from '../migrations/nc_004_add_view_type_column'; import * as viewType from '../../migrations/nc_004_add_view_type_column';
import * as viewName from '../migrations/nc_005_add_view_name_column'; import * as viewName from '../../migrations/nc_005_add_view_name_column';
import * as nc_006_alter_nc_shared_views from '../migrations/nc_006_alter_nc_shared_views'; import * as nc_006_alter_nc_shared_views from '../../migrations/nc_006_alter_nc_shared_views';
import * as nc_007_alter_nc_shared_views_1 from '../migrations/nc_007_alter_nc_shared_views_1'; import * as nc_007_alter_nc_shared_views_1 from '../../migrations/nc_007_alter_nc_shared_views_1';
import * as nc_008_add_nc_shared_bases from '../migrations/nc_008_add_nc_shared_bases'; import * as nc_008_add_nc_shared_bases from '../../migrations/nc_008_add_nc_shared_bases';
import * as nc_009_add_model_order from '../migrations/nc_009_add_model_order'; import * as nc_009_add_model_order from '../../migrations/nc_009_add_model_order';
import * as nc_010_add_parent_title_column from '../migrations/nc_010_add_parent_title_column'; import * as nc_010_add_parent_title_column from '../../migrations/nc_010_add_parent_title_column';
import * as nc_011_remove_old_ses_plugin from '../migrations/nc_011_remove_old_ses_plugin'; import * as nc_011_remove_old_ses_plugin from '../../migrations/nc_011_remove_old_ses_plugin';
// Create a custom migration source class // Create a custom migration source class
export default class XcMigrationSource { export default class XcMigrationSource {

12
packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts

@ -1,9 +1,9 @@
import * as nc_011 from '../migrationsv2/nc_011'; import * as nc_011 from '../../migrationsv2/nc_011';
import * as nc_012_alter_column_data_types from '../migrationsv2/nc_012_alter_column_data_types'; import * as nc_012_alter_column_data_types from '../../migrationsv2/nc_012_alter_column_data_types';
import * as nc_013_sync_source from '../migrationsv2/nc_013_sync_source'; import * as nc_013_sync_source from '../../migrationsv2/nc_013_sync_source';
import * as nc_014_alter_column_data_types from '../migrationsv2/nc_014_alter_column_data_types'; import * as nc_014_alter_column_data_types from '../../migrationsv2/nc_014_alter_column_data_types';
import * as nc_015_add_meta_col_in_column_table from '../migrationsv2/nc_015_add_meta_col_in_column_table'; import * as nc_015_add_meta_col_in_column_table from '../../migrationsv2/nc_015_add_meta_col_in_column_table';
import * as nc_016_alter_hooklog_payload_types from '../migrationsv2/nc_016_alter_hooklog_payload_types'; import * as nc_016_alter_hooklog_payload_types from '../../migrationsv2/nc_016_alter_hooklog_payload_types';
// Create a custom migration source class // Create a custom migration source class
export default class XcMigrationSourcev2 { export default class XcMigrationSourcev2 {

6
packages/nocodb/src/lib/noco/gql/GqlApiBuilder.ts

@ -8,9 +8,9 @@ import { BaseType } from 'xc-core-ts';
import XcMetaMgr from '../../../interface/XcMetaMgr'; import XcMetaMgr from '../../../interface/XcMetaMgr';
import { DbConfig, NcConfig } from '../../../interface/config'; import { DbConfig, NcConfig } from '../../../interface/config';
import ExpressXcTsPolicyGql from '../../sqlMgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql'; import ExpressXcTsPolicyGql from '../../sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql';
import GqlXcSchemaFactory from '../../sqlMgr/code/gql-schema/xc-ts/GqlXcSchemaFactory'; import GqlXcSchemaFactory from '../../sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory';
import ModelXcMetaFactory from '../../sqlMgr/code/models/xc/ModelXcMetaFactory'; import ModelXcMetaFactory from '../../sql-mgr/code/models/xc/ModelXcMetaFactory';
import NcHelp from '../../utils/NcHelp'; import NcHelp from '../../utils/NcHelp';
import NcProjectBuilder from '../NcProjectBuilder'; import NcProjectBuilder from '../NcProjectBuilder';
import Noco from '../Noco'; import Noco from '../Noco';

2
packages/nocodb/src/lib/noco/gql/GqlAuthResolver.ts

@ -8,7 +8,7 @@ import { ExtractJwt, Strategy } from 'passport-jwt';
import IEmailAdapter from '../../../interface/IEmailAdapter'; import IEmailAdapter from '../../../interface/IEmailAdapter';
import { DbConfig, NcConfig } from '../../../interface/config'; import { DbConfig, NcConfig } from '../../../interface/config';
import { Knex, XKnex } from '../../dataMapper'; import { Knex, XKnex } from '../../sql-data-mapper';
import Noco from '../Noco'; import Noco from '../Noco';
import authSchema from './auth/schema'; import authSchema from './auth/schema';

2
packages/nocodb/src/lib/noco/gql/GqlCommonResolvers.ts

@ -1,4 +1,4 @@
import { BaseModelSql } from '../../dataMapper'; import { BaseModelSql } from '../../sql-data-mapper';
export const m2mNotChildren = ({ export const m2mNotChildren = ({
models = {} models = {}

2
packages/nocodb/src/lib/noco/gql/GqlResolver.ts

@ -1,7 +1,7 @@
import autoBind from 'auto-bind'; import autoBind from 'auto-bind';
import { Acls } from '../../../interface/config'; import { Acls } from '../../../interface/config';
import { BaseModelSql } from '../../dataMapper'; import { BaseModelSql } from '../../sql-data-mapper';
import Noco from '../Noco'; import Noco from '../Noco';
import GqlBaseResolver from './GqlBaseResolver'; import GqlBaseResolver from './GqlBaseResolver';

2
packages/nocodb/src/lib/noco/meta/MetaAPILogger.ts

@ -1,4 +1,4 @@
import { XKnex } from '../../dataMapper'; import { XKnex } from '../../sql-data-mapper';
import { Request } from 'express'; import { Request } from 'express';
export default class MetaAPILogger { export default class MetaAPILogger {

2
packages/nocodb/src/lib/noco/meta/NcMetaIO.ts

@ -1,6 +1,6 @@
import { NcConfig } from '../../../interface/config'; import { NcConfig } from '../../../interface/config';
import Noco from '../Noco'; import Noco from '../Noco';
import { XKnex } from '../../dataMapper'; import { XKnex } from '../../sql-data-mapper';
const META_TABLES = { const META_TABLES = {
graphql: [ graphql: [

2
packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts

@ -2,7 +2,7 @@ import CryptoJS from 'crypto-js';
import { customAlphabet } from 'nanoid'; import { customAlphabet } from 'nanoid';
import { NcConfig } from '../../../interface/config'; import { NcConfig } from '../../../interface/config';
import { Knex, XKnex } from '../../dataMapper'; import { Knex, XKnex } from '../../sql-data-mapper';
import Noco from '../Noco'; import Noco from '../Noco';
import XcMigrationSource from '../common/XcMigrationSource'; import XcMigrationSource from '../common/XcMigrationSource';

10
packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts

@ -20,10 +20,10 @@ import IEmailAdapter from '../../../interface/IEmailAdapter';
import IStorageAdapter from '../../../interface/IStorageAdapter'; import IStorageAdapter from '../../../interface/IStorageAdapter';
import { NcConfig, Result } from '../../../interface/config'; import { NcConfig, Result } from '../../../interface/config';
import { NcConfigFactory } from '../../index'; import { NcConfigFactory } from '../../index';
import ProjectMgr from '../../sqlMgr/ProjectMgr'; import ProjectMgr from '../../sql-mgr/ProjectMgr';
import ExpressXcTsRoutes from '../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutes'; import ExpressXcTsRoutes from '../../sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes';
import ExpressXcTsRoutesBt from '../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesBt'; import ExpressXcTsRoutesBt from '../../sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt';
import ExpressXcTsRoutesHm from '../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesHm'; import ExpressXcTsRoutesHm from '../../sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm';
import NcHelp from '../../utils/NcHelp'; import NcHelp from '../../utils/NcHelp';
import mimetypes, { mimeIcons } from '../../utils/mimeTypes'; import mimetypes, { mimeIcons } from '../../utils/mimeTypes';
import projectAcl from '../../utils/projectAcl'; import projectAcl from '../../utils/projectAcl';
@ -36,7 +36,7 @@ import RestAuthCtrl from '../rest/RestAuthCtrlEE';
import { packageVersion } from 'nc-help'; import { packageVersion } from 'nc-help';
import NcMetaIO, { META_TABLES } from './NcMetaIO'; import NcMetaIO, { META_TABLES } from './NcMetaIO';
import { promisify } from 'util'; import { promisify } from 'util';
import NcTemplateParser from '../../templateParser/NcTemplateParser'; import NcTemplateParser from '../../template-parser/NcTemplateParser';
import { defaultConnectionConfig } from '../../utils/NcConfigFactory'; import { defaultConnectionConfig } from '../../utils/NcConfigFactory';
import xcMetaDiff from './handlers/xcMetaDiff'; import xcMetaDiff from './handlers/xcMetaDiff';
import { UITypes } from 'nocodb-sdk'; import { UITypes } from 'nocodb-sdk';

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

@ -3,7 +3,7 @@ import { Handler, Router } from 'express';
import multer from 'multer'; import multer from 'multer';
import { NcConfig } from '../../../interface/config'; import { NcConfig } from '../../../interface/config';
import ProjectMgr from '../../sqlMgr/ProjectMgr'; import ProjectMgr from '../../sql-mgr/ProjectMgr';
import projectAcl from '../../utils/projectAcl'; import projectAcl from '../../utils/projectAcl';
import Noco from '../Noco'; import Noco from '../Noco';
import NcPluginMgr from '../plugins/NcPluginMgr'; import NcPluginMgr from '../plugins/NcPluginMgr';

2
packages/nocodb/src/lib/noco/meta/api/apiTokenApis.ts

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import ApiToken from '../../../noco-models/ApiToken'; import ApiToken from '../../../models/ApiToken';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';

4
packages/nocodb/src/lib/noco/meta/api/auditApis.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import Audit from '../../../noco-models/Audit'; import Audit from '../../../models/Audit';
import { AuditOperationSubTypes, AuditOperationTypes } from 'nocodb-sdk'; import { AuditOperationSubTypes, AuditOperationTypes } from 'nocodb-sdk';
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';

2
packages/nocodb/src/lib/noco/meta/api/cacheApis.ts

@ -1,5 +1,5 @@
import catchError from '../helpers/catchError'; import catchError from '../helpers/catchError';
import NocoCache from '../../../noco-cache/NocoCache'; import NocoCache from '../../../cache/NocoCache';
import { Router } from 'express'; import { Router } from 'express';
export async function cacheGet(_, res) { export async function cacheGet(_, res) {

22
packages/nocodb/src/lib/noco/meta/api/columnApis.ts

@ -1,13 +1,13 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2';
import Base from '../../../noco-models/Base'; import Base from '../../../models/Base';
import Column from '../../../noco-models/Column'; import Column from '../../../models/Column';
import validateParams from '../helpers/validateParams'; import validateParams from '../helpers/validateParams';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { customAlphabet } from 'nanoid'; import { customAlphabet } from 'nanoid';
import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn';
import { import {
getUniqueColumnAliasName, getUniqueColumnAliasName,
getUniqueColumnName getUniqueColumnName
@ -23,8 +23,8 @@ import {
TableType, TableType,
UITypes UITypes
} from 'nocodb-sdk'; } from 'nocodb-sdk';
import Audit from '../../../noco-models/Audit'; import Audit from '../../../models/Audit';
import SqlMgrv2 from '../../../sqlMgr/v2/SqlMgrv2'; import SqlMgrv2 from '../../../sql-mgr/v2/SqlMgrv2';
import Noco from '../../Noco'; import Noco from '../../Noco';
import NcMetaIO from '../NcMetaIO'; import NcMetaIO from '../NcMetaIO';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
@ -33,7 +33,7 @@ import getColumnPropsFromUIDT from '../helpers/getColumnPropsFromUIDT';
import mapDefaultPrimaryValue from '../helpers/mapDefaultPrimaryValue'; import mapDefaultPrimaryValue from '../helpers/mapDefaultPrimaryValue';
import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';
import FormulaColumn from '../../../noco-models/FormulaColumn'; import FormulaColumn from '../../../models/FormulaColumn';
import { MetaTable } from '../../../utils/globals'; import { MetaTable } from '../../../utils/globals';
const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 10); const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 10);
@ -728,7 +728,7 @@ export async function columnDelete(req: Request, res: Response<TableType>) {
const base = await Base.get(table.base_id); const base = await Base.get(table.base_id);
// const ncMeta = await Noco.ncMeta.startTransaction(); // const ncMeta = await Noco.ncMeta.startTransaction();
// const sqlMgr = await ProjectMgrv2.getSqlMgrTrans( // const sql-mgr = await ProjectMgrv2.getSqlMgrTrans(
// { id: base.project_id }, // { id: base.project_id },
// ncMeta, // ncMeta,
// base // base
@ -929,12 +929,12 @@ export async function columnDelete(req: Request, res: Response<TableType>) {
} }
// await ncMeta.commit(); // await ncMeta.commit();
// await sqlMgr.commit(); // await sql-mgr.commit();
Tele.emit('evt', { evt_type: 'column:deleted' }); Tele.emit('evt', { evt_type: 'column:deleted' });
res.json(table); res.json(table);
// } catch (e) { // } catch (e) {
// sqlMgr.rollback(); // sql-mgr.rollback();
// ncMeta.rollback(); // ncMeta.rollback();
// throw e; // throw e;
// } // }

4
packages/nocodb/src/lib/noco/meta/api/dataApis/bulkDataAliasApis.ts

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import Model from '../../../../noco-models/Model'; import Model from '../../../../models/Model';
import Base from '../../../../noco-models/Base'; import Base from '../../../../models/Base';
import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2';
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import ncMetaAclMw from '../../helpers/ncMetaAclMw';
import { getViewAndModelFromRequestByAliasOrId } from './helpers'; import { getViewAndModelFromRequestByAliasOrId } from './helpers';

8
packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts

@ -1,14 +1,14 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import Model from '../../../../noco-models/Model'; import Model from '../../../../models/Model';
import { nocoExecute } from 'nc-help'; import { nocoExecute } from 'nc-help';
import Base from '../../../../noco-models/Base'; import Base from '../../../../models/Base';
import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2';
import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { PagedResponseImpl } from '../../helpers/PagedResponse';
import View from '../../../../noco-models/View'; import View from '../../../../models/View';
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import ncMetaAclMw from '../../helpers/ncMetaAclMw';
import { getViewAndModelFromRequestByAliasOrId } from './helpers'; import { getViewAndModelFromRequestByAliasOrId } from './helpers';
import apiMetrics from '../../helpers/apiMetrics'; import apiMetrics from '../../helpers/apiMetrics';
import getAst from '../../../../dataMapper/lib/sql/helpers/getAst'; import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst';
async function dataList(req: Request, res: Response) { async function dataList(req: Request, res: Response) {
const { model, view } = await getViewAndModelFromRequestByAliasOrId(req); const { model, view } = await getViewAndModelFromRequestByAliasOrId(req);

4
packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasNestedApis.ts

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import Model from '../../../../noco-models/Model'; import Model from '../../../../models/Model';
import Base from '../../../../noco-models/Base'; import Base from '../../../../models/Base';
import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2';
import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { PagedResponseImpl } from '../../helpers/PagedResponse';
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import ncMetaAclMw from '../../helpers/ncMetaAclMw';

8
packages/nocodb/src/lib/noco/meta/api/dataApis/dataApis.ts

@ -1,14 +1,14 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import Model from '../../../../noco-models/Model'; import Model from '../../../../models/Model';
import { nocoExecute } from 'nc-help'; import { nocoExecute } from 'nc-help';
import Base from '../../../../noco-models/Base'; import Base from '../../../../models/Base';
import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2';
import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { PagedResponseImpl } from '../../helpers/PagedResponse';
import View from '../../../../noco-models/View'; import View from '../../../../models/View';
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import ncMetaAclMw from '../../helpers/ncMetaAclMw';
import { NcError } from '../../helpers/catchError'; import { NcError } from '../../helpers/catchError';
import apiMetrics from '../../helpers/apiMetrics'; import apiMetrics from '../../helpers/apiMetrics';
import getAst from '../../../../dataMapper/lib/sql/helpers/getAst'; import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst';
export async function dataList(req: Request, res: Response, next) { export async function dataList(req: Request, res: Response, next) {
const view = await View.get(req.params.viewId); const view = await View.get(req.params.viewId);

16
packages/nocodb/src/lib/noco/meta/api/dataApis/helpers.ts

@ -1,19 +1,19 @@
import Project from '../../../../noco-models/Project'; import Project from '../../../../models/Project';
import Model from '../../../../noco-models/Model'; import Model from '../../../../models/Model';
import View from '../../../../noco-models/View'; import View from '../../../../models/View';
import { NcError } from '../../helpers/catchError'; import { NcError } from '../../helpers/catchError';
import { Request } from 'express'; import { Request } from 'express';
import Base from '../../../../noco-models/Base'; import Base from '../../../../models/Base';
import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2';
import { isSystemColumn, UITypes } from 'nocodb-sdk'; import { isSystemColumn, UITypes } from 'nocodb-sdk';
import { nocoExecute } from 'nc-help'; import { nocoExecute } from 'nc-help';
import Column from '../../../../noco-models/Column'; import Column from '../../../../models/Column';
import LookupColumn from '../../../../noco-models/LookupColumn'; import LookupColumn from '../../../../models/LookupColumn';
import LinkToAnotherRecordColumn from '../../../../noco-models/LinkToAnotherRecordColumn'; import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn';
import papaparse from 'papaparse'; import papaparse from 'papaparse';
import getAst from '../../../../dataMapper/lib/sql/helpers/getAst'; import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst';
export async function getViewAndModelFromRequestByAliasOrId( export async function getViewAndModelFromRequestByAliasOrId(
req: req:
| Request<{ projectName: string; tableName: string; viewName?: string }> | Request<{ projectName: string; tableName: string; viewName?: string }>

10
packages/nocodb/src/lib/noco/meta/api/dataApis/oldDataApis.ts

@ -1,14 +1,14 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import Model from '../../../../noco-models/Model'; import Model from '../../../../models/Model';
import { nocoExecute } from 'nc-help'; import { nocoExecute } from 'nc-help';
import Base from '../../../../noco-models/Base'; import Base from '../../../../models/Base';
import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2';
import View from '../../../../noco-models/View'; import View from '../../../../models/View';
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import ncMetaAclMw from '../../helpers/ncMetaAclMw';
import Project from '../../../../noco-models/Project'; import Project from '../../../../models/Project';
import { NcError } from '../../helpers/catchError'; import { NcError } from '../../helpers/catchError';
import apiMetrics from '../../helpers/apiMetrics'; import apiMetrics from '../../helpers/apiMetrics';
import getAst from '../../../../dataMapper/lib/sql/helpers/getAst'; import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst';
export async function dataList(req: Request, res: Response) { export async function dataList(req: Request, res: Response) {
const { model, view } = await getViewAndModelFromRequest(req); const { model, view } = await getViewAndModelFromRequest(req);

2
packages/nocodb/src/lib/noco/meta/api/exportApis.ts

@ -1,5 +1,5 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import View from '../../../noco-models/View'; import View from '../../../models/View';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { extractCsvData } from './dataApis/helpers'; import { extractCsvData } from './dataApis/helpers';

8
packages/nocodb/src/lib/noco/meta/api/filterApis.ts

@ -1,15 +1,15 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
// @ts-ignore // @ts-ignore
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
// @ts-ignore // @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
// @ts-ignore // @ts-ignore
import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk'; import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk';
// @ts-ignore // @ts-ignore
import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2';
// @ts-ignore // @ts-ignore
import Project from '../../../noco-models/Project'; import Project from '../../../models/Project';
import Filter from '../../../noco-models/Filter'; import Filter from '../../../models/Filter';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';

10
packages/nocodb/src/lib/noco/meta/api/formViewApis.ts

@ -1,15 +1,15 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
// @ts-ignore // @ts-ignore
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
// @ts-ignore // @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
import { FormType, ViewTypes } from 'nocodb-sdk'; import { FormType, ViewTypes } from 'nocodb-sdk';
// @ts-ignore // @ts-ignore
import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2';
// @ts-ignore // @ts-ignore
import Project from '../../../noco-models/Project'; import Project from '../../../models/Project';
import View from '../../../noco-models/View'; import View from '../../../models/View';
import FormView from '../../../noco-models/FormView'; import FormView from '../../../models/FormView';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';

2
packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts

@ -1,5 +1,5 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import FormViewColumn from '../../../noco-models/FormViewColumn'; import FormViewColumn from '../../../models/FormViewColumn';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';

4
packages/nocodb/src/lib/noco/meta/api/galleryViewApis.ts

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import { GalleryType, ViewTypes } from 'nocodb-sdk'; import { GalleryType, ViewTypes } from 'nocodb-sdk';
import View from '../../../noco-models/View'; import View from '../../../models/View';
import GalleryView from '../../../noco-models/GalleryView'; import GalleryView from '../../../models/GalleryView';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';

8
packages/nocodb/src/lib/noco/meta/api/gridViewApis.ts

@ -1,14 +1,14 @@
import { Request, Router } from 'express'; import { Request, Router } from 'express';
// @ts-ignore // @ts-ignore
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
// @ts-ignore // @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
import { ViewTypes } from 'nocodb-sdk'; import { ViewTypes } from 'nocodb-sdk';
// @ts-ignore // @ts-ignore
import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2';
// @ts-ignore // @ts-ignore
import Project from '../../../noco-models/Project'; import Project from '../../../models/Project';
import View from '../../../noco-models/View'; import View from '../../../models/View';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';

2
packages/nocodb/src/lib/noco/meta/api/gridViewColumnApis.ts

@ -1,5 +1,5 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import GridViewColumn from '../../../noco-models/GridViewColumn'; import GridViewColumn from '../../../models/GridViewColumn';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';

4
packages/nocodb/src/lib/noco/meta/api/hookApis.ts

@ -1,10 +1,10 @@
import catchError from '../helpers/catchError'; import catchError from '../helpers/catchError';
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import Hook from '../../../noco-models/Hook'; import Hook from '../../../models/Hook';
import { HookListType, HookType } from 'nocodb-sdk'; import { HookListType, HookType } from 'nocodb-sdk';
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
import { invokeWebhook } from '../helpers/webhookHelpers'; import { invokeWebhook } from '../helpers/webhookHelpers';
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
import populateSamplePayload from '../helpers/populateSamplePayload'; import populateSamplePayload from '../helpers/populateSamplePayload';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';

8
packages/nocodb/src/lib/noco/meta/api/hookFilterApis.ts

@ -1,15 +1,15 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
// @ts-ignore // @ts-ignore
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
// @ts-ignore // @ts-ignore
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
// @ts-ignore // @ts-ignore
import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk'; import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk';
// @ts-ignore // @ts-ignore
import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2';
// @ts-ignore // @ts-ignore
import Project from '../../../noco-models/Project'; import Project from '../../../models/Project';
import Filter from '../../../noco-models/Filter'; import Filter from '../../../models/Filter';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';

12
packages/nocodb/src/lib/noco/meta/api/metaDiffApis.ts

@ -1,15 +1,15 @@
// // Project CRUD // // Project CRUD
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
import Project from '../../../noco-models/Project'; import Project from '../../../models/Project';
import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2';
import { isVirtualCol, ModelTypes, RelationTypes, UITypes } from 'nocodb-sdk'; import { isVirtualCol, ModelTypes, RelationTypes, UITypes } from 'nocodb-sdk';
import { Router } from 'express'; import { Router } from 'express';
import Base from '../../../noco-models/Base'; import Base from '../../../models/Base';
import ModelXcMetaFactory from '../../../sqlMgr/code/models/xc/ModelXcMetaFactory'; import ModelXcMetaFactory from '../../../sql-mgr/code/models/xc/ModelXcMetaFactory';
import Column from '../../../noco-models/Column'; import Column from '../../../models/Column';
import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn';
import { getUniqueColumnAliasName } from '../helpers/getUniqueName'; import { getUniqueColumnAliasName } from '../helpers/getUniqueName';
import NcHelp from '../../../utils/NcHelp'; import NcHelp from '../../../utils/NcHelp';
import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName';

6
packages/nocodb/src/lib/noco/meta/api/modelVisibilityApis.ts

@ -1,9 +1,9 @@
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
import ModelRoleVisibility from '../../../noco-models/ModelRoleVisibility'; import ModelRoleVisibility from '../../../models/ModelRoleVisibility';
import { Router } from 'express'; import { Router } from 'express';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import Project from '../../../noco-models/Project'; import Project from '../../../models/Project';
import { metaApiMetrics } from '../helpers/apiMetrics'; import { metaApiMetrics } from '../helpers/apiMetrics';
async function xcVisibilityMetaSetAll(req, res) { async function xcVisibilityMetaSetAll(req, res) {
Tele.emit('evt', { evt_type: 'uiAcl:updated' }); Tele.emit('evt', { evt_type: 'uiAcl:updated' });

2
packages/nocodb/src/lib/noco/meta/api/pluginApis.ts

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
import Plugin from '../../../noco-models/Plugin'; import Plugin from '../../../models/Plugin';
import { PluginType } from 'nocodb-sdk'; import { PluginType } from 'nocodb-sdk';
import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; import NcPluginMgrv2 from '../helpers/NcPluginMgrv2';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';

12
packages/nocodb/src/lib/noco/meta/api/projectApis.ts

@ -1,19 +1,19 @@
import { Request, Response } from 'express'; import { Request, Response } from 'express';
import Project from '../../../noco-models/Project'; import Project from '../../../models/Project';
import { ModelTypes, ProjectListType, UITypes } from 'nocodb-sdk'; import { ModelTypes, ProjectListType, UITypes } from 'nocodb-sdk';
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
import syncMigration from '../helpers/syncMigration'; import syncMigration from '../helpers/syncMigration';
import { IGNORE_TABLES } from '../../common/BaseApiBuilder'; import { IGNORE_TABLES } from '../../common/BaseApiBuilder';
import Column from '../../../noco-models/Column'; import Column from '../../../models/Column';
import Model from '../../../noco-models/Model'; import Model from '../../../models/Model';
import NcHelp from '../../../utils/NcHelp'; import NcHelp from '../../../utils/NcHelp';
import Base from '../../../noco-models/Base'; import Base from '../../../models/Base';
import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2';
import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName';
import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn';
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import ProjectUser from '../../../noco-models/ProjectUser'; import ProjectUser from '../../../models/ProjectUser';
import { customAlphabet } from 'nanoid'; import { customAlphabet } from 'nanoid';
import Noco from '../../Noco'; import Noco from '../../Noco';
import isDocker from 'is-docker'; import isDocker from 'is-docker';

8
packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts

@ -1,14 +1,14 @@
import ncMetaAclMw from '../helpers/ncMetaAclMw'; import ncMetaAclMw from '../helpers/ncMetaAclMw';
import { Router } from 'express'; import { Router } from 'express';
import { PagedResponseImpl } from '../helpers/PagedResponse'; import { PagedResponseImpl } from '../helpers/PagedResponse';
import ProjectUser from '../../../noco-models/ProjectUser'; import ProjectUser from '../../../models/ProjectUser';
import validator from 'validator'; import validator from 'validator';
import { NcError } from '../helpers/catchError'; import { NcError } from '../helpers/catchError';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import User from '../../../noco-models/User'; import User from '../../../models/User';
import { Tele } from 'nc-help'; import { Tele } from 'nc-help';
import Audit from '../../../noco-models/Audit'; import Audit from '../../../models/Audit';
import NocoCache from '../../../noco-cache/NocoCache'; import NocoCache from '../../../cache/NocoCache';
import { CacheGetType, CacheScope, MetaTable } from '../../../utils/globals'; import { CacheGetType, CacheScope, MetaTable } from '../../../utils/globals';
import * as ejs from 'ejs'; import * as ejs from 'ejs';
import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; import NcPluginMgrv2 from '../helpers/NcPluginMgrv2';

12
packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataApis.ts

@ -1,22 +1,22 @@
import { Request, Response, Router } from 'express'; import { Request, Response, Router } from 'express';
import Model from '../../../../noco-models/Model'; import Model from '../../../../models/Model';
import { nocoExecute } from 'nc-help'; import { nocoExecute } from 'nc-help';
import Base from '../../../../noco-models/Base'; import Base from '../../../../models/Base';
import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2';
import { PagedResponseImpl } from '../../helpers/PagedResponse'; import { PagedResponseImpl } from '../../helpers/PagedResponse';
import View from '../../../../noco-models/View'; import View from '../../../../models/View';
import catchError, { NcError } from '../../helpers/catchError'; import catchError, { NcError } from '../../helpers/catchError';
import multer from 'multer'; import multer from 'multer';
import { ErrorMessages, UITypes, ViewTypes } from 'nocodb-sdk'; import { ErrorMessages, UITypes, ViewTypes } from 'nocodb-sdk';
import Column from '../../../../noco-models/Column'; import Column from '../../../../models/Column';
import LinkToAnotherRecordColumn from '../../../../noco-models/LinkToAnotherRecordColumn'; import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn';
import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2';
import path from 'path'; import path from 'path';
import { nanoid } from 'nanoid'; import { nanoid } from 'nanoid';
import { mimeIcons } from '../../../../utils/mimeTypes'; import { mimeIcons } from '../../../../utils/mimeTypes';
import slash from 'slash'; import slash from 'slash';
import { sanitizeUrlPath } from '../attachmentApis'; import { sanitizeUrlPath } from '../attachmentApis';
import getAst from '../../../../dataMapper/lib/sql/helpers/getAst'; import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst';
export async function dataList(req: Request, res: Response) { export async function dataList(req: Request, res: Response) {
try { try {

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

Loading…
Cancel
Save