diff --git a/packages/nocodb/src/__tests__/TemplateParser.test.ts b/packages/nocodb/src/__tests__/TemplateParser.test.ts index 94139fa34f..8f932bcedb 100644 --- a/packages/nocodb/src/__tests__/TemplateParser.test.ts +++ b/packages/nocodb/src/__tests__/TemplateParser.test.ts @@ -1,6 +1,6 @@ import { expect } from 'chai'; import 'mocha'; -import NcTemplateParser from '../lib/templateParser/NcTemplateParser'; +import NcTemplateParser from '../lib/template-parser/NcTemplateParser'; import template from './template'; describe('Template parser', () => { diff --git a/packages/nocodb/src/__tests__/formula.test.ts b/packages/nocodb/src/__tests__/formula.test.ts index f9d0a50c4c..ba78bfd62c 100644 --- a/packages/nocodb/src/__tests__/formula.test.ts +++ b/packages/nocodb/src/__tests__/formula.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import 'mocha'; -import knex from '../lib/dataMapper/lib/sql/CustomKnex'; -import formulaQueryBuilderFromString from '../lib/dataMapper/lib/sql/formulaQueryBuilderFromString'; +import knex from '../lib/sql-data-mapper/lib/sql/CustomKnex'; +import formulaQueryBuilderFromString from '../lib/sql-data-mapper/lib/sql/formulaQueryBuilderFromString'; process.env.TEST = 'test'; diff --git a/packages/nocodb/src/lib/noco-cache/CacheMgr.ts b/packages/nocodb/src/lib/cache/CacheMgr.ts similarity index 100% rename from packages/nocodb/src/lib/noco-cache/CacheMgr.ts rename to packages/nocodb/src/lib/cache/CacheMgr.ts diff --git a/packages/nocodb/src/lib/noco-cache/NocoCache.ts b/packages/nocodb/src/lib/cache/NocoCache.ts similarity index 100% rename from packages/nocodb/src/lib/noco-cache/NocoCache.ts rename to packages/nocodb/src/lib/cache/NocoCache.ts diff --git a/packages/nocodb/src/lib/noco-cache/RedisCacheMgr.ts b/packages/nocodb/src/lib/cache/RedisCacheMgr.ts similarity index 100% rename from packages/nocodb/src/lib/noco-cache/RedisCacheMgr.ts rename to packages/nocodb/src/lib/cache/RedisCacheMgr.ts diff --git a/packages/nocodb/src/lib/noco-cache/RedisMockCacheMgr.ts b/packages/nocodb/src/lib/cache/RedisMockCacheMgr.ts similarity index 100% rename from packages/nocodb/src/lib/noco-cache/RedisMockCacheMgr.ts rename to packages/nocodb/src/lib/cache/RedisMockCacheMgr.ts diff --git a/packages/nocodb/src/lib/noco-jobs/EmitteryJobsMgr.ts b/packages/nocodb/src/lib/jobs/EmitteryJobsMgr.ts similarity index 100% rename from packages/nocodb/src/lib/noco-jobs/EmitteryJobsMgr.ts rename to packages/nocodb/src/lib/jobs/EmitteryJobsMgr.ts diff --git a/packages/nocodb/src/lib/noco-jobs/JobsMgr.ts b/packages/nocodb/src/lib/jobs/JobsMgr.ts similarity index 100% rename from packages/nocodb/src/lib/noco-jobs/JobsMgr.ts rename to packages/nocodb/src/lib/jobs/JobsMgr.ts diff --git a/packages/nocodb/src/lib/noco-jobs/NocoJobs.ts b/packages/nocodb/src/lib/jobs/NocoJobs.ts similarity index 100% rename from packages/nocodb/src/lib/noco-jobs/NocoJobs.ts rename to packages/nocodb/src/lib/jobs/NocoJobs.ts diff --git a/packages/nocodb/src/lib/noco-jobs/RedisJobsMgr.ts b/packages/nocodb/src/lib/jobs/RedisJobsMgr.ts similarity index 100% rename from packages/nocodb/src/lib/noco-jobs/RedisJobsMgr.ts rename to packages/nocodb/src/lib/jobs/RedisJobsMgr.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_001_init.ts b/packages/nocodb/src/lib/migrations/nc_001_init.ts similarity index 98% rename from packages/nocodb/src/lib/noco/migrations/nc_001_init.ts rename to packages/nocodb/src/lib/migrations/nc_001_init.ts index 2ef5465966..a64f0991ab 100644 --- a/packages/nocodb/src/lib/noco/migrations/nc_001_init.ts +++ b/packages/nocodb/src/lib/migrations/nc_001_init.ts @@ -1,6 +1,6 @@ -import cache from '../plugins/cache'; -import googleAuth from '../plugins/googleAuth'; -import ses from '../plugins/ses'; +import cache from '../noco/plugins/cache'; +import googleAuth from '../noco/plugins/googleAuth'; +import ses from '../noco/plugins/ses'; const up = async knex => { await knex.schema.createTable('nc_projects', table => { diff --git a/packages/nocodb/src/lib/noco/migrations/nc_002_add_m2m.ts b/packages/nocodb/src/lib/migrations/nc_002_add_m2m.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_002_add_m2m.ts rename to packages/nocodb/src/lib/migrations/nc_002_add_m2m.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_003_add_fkn_column.ts b/packages/nocodb/src/lib/migrations/nc_003_add_fkn_column.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_003_add_fkn_column.ts rename to packages/nocodb/src/lib/migrations/nc_003_add_fkn_column.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_004_add_view_type_column.ts b/packages/nocodb/src/lib/migrations/nc_004_add_view_type_column.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_004_add_view_type_column.ts rename to packages/nocodb/src/lib/migrations/nc_004_add_view_type_column.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_005_add_view_name_column.ts b/packages/nocodb/src/lib/migrations/nc_005_add_view_name_column.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_005_add_view_name_column.ts rename to packages/nocodb/src/lib/migrations/nc_005_add_view_name_column.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_006_alter_nc_shared_views.ts b/packages/nocodb/src/lib/migrations/nc_006_alter_nc_shared_views.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_006_alter_nc_shared_views.ts rename to packages/nocodb/src/lib/migrations/nc_006_alter_nc_shared_views.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_007_alter_nc_shared_views_1.ts b/packages/nocodb/src/lib/migrations/nc_007_alter_nc_shared_views_1.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_007_alter_nc_shared_views_1.ts rename to packages/nocodb/src/lib/migrations/nc_007_alter_nc_shared_views_1.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_008_add_nc_shared_bases.ts b/packages/nocodb/src/lib/migrations/nc_008_add_nc_shared_bases.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_008_add_nc_shared_bases.ts rename to packages/nocodb/src/lib/migrations/nc_008_add_nc_shared_bases.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_009_add_model_order.ts b/packages/nocodb/src/lib/migrations/nc_009_add_model_order.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_009_add_model_order.ts rename to packages/nocodb/src/lib/migrations/nc_009_add_model_order.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_010_add_parent_title_column.ts b/packages/nocodb/src/lib/migrations/nc_010_add_parent_title_column.ts similarity index 100% rename from packages/nocodb/src/lib/noco/migrations/nc_010_add_parent_title_column.ts rename to packages/nocodb/src/lib/migrations/nc_010_add_parent_title_column.ts diff --git a/packages/nocodb/src/lib/noco/migrations/nc_011_remove_old_ses_plugin.ts b/packages/nocodb/src/lib/migrations/nc_011_remove_old_ses_plugin.ts similarity index 96% rename from packages/nocodb/src/lib/noco/migrations/nc_011_remove_old_ses_plugin.ts rename to packages/nocodb/src/lib/migrations/nc_011_remove_old_ses_plugin.ts index 8bdf7dca78..4ee951490a 100644 --- a/packages/nocodb/src/lib/noco/migrations/nc_011_remove_old_ses_plugin.ts +++ b/packages/nocodb/src/lib/migrations/nc_011_remove_old_ses_plugin.ts @@ -1,5 +1,5 @@ import Knex from 'knex'; -import ses from '../plugins/ses'; +import ses from '../noco/plugins/ses'; const up = async (knex: Knex) => { await knex('nc_plugins').del().where({title: "SES"}); diff --git a/packages/nocodb/src/lib/noco/migrationsv2/nc_011.ts b/packages/nocodb/src/lib/migrationsv2/nc_011.ts similarity index 99% rename from packages/nocodb/src/lib/noco/migrationsv2/nc_011.ts rename to packages/nocodb/src/lib/migrationsv2/nc_011.ts index 846c85ef2b..f180d26106 100644 --- a/packages/nocodb/src/lib/noco/migrationsv2/nc_011.ts +++ b/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 ses from '../plugins/ses'; // import cache from '../plugins/cache'; diff --git a/packages/nocodb/src/lib/noco/migrationsv2/nc_012_alter_column_data_types.ts b/packages/nocodb/src/lib/migrationsv2/nc_012_alter_column_data_types.ts similarity index 97% rename from packages/nocodb/src/lib/noco/migrationsv2/nc_012_alter_column_data_types.ts rename to packages/nocodb/src/lib/migrationsv2/nc_012_alter_column_data_types.ts index 1e6c965aa9..5eaa2d5d19 100644 --- a/packages/nocodb/src/lib/noco/migrationsv2/nc_012_alter_column_data_types.ts +++ b/packages/nocodb/src/lib/migrationsv2/nc_012_alter_column_data_types.ts @@ -1,5 +1,5 @@ import Knex from 'knex'; -import { MetaTable } from '../../utils/globals'; +import { MetaTable } from '../utils/globals'; const up = async (knex: Knex) => { if (knex.client.config.client !== 'sqlite3') { diff --git a/packages/nocodb/src/lib/noco/migrationsv2/nc_013_sync_source.ts b/packages/nocodb/src/lib/migrationsv2/nc_013_sync_source.ts similarity index 97% rename from packages/nocodb/src/lib/noco/migrationsv2/nc_013_sync_source.ts rename to packages/nocodb/src/lib/migrationsv2/nc_013_sync_source.ts index 638eab0eec..e4de3664f7 100644 --- a/packages/nocodb/src/lib/noco/migrationsv2/nc_013_sync_source.ts +++ b/packages/nocodb/src/lib/migrationsv2/nc_013_sync_source.ts @@ -1,5 +1,5 @@ import Knex from 'knex'; -import { MetaTable } from '../../utils/globals'; +import { MetaTable } from '../utils/globals'; const up = async (knex: Knex) => { await knex.schema.createTable(MetaTable.SYNC_SOURCE, table => { diff --git a/packages/nocodb/src/lib/noco/migrationsv2/nc_014_alter_column_data_types.ts b/packages/nocodb/src/lib/migrationsv2/nc_014_alter_column_data_types.ts similarity index 97% rename from packages/nocodb/src/lib/noco/migrationsv2/nc_014_alter_column_data_types.ts rename to packages/nocodb/src/lib/migrationsv2/nc_014_alter_column_data_types.ts index a64de5bab0..6061726ef1 100644 --- a/packages/nocodb/src/lib/noco/migrationsv2/nc_014_alter_column_data_types.ts +++ b/packages/nocodb/src/lib/migrationsv2/nc_014_alter_column_data_types.ts @@ -1,5 +1,5 @@ import Knex from 'knex'; -import { MetaTable } from '../../utils/globals'; +import { MetaTable } from '../utils/globals'; const up = async (knex: Knex) => { if (knex.client.config.client !== 'sqlite3') { diff --git a/packages/nocodb/src/lib/noco/migrationsv2/nc_015_add_meta_col_in_column_table.ts b/packages/nocodb/src/lib/migrationsv2/nc_015_add_meta_col_in_column_table.ts similarity index 95% rename from packages/nocodb/src/lib/noco/migrationsv2/nc_015_add_meta_col_in_column_table.ts rename to packages/nocodb/src/lib/migrationsv2/nc_015_add_meta_col_in_column_table.ts index aeb1d9f9d4..57c3026014 100644 --- a/packages/nocodb/src/lib/noco/migrationsv2/nc_015_add_meta_col_in_column_table.ts +++ b/packages/nocodb/src/lib/migrationsv2/nc_015_add_meta_col_in_column_table.ts @@ -1,5 +1,5 @@ import Knex from 'knex'; -import { MetaTable } from '../../utils/globals'; +import { MetaTable } from '../utils/globals'; const up = async (knex: Knex) => { await knex.schema.alterTable(MetaTable.COLUMNS, table => { diff --git a/packages/nocodb/src/lib/noco/migrationsv2/nc_016_alter_hooklog_payload_types.ts b/packages/nocodb/src/lib/migrationsv2/nc_016_alter_hooklog_payload_types.ts similarity index 96% rename from packages/nocodb/src/lib/noco/migrationsv2/nc_016_alter_hooklog_payload_types.ts rename to packages/nocodb/src/lib/migrationsv2/nc_016_alter_hooklog_payload_types.ts index 31126be296..18bd9a616f 100644 --- a/packages/nocodb/src/lib/noco/migrationsv2/nc_016_alter_hooklog_payload_types.ts +++ b/packages/nocodb/src/lib/migrationsv2/nc_016_alter_hooklog_payload_types.ts @@ -1,5 +1,5 @@ import Knex from 'knex'; -import { MetaTable } from '../../utils/globals'; +import { MetaTable } from '../utils/globals'; const up = async (knex: Knex) => { if (knex.client.config.client !== 'sqlite3') { diff --git a/packages/nocodb/src/lib/noco-models/ApiToken.ts b/packages/nocodb/src/lib/models/ApiToken.ts similarity index 97% rename from packages/nocodb/src/lib/noco-models/ApiToken.ts rename to packages/nocodb/src/lib/models/ApiToken.ts index a9be8520af..c0e62373aa 100644 --- a/packages/nocodb/src/lib/noco-models/ApiToken.ts +++ b/packages/nocodb/src/lib/models/ApiToken.ts @@ -6,7 +6,7 @@ import { } from '../utils/globals'; import Noco from '../noco/Noco'; import { nanoid } from 'nanoid'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class ApiToken { project_id?: string; diff --git a/packages/nocodb/src/lib/noco-models/Audit.ts b/packages/nocodb/src/lib/models/Audit.ts similarity index 100% rename from packages/nocodb/src/lib/noco-models/Audit.ts rename to packages/nocodb/src/lib/models/Audit.ts diff --git a/packages/nocodb/src/lib/noco-models/Base.ts b/packages/nocodb/src/lib/models/Base.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/Base.ts rename to packages/nocodb/src/lib/models/Base.ts index 3ab776f2fd..4c2d25b30f 100644 --- a/packages/nocodb/src/lib/noco-models/Base.ts +++ b/packages/nocodb/src/lib/models/Base.ts @@ -8,7 +8,7 @@ import { } from '../utils/globals'; import Model from './Model'; import { BaseType } from 'nocodb-sdk'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import CryptoJS from 'crypto-js'; import extractProps from '../noco/meta/helpers/extractProps'; diff --git a/packages/nocodb/src/lib/noco-models/Column.ts b/packages/nocodb/src/lib/models/Column.ts similarity index 99% rename from packages/nocodb/src/lib/noco-models/Column.ts rename to packages/nocodb/src/lib/models/Column.ts index 0592a79bc2..46e7580df9 100644 --- a/packages/nocodb/src/lib/noco-models/Column.ts +++ b/packages/nocodb/src/lib/models/Column.ts @@ -5,7 +5,7 @@ import RollupColumn from './RollupColumn'; import SingleSelectColumn from './SingleSelectColumn'; import MultiSelectColumn from './MultiSelectColumn'; import Model from './Model'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import { ColumnType, UITypes } from 'nocodb-sdk'; import { CacheDelDirection, diff --git a/packages/nocodb/src/lib/noco-models/Filter.ts b/packages/nocodb/src/lib/models/Filter.ts similarity index 99% rename from packages/nocodb/src/lib/noco-models/Filter.ts rename to packages/nocodb/src/lib/models/Filter.ts index e31929a2b2..5d4d74b6d5 100644 --- a/packages/nocodb/src/lib/noco-models/Filter.ts +++ b/packages/nocodb/src/lib/models/Filter.ts @@ -9,7 +9,7 @@ import { } from '../utils/globals'; import View from './View'; import { FilterType, UITypes } from 'nocodb-sdk'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class Filter { id: string; diff --git a/packages/nocodb/src/lib/noco-models/FormView.ts b/packages/nocodb/src/lib/models/FormView.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/FormView.ts rename to packages/nocodb/src/lib/models/FormView.ts index 3ea415cac7..c74e288dd8 100644 --- a/packages/nocodb/src/lib/noco-models/FormView.ts +++ b/packages/nocodb/src/lib/models/FormView.ts @@ -3,7 +3,7 @@ import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { FormType } from 'nocodb-sdk'; import FormViewColumn from './FormViewColumn'; import View from './View'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class FormView implements FormType { show: boolean; diff --git a/packages/nocodb/src/lib/noco-models/FormViewColumn.ts b/packages/nocodb/src/lib/models/FormViewColumn.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/FormViewColumn.ts rename to packages/nocodb/src/lib/models/FormViewColumn.ts index 28f3f02b7f..aad0f4eb84 100644 --- a/packages/nocodb/src/lib/noco-models/FormViewColumn.ts +++ b/packages/nocodb/src/lib/models/FormViewColumn.ts @@ -2,7 +2,7 @@ import Noco from '../noco/Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { FormColumnType } from 'nocodb-sdk'; import View from './View'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import extractProps from '../noco/meta/helpers/extractProps'; export default class FormViewColumn implements FormColumnType { diff --git a/packages/nocodb/src/lib/noco-models/FormulaColumn.ts b/packages/nocodb/src/lib/models/FormulaColumn.ts similarity index 97% rename from packages/nocodb/src/lib/noco-models/FormulaColumn.ts rename to packages/nocodb/src/lib/models/FormulaColumn.ts index 047df06c47..332b4b45db 100644 --- a/packages/nocodb/src/lib/noco-models/FormulaColumn.ts +++ b/packages/nocodb/src/lib/models/FormulaColumn.ts @@ -1,6 +1,6 @@ import Noco from '../../lib/noco/Noco'; 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'; export default class FormulaColumn { diff --git a/packages/nocodb/src/lib/noco-models/GalleryView.ts b/packages/nocodb/src/lib/models/GalleryView.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/GalleryView.ts rename to packages/nocodb/src/lib/models/GalleryView.ts index 3fdbe7581b..0bec164992 100644 --- a/packages/nocodb/src/lib/noco-models/GalleryView.ts +++ b/packages/nocodb/src/lib/models/GalleryView.ts @@ -2,7 +2,7 @@ import Noco from '../noco/Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { GalleryColumnType, GalleryType, UITypes } from 'nocodb-sdk'; import View from './View'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class GalleryView implements GalleryType { fk_view_id?: string; diff --git a/packages/nocodb/src/lib/noco-models/GalleryViewColumn.ts b/packages/nocodb/src/lib/models/GalleryViewColumn.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/GalleryViewColumn.ts rename to packages/nocodb/src/lib/models/GalleryViewColumn.ts index d12da978f7..73a1582b95 100644 --- a/packages/nocodb/src/lib/noco-models/GalleryViewColumn.ts +++ b/packages/nocodb/src/lib/models/GalleryViewColumn.ts @@ -1,7 +1,7 @@ import Noco from '../noco/Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import View from './View'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class GalleryViewColumn { id: string; diff --git a/packages/nocodb/src/lib/noco-models/GridView.ts b/packages/nocodb/src/lib/models/GridView.ts similarity index 97% rename from packages/nocodb/src/lib/noco-models/GridView.ts rename to packages/nocodb/src/lib/models/GridView.ts index 8ea7746c28..9a3b057228 100644 --- a/packages/nocodb/src/lib/noco-models/GridView.ts +++ b/packages/nocodb/src/lib/models/GridView.ts @@ -2,7 +2,7 @@ import Noco from '../noco/Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import GridViewColumn from './GridViewColumn'; import View from './View'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class GridView { title: string; diff --git a/packages/nocodb/src/lib/noco-models/GridViewColumn.ts b/packages/nocodb/src/lib/models/GridViewColumn.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/GridViewColumn.ts rename to packages/nocodb/src/lib/models/GridViewColumn.ts index 94794d24e3..ffba656947 100644 --- a/packages/nocodb/src/lib/noco-models/GridViewColumn.ts +++ b/packages/nocodb/src/lib/models/GridViewColumn.ts @@ -3,7 +3,7 @@ import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { GridColumnType } from 'nocodb-sdk'; import extractProps from '../noco/meta/helpers/extractProps'; import View from './View'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class GridViewColumn implements GridColumnType { id: string; diff --git a/packages/nocodb/src/lib/noco-models/Hook.ts b/packages/nocodb/src/lib/models/Hook.ts similarity index 99% rename from packages/nocodb/src/lib/noco-models/Hook.ts rename to packages/nocodb/src/lib/models/Hook.ts index 7cdb218c20..e998d3a471 100644 --- a/packages/nocodb/src/lib/noco-models/Hook.ts +++ b/packages/nocodb/src/lib/models/Hook.ts @@ -7,7 +7,7 @@ import { } from '../utils/globals'; import Noco from '../noco/Noco'; import Model from './Model'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import Filter from './Filter'; import HookFilter from './HookFilter'; diff --git a/packages/nocodb/src/lib/noco-models/HookFilter.ts b/packages/nocodb/src/lib/models/HookFilter.ts similarity index 99% rename from packages/nocodb/src/lib/noco-models/HookFilter.ts rename to packages/nocodb/src/lib/models/HookFilter.ts index 04946df456..140c7d7539 100644 --- a/packages/nocodb/src/lib/noco-models/HookFilter.ts +++ b/packages/nocodb/src/lib/models/HookFilter.ts @@ -9,7 +9,7 @@ import { } from '../utils/globals'; import View from './View'; import { FilterType, UITypes } from 'nocodb-sdk'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class Filter { id: string; diff --git a/packages/nocodb/src/lib/noco-models/HookLog.ts b/packages/nocodb/src/lib/models/HookLog.ts similarity index 100% rename from packages/nocodb/src/lib/noco-models/HookLog.ts rename to packages/nocodb/src/lib/models/HookLog.ts diff --git a/packages/nocodb/src/lib/noco-models/KanbanView.ts b/packages/nocodb/src/lib/models/KanbanView.ts similarity index 100% rename from packages/nocodb/src/lib/noco-models/KanbanView.ts rename to packages/nocodb/src/lib/models/KanbanView.ts diff --git a/packages/nocodb/src/lib/noco-models/LinkToAnotherRecordColumn.ts b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts similarity index 97% rename from packages/nocodb/src/lib/noco-models/LinkToAnotherRecordColumn.ts rename to packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts index 8064288c1f..ee175732a6 100644 --- a/packages/nocodb/src/lib/noco-models/LinkToAnotherRecordColumn.ts +++ b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts @@ -1,9 +1,9 @@ import Noco from '../../lib/noco/Noco'; import Column from './Column'; import Model from './Model'; -// import NocoCache from '../noco-cache/NocoCache'; +// import NocoCache from '../cache/NocoCache'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class LinkToAnotherRecordColumn { fk_column_id?: string; diff --git a/packages/nocodb/src/lib/noco-models/LookupColumn.ts b/packages/nocodb/src/lib/models/LookupColumn.ts similarity index 94% rename from packages/nocodb/src/lib/noco-models/LookupColumn.ts rename to packages/nocodb/src/lib/models/LookupColumn.ts index 592fc1b56b..32179295ec 100644 --- a/packages/nocodb/src/lib/noco-models/LookupColumn.ts +++ b/packages/nocodb/src/lib/models/LookupColumn.ts @@ -1,8 +1,8 @@ import Noco from '../../lib/noco/Noco'; -// import NocoCache from '../noco-cache/NocoCache'; +// import NocoCache from '../cache/NocoCache'; import Column from './Column'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class LookupColumn { fk_relation_column_id: string; diff --git a/packages/nocodb/src/lib/noco-models/Model.ts b/packages/nocodb/src/lib/models/Model.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/Model.ts rename to packages/nocodb/src/lib/models/Model.ts index 244493589e..5a1dd7d2bf 100644 --- a/packages/nocodb/src/lib/noco-models/Model.ts +++ b/packages/nocodb/src/lib/models/Model.ts @@ -1,8 +1,8 @@ import Noco from '../../lib/noco/Noco'; import Column from './Column'; -import NocoCache from '../noco-cache/NocoCache'; -import { XKnex } from '../dataMapper'; -import { BaseModelSqlv2 } from '../dataMapper/lib/sql/BaseModelSqlv2'; +import NocoCache from '../cache/NocoCache'; +import { XKnex } from '../sql-data-mapper'; +import { BaseModelSqlv2 } from '../sql-data-mapper/lib/sql/BaseModelSqlv2'; import { isVirtualCol, ModelTypes, diff --git a/packages/nocodb/src/lib/noco-models/ModelRoleVisibility.ts b/packages/nocodb/src/lib/models/ModelRoleVisibility.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/ModelRoleVisibility.ts rename to packages/nocodb/src/lib/models/ModelRoleVisibility.ts index e3f2026112..92a34c970f 100644 --- a/packages/nocodb/src/lib/noco-models/ModelRoleVisibility.ts +++ b/packages/nocodb/src/lib/models/ModelRoleVisibility.ts @@ -6,7 +6,7 @@ import { CacheScope, MetaTable } from '../utils/globals'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import View from './View'; export default class ModelRoleVisibility implements ModelRoleVisibilityType { diff --git a/packages/nocodb/src/lib/noco-models/MultiSelectColumn.ts b/packages/nocodb/src/lib/models/MultiSelectColumn.ts similarity index 97% rename from packages/nocodb/src/lib/noco-models/MultiSelectColumn.ts rename to packages/nocodb/src/lib/models/MultiSelectColumn.ts index ff5b040759..ab01a0f757 100644 --- a/packages/nocodb/src/lib/noco-models/MultiSelectColumn.ts +++ b/packages/nocodb/src/lib/models/MultiSelectColumn.ts @@ -1,5 +1,5 @@ import Noco from '../../lib/noco/Noco'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; export default class MultiSelectColumn { diff --git a/packages/nocodb/src/lib/noco-models/Plugin.ts b/packages/nocodb/src/lib/models/Plugin.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/Plugin.ts rename to packages/nocodb/src/lib/models/Plugin.ts index ac354d0b4e..5b6834f452 100644 --- a/packages/nocodb/src/lib/noco-models/Plugin.ts +++ b/packages/nocodb/src/lib/models/Plugin.ts @@ -1,7 +1,7 @@ import { PluginType } from 'nocodb-sdk'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import Noco from '../noco/Noco'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class Plugin implements PluginType { id?: string; diff --git a/packages/nocodb/src/lib/noco-models/Project.ts b/packages/nocodb/src/lib/models/Project.ts similarity index 99% rename from packages/nocodb/src/lib/noco-models/Project.ts rename to packages/nocodb/src/lib/models/Project.ts index 20009b3148..f620bea5cc 100644 --- a/packages/nocodb/src/lib/noco-models/Project.ts +++ b/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 { ProjectType } from 'nocodb-sdk'; import { @@ -8,7 +8,7 @@ import { MetaTable } from '../utils/globals'; import extractProps from '../noco/meta/helpers/extractProps'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class Project implements ProjectType { public id: string; diff --git a/packages/nocodb/src/lib/noco-models/ProjectUser.ts b/packages/nocodb/src/lib/models/ProjectUser.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/ProjectUser.ts rename to packages/nocodb/src/lib/models/ProjectUser.ts index eed177c5c5..fa04375206 100644 --- a/packages/nocodb/src/lib/noco-models/ProjectUser.ts +++ b/packages/nocodb/src/lib/models/ProjectUser.ts @@ -5,7 +5,7 @@ import { MetaTable } from '../utils/globals'; import Noco from '../noco/Noco'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import User from './User'; export default class ProjectUser { diff --git a/packages/nocodb/src/lib/noco-models/RollupColumn.ts b/packages/nocodb/src/lib/models/RollupColumn.ts similarity index 97% rename from packages/nocodb/src/lib/noco-models/RollupColumn.ts rename to packages/nocodb/src/lib/models/RollupColumn.ts index d9e9b975c2..0ca20fc7e9 100644 --- a/packages/nocodb/src/lib/noco-models/RollupColumn.ts +++ b/packages/nocodb/src/lib/models/RollupColumn.ts @@ -1,7 +1,7 @@ import Noco from '../../lib/noco/Noco'; import Column from './Column'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class RollupColumn { fk_column_id; diff --git a/packages/nocodb/src/lib/noco-models/SingleSelectColumn.ts b/packages/nocodb/src/lib/models/SingleSelectColumn.ts similarity index 97% rename from packages/nocodb/src/lib/noco-models/SingleSelectColumn.ts rename to packages/nocodb/src/lib/models/SingleSelectColumn.ts index 688c4f6e31..2c0b973168 100644 --- a/packages/nocodb/src/lib/noco-models/SingleSelectColumn.ts +++ b/packages/nocodb/src/lib/models/SingleSelectColumn.ts @@ -1,5 +1,5 @@ import Noco from '../../lib/noco/Noco'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; export default class SingleSelectColumn { diff --git a/packages/nocodb/src/lib/noco-models/Sort.ts b/packages/nocodb/src/lib/models/Sort.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/Sort.ts rename to packages/nocodb/src/lib/models/Sort.ts index 432cfb91ed..1dac3d3d6f 100644 --- a/packages/nocodb/src/lib/noco-models/Sort.ts +++ b/packages/nocodb/src/lib/models/Sort.ts @@ -7,7 +7,7 @@ import { CacheScope, MetaTable } from '../utils/globals'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import { SortType } from 'nocodb-sdk'; export default class Sort { diff --git a/packages/nocodb/src/lib/noco-models/SyncLogs.ts b/packages/nocodb/src/lib/models/SyncLogs.ts similarity index 100% rename from packages/nocodb/src/lib/noco-models/SyncLogs.ts rename to packages/nocodb/src/lib/models/SyncLogs.ts diff --git a/packages/nocodb/src/lib/noco-models/SyncSource.ts b/packages/nocodb/src/lib/models/SyncSource.ts similarity index 100% rename from packages/nocodb/src/lib/noco-models/SyncSource.ts rename to packages/nocodb/src/lib/models/SyncSource.ts diff --git a/packages/nocodb/src/lib/noco-models/User.ts b/packages/nocodb/src/lib/models/User.ts similarity index 98% rename from packages/nocodb/src/lib/noco-models/User.ts rename to packages/nocodb/src/lib/models/User.ts index 7e7cdf3bdc..17023bbb7d 100644 --- a/packages/nocodb/src/lib/noco-models/User.ts +++ b/packages/nocodb/src/lib/models/User.ts @@ -2,7 +2,7 @@ import { UserType } from 'nocodb-sdk'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import Noco from '../noco/Noco'; import extractProps from '../noco/meta/helpers/extractProps'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; export default class User implements UserType { id: number; diff --git a/packages/nocodb/src/lib/noco-models/View.ts b/packages/nocodb/src/lib/models/View.ts similarity index 99% rename from packages/nocodb/src/lib/noco-models/View.ts rename to packages/nocodb/src/lib/models/View.ts index 381abc88b7..1eaf1f50a5 100644 --- a/packages/nocodb/src/lib/noco-models/View.ts +++ b/packages/nocodb/src/lib/models/View.ts @@ -17,7 +17,7 @@ import { isSystemColumn, ViewType, ViewTypes } from 'nocodb-sdk'; import GalleryViewColumn from './GalleryViewColumn'; import FormViewColumn from './FormViewColumn'; import Column from './Column'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import extractProps from '../noco/meta/helpers/extractProps'; const { v4: uuidv4 } = require('uuid'); diff --git a/packages/nocodb/src/lib/noco/NcProjectBuilder.ts b/packages/nocodb/src/lib/noco/NcProjectBuilder.ts index c6ffd1d96c..24a19324f5 100644 --- a/packages/nocodb/src/lib/noco/NcProjectBuilder.ts +++ b/packages/nocodb/src/lib/noco/NcProjectBuilder.ts @@ -6,7 +6,7 @@ import { Router } from 'express'; import { SqlClientFactory, Tele } from 'nc-help'; import { NcConfig } from '../../interface/config'; -import Migrator from '../migrator/SqlMigrator/lib/KnexMigrator'; +import Migrator from '../sql-migrator/lib/KnexMigrator'; import Noco from './Noco'; import { GqlApiBuilder } from './gql/GqlApiBuilder'; @@ -702,14 +702,14 @@ export default class NcProjectBuilder { config: this.config, projectId: this.id }); - /* create migrator */ + /* create sql-migrator */ const migrator = new Migrator({ project_id: this.id, config: this.config, 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( this.app.getToolDir(), 'nc', @@ -725,7 +725,7 @@ export default class NcProjectBuilder { }); } - /* migrator : sync & up */ + /* sql-migrator : sync & up */ await migrator.sync({ folder: this.app.getToolDir(), env: this.appConfig.workingEnv, diff --git a/packages/nocodb/src/lib/noco/Noco.ts b/packages/nocodb/src/lib/noco/Noco.ts index 5fe7de491d..241a97d732 100644 --- a/packages/nocodb/src/lib/noco/Noco.ts +++ b/packages/nocodb/src/lib/noco/Noco.ts @@ -16,7 +16,7 @@ import requestIp from 'request-ip'; import { v4 as uuidv4 } from 'uuid'; 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 NcProjectBuilderCE from './NcProjectBuilder'; @@ -34,10 +34,10 @@ import mkdirp from 'mkdirp'; import MetaAPILogger from './meta/MetaAPILogger'; import NcUpgrader from './upgrader/NcUpgrader'; import NcMetaMgrv2 from './meta/NcMetaMgrv2'; -import NocoCache from '../noco-cache/NocoCache'; +import NocoCache from '../cache/NocoCache'; import registerMetaApis from './meta/api'; import NcPluginMgrv2 from './meta/helpers/NcPluginMgrv2'; -import User from '../noco-models/User'; +import User from '../models/User'; import { Tele } from 'nc-help'; import * as http from 'http'; import weAreHiring from '../utils/weAreHiring'; diff --git a/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts b/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts index 29cb78a069..70f6156416 100644 --- a/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts +++ b/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts @@ -14,9 +14,9 @@ import { import XcDynamicChanges from '../../../interface/XcDynamicChanges'; import { Acls, DbConfig, NcConfig } from '../../../interface/config'; -import { BaseModelSql, XKnex } from '../../dataMapper'; -import ModelXcMetaFactory from '../../sqlMgr/code/models/xc/ModelXcMetaFactory'; -import ExpressXcPolicy from '../../sqlMgr/code/policies/xc/ExpressXcPolicy'; +import { BaseModelSql, XKnex } from '../../sql-data-mapper'; +import ModelXcMetaFactory from '../../sql-mgr/code/models/xc/ModelXcMetaFactory'; +import ExpressXcPolicy from '../../sql-mgr/code/policies/xc/ExpressXcPolicy'; import NcHelp from '../../utils/NcHelp'; import NcProjectBuilder from '../NcProjectBuilder'; import Noco from '../Noco'; diff --git a/packages/nocodb/src/lib/noco/common/BaseModel.ts b/packages/nocodb/src/lib/noco/common/BaseModel.ts index 938b66b4e8..51b79d36f0 100644 --- a/packages/nocodb/src/lib/noco/common/BaseModel.ts +++ b/packages/nocodb/src/lib/noco/common/BaseModel.ts @@ -2,7 +2,7 @@ import Handlebars from 'handlebars'; import { IWebhookNotificationAdapter } from 'nc-plugin'; import ejs from 'ejs'; import IEmailAdapter from '../../../interface/IEmailAdapter'; -import { BaseModelSql } from '../../dataMapper'; +import { BaseModelSql } from '../../sql-data-mapper'; // import axios from "axios"; import BaseApiBuilder from './BaseApiBuilder'; diff --git a/packages/nocodb/src/lib/noco/common/NcConnectionMgr.ts b/packages/nocodb/src/lib/noco/common/NcConnectionMgr.ts index 3d7c577cd6..28a0a1d2e1 100644 --- a/packages/nocodb/src/lib/noco/common/NcConnectionMgr.ts +++ b/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 fs from 'fs'; import Knex from 'knex'; diff --git a/packages/nocodb/src/lib/noco/common/NcConnectionMgrv2.ts b/packages/nocodb/src/lib/noco/common/NcConnectionMgrv2.ts index ebe4c1c66a..1a23dac973 100644 --- a/packages/nocodb/src/lib/noco/common/NcConnectionMgrv2.ts +++ b/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 fs from 'fs'; // import Knex from 'knex'; @@ -6,7 +6,7 @@ import { XKnex } from '../../dataMapper'; import { SqlClientFactory } from 'nc-help'; // import NcMetaIO from '../meta/NcMetaIO'; import { defaultConnectionConfig } from '../../utils/NcConfigFactory'; -import Base from '../../noco-models/Base'; +import Base from '../../models/Base'; import Noco from '../Noco'; export default class NcConnectionMgrv2 { diff --git a/packages/nocodb/src/lib/noco/common/XcMigrationSource.ts b/packages/nocodb/src/lib/noco/common/XcMigrationSource.ts index 7d128b13da..6406da240c 100644 --- a/packages/nocodb/src/lib/noco/common/XcMigrationSource.ts +++ b/packages/nocodb/src/lib/noco/common/XcMigrationSource.ts @@ -1,14 +1,14 @@ -import * as project from '../migrations/nc_001_init'; -import * as m2m from '../migrations/nc_002_add_m2m'; -import * as fkn from '../migrations/nc_003_add_fkn_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 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_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_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 project from '../../migrations/nc_001_init'; +import * as m2m from '../../migrations/nc_002_add_m2m'; +import * as fkn from '../../migrations/nc_003_add_fkn_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 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_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_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'; // Create a custom migration source class export default class XcMigrationSource { diff --git a/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts b/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts index f9e14a9bbb..faae32d1f9 100644 --- a/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts +++ b/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts @@ -1,9 +1,9 @@ -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_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_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_011 from '../../migrationsv2/nc_011'; +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_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_016_alter_hooklog_payload_types from '../../migrationsv2/nc_016_alter_hooklog_payload_types'; // Create a custom migration source class export default class XcMigrationSourcev2 { diff --git a/packages/nocodb/src/lib/noco/gql/GqlApiBuilder.ts b/packages/nocodb/src/lib/noco/gql/GqlApiBuilder.ts index db8aeba3d2..9ccc8eb388 100644 --- a/packages/nocodb/src/lib/noco/gql/GqlApiBuilder.ts +++ b/packages/nocodb/src/lib/noco/gql/GqlApiBuilder.ts @@ -8,9 +8,9 @@ import { BaseType } from 'xc-core-ts'; import XcMetaMgr from '../../../interface/XcMetaMgr'; import { DbConfig, NcConfig } from '../../../interface/config'; -import ExpressXcTsPolicyGql from '../../sqlMgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql'; -import GqlXcSchemaFactory from '../../sqlMgr/code/gql-schema/xc-ts/GqlXcSchemaFactory'; -import ModelXcMetaFactory from '../../sqlMgr/code/models/xc/ModelXcMetaFactory'; +import ExpressXcTsPolicyGql from '../../sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql'; +import GqlXcSchemaFactory from '../../sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory'; +import ModelXcMetaFactory from '../../sql-mgr/code/models/xc/ModelXcMetaFactory'; import NcHelp from '../../utils/NcHelp'; import NcProjectBuilder from '../NcProjectBuilder'; import Noco from '../Noco'; diff --git a/packages/nocodb/src/lib/noco/gql/GqlAuthResolver.ts b/packages/nocodb/src/lib/noco/gql/GqlAuthResolver.ts index ff538318e8..4b02339355 100644 --- a/packages/nocodb/src/lib/noco/gql/GqlAuthResolver.ts +++ b/packages/nocodb/src/lib/noco/gql/GqlAuthResolver.ts @@ -8,7 +8,7 @@ import { ExtractJwt, Strategy } from 'passport-jwt'; import IEmailAdapter from '../../../interface/IEmailAdapter'; import { DbConfig, NcConfig } from '../../../interface/config'; -import { Knex, XKnex } from '../../dataMapper'; +import { Knex, XKnex } from '../../sql-data-mapper'; import Noco from '../Noco'; import authSchema from './auth/schema'; diff --git a/packages/nocodb/src/lib/noco/gql/GqlCommonResolvers.ts b/packages/nocodb/src/lib/noco/gql/GqlCommonResolvers.ts index ee02396359..a0bedf4466 100644 --- a/packages/nocodb/src/lib/noco/gql/GqlCommonResolvers.ts +++ b/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 = ({ models = {} diff --git a/packages/nocodb/src/lib/noco/gql/GqlResolver.ts b/packages/nocodb/src/lib/noco/gql/GqlResolver.ts index 95dde43251..e99c00181d 100644 --- a/packages/nocodb/src/lib/noco/gql/GqlResolver.ts +++ b/packages/nocodb/src/lib/noco/gql/GqlResolver.ts @@ -1,7 +1,7 @@ import autoBind from 'auto-bind'; import { Acls } from '../../../interface/config'; -import { BaseModelSql } from '../../dataMapper'; +import { BaseModelSql } from '../../sql-data-mapper'; import Noco from '../Noco'; import GqlBaseResolver from './GqlBaseResolver'; diff --git a/packages/nocodb/src/lib/noco/meta/MetaAPILogger.ts b/packages/nocodb/src/lib/noco/meta/MetaAPILogger.ts index a7bc36ce12..37ef33f0f5 100644 --- a/packages/nocodb/src/lib/noco/meta/MetaAPILogger.ts +++ b/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'; export default class MetaAPILogger { diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaIO.ts b/packages/nocodb/src/lib/noco/meta/NcMetaIO.ts index 47991064f9..06f535fd17 100644 --- a/packages/nocodb/src/lib/noco/meta/NcMetaIO.ts +++ b/packages/nocodb/src/lib/noco/meta/NcMetaIO.ts @@ -1,6 +1,6 @@ import { NcConfig } from '../../../interface/config'; import Noco from '../Noco'; -import { XKnex } from '../../dataMapper'; +import { XKnex } from '../../sql-data-mapper'; const META_TABLES = { graphql: [ diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts b/packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts index f2dcb929ec..22f83ce15e 100644 --- a/packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts +++ b/packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts @@ -2,7 +2,7 @@ import CryptoJS from 'crypto-js'; import { customAlphabet } from 'nanoid'; import { NcConfig } from '../../../interface/config'; -import { Knex, XKnex } from '../../dataMapper'; +import { Knex, XKnex } from '../../sql-data-mapper'; import Noco from '../Noco'; import XcMigrationSource from '../common/XcMigrationSource'; diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts b/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts index 1dbd938dea..bcac3235c2 100644 --- a/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts +++ b/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts @@ -20,10 +20,10 @@ import IEmailAdapter from '../../../interface/IEmailAdapter'; import IStorageAdapter from '../../../interface/IStorageAdapter'; import { NcConfig, Result } from '../../../interface/config'; import { NcConfigFactory } from '../../index'; -import ProjectMgr from '../../sqlMgr/ProjectMgr'; -import ExpressXcTsRoutes from '../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutes'; -import ExpressXcTsRoutesBt from '../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesBt'; -import ExpressXcTsRoutesHm from '../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesHm'; +import ProjectMgr from '../../sql-mgr/ProjectMgr'; +import ExpressXcTsRoutes from '../../sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes'; +import ExpressXcTsRoutesBt from '../../sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt'; +import ExpressXcTsRoutesHm from '../../sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm'; import NcHelp from '../../utils/NcHelp'; import mimetypes, { mimeIcons } from '../../utils/mimeTypes'; import projectAcl from '../../utils/projectAcl'; @@ -36,7 +36,7 @@ import RestAuthCtrl from '../rest/RestAuthCtrlEE'; import { packageVersion } from 'nc-help'; import NcMetaIO, { META_TABLES } from './NcMetaIO'; import { promisify } from 'util'; -import NcTemplateParser from '../../templateParser/NcTemplateParser'; +import NcTemplateParser from '../../template-parser/NcTemplateParser'; import { defaultConnectionConfig } from '../../utils/NcConfigFactory'; import xcMetaDiff from './handlers/xcMetaDiff'; import { UITypes } from 'nocodb-sdk'; diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaMgrv2.ts b/packages/nocodb/src/lib/noco/meta/NcMetaMgrv2.ts index 87e7b37783..94e475350a 100644 --- a/packages/nocodb/src/lib/noco/meta/NcMetaMgrv2.ts +++ b/packages/nocodb/src/lib/noco/meta/NcMetaMgrv2.ts @@ -3,7 +3,7 @@ import { Handler, Router } from 'express'; import multer from 'multer'; import { NcConfig } from '../../../interface/config'; -import ProjectMgr from '../../sqlMgr/ProjectMgr'; +import ProjectMgr from '../../sql-mgr/ProjectMgr'; import projectAcl from '../../utils/projectAcl'; import Noco from '../Noco'; import NcPluginMgr from '../plugins/NcPluginMgr'; diff --git a/packages/nocodb/src/lib/noco/meta/api/apiTokenApis.ts b/packages/nocodb/src/lib/noco/meta/api/apiTokenApis.ts index 3f623295de..d2699bb6eb 100644 --- a/packages/nocodb/src/lib/noco/meta/api/apiTokenApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/apiTokenApis.ts @@ -1,6 +1,6 @@ import { Request, Response, Router } from 'express'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; -import ApiToken from '../../../noco-models/ApiToken'; +import ApiToken from '../../../models/ApiToken'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/auditApis.ts b/packages/nocodb/src/lib/noco/meta/api/auditApis.ts index baa2e33c71..9295ff20dd 100644 --- a/packages/nocodb/src/lib/noco/meta/api/auditApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/auditApis.ts @@ -1,7 +1,7 @@ import { Request, Response, Router } from 'express'; -import Audit from '../../../noco-models/Audit'; +import Audit from '../../../models/Audit'; import { AuditOperationSubTypes, AuditOperationTypes } from 'nocodb-sdk'; -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; import { PagedResponseImpl } from '../helpers/PagedResponse'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; diff --git a/packages/nocodb/src/lib/noco/meta/api/cacheApis.ts b/packages/nocodb/src/lib/noco/meta/api/cacheApis.ts index 082aab1aa5..e9cc5d327a 100644 --- a/packages/nocodb/src/lib/noco/meta/api/cacheApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/cacheApis.ts @@ -1,5 +1,5 @@ import catchError from '../helpers/catchError'; -import NocoCache from '../../../noco-cache/NocoCache'; +import NocoCache from '../../../cache/NocoCache'; import { Router } from 'express'; export async function cacheGet(_, res) { diff --git a/packages/nocodb/src/lib/noco/meta/api/columnApis.ts b/packages/nocodb/src/lib/noco/meta/api/columnApis.ts index 02e6cdfbc7..646dab3a85 100644 --- a/packages/nocodb/src/lib/noco/meta/api/columnApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/columnApis.ts @@ -1,13 +1,13 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../noco-models/Model'; -import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; -import Base from '../../../noco-models/Base'; -import Column from '../../../noco-models/Column'; +import Model from '../../../models/Model'; +import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; +import Base from '../../../models/Base'; +import Column from '../../../models/Column'; import validateParams from '../helpers/validateParams'; import { Tele } from 'nc-help'; import { customAlphabet } from 'nanoid'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import { getUniqueColumnAliasName, getUniqueColumnName @@ -23,8 +23,8 @@ import { TableType, UITypes } from 'nocodb-sdk'; -import Audit from '../../../noco-models/Audit'; -import SqlMgrv2 from '../../../sqlMgr/v2/SqlMgrv2'; +import Audit from '../../../models/Audit'; +import SqlMgrv2 from '../../../sql-mgr/v2/SqlMgrv2'; import Noco from '../../Noco'; import NcMetaIO from '../NcMetaIO'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; @@ -33,7 +33,7 @@ import getColumnPropsFromUIDT from '../helpers/getColumnPropsFromUIDT'; import mapDefaultPrimaryValue from '../helpers/mapDefaultPrimaryValue'; import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import FormulaColumn from '../../../noco-models/FormulaColumn'; +import FormulaColumn from '../../../models/FormulaColumn'; import { MetaTable } from '../../../utils/globals'; const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 10); @@ -728,7 +728,7 @@ export async function columnDelete(req: Request, res: Response) { const base = await Base.get(table.base_id); // const ncMeta = await Noco.ncMeta.startTransaction(); - // const sqlMgr = await ProjectMgrv2.getSqlMgrTrans( + // const sql-mgr = await ProjectMgrv2.getSqlMgrTrans( // { id: base.project_id }, // ncMeta, // base @@ -929,12 +929,12 @@ export async function columnDelete(req: Request, res: Response) { } // await ncMeta.commit(); - // await sqlMgr.commit(); + // await sql-mgr.commit(); Tele.emit('evt', { evt_type: 'column:deleted' }); res.json(table); // } catch (e) { - // sqlMgr.rollback(); + // sql-mgr.rollback(); // ncMeta.rollback(); // throw e; // } diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/bulkDataAliasApis.ts b/packages/nocodb/src/lib/noco/meta/api/dataApis/bulkDataAliasApis.ts index 5e0a8b9c73..eb19e3bbce 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/bulkDataAliasApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/dataApis/bulkDataAliasApis.ts @@ -1,6 +1,6 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../noco-models/Model'; -import Base from '../../../../noco-models/Base'; +import Model from '../../../../models/Model'; +import Base from '../../../../models/Base'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import { getViewAndModelFromRequestByAliasOrId } from './helpers'; diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts b/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts index ef85e362de..a96eede04e 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts @@ -1,14 +1,14 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../noco-models/Model'; +import Model from '../../../../models/Model'; import { nocoExecute } from 'nc-help'; -import Base from '../../../../noco-models/Base'; +import Base from '../../../../models/Base'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; -import View from '../../../../noco-models/View'; +import View from '../../../../models/View'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import { getViewAndModelFromRequestByAliasOrId } from './helpers'; 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) { const { model, view } = await getViewAndModelFromRequestByAliasOrId(req); diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasNestedApis.ts b/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasNestedApis.ts index fa070beb73..d0d839980e 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasNestedApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasNestedApis.ts @@ -1,6 +1,6 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../noco-models/Model'; -import Base from '../../../../noco-models/Base'; +import Model from '../../../../models/Model'; +import Base from '../../../../models/Base'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataApis.ts b/packages/nocodb/src/lib/noco/meta/api/dataApis/dataApis.ts index 780367c4ab..f733016cfd 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/dataApis/dataApis.ts @@ -1,14 +1,14 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../noco-models/Model'; +import Model from '../../../../models/Model'; import { nocoExecute } from 'nc-help'; -import Base from '../../../../noco-models/Base'; +import Base from '../../../../models/Base'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; -import View from '../../../../noco-models/View'; +import View from '../../../../models/View'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import { NcError } from '../../helpers/catchError'; 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) { const view = await View.get(req.params.viewId); diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/helpers.ts b/packages/nocodb/src/lib/noco/meta/api/dataApis/helpers.ts index fb509dba69..7ba675b184 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/helpers.ts +++ b/packages/nocodb/src/lib/noco/meta/api/dataApis/helpers.ts @@ -1,19 +1,19 @@ -import Project from '../../../../noco-models/Project'; -import Model from '../../../../noco-models/Model'; -import View from '../../../../noco-models/View'; +import Project from '../../../../models/Project'; +import Model from '../../../../models/Model'; +import View from '../../../../models/View'; import { NcError } from '../../helpers/catchError'; import { Request } from 'express'; -import Base from '../../../../noco-models/Base'; +import Base from '../../../../models/Base'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import { isSystemColumn, UITypes } from 'nocodb-sdk'; import { nocoExecute } from 'nc-help'; -import Column from '../../../../noco-models/Column'; -import LookupColumn from '../../../../noco-models/LookupColumn'; -import LinkToAnotherRecordColumn from '../../../../noco-models/LinkToAnotherRecordColumn'; +import Column from '../../../../models/Column'; +import LookupColumn from '../../../../models/LookupColumn'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; 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( req: | Request<{ projectName: string; tableName: string; viewName?: string }> diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/oldDataApis.ts b/packages/nocodb/src/lib/noco/meta/api/dataApis/oldDataApis.ts index 53f6952364..08f2f81358 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/oldDataApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/dataApis/oldDataApis.ts @@ -1,14 +1,14 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../noco-models/Model'; +import Model from '../../../../models/Model'; import { nocoExecute } from 'nc-help'; -import Base from '../../../../noco-models/Base'; +import Base from '../../../../models/Base'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; -import View from '../../../../noco-models/View'; +import View from '../../../../models/View'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; -import Project from '../../../../noco-models/Project'; +import Project from '../../../../models/Project'; import { NcError } from '../../helpers/catchError'; 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) { const { model, view } = await getViewAndModelFromRequest(req); diff --git a/packages/nocodb/src/lib/noco/meta/api/exportApis.ts b/packages/nocodb/src/lib/noco/meta/api/exportApis.ts index 9bbd8b2452..7a8b486c04 100644 --- a/packages/nocodb/src/lib/noco/meta/api/exportApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/exportApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import View from '../../../noco-models/View'; +import View from '../../../models/View'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { extractCsvData } from './dataApis/helpers'; diff --git a/packages/nocodb/src/lib/noco/meta/api/filterApis.ts b/packages/nocodb/src/lib/noco/meta/api/filterApis.ts index 7aa16bde8a..86ea0a5929 100644 --- a/packages/nocodb/src/lib/noco/meta/api/filterApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/filterApis.ts @@ -1,15 +1,15 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; // @ts-ignore import { PagedResponseImpl } from '../helpers/PagedResponse'; // @ts-ignore import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk'; // @ts-ignore -import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../noco-models/Project'; -import Filter from '../../../noco-models/Filter'; +import Project from '../../../models/Project'; +import Filter from '../../../models/Filter'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/formViewApis.ts b/packages/nocodb/src/lib/noco/meta/api/formViewApis.ts index b14ad82c50..47f55db4fc 100644 --- a/packages/nocodb/src/lib/noco/meta/api/formViewApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/formViewApis.ts @@ -1,15 +1,15 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; // @ts-ignore import { PagedResponseImpl } from '../helpers/PagedResponse'; import { FormType, ViewTypes } from 'nocodb-sdk'; // @ts-ignore -import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../noco-models/Project'; -import View from '../../../noco-models/View'; -import FormView from '../../../noco-models/FormView'; +import Project from '../../../models/Project'; +import View from '../../../models/View'; +import FormView from '../../../models/FormView'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts b/packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts index adb8370c5f..12268866d4 100644 --- a/packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import FormViewColumn from '../../../noco-models/FormViewColumn'; +import FormViewColumn from '../../../models/FormViewColumn'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/galleryViewApis.ts b/packages/nocodb/src/lib/noco/meta/api/galleryViewApis.ts index 92fe2cc413..b219847a15 100644 --- a/packages/nocodb/src/lib/noco/meta/api/galleryViewApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/galleryViewApis.ts @@ -1,7 +1,7 @@ import { Request, Response, Router } from 'express'; import { GalleryType, ViewTypes } from 'nocodb-sdk'; -import View from '../../../noco-models/View'; -import GalleryView from '../../../noco-models/GalleryView'; +import View from '../../../models/View'; +import GalleryView from '../../../models/GalleryView'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/gridViewApis.ts b/packages/nocodb/src/lib/noco/meta/api/gridViewApis.ts index d5dc62cf02..fcf919db01 100644 --- a/packages/nocodb/src/lib/noco/meta/api/gridViewApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/gridViewApis.ts @@ -1,14 +1,14 @@ import { Request, Router } from 'express'; // @ts-ignore -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; // @ts-ignore import { PagedResponseImpl } from '../helpers/PagedResponse'; import { ViewTypes } from 'nocodb-sdk'; // @ts-ignore -import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../noco-models/Project'; -import View from '../../../noco-models/View'; +import Project from '../../../models/Project'; +import View from '../../../models/View'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/gridViewColumnApis.ts b/packages/nocodb/src/lib/noco/meta/api/gridViewColumnApis.ts index 3c02ac9b57..cd1779f4fe 100644 --- a/packages/nocodb/src/lib/noco/meta/api/gridViewColumnApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/gridViewColumnApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import GridViewColumn from '../../../noco-models/GridViewColumn'; +import GridViewColumn from '../../../models/GridViewColumn'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/hookApis.ts b/packages/nocodb/src/lib/noco/meta/api/hookApis.ts index e6cfb1ca2b..9dc7e3e431 100644 --- a/packages/nocodb/src/lib/noco/meta/api/hookApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/hookApis.ts @@ -1,10 +1,10 @@ import catchError from '../helpers/catchError'; import { Request, Response, Router } from 'express'; -import Hook from '../../../noco-models/Hook'; +import Hook from '../../../models/Hook'; import { HookListType, HookType } from 'nocodb-sdk'; import { PagedResponseImpl } from '../helpers/PagedResponse'; import { invokeWebhook } from '../helpers/webhookHelpers'; -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; import populateSamplePayload from '../helpers/populateSamplePayload'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; diff --git a/packages/nocodb/src/lib/noco/meta/api/hookFilterApis.ts b/packages/nocodb/src/lib/noco/meta/api/hookFilterApis.ts index 621a64dc65..2ace40b883 100644 --- a/packages/nocodb/src/lib/noco/meta/api/hookFilterApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/hookFilterApis.ts @@ -1,15 +1,15 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; // @ts-ignore import { PagedResponseImpl } from '../helpers/PagedResponse'; // @ts-ignore import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk'; // @ts-ignore -import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../noco-models/Project'; -import Filter from '../../../noco-models/Filter'; +import Project from '../../../models/Project'; +import Filter from '../../../models/Filter'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/metaDiffApis.ts b/packages/nocodb/src/lib/noco/meta/api/metaDiffApis.ts index 659fc00392..de80b4ea70 100644 --- a/packages/nocodb/src/lib/noco/meta/api/metaDiffApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/metaDiffApis.ts @@ -1,15 +1,15 @@ // // Project CRUD import ncMetaAclMw from '../helpers/ncMetaAclMw'; -import Model from '../../../noco-models/Model'; -import Project from '../../../noco-models/Project'; +import Model from '../../../models/Model'; +import Project from '../../../models/Project'; import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; import { isVirtualCol, ModelTypes, RelationTypes, UITypes } from 'nocodb-sdk'; import { Router } from 'express'; -import Base from '../../../noco-models/Base'; -import ModelXcMetaFactory from '../../../sqlMgr/code/models/xc/ModelXcMetaFactory'; -import Column from '../../../noco-models/Column'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; +import Base from '../../../models/Base'; +import ModelXcMetaFactory from '../../../sql-mgr/code/models/xc/ModelXcMetaFactory'; +import Column from '../../../models/Column'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import { getUniqueColumnAliasName } from '../helpers/getUniqueName'; import NcHelp from '../../../utils/NcHelp'; import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; diff --git a/packages/nocodb/src/lib/noco/meta/api/modelVisibilityApis.ts b/packages/nocodb/src/lib/noco/meta/api/modelVisibilityApis.ts index a5aab04377..2a901abfc2 100644 --- a/packages/nocodb/src/lib/noco/meta/api/modelVisibilityApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/modelVisibilityApis.ts @@ -1,9 +1,9 @@ -import Model from '../../../noco-models/Model'; -import ModelRoleVisibility from '../../../noco-models/ModelRoleVisibility'; +import Model from '../../../models/Model'; +import ModelRoleVisibility from '../../../models/ModelRoleVisibility'; import { Router } from 'express'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; -import Project from '../../../noco-models/Project'; +import Project from '../../../models/Project'; import { metaApiMetrics } from '../helpers/apiMetrics'; async function xcVisibilityMetaSetAll(req, res) { Tele.emit('evt', { evt_type: 'uiAcl:updated' }); diff --git a/packages/nocodb/src/lib/noco/meta/api/pluginApis.ts b/packages/nocodb/src/lib/noco/meta/api/pluginApis.ts index e37c0fb40b..338608876f 100644 --- a/packages/nocodb/src/lib/noco/meta/api/pluginApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/pluginApis.ts @@ -1,6 +1,6 @@ import { Request, Response, Router } from 'express'; import { PagedResponseImpl } from '../helpers/PagedResponse'; -import Plugin from '../../../noco-models/Plugin'; +import Plugin from '../../../models/Plugin'; import { PluginType } from 'nocodb-sdk'; import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; diff --git a/packages/nocodb/src/lib/noco/meta/api/projectApis.ts b/packages/nocodb/src/lib/noco/meta/api/projectApis.ts index 33e48d693c..d7485a26ab 100644 --- a/packages/nocodb/src/lib/noco/meta/api/projectApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/projectApis.ts @@ -1,19 +1,19 @@ import { Request, Response } from 'express'; -import Project from '../../../noco-models/Project'; +import Project from '../../../models/Project'; import { ModelTypes, ProjectListType, UITypes } from 'nocodb-sdk'; import { PagedResponseImpl } from '../helpers/PagedResponse'; import syncMigration from '../helpers/syncMigration'; import { IGNORE_TABLES } from '../../common/BaseApiBuilder'; -import Column from '../../../noco-models/Column'; -import Model from '../../../noco-models/Model'; +import Column from '../../../models/Column'; +import Model from '../../../models/Model'; import NcHelp from '../../../utils/NcHelp'; -import Base from '../../../noco-models/Base'; +import Base from '../../../models/Base'; import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; -import ProjectUser from '../../../noco-models/ProjectUser'; +import ProjectUser from '../../../models/ProjectUser'; import { customAlphabet } from 'nanoid'; import Noco from '../../Noco'; import isDocker from 'is-docker'; diff --git a/packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts b/packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts index 3075e70f73..c686caec2c 100644 --- a/packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts @@ -1,14 +1,14 @@ import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Router } from 'express'; import { PagedResponseImpl } from '../helpers/PagedResponse'; -import ProjectUser from '../../../noco-models/ProjectUser'; +import ProjectUser from '../../../models/ProjectUser'; import validator from 'validator'; import { NcError } from '../helpers/catchError'; import { v4 as uuidv4 } from 'uuid'; -import User from '../../../noco-models/User'; +import User from '../../../models/User'; import { Tele } from 'nc-help'; -import Audit from '../../../noco-models/Audit'; -import NocoCache from '../../../noco-cache/NocoCache'; +import Audit from '../../../models/Audit'; +import NocoCache from '../../../cache/NocoCache'; import { CacheGetType, CacheScope, MetaTable } from '../../../utils/globals'; import * as ejs from 'ejs'; import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; diff --git a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataApis.ts b/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataApis.ts index 179d93055f..8122c71c56 100644 --- a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataApis.ts @@ -1,22 +1,22 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../noco-models/Model'; +import Model from '../../../../models/Model'; import { nocoExecute } from 'nc-help'; -import Base from '../../../../noco-models/Base'; +import Base from '../../../../models/Base'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; -import View from '../../../../noco-models/View'; +import View from '../../../../models/View'; import catchError, { NcError } from '../../helpers/catchError'; import multer from 'multer'; import { ErrorMessages, UITypes, ViewTypes } from 'nocodb-sdk'; -import Column from '../../../../noco-models/Column'; -import LinkToAnotherRecordColumn from '../../../../noco-models/LinkToAnotherRecordColumn'; +import Column from '../../../../models/Column'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; import path from 'path'; import { nanoid } from 'nanoid'; import { mimeIcons } from '../../../../utils/mimeTypes'; import slash from 'slash'; 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) { try { diff --git a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts b/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts index 429f621960..f2ae95db13 100644 --- a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts @@ -1,16 +1,16 @@ import { Request, Response, Router } from 'express'; -import View from '../../../../noco-models/View'; -import Model from '../../../../noco-models/Model'; -import Base from '../../../../noco-models/Base'; +import View from '../../../../models/View'; +import Model from '../../../../models/Model'; +import Base from '../../../../models/Base'; import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; import { nocoExecute } from 'nc-help'; import papaparse from 'papaparse'; import { ErrorMessages, isSystemColumn, UITypes, ViewTypes } from 'nocodb-sdk'; -import Column from '../../../../noco-models/Column'; -import LinkToAnotherRecordColumn from '../../../../noco-models/LinkToAnotherRecordColumn'; -import LookupColumn from '../../../../noco-models/LookupColumn'; +import Column from '../../../../models/Column'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; +import LookupColumn from '../../../../models/LookupColumn'; import catchError, { NcError } from '../../helpers/catchError'; -import getAst from '../../../../dataMapper/lib/sql/helpers/getAst'; +import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst'; async function exportCsv(req: Request, res: Response) { const view = await View.getByUUID(req.params.publicDataUuid); diff --git a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicMetaApis.ts b/packages/nocodb/src/lib/noco/meta/api/publicApis/publicMetaApis.ts index 1516c07405..54e1ac39b0 100644 --- a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicMetaApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/publicApis/publicMetaApis.ts @@ -1,11 +1,11 @@ import { Request, Response, Router } from 'express'; import catchError, { NcError } from '../../helpers/catchError'; -import View from '../../../../noco-models/View'; -import Model from '../../../../noco-models/Model'; +import View from '../../../../models/View'; +import Model from '../../../../models/Model'; import { ErrorMessages, LinkToAnotherRecordType, UITypes } from 'nocodb-sdk'; -import Column from '../../../../noco-models/Column'; -import Base from '../../../../noco-models/Base'; -import Project from '../../../../noco-models/Project'; +import Column from '../../../../models/Column'; +import Base from '../../../../models/Base'; +import Project from '../../../../models/Project'; export async function viewMetaGet(req: Request, res: Response) { const view: View & { diff --git a/packages/nocodb/src/lib/noco/meta/api/sharedBaseApis.ts b/packages/nocodb/src/lib/noco/meta/api/sharedBaseApis.ts index 1fa4be4508..77c5316b28 100644 --- a/packages/nocodb/src/lib/noco/meta/api/sharedBaseApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/sharedBaseApis.ts @@ -2,7 +2,7 @@ import { Router } from 'express'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { v4 as uuidv4 } from 'uuid'; import { Tele } from 'nc-help'; -import Project from '../../../noco-models/Project'; +import Project from '../../../models/Project'; import { NcError } from '../helpers/catchError'; // todo: load from config const config = { diff --git a/packages/nocodb/src/lib/noco/meta/api/sortApis.ts b/packages/nocodb/src/lib/noco/meta/api/sortApis.ts index e0d6083044..4f57112ec5 100644 --- a/packages/nocodb/src/lib/noco/meta/api/sortApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/sortApis.ts @@ -1,14 +1,14 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; // @ts-ignore import { PagedResponseImpl } from '../helpers/PagedResponse'; import { SortListType, TableReqType, TableType } from 'nocodb-sdk'; // @ts-ignore -import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../noco-models/Project'; -import Sort from '../../../noco-models/Sort'; +import Project from '../../../models/Project'; +import Sort from '../../../models/Sort'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getPaths.ts b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getPaths.ts index 603cc8173c..9c8ae78796 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getPaths.ts +++ b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getPaths.ts @@ -1,6 +1,6 @@ import Noco from '../../../../Noco'; -import Model from '../../../../../noco-models/Model'; -import Project from '../../../../../noco-models/Project'; +import Model from '../../../../../models/Model'; +import Project from '../../../../../models/Project'; import { getModelPaths, getViewPaths } from './templates/paths'; import { SwaggerColumn } from './getSwaggerColumnMetas'; import { SwaggerView } from './getSwaggerJSON'; diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSchemas.ts b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSchemas.ts index 562eb7cafe..198206b0a8 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSchemas.ts +++ b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSchemas.ts @@ -1,6 +1,6 @@ import Noco from '../../../../Noco'; -import Model from '../../../../../noco-models/Model'; -import Project from '../../../../../noco-models/Project'; +import Model from '../../../../../models/Model'; +import Project from '../../../../../models/Project'; import { getModelSchemas, getViewSchemas } from './templates/schemas'; import { SwaggerColumn } from './getSwaggerColumnMetas'; import { SwaggerView } from './getSwaggerJSON'; diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerColumnMetas.ts b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerColumnMetas.ts index 8ab1d48142..377a048fa1 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerColumnMetas.ts +++ b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerColumnMetas.ts @@ -1,9 +1,9 @@ import { UITypes } from 'nocodb-sdk'; -import LinkToAnotherRecordColumn from '../../../../../noco-models/LinkToAnotherRecordColumn'; -import SwaggerTypes from '../../../../../sqlMgr/code/routers/xc-ts/SwaggerTypes'; -import Column from '../../../../../noco-models/Column'; +import LinkToAnotherRecordColumn from '../../../../../models/LinkToAnotherRecordColumn'; +import SwaggerTypes from '../../../../../sql-mgr/code/routers/xc-ts/SwaggerTypes'; +import Column from '../../../../../models/Column'; import Noco from '../../../../Noco'; -import Project from '../../../../../noco-models/Project'; +import Project from '../../../../../models/Project'; export default async ( columns: Column[], diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerJSON.ts b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerJSON.ts index 9d2f53d2bc..2657df4bc7 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerJSON.ts +++ b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerJSON.ts @@ -1,13 +1,13 @@ import Noco from '../../../../Noco'; -import Model from '../../../../../noco-models/Model'; +import Model from '../../../../../models/Model'; import swaggerBase from './swagger-base.json'; import getPaths from './getPaths'; import getSchemas from './getSchemas'; -import Project from '../../../../../noco-models/Project'; +import Project from '../../../../../models/Project'; import getSwaggerColumnMetas from './getSwaggerColumnMetas'; import { ViewTypes } from 'nocodb-sdk'; -import GridViewColumn from '../../../../../noco-models/GridViewColumn'; -import View from '../../../../../noco-models/View'; +import GridViewColumn from '../../../../../models/GridViewColumn'; +import View from '../../../../../models/View'; export default async function getSwaggerJSON( project: Project, diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/params.ts b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/params.ts index 88be4ebf79..7d32938953 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/params.ts +++ b/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/params.ts @@ -1,6 +1,6 @@ import { SwaggerColumn } from '../getSwaggerColumnMetas'; import { RelationTypes, UITypes } from 'nocodb-sdk'; -import LinkToAnotherRecordColumn from '../../../../../../noco-models/LinkToAnotherRecordColumn'; +import LinkToAnotherRecordColumn from '../../../../../../models/LinkToAnotherRecordColumn'; export const rowIdParam = { schema: { diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts b/packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts index 3297b02e7e..9d52cbc432 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts @@ -1,9 +1,9 @@ // @ts-ignore import catchError, { NcError } from '../../helpers/catchError'; import { Router } from 'express'; -import Model from '../../../../noco-models/Model'; +import Model from '../../../../models/Model'; import getSwaggerJSON from './helpers/getSwaggerJSON'; -import Project from '../../../../noco-models/Project'; +import Project from '../../../../models/Project'; import swaggerHtml from './swaggerHtml'; import redocHtml from './redocHtml'; diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/importApis.ts b/packages/nocodb/src/lib/noco/meta/api/sync/importApis.ts index d53952514a..a2ce900154 100644 --- a/packages/nocodb/src/lib/noco/meta/api/sync/importApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/sync/importApis.ts @@ -3,9 +3,9 @@ import { Request, Router } from 'express'; // import axios from 'axios'; import catchError from '../../helpers/catchError'; import { Socket } from 'socket.io'; -import NocoJobs from '../../../../noco-jobs/NocoJobs'; +import NocoJobs from '../../../../jobs/NocoJobs'; import job, { AirtableSyncConfig } from './helpers/job'; -import SyncSource from '../../../../noco-models/SyncSource'; +import SyncSource from '../../../../models/SyncSource'; import Noco from '../../../Noco'; import * as jwt from 'jsonwebtoken'; const AIRTABLE_IMPORT_JOB = 'AIRTABLE_IMPORT_JOB'; diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/syncSourceApis.ts b/packages/nocodb/src/lib/noco/meta/api/sync/syncSourceApis.ts index ce2d00b1af..8fd66611e5 100644 --- a/packages/nocodb/src/lib/noco/meta/api/sync/syncSourceApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/sync/syncSourceApis.ts @@ -1,7 +1,7 @@ import { Request, Response, Router } from 'express'; import { Tele } from 'nc-help'; -import SyncSource from '../../../../noco-models/SyncSource'; +import SyncSource from '../../../../models/SyncSource'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; diff --git a/packages/nocodb/src/lib/noco/meta/api/tableApis.ts b/packages/nocodb/src/lib/noco/meta/api/tableApis.ts index 4c2b477b83..e05cc5fdb1 100644 --- a/packages/nocodb/src/lib/noco/meta/api/tableApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/tableApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; import { PagedResponseImpl } from '../helpers/PagedResponse'; import { Tele } from 'nc-help'; import { @@ -12,20 +12,20 @@ import { TableType, UITypes } from 'nocodb-sdk'; -import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; -import Project from '../../../noco-models/Project'; -import Audit from '../../../noco-models/Audit'; +import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; +import Project from '../../../models/Project'; +import Audit from '../../../models/Audit'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { xcVisibilityMetaGet } from './modelVisibilityApis'; -import View from '../../../noco-models/View'; +import View from '../../../models/View'; import getColumnPropsFromUIDT from '../helpers/getColumnPropsFromUIDT'; import mapDefaultPrimaryValue from '../helpers/mapDefaultPrimaryValue'; import { NcError } from '../helpers/catchError'; import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; -import Column from '../../../noco-models/Column'; +import Column from '../../../models/Column'; import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; import getColumnUiType from '../helpers/getColumnUiType'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import { metaApiMetrics } from '../helpers/apiMetrics'; export async function tableGet(req: Request, res: Response) { diff --git a/packages/nocodb/src/lib/noco/meta/api/userApi/initStrategies.ts b/packages/nocodb/src/lib/noco/meta/api/userApi/initStrategies.ts index 36a4198d24..97a70f1853 100644 --- a/packages/nocodb/src/lib/noco/meta/api/userApi/initStrategies.ts +++ b/packages/nocodb/src/lib/noco/meta/api/userApi/initStrategies.ts @@ -1,5 +1,5 @@ -import User from '../../../../noco-models/User'; -import ProjectUser from '../../../../noco-models/ProjectUser'; +import User from '../../../../models/User'; +import ProjectUser from '../../../../models/ProjectUser'; import { promisify } from 'util'; import { Strategy as CustomStrategy } from 'passport-custom'; @@ -17,12 +17,12 @@ const jwtOptions = { }; import bcrypt from 'bcryptjs'; -import Project from '../../../../noco-models/Project'; -import NocoCache from '../../../../noco-cache/NocoCache'; +import Project from '../../../../models/Project'; +import NocoCache from '../../../../cache/NocoCache'; import { CacheGetType, CacheScope } from '../../../../utils/globals'; -import ApiToken from '../../../../noco-models/ApiToken'; +import ApiToken from '../../../../models/ApiToken'; import Noco from '../../../Noco'; -import Plugin from '../../../../noco-models/Plugin'; +import Plugin from '../../../../models/Plugin'; export function initStrategies(router): void { passport.use( diff --git a/packages/nocodb/src/lib/noco/meta/api/userApi/userApis.ts b/packages/nocodb/src/lib/noco/meta/api/userApi/userApis.ts index 12cd235061..eb7c2401b3 100644 --- a/packages/nocodb/src/lib/noco/meta/api/userApi/userApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/userApi/userApis.ts @@ -6,12 +6,12 @@ import * as ejs from 'ejs'; import bcrypt from 'bcryptjs'; import { promisify } from 'util'; -import User from '../../../../noco-models/User'; +import User from '../../../../models/User'; import { Tele } from 'nc-help'; const { v4: uuidv4 } = require('uuid'); import * as jwt from 'jsonwebtoken'; -import Audit from '../../../../noco-models/Audit'; +import Audit from '../../../../models/Audit'; import crypto from 'crypto'; import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; diff --git a/packages/nocodb/src/lib/noco/meta/api/utilApis.ts b/packages/nocodb/src/lib/noco/meta/api/utilApis.ts index 25073bbc54..43349aaa75 100644 --- a/packages/nocodb/src/lib/noco/meta/api/utilApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/utilApis.ts @@ -3,9 +3,9 @@ import { Request, Response } from 'express'; import { packageVersion } from 'nc-help'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; -import SqlMgrv2 from '../../../sqlMgr/v2/SqlMgrv2'; +import SqlMgrv2 from '../../../sql-mgr/v2/SqlMgrv2'; import { defaultConnectionConfig } from '../../../utils/NcConfigFactory'; -import User from '../../../noco-models/User'; +import User from '../../../models/User'; import catchError from '../helpers/catchError'; import axios from 'axios'; diff --git a/packages/nocodb/src/lib/noco/meta/api/viewApis.ts b/packages/nocodb/src/lib/noco/meta/api/viewApis.ts index 7dd3b3f61a..44b23f3885 100644 --- a/packages/nocodb/src/lib/noco/meta/api/viewApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/viewApis.ts @@ -1,15 +1,15 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; // @ts-ignore import { PagedResponseImpl } from '../helpers/PagedResponse'; // @ts-ignore import { Table, TableReq, ViewList } from 'nocodb-sdk'; // @ts-ignore -import ProjectMgrv2 from '../../../sqlMgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../noco-models/Project'; -import View from '../../../noco-models/View'; +import Project from '../../../models/Project'; +import View from '../../../models/View'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { xcVisibilityMetaGet } from './modelVisibilityApis'; import { Tele } from 'nc-help'; diff --git a/packages/nocodb/src/lib/noco/meta/api/viewColumnApis.ts b/packages/nocodb/src/lib/noco/meta/api/viewColumnApis.ts index 2ac50cacfb..00e339764d 100644 --- a/packages/nocodb/src/lib/noco/meta/api/viewColumnApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/viewColumnApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import View from '../../../noco-models/View'; +import View from '../../../models/View'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Tele } from 'nc-help'; import { metaApiMetrics } from '../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/handlersv2/ncCreateLookup.ts b/packages/nocodb/src/lib/noco/meta/handlersv2/ncCreateLookup.ts index b49d5b1f83..1aef11af4b 100644 --- a/packages/nocodb/src/lib/noco/meta/handlersv2/ncCreateLookup.ts +++ b/packages/nocodb/src/lib/noco/meta/handlersv2/ncCreateLookup.ts @@ -1,5 +1,5 @@ import { NcContextV2 } from '../NcMetaMgrv2'; -import Column from '../../../noco-models/Column'; +import Column from '../../../models/Column'; import { UITypes } from 'nocodb-sdk'; export default async function(this: NcContextV2, { args }: any) { diff --git a/packages/nocodb/src/lib/noco/meta/handlersv2/ncGetMeta.ts b/packages/nocodb/src/lib/noco/meta/handlersv2/ncGetMeta.ts index fec9b75e76..a94d252760 100644 --- a/packages/nocodb/src/lib/noco/meta/handlersv2/ncGetMeta.ts +++ b/packages/nocodb/src/lib/noco/meta/handlersv2/ncGetMeta.ts @@ -1,5 +1,5 @@ import { NcContextV2 } from '../NcMetaMgrv2'; -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; export default async function(this: NcContextV2, { args }: any) { const meta = await Model.getByIdOrName({ diff --git a/packages/nocodb/src/lib/noco/meta/helpers/addFormulaErrorIfMissingColumn.ts b/packages/nocodb/src/lib/noco/meta/helpers/addFormulaErrorIfMissingColumn.ts index 4684c8b34f..6c6ce89a7e 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/addFormulaErrorIfMissingColumn.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/addFormulaErrorIfMissingColumn.ts @@ -1,4 +1,4 @@ -import FormulaColumn from '../../../noco-models/FormulaColumn'; +import FormulaColumn from '../../../models/FormulaColumn'; import jsep from 'jsep'; export default function addFormulaErrorIfMissingColumn({ diff --git a/packages/nocodb/src/lib/noco/meta/helpers/extractProjectIdAndAuthenticate.ts b/packages/nocodb/src/lib/noco/meta/helpers/extractProjectIdAndAuthenticate.ts index 9fcad108da..6e68f1779c 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/extractProjectIdAndAuthenticate.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/extractProjectIdAndAuthenticate.ts @@ -1,16 +1,16 @@ import { promisify } from 'util'; import passport from 'passport'; -import Model from '../../../noco-models/Model'; -import View from '../../../noco-models/View'; -import Hook from '../../../noco-models/Hook'; -import GridViewColumn from '../../../noco-models/GridViewColumn'; -import FormViewColumn from '../../../noco-models/FormViewColumn'; -import GalleryViewColumn from '../../../noco-models/GalleryViewColumn'; -import Project from '../../../noco-models/Project'; -import Column from '../../../noco-models/Column'; -import Filter from '../../../noco-models/Filter'; -import Sort from '../../../noco-models/Sort'; +import Model from '../../../models/Model'; +import View from '../../../models/View'; +import Hook from '../../../models/Hook'; +import GridViewColumn from '../../../models/GridViewColumn'; +import FormViewColumn from '../../../models/FormViewColumn'; +import GalleryViewColumn from '../../../models/GalleryViewColumn'; +import Project from '../../../models/Project'; +import Column from '../../../models/Column'; +import Filter from '../../../models/Filter'; +import Sort from '../../../models/Sort'; export default async (req, res, next) => { try { diff --git a/packages/nocodb/src/lib/noco/meta/helpers/getColumnPropsFromUIDT.ts b/packages/nocodb/src/lib/noco/meta/helpers/getColumnPropsFromUIDT.ts index 14dadda942..0187eaf799 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/getColumnPropsFromUIDT.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/getColumnPropsFromUIDT.ts @@ -1,5 +1,5 @@ import { ColumnReqType, SqlUIColumn, SqlUiFactory, UITypes } from 'nocodb-sdk'; -import Base from '../../../noco-models/Base'; +import Base from '../../../models/Base'; export default function getColumnPropsFromUIDT( column: SqlUIColumn & { uidt: UITypes } & ColumnReqType, diff --git a/packages/nocodb/src/lib/noco/meta/helpers/getColumnUiType.ts b/packages/nocodb/src/lib/noco/meta/helpers/getColumnUiType.ts index 4ef6316122..a1b4f1a659 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/getColumnUiType.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/getColumnUiType.ts @@ -1,7 +1,7 @@ -import Base from '../../../noco-models/Base'; -import Column from '../../../noco-models/Column'; +import Base from '../../../models/Base'; +import Column from '../../../models/Column'; import { ColumnType } from 'nocodb-sdk'; -import ModelXcMetaFactory from '../../../sqlMgr/code/models/xc/ModelXcMetaFactory'; +import ModelXcMetaFactory from '../../../sql-mgr/code/models/xc/ModelXcMetaFactory'; export default function getColumnUiType( base: Base, diff --git a/packages/nocodb/src/lib/noco/meta/helpers/getTableName.ts b/packages/nocodb/src/lib/noco/meta/helpers/getTableName.ts index 55d944a4e8..befbf68fb9 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/getTableName.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/getTableName.ts @@ -1,5 +1,5 @@ import inflection from 'inflection'; -import Base from '../../../noco-models/Base'; +import Base from '../../../models/Base'; export default function getTableNameAlias( tableName: string, diff --git a/packages/nocodb/src/lib/noco/meta/helpers/getUniqueName.ts b/packages/nocodb/src/lib/noco/meta/helpers/getUniqueName.ts index 5419efd6ab..c6d097412b 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/getUniqueName.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/getUniqueName.ts @@ -1,4 +1,4 @@ -import Column from '../../../noco-models/Column'; +import Column from '../../../models/Column'; export function getUniqueColumnName(columns: Column[], initialName = 'field') { let c = 0; diff --git a/packages/nocodb/src/lib/noco/meta/helpers/populateSamplePayload.ts b/packages/nocodb/src/lib/noco/meta/helpers/populateSamplePayload.ts index 1c3dc4c5d4..b9be146d1f 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/populateSamplePayload.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/populateSamplePayload.ts @@ -1,11 +1,11 @@ -import View from '../../../noco-models/View'; -import Column from '../../../noco-models/Column'; +import View from '../../../models/View'; +import Column from '../../../models/Column'; import { RelationTypes, UITypes } from 'nocodb-sdk'; -import Model from '../../../noco-models/Model'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; -import LookupColumn from '../../../noco-models/LookupColumn'; -import MultiSelectColumn from '../../../noco-models/MultiSelectColumn'; -import SingleSelectColumn from '../../../noco-models/SingleSelectColumn'; +import Model from '../../../models/Model'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; +import LookupColumn from '../../../models/LookupColumn'; +import MultiSelectColumn from '../../../models/MultiSelectColumn'; +import SingleSelectColumn from '../../../models/SingleSelectColumn'; export default async function populateSamplePayload( viewOrModel: View | Model, diff --git a/packages/nocodb/src/lib/noco/meta/helpers/syncMigration.ts b/packages/nocodb/src/lib/noco/meta/helpers/syncMigration.ts index ff73a0bfbb..45f5b823e2 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/syncMigration.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/syncMigration.ts @@ -1,15 +1,15 @@ -import Migrator from '../../../migrator/SqlMigrator/lib/KnexMigratorv2'; -import Project from '../../../noco-models/Project'; +import Migrator from '../../../sql-migrator/lib/KnexMigratorv2'; +import Project from '../../../models/Project'; export default async function syncMigration(project: Project): Promise { for (const base of await project.getBases()) { try { - /* create migrator */ + /* create sql-migrator */ const migrator = new Migrator(project); await migrator.init(base); - /* migrator : sync & up */ + /* sql-migrator : sync & up */ await migrator.sync(base); await migrator.migrationsUp({ base }); diff --git a/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts b/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts index 491f82d44b..dfa591f885 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts +++ b/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts @@ -1,10 +1,10 @@ import Handlebars from 'handlebars'; -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; import NcPluginMgrv2 from './NcPluginMgrv2'; -import Column from '../../../noco-models/Column'; -import Hook from '../../../noco-models/Hook'; -import Filter from '../../../noco-models/Filter'; -import HookLog from '../../../noco-models/HookLog'; +import Column from '../../../models/Column'; +import Hook from '../../../models/Hook'; +import Filter from '../../../models/Filter'; +import HookLog from '../../../models/HookLog'; import { HookLogType } from 'nocodb-sdk'; export function parseBody( diff --git a/packages/nocodb/src/lib/noco/rest/RestApiBuilder.ts b/packages/nocodb/src/lib/noco/rest/RestApiBuilder.ts index 170d8c31c6..64cfce2e80 100644 --- a/packages/nocodb/src/lib/noco/rest/RestApiBuilder.ts +++ b/packages/nocodb/src/lib/noco/rest/RestApiBuilder.ts @@ -10,13 +10,13 @@ import mkdirp from 'mkdirp'; import { URL } from 'url'; import { DbConfig, NcConfig } from '../../../interface/config'; -import ModelXcMetaFactory from '../../sqlMgr/code/models/xc/ModelXcMetaFactory'; -import SwaggerXc from '../../sqlMgr/code/routers/xc-ts/SwaggerXc'; -import SwaggerXcBt from '../../sqlMgr/code/routers/xc-ts/SwaggerXcBt'; -import SwaggerXcHm from '../../sqlMgr/code/routers/xc-ts/SwaggerXcHm'; -import ExpressXcTsRoutes from '../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutes'; -import ExpressXcTsRoutesBt from '../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesBt'; -import ExpressXcTsRoutesHm from '../../sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesHm'; +import ModelXcMetaFactory from '../../sql-mgr/code/models/xc/ModelXcMetaFactory'; +import SwaggerXc from '../../sql-mgr/code/routers/xc-ts/SwaggerXc'; +import SwaggerXcBt from '../../sql-mgr/code/routers/xc-ts/SwaggerXcBt'; +import SwaggerXcHm from '../../sql-mgr/code/routers/xc-ts/SwaggerXcHm'; +import ExpressXcTsRoutes from '../../sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes'; +import ExpressXcTsRoutesBt from '../../sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt'; +import ExpressXcTsRoutesHm from '../../sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm'; import NcHelp from '../../utils/NcHelp'; import NcProjectBuilder from '../NcProjectBuilder'; import Noco from '../Noco'; @@ -32,13 +32,13 @@ import { RestCtrlBelongsTo } from './RestCtrlBelongsTo'; import { RestCtrlCustom } from './RestCtrlCustom'; import { RestCtrlHasMany } from './RestCtrlHasMany'; import { RestCtrlProcedure } from './RestCtrlProcedure'; -import Column from '../../noco-models/Column'; +import Column from '../../models/Column'; // import NocoTypeGenerator from '../noco-resolver/NocoTypeGenerator'; // import NocoResolverGenerator from '../noco-resolver/NocoResolverGenerator'; // import { RestCtrlv2 } from './RestCtrlv2'; // import registerRestCtrl from './registerRestCtrl'; import { MetaTable } from '../../utils/globals'; -// import { BaseModelSqlv2 } from '../../dataMapper/lib/sql/BaseModelSqlv2'; +// import { BaseModelSqlv2 } from '../../sql-data-mapper/lib/sql/BaseModelSqlv2'; const log = debug('nc:api:rest'); const NC_CUSTOM_ROUTE_KEY = '__xc_custom'; diff --git a/packages/nocodb/src/lib/noco/rest/RestAuthCtrl.ts b/packages/nocodb/src/lib/noco/rest/RestAuthCtrl.ts index ce715c6426..649b2c16ae 100644 --- a/packages/nocodb/src/lib/noco/rest/RestAuthCtrl.ts +++ b/packages/nocodb/src/lib/noco/rest/RestAuthCtrl.ts @@ -12,7 +12,7 @@ import { ExtractJwt, Strategy } from 'passport-jwt'; import validator from 'validator'; import { DbConfig, NcConfig } from '../../../interface/config'; -import { Knex } from '../../dataMapper'; +import { Knex } from '../../sql-data-mapper'; import Noco from '../Noco'; const autoBind = require('auto-bind'); diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrl.ts b/packages/nocodb/src/lib/noco/rest/RestCtrl.ts index 00d385aab1..f9af7096ad 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrl.ts +++ b/packages/nocodb/src/lib/noco/rest/RestCtrl.ts @@ -2,10 +2,10 @@ import autoBind from 'auto-bind'; import { NextFunction, Request, Response, Router } from 'express'; import { Acl, Acls, Route } from '../../../interface/config'; -import { BaseModelSql } from '../../dataMapper'; +import { BaseModelSql } from '../../sql-data-mapper'; import { RestBaseCtrl } from './RestBaseCtrl'; -import { BaseModelSqlv2 } from '../../dataMapper/lib/sql/BaseModelSqlv2'; +import { BaseModelSqlv2 } from '../../sql-data-mapper/lib/sql/BaseModelSqlv2'; function parseHrtimeToSeconds(hrtime) { const seconds = (hrtime[0] + hrtime[1] / 1e6).toFixed(3); diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlBelongsTo.ts b/packages/nocodb/src/lib/noco/rest/RestCtrlBelongsTo.ts index f58154f870..6cde6fafe1 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlBelongsTo.ts +++ b/packages/nocodb/src/lib/noco/rest/RestCtrlBelongsTo.ts @@ -2,7 +2,7 @@ import autoBind from 'auto-bind'; import { NextFunction, Request, Response } from 'express'; import { Acl, Acls, Route } from '../../../interface/config'; -import { BaseModelSql } from '../../dataMapper'; +import { BaseModelSql } from '../../sql-data-mapper'; import { RestBaseCtrl } from './RestBaseCtrl'; diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlCustom.ts b/packages/nocodb/src/lib/noco/rest/RestCtrlCustom.ts index b591207094..87dcc541b3 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlCustom.ts +++ b/packages/nocodb/src/lib/noco/rest/RestCtrlCustom.ts @@ -2,7 +2,7 @@ import autoBind from 'auto-bind'; import { NextFunction, Request, Response, Router } from 'express'; import { Route } from '../../../interface/config'; -import { BaseModelSql } from '../../dataMapper'; +import { BaseModelSql } from '../../sql-data-mapper'; import { RestBaseCtrl } from './RestBaseCtrl'; diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlHasMany.ts b/packages/nocodb/src/lib/noco/rest/RestCtrlHasMany.ts index d58bc4e7f3..1f4a9ab77f 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlHasMany.ts +++ b/packages/nocodb/src/lib/noco/rest/RestCtrlHasMany.ts @@ -2,7 +2,7 @@ import autoBind from 'auto-bind'; import { NextFunction, Request, Response } from 'express'; import { Acl, Acls, Route } from '../../../interface/config'; -import { BaseModelSql } from '../../dataMapper'; +import { BaseModelSql } from '../../sql-data-mapper'; import { RestBaseCtrl } from './RestBaseCtrl'; diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlMin.ts b/packages/nocodb/src/lib/noco/rest/RestCtrlMin.ts index 0acdabf7d1..d878acbf6c 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlMin.ts +++ b/packages/nocodb/src/lib/noco/rest/RestCtrlMin.ts @@ -2,7 +2,7 @@ import autoBind from 'auto-bind'; import { Request, Response, Router } from 'express'; import { Acls } from '../../../interface/config'; -import { BaseModelSql } from '../../dataMapper'; +import { BaseModelSql } from '../../sql-data-mapper'; function parseHrtimeToSeconds(hrtime) { const seconds = (hrtime[0] + hrtime[1] / 1e6).toFixed(3); diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlv2.ts b/packages/nocodb/src/lib/noco/rest/RestCtrlv2.ts index 4743ae4741..428406ddab 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlv2.ts +++ b/packages/nocodb/src/lib/noco/rest/RestCtrlv2.ts @@ -2,9 +2,9 @@ import autoBind from 'auto-bind'; import { Router } from 'express'; import { Acls } from '../../../interface/config'; -import { BaseModelSql } from '../../dataMapper'; +import { BaseModelSql } from '../../sql-data-mapper'; -import { BaseModelSqlv2 } from '../../dataMapper/lib/sql/BaseModelSqlv2'; +import { BaseModelSqlv2 } from '../../sql-data-mapper/lib/sql/BaseModelSqlv2'; // import { nocoExecute } from '../noco-resolver/NocoExecute'; // function parseHrtimeToSeconds(hrtime) { diff --git a/packages/nocodb/src/lib/noco/rest/registerRestCtrl.ts b/packages/nocodb/src/lib/noco/rest/registerRestCtrl.ts index c968bed50c..79e492c5eb 100644 --- a/packages/nocodb/src/lib/noco/rest/registerRestCtrl.ts +++ b/packages/nocodb/src/lib/noco/rest/registerRestCtrl.ts @@ -1,16 +1,16 @@ // import { nocoExecute } from '../noco-resolver/NocoExecute'; // import { Router } from 'express'; -// import Model from '../../noco-models/Model'; -// import Column from '../../noco-models/Column'; +// import Model from '../../models/Model'; +// import Column from '../../models/Column'; // import UITypes from '../../sqlUi/UITypes'; -// import LookupColumn from '../../noco-models/LookupColumn'; -// import RollupColumn from '../../noco-models/RollupColumn'; -// import Filter from '../../noco-models/Filter'; -// import Sort from '../../noco-models/Sort'; -// import LinkToAnotherRecordColumn from '../../noco-models/LinkToAnotherRecordColumn'; +// import LookupColumn from '../../models/LookupColumn'; +// import RollupColumn from '../../models/RollupColumn'; +// import Filter from '../../models/Filter'; +// import Sort from '../../models/Sort'; +// import LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; // import jsep from 'jsep'; // import jsepTreeToFormula from '../common/helpers/jsepTreeToFormula'; -// import FormulaColumn from '../../noco-models/FormulaColumn'; +// import FormulaColumn from '../../models/FormulaColumn'; // import Noco from '../Noco'; // import { MetaTable } from '../../utils/globals'; // diff --git a/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts b/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts index 6b451221c7..651b93ed45 100644 --- a/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts +++ b/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts @@ -1,34 +1,34 @@ import { NcUpgraderCtx } from '../NcUpgrader'; import Noco from '../../Noco'; -import User from '../../../noco-models/User'; -import Project from '../../../noco-models/Project'; -import ProjectUser from '../../../noco-models/ProjectUser'; -import Model from '../../../noco-models/Model'; +import User from '../../../models/User'; +import Project from '../../../models/Project'; +import ProjectUser from '../../../models/ProjectUser'; +import Model from '../../../models/Model'; import { ModelTypes, substituteColumnAliasWithIdInFormula, UITypes, ViewTypes } from 'nocodb-sdk'; -import Column from '../../../noco-models/Column'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; +import Column from '../../../models/Column'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import NcHelp from '../../../utils/NcHelp'; -import RollupColumn from '../../../noco-models/RollupColumn'; -import View from '../../../noco-models/View'; -import GridView from '../../../noco-models/GridView'; -import KanbanView from '../../../noco-models/KanbanView'; -import FormView from '../../../noco-models/FormView'; -import GalleryView from '../../../noco-models/GalleryView'; -import Sort from '../../../noco-models/Sort'; -import Filter from '../../../noco-models/Filter'; -import ModelRoleVisibility from '../../../noco-models/ModelRoleVisibility'; +import RollupColumn from '../../../models/RollupColumn'; +import View from '../../../models/View'; +import GridView from '../../../models/GridView'; +import KanbanView from '../../../models/KanbanView'; +import FormView from '../../../models/FormView'; +import GalleryView from '../../../models/GalleryView'; +import Sort from '../../../models/Sort'; +import Filter from '../../../models/Filter'; +import ModelRoleVisibility from '../../../models/ModelRoleVisibility'; import { MetaTable } from '../../../utils/globals'; -import Hook from '../../../noco-models/Hook'; -import FormViewColumn from '../../../noco-models/FormViewColumn'; -import GridViewColumn from '../../../noco-models/GridViewColumn'; +import Hook from '../../../models/Hook'; +import FormViewColumn from '../../../models/FormViewColumn'; +import GridViewColumn from '../../../models/GridViewColumn'; import { getUniqueColumnAliasName } from '../../meta/helpers/getUniqueName'; import NcProjectBuilderEE from '../../NcProjectBuilderEE'; -import Audit from '../../../noco-models/Audit'; +import Audit from '../../../models/Audit'; export default async function(ctx: NcUpgraderCtx) { const ncMeta = ctx.ncMeta; diff --git a/packages/nocodb/src/lib/dataMapper/README.md b/packages/nocodb/src/lib/sql-data-mapper/README.md similarity index 100% rename from packages/nocodb/src/lib/dataMapper/README.md rename to packages/nocodb/src/lib/sql-data-mapper/README.md diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/conditionClause.test.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/conditionClause.test.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/conditionClause.test.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/conditionClause.test.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/conditionGraph.test.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/conditionGraph.test.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/conditionGraph.test.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/conditionGraph.test.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/models/city.meta.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/city.meta.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/models/city.meta.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/models/city.meta.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/models/city.model.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/city.model.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/models/city.model.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/models/city.model.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/models/country.meta.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/country.meta.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/models/country.meta.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/models/country.meta.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/models/country.model.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/country.model.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/models/country.model.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/models/country.model.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/models/film.meta.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/film.meta.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/models/film.meta.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/models/film.meta.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/models/film.model.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/film.model.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/models/film.model.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/models/film.model.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/models/index.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/index.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/models/index.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/models/index.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/sql.test.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/sql.test.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/sql.test.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/sql.test.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/whereClause.test.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/whereClause.test.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/whereClause.test.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/whereClause.test.js diff --git a/packages/nocodb/src/lib/dataMapper/__tests__/xSelect.test.js b/packages/nocodb/src/lib/sql-data-mapper/__tests__/xSelect.test.js similarity index 100% rename from packages/nocodb/src/lib/dataMapper/__tests__/xSelect.test.js rename to packages/nocodb/src/lib/sql-data-mapper/__tests__/xSelect.test.js diff --git a/packages/nocodb/src/lib/dataMapper/index.ts b/packages/nocodb/src/lib/sql-data-mapper/index.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/index.ts rename to packages/nocodb/src/lib/sql-data-mapper/index.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/BaseModel.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/BaseModel.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/BaseModel.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/BaseModel.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/DbFactory.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/DbFactory.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/DbFactory.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/DbFactory.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSql.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSql.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSqlv2.ts similarity index 99% rename from packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSqlv2.ts index 9c49608848..b2c40b908d 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts +++ b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSqlv2.ts @@ -1,23 +1,23 @@ import autoBind from 'auto-bind'; import _ from 'lodash'; -import Model from '../../../noco-models/Model'; +import Model from '../../../models/Model'; import { XKnex } from '../..'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; -import RollupColumn from '../../../noco-models/RollupColumn'; -import LookupColumn from '../../../noco-models/LookupColumn'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; +import RollupColumn from '../../../models/RollupColumn'; +import LookupColumn from '../../../models/LookupColumn'; import DataLoader from 'dataloader'; -import Column from '../../../noco-models/Column'; +import Column from '../../../models/Column'; import { XcFilter, XcFilterWithAlias } from '../BaseModel'; import conditionV2 from './conditionV2'; -import Filter from '../../../noco-models/Filter'; +import Filter from '../../../models/Filter'; import sortV2 from './sortV2'; -import Sort from '../../../noco-models/Sort'; -import FormulaColumn from '../../../noco-models/FormulaColumn'; +import Sort from '../../../models/Sort'; +import FormulaColumn from '../../../models/FormulaColumn'; import genRollupSelectv2 from './genRollupSelectv2'; import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; import { QueryBuilder } from 'knex'; -import View from '../../../noco-models/View'; +import View from '../../../models/View'; import { AuditOperationSubTypes, AuditOperationTypes, @@ -28,9 +28,9 @@ import { } from 'nocodb-sdk'; import formSubmissionEmailTemplate from '../../../noco/common/formSubmissionEmailTemplate'; import ejs from 'ejs'; -import Audit from '../../../noco-models/Audit'; -import FormView from '../../../noco-models/FormView'; -import Hook from '../../../noco-models/Hook'; +import Audit from '../../../models/Audit'; +import FormView from '../../../models/FormView'; +import Hook from '../../../models/Hook'; import NcPluginMgrv2 from '../../../noco/meta/helpers/NcPluginMgrv2'; import { _transformSubmittedFormDataForEmail, diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/CustomKnex.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/CustomKnex.ts similarity index 99% rename from packages/nocodb/src/lib/dataMapper/lib/sql/CustomKnex.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/CustomKnex.ts index 34d38e7acc..0c3cb68eca 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/CustomKnex.ts +++ b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/CustomKnex.ts @@ -5,7 +5,7 @@ const types = require('pg').types; types.setTypeParser(1082, val => val); import { BaseModelSql } from './BaseModelSql'; -import Filter from '../../../noco-models/Filter'; +import Filter from '../../../models/Filter'; const opMappingGen = { eq: '=', diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/conditionV2.ts similarity index 97% rename from packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/conditionV2.ts index 461619b324..7055ee0727 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/conditionV2.ts +++ b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/conditionV2.ts @@ -1,15 +1,15 @@ -import Filter from '../../../noco-models/Filter'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; +import Filter from '../../../models/Filter'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import { QueryBuilder } from 'knex'; import { XKnex } from '../..'; -import Column from '../../../noco-models/Column'; -import LookupColumn from '../../../noco-models/LookupColumn'; +import Column from '../../../models/Column'; +import LookupColumn from '../../../models/LookupColumn'; import genRollupSelectv2 from './genRollupSelectv2'; -import RollupColumn from '../../../noco-models/RollupColumn'; +import RollupColumn from '../../../models/RollupColumn'; import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; -import FormulaColumn from '../../../noco-models/FormulaColumn'; +import FormulaColumn from '../../../models/FormulaColumn'; import { RelationTypes, UITypes } from 'nocodb-sdk'; -// import LookupColumn from '../../../noco-models/LookupColumn'; +// import LookupColumn from '../../../models/LookupColumn'; export default async function conditionV2( conditionObj: Filter | Filter[], diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/customValidators.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/customValidators.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/customValidators.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/customValidators.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/formulaQueryBuilderFromString.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulaQueryBuilderFromString.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/formulaQueryBuilderFromString.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulaQueryBuilderFromString.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/formulav2/formulaQueryBuilderv2.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts similarity index 98% rename from packages/nocodb/src/lib/dataMapper/lib/sql/formulav2/formulaQueryBuilderv2.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts index a73841eb05..982f4bbda0 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/formulav2/formulaQueryBuilderv2.ts +++ b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts @@ -1,12 +1,12 @@ import jsep from 'jsep'; import mapFunctionName from '../mapFunctionName'; -import Model from '../../../../noco-models/Model'; +import Model from '../../../../models/Model'; import genRollupSelectv2 from '../genRollupSelectv2'; -import RollupColumn from '../../../../noco-models/RollupColumn'; -import FormulaColumn from '../../../../noco-models/FormulaColumn'; +import RollupColumn from '../../../../models/RollupColumn'; +import FormulaColumn from '../../../../models/FormulaColumn'; import { XKnex } from '../../..'; -import LinkToAnotherRecordColumn from '../../../../noco-models/LinkToAnotherRecordColumn'; -import LookupColumn from '../../../../noco-models/LookupColumn'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; +import LookupColumn from '../../../../models/LookupColumn'; import { jsepCurlyHook, UITypes } from 'nocodb-sdk'; // todo: switch function based on database diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/commonFns.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/commonFns.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/commonFns.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/commonFns.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/mssql.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/mssql.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/mssql.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/mssql.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/mysql.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/mysql.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/mysql.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/mysql.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/pg.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/pg.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/pg.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/pg.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/sqlite.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/sqlite.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/functionMappings/sqlite.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/sqlite.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/genRollupSelect.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelect.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/genRollupSelect.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelect.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/genRollupSelectv2.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelectv2.ts similarity index 94% rename from packages/nocodb/src/lib/dataMapper/lib/sql/genRollupSelectv2.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelectv2.ts index 5da9b2fc82..5215cf576d 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/genRollupSelectv2.ts +++ b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelectv2.ts @@ -1,6 +1,6 @@ -import RollupColumn from '../../../noco-models/RollupColumn'; +import RollupColumn from '../../../models/RollupColumn'; import { XKnex } from '../..'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import { QueryBuilder } from 'knex'; import { RelationTypes } from 'nocodb-sdk'; diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/helpers/getAst.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/helpers/getAst.ts similarity index 93% rename from packages/nocodb/src/lib/dataMapper/lib/sql/helpers/getAst.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/helpers/getAst.ts index acfb6e31ba..d5d61a3dbb 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/helpers/getAst.ts +++ b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/helpers/getAst.ts @@ -1,7 +1,7 @@ -import View from '../../../../noco-models/View'; +import View from '../../../../models/View'; import { isSystemColumn, UITypes } from 'nocodb-sdk'; -import Model from '../../../../noco-models/Model'; -import LinkToAnotherRecordColumn from '../../../../noco-models/LinkToAnotherRecordColumn'; +import Model from '../../../../models/Model'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; const getAst = async ({ query, diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/mapFunctionName.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/mapFunctionName.ts similarity index 100% rename from packages/nocodb/src/lib/dataMapper/lib/sql/mapFunctionName.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/mapFunctionName.ts diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/sortV2.ts b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/sortV2.ts similarity index 95% rename from packages/nocodb/src/lib/dataMapper/lib/sql/sortV2.ts rename to packages/nocodb/src/lib/sql-data-mapper/lib/sql/sortV2.ts index d8a395d8b2..07acd23d73 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/sortV2.ts +++ b/packages/nocodb/src/lib/sql-data-mapper/lib/sql/sortV2.ts @@ -1,12 +1,12 @@ import { QueryBuilder } from 'knex'; import { XKnex } from '../..'; -import Sort from '../../../noco-models/Sort'; -import LinkToAnotherRecordColumn from '../../../noco-models/LinkToAnotherRecordColumn'; +import Sort from '../../../models/Sort'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import genRollupSelectv2 from './genRollupSelectv2'; -import RollupColumn from '../../../noco-models/RollupColumn'; -import LookupColumn from '../../../noco-models/LookupColumn'; +import RollupColumn from '../../../models/RollupColumn'; +import LookupColumn from '../../../models/LookupColumn'; import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; -import FormulaColumn from '../../../noco-models/FormulaColumn'; +import FormulaColumn from '../../../models/FormulaColumn'; import { RelationTypes, UITypes } from 'nocodb-sdk'; export default async function sortV2( diff --git a/packages/nocodb/src/lib/sqlMgr/ProjectMgr.ts b/packages/nocodb/src/lib/sql-mgr/ProjectMgr.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/ProjectMgr.ts rename to packages/nocodb/src/lib/sql-mgr/ProjectMgr.ts diff --git a/packages/nocodb/src/lib/sqlMgr/SqlMgr.ts b/packages/nocodb/src/lib/sql-mgr/SqlMgr.ts similarity index 99% rename from packages/nocodb/src/lib/sqlMgr/SqlMgr.ts rename to packages/nocodb/src/lib/sql-mgr/SqlMgr.ts index 6ced2142ad..dab52119a0 100644 --- a/packages/nocodb/src/lib/sqlMgr/SqlMgr.ts +++ b/packages/nocodb/src/lib/sql-mgr/SqlMgr.ts @@ -11,8 +11,8 @@ import slash from 'slash'; // import debug from 'debug'; const log = new Debug('SqlMgr'); -import KnexMigrator from '../migrator/SqlMigrator/lib/KnexMigrator'; -// import {XKnex} from "../dataMapper"; +import KnexMigrator from '../sql-migrator/lib/KnexMigrator'; +// import {XKnex} from "../sql-data-mapper"; import NcConnectionMgr from '../noco/common/NcConnectionMgr'; import { customAlphabet } from 'nanoid'; const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 20); @@ -728,7 +728,7 @@ export default class SqlMgr { const result = new Result(); log.api(`${func}:args:`, args); - // await this.migrator().clean(args); + // await this.sql-migrator().clean(args); await this._project.remove(args); return result; diff --git a/packages/nocodb/src/lib/sqlMgr/code/BaseRender.ts b/packages/nocodb/src/lib/sql-mgr/code/BaseRender.ts similarity index 95% rename from packages/nocodb/src/lib/sqlMgr/code/BaseRender.ts rename to packages/nocodb/src/lib/sql-mgr/code/BaseRender.ts index 31e041371e..e4317c5b82 100644 --- a/packages/nocodb/src/lib/sqlMgr/code/BaseRender.ts +++ b/packages/nocodb/src/lib/sql-mgr/code/BaseRender.ts @@ -7,9 +7,9 @@ // import js_beautify from "js-beautify"; // import fsExtra from "fs-extra"; // import md5 from "md5"; -// import dayjs from "dayjs";import Emit from "../../migrator/util/emit"; -import Debug from '../../migrator/util/Debug'; -import Emit from '../../migrator/util/emit'; +// import dayjs from "dayjs";import Emit from "../../sql-migrator/util/emit"; +import Debug from '../../sql-migrator/util/Debug'; +import Emit from '../../sql-migrator/util/emit'; // const beautify = js_beautify.js; diff --git a/packages/nocodb/src/lib/sqlMgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts b/packages/nocodb/src/lib/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts rename to packages/nocodb/src/lib/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts b/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts rename to packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcSchemaFactory.ts b/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcSchemaFactory.ts rename to packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaMssql.ts b/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMssql.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaMssql.ts rename to packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMssql.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaMysql.ts b/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMysql.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaMysql.ts rename to packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMysql.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts b/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts rename to packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts b/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts rename to packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts b/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts rename to packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/schemaHelp.ts b/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/schemaHelp.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/gql-schema/xc-ts/schemaHelp.ts rename to packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/schemaHelp.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/models/xc/BaseModelXcMeta.ts b/packages/nocodb/src/lib/sql-mgr/code/models/xc/BaseModelXcMeta.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/models/xc/BaseModelXcMeta.ts rename to packages/nocodb/src/lib/sql-mgr/code/models/xc/BaseModelXcMeta.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaFactory.ts b/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaFactory.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaFactory.ts rename to packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaFactory.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaMssql.ts b/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMssql.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaMssql.ts rename to packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMssql.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaMysql.ts b/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMysql.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaMysql.ts rename to packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMysql.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaOracle.ts b/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaOracle.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaOracle.ts rename to packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaOracle.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaPg.ts b/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaPg.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaPg.ts rename to packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaPg.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaSqlite.ts b/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaSqlite.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/models/xc/ModelXcMetaSqlite.ts rename to packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaSqlite.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/policies/xc/ExpressXcPolicy.ts b/packages/nocodb/src/lib/sql-mgr/code/policies/xc/ExpressXcPolicy.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/policies/xc/ExpressXcPolicy.ts rename to packages/nocodb/src/lib/sql-mgr/code/policies/xc/ExpressXcPolicy.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/routers/xc-ts/SwaggerTypes.ts b/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerTypes.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/routers/xc-ts/SwaggerTypes.ts rename to packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerTypes.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/routers/xc-ts/SwaggerXc.ts b/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXc.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/routers/xc-ts/SwaggerXc.ts rename to packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXc.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/routers/xc-ts/SwaggerXcBt.ts b/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/routers/xc-ts/SwaggerXcBt.ts rename to packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/routers/xc-ts/SwaggerXcHm.ts b/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/routers/xc-ts/SwaggerXcHm.ts rename to packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/routes/xc-ts/ExpressXcTsRoutes.ts b/packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/routes/xc-ts/ExpressXcTsRoutes.ts rename to packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts b/packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts rename to packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts diff --git a/packages/nocodb/src/lib/sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts b/packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts similarity index 100% rename from packages/nocodb/src/lib/sqlMgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts rename to packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts diff --git a/packages/nocodb/src/lib/sqlMgr/v2/ProjectMgrv2.ts b/packages/nocodb/src/lib/sql-mgr/v2/ProjectMgrv2.ts similarity index 94% rename from packages/nocodb/src/lib/sqlMgr/v2/ProjectMgrv2.ts rename to packages/nocodb/src/lib/sql-mgr/v2/ProjectMgrv2.ts index 2f2c0ffaa8..a973c338ec 100644 --- a/packages/nocodb/src/lib/sqlMgr/v2/ProjectMgrv2.ts +++ b/packages/nocodb/src/lib/sql-mgr/v2/ProjectMgrv2.ts @@ -1,7 +1,7 @@ import SqlMgrv2 from './SqlMgrv2'; import SqlMgrv2Trans from './SqlMgrv2Trans'; import NcMetaIO from '../../noco/meta/NcMetaIO'; -import Base from '../../noco-models/Base'; +import Base from '../../models/Base'; export default class ProjectMgrv2 { private static sqlMgrMap: { diff --git a/packages/nocodb/src/lib/sqlMgr/v2/SqlMgrv2.ts b/packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2.ts similarity index 89% rename from packages/nocodb/src/lib/sqlMgr/v2/SqlMgrv2.ts rename to packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2.ts index 2eb48c0bfc..fa7cc676a4 100644 --- a/packages/nocodb/src/lib/sqlMgr/v2/SqlMgrv2.ts +++ b/packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2.ts @@ -3,10 +3,10 @@ import { Debug, SqlClientFactory } from 'nc-help'; // import debug from 'debug'; const log = new Debug('SqlMgr'); -// import {XKnex} from "../dataMapper"; +// import {XKnex} from "../sql-data-mapper"; import NcConnectionMgrv2 from '../../noco/common/NcConnectionMgrv2'; -import KnexMigratorv2 from '../../migrator/SqlMigrator/lib/KnexMigratorv2'; -import Base from '../../noco-models/Base'; +import KnexMigratorv2 from '../../sql-migrator/lib/KnexMigratorv2'; +import Base from '../../models/Base'; export default class SqlMgrv2 { protected _migrator: KnexMigratorv2; @@ -84,7 +84,7 @@ export default class SqlMgrv2 { ); /* // create sql migration files - const sqlMigrationFiles = await this.migrator(base).migrationsCreate(base); + const sqlMigrationFiles = await this.sql-migrator(base).migrationsCreate(base); console.log(`Sql Migration Files for '${op}'`, sqlMigrationFiles); // write sql statements to migration files @@ -92,7 +92,7 @@ export default class SqlMgrv2 { `Write sql migration files for '${op}' with`, sqlMigrationStatements ); - await this.migrator(base).migrationsWrite({ + await this.sql-migrator(base).migrationsWrite({ base, ...sqlMigrationStatements.data.object, folder: this.currentProjectFolder, @@ -112,7 +112,7 @@ export default class SqlMgrv2 { folder: this.currentProjectFolder, sqlClient }; - await this.migrator(base).migrationsUp(migrationArgs); + await this.sql-migrator(base).migrationsUp(migrationArgs); */ return sqlMigrationStatements; } diff --git a/packages/nocodb/src/lib/sqlMgr/v2/SqlMgrv2Trans.ts b/packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2Trans.ts similarity index 90% rename from packages/nocodb/src/lib/sqlMgr/v2/SqlMgrv2Trans.ts rename to packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2Trans.ts index b283e93cd7..401482e051 100644 --- a/packages/nocodb/src/lib/sqlMgr/v2/SqlMgrv2Trans.ts +++ b/packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2Trans.ts @@ -1,10 +1,10 @@ import SqlMgrv2 from './SqlMgrv2'; -import Base from '../../noco-models/Base'; +import Base from '../../models/Base'; import NcConnectionMgrv2 from '../../noco/common/NcConnectionMgrv2'; import { Transaction } from 'knex'; -import { XKnex } from '../../dataMapper'; +import { XKnex } from '../../sql-data-mapper'; import NcMetaIO from '../../noco/meta/NcMetaIO'; -import KnexMigratorv2Tans from '../../migrator/SqlMigrator/lib/KnexMigratorv2Tans'; +import KnexMigratorv2Tans from '../../sql-migrator/lib/KnexMigratorv2Tans'; export default class SqlMgrv2Trans extends SqlMgrv2 { protected trx: Transaction; diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/KnexMigrator.ts b/packages/nocodb/src/lib/sql-migrator/lib/KnexMigrator.ts similarity index 99% rename from packages/nocodb/src/lib/migrator/SqlMigrator/lib/KnexMigrator.ts rename to packages/nocodb/src/lib/sql-migrator/lib/KnexMigrator.ts index cea5e9cd9f..cac555276a 100644 --- a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/KnexMigrator.ts +++ b/packages/nocodb/src/lib/sql-migrator/lib/KnexMigrator.ts @@ -8,13 +8,13 @@ import mkdirp from 'mkdirp'; import { SqlClientFactory } from 'nc-help'; import rmdir from 'rmdir'; -import Debug from '../../util/Debug'; -import Result from '../../util/Result'; -import Emit from '../../util/emit'; -import * as fileHelp from '../../util/file.help'; +import Debug from '../util/Debug'; +import Result from '../util/Result'; +import Emit from '../util/emit'; +import * as fileHelp from '../util/file.help'; import SqlMigrator from './SqlMigrator'; -import NcConfigFactory from '../../../utils/NcConfigFactory'; +import NcConfigFactory from '../../utils/NcConfigFactory'; const evt = new Emit(); const log = new Debug('KnexMigrator'); diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/KnexMigratorv2.ts b/packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2.ts similarity index 99% rename from packages/nocodb/src/lib/migrator/SqlMigrator/lib/KnexMigratorv2.ts rename to packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2.ts index 4a0f572b5c..96025728a4 100644 --- a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/KnexMigratorv2.ts +++ b/packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2.ts @@ -6,18 +6,18 @@ import glob from 'glob'; // import Handlebars from 'handlebars'; // import mkdirp from 'mkdirp'; import { SqlClientFactory } from 'nc-help'; -import Debug from '../../util/Debug'; -import Result from '../../util/Result'; -import Emit from '../../util/emit'; -import * as fileHelp from '../../util/file.help'; +import Debug from '../util/Debug'; +import Result from '../util/Result'; +import Emit from '../util/emit'; +import * as fileHelp from '../util/file.help'; // import SqlMigrator from './SqlMigrator'; // import NcConfigFactory from '../../../utils/NcConfigFactory'; -import Noco from '../../../noco/Noco'; -import { XKnex } from '../../../dataMapper'; -import Project from '../../../noco-models/Project'; -import Base from '../../../noco-models/Base'; -import NcConnectionMgrv2 from '../../../noco/common/NcConnectionMgrv2'; +import Noco from '../../noco/Noco'; +import { XKnex } from '../../sql-data-mapper'; +import Project from '../../models/Project'; +import Base from '../../models/Base'; +import NcConnectionMgrv2 from '../../noco/common/NcConnectionMgrv2'; const evt = new Emit(); const log = new Debug('KnexMigrator'); diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/KnexMigratorv2Tans.ts b/packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2Tans.ts similarity index 85% rename from packages/nocodb/src/lib/migrator/SqlMigrator/lib/KnexMigratorv2Tans.ts rename to packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2Tans.ts index 2cd8a62bea..d5879f57cf 100644 --- a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/KnexMigratorv2Tans.ts +++ b/packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2Tans.ts @@ -5,11 +5,11 @@ * @extends {SqlMigrator} */ import KnexMigratorv2 from './KnexMigratorv2'; -import Base from '../../../noco-models/Base'; -import NcConnectionMgrv2 from '../../../noco/common/NcConnectionMgrv2'; -import Noco from '../../../noco/Noco'; -import { XKnex } from '../../../dataMapper'; -import NcMetaIO from '../../../noco/meta/NcMetaIO'; +import Base from '../../models/Base'; +import NcConnectionMgrv2 from '../../noco/common/NcConnectionMgrv2'; +import Noco from '../../noco/Noco'; +import { XKnex } from '../../sql-data-mapper'; +import NcMetaIO from '../../noco/meta/NcMetaIO'; export default class KnexMigratorv2Tans extends KnexMigratorv2 { protected sqlClient: any; diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/SqlMigrator.ts b/packages/nocodb/src/lib/sql-migrator/lib/SqlMigrator.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/SqlMigrator/lib/SqlMigrator.ts rename to packages/nocodb/src/lib/sql-migrator/lib/SqlMigrator.ts diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/SqlMigratorFactory.ts b/packages/nocodb/src/lib/sql-migrator/lib/SqlMigratorFactory.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/SqlMigrator/lib/SqlMigratorFactory.ts rename to packages/nocodb/src/lib/sql-migrator/lib/SqlMigratorFactory.ts diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/templates/mssql.template.ts b/packages/nocodb/src/lib/sql-migrator/lib/templates/mssql.template.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/SqlMigrator/lib/templates/mssql.template.ts rename to packages/nocodb/src/lib/sql-migrator/lib/templates/mssql.template.ts diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/templates/mysql.template.ts b/packages/nocodb/src/lib/sql-migrator/lib/templates/mysql.template.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/SqlMigrator/lib/templates/mysql.template.ts rename to packages/nocodb/src/lib/sql-migrator/lib/templates/mysql.template.ts diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/templates/pg.template.ts b/packages/nocodb/src/lib/sql-migrator/lib/templates/pg.template.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/SqlMigrator/lib/templates/pg.template.ts rename to packages/nocodb/src/lib/sql-migrator/lib/templates/pg.template.ts diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/lib/templates/sqlite.template.ts b/packages/nocodb/src/lib/sql-migrator/lib/templates/sqlite.template.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/SqlMigrator/lib/templates/sqlite.template.ts rename to packages/nocodb/src/lib/sql-migrator/lib/templates/sqlite.template.ts diff --git a/packages/nocodb/src/lib/migrator/SqlMigrator/tests/sqlmigrator.test.ts b/packages/nocodb/src/lib/sql-migrator/tests/sqlmigrator.test.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/SqlMigrator/tests/sqlmigrator.test.ts rename to packages/nocodb/src/lib/sql-migrator/tests/sqlmigrator.test.ts diff --git a/packages/nocodb/src/lib/migrator/util/Debug.ts b/packages/nocodb/src/lib/sql-migrator/util/Debug.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/util/Debug.ts rename to packages/nocodb/src/lib/sql-migrator/util/Debug.ts diff --git a/packages/nocodb/src/lib/migrator/util/DebugMgr.ts b/packages/nocodb/src/lib/sql-migrator/util/DebugMgr.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/util/DebugMgr.ts rename to packages/nocodb/src/lib/sql-migrator/util/DebugMgr.ts diff --git a/packages/nocodb/src/lib/migrator/util/FileCollection.ts b/packages/nocodb/src/lib/sql-migrator/util/FileCollection.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/util/FileCollection.ts rename to packages/nocodb/src/lib/sql-migrator/util/FileCollection.ts diff --git a/packages/nocodb/src/lib/migrator/util/Result.ts b/packages/nocodb/src/lib/sql-migrator/util/Result.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/util/Result.ts rename to packages/nocodb/src/lib/sql-migrator/util/Result.ts diff --git a/packages/nocodb/src/lib/migrator/util/emit.ts b/packages/nocodb/src/lib/sql-migrator/util/emit.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/util/emit.ts rename to packages/nocodb/src/lib/sql-migrator/util/emit.ts diff --git a/packages/nocodb/src/lib/migrator/util/file.help.ts b/packages/nocodb/src/lib/sql-migrator/util/file.help.ts similarity index 100% rename from packages/nocodb/src/lib/migrator/util/file.help.ts rename to packages/nocodb/src/lib/sql-migrator/util/file.help.ts diff --git a/packages/nocodb/src/lib/templateParser/NcTemplateParser.ts b/packages/nocodb/src/lib/template-parser/NcTemplateParser.ts similarity index 100% rename from packages/nocodb/src/lib/templateParser/NcTemplateParser.ts rename to packages/nocodb/src/lib/template-parser/NcTemplateParser.ts