From 4b5bb7d58afb99686e52a12e983fd93774b25b03 Mon Sep 17 00:00:00 2001 From: Naveen MR Date: Fri, 3 Jun 2022 10:59:22 +0100 Subject: [PATCH] refactor: folder structure --- .run/Clear metadb.run.xml | 2 +- packages/nocodb/package.json | 28 +++++------ .../src/__tests__/TemplateParser.test.ts | 2 +- packages/nocodb/src/__tests__/formula.test.ts | 4 +- packages/nocodb/src/__tests__/graphql.test.ts | 18 +++---- packages/nocodb/src/lib/{noco => }/Noco.ts | 26 +++++----- .../lib/{ => db}/sql-data-mapper/README.md | 0 .../__tests__/conditionClause.test.js | 0 .../__tests__/conditionGraph.test.js | 0 .../__tests__/models/city.meta.js | 0 .../__tests__/models/city.model.js | 0 .../__tests__/models/country.meta.js | 0 .../__tests__/models/country.model.js | 0 .../__tests__/models/film.meta.js | 0 .../__tests__/models/film.model.js | 0 .../sql-data-mapper/__tests__/models/index.js | 0 .../sql-data-mapper/__tests__/sql.test.js | 0 .../__tests__/whereClause.test.js | 0 .../sql-data-mapper/__tests__/xSelect.test.js | 0 .../src/lib/{ => db}/sql-data-mapper/index.ts | 0 .../{ => db}/sql-data-mapper/lib/BaseModel.ts | 4 +- .../{ => db}/sql-data-mapper/lib/DbFactory.ts | 0 .../sql-data-mapper/lib/sql/BaseModelSql.ts | 4 +- .../sql-data-mapper/lib/sql/BaseModelSqlv2.ts | 34 ++++++------- .../sql-data-mapper/lib/sql/CustomKnex.ts | 2 +- .../sql-data-mapper/lib/sql/conditionV2.ts | 14 +++--- .../lib/sql/customValidators.ts | 0 .../lib/sql/formulaQueryBuilderFromString.ts | 0 .../sql/formulav2/formulaQueryBuilderv2.ts | 12 ++--- .../lib/sql/functionMappings/commonFns.ts | 0 .../lib/sql/functionMappings/mssql.ts | 0 .../lib/sql/functionMappings/mysql.ts | 0 .../lib/sql/functionMappings/pg.ts | 0 .../lib/sql/functionMappings/sqlite.ts | 0 .../lib/sql/genRollupSelect.ts | 0 .../lib/sql/genRollupSelectv2.ts | 6 +-- .../sql-data-mapper/lib/sql/helpers/getAst.ts | 6 +-- .../lib/sql/mapFunctionName.ts | 0 .../sql-data-mapper/lib/sql/sortV2.ts | 12 ++--- .../src/lib/{ => db}/sql-mgr/ProjectMgr.ts | 0 .../nocodb/src/lib/{ => db}/sql-mgr/SqlMgr.ts | 2 +- .../lib/{ => db}/sql-mgr/code/BaseRender.ts | 0 .../xc-ts/ExpressXcTsPolicyGql.ts | 2 +- .../gql-schema/xc-ts/BaseGqlXcTsSchema.ts | 0 .../gql-schema/xc-ts/GqlXcSchemaFactory.ts | 0 .../gql-schema/xc-ts/GqlXcTsSchemaMssql.ts | 0 .../gql-schema/xc-ts/GqlXcTsSchemaMysql.ts | 0 .../gql-schema/xc-ts/GqlXcTsSchemaOracle.ts | 2 +- .../code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts | 0 .../gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts | 0 .../code/gql-schema/xc-ts/schemaHelp.ts | 0 .../sql-mgr/code/models/xc/BaseModelXcMeta.ts | 2 +- .../code/models/xc/ModelXcMetaFactory.ts | 0 .../code/models/xc/ModelXcMetaMssql.ts | 2 +- .../code/models/xc/ModelXcMetaMysql.ts | 2 +- .../code/models/xc/ModelXcMetaOracle.ts | 2 +- .../sql-mgr/code/models/xc/ModelXcMetaPg.ts | 2 +- .../code/models/xc/ModelXcMetaSqlite.ts | 2 +- .../code/policies/xc/ExpressXcPolicy.ts | 4 +- .../code/routers/xc-ts/SwaggerTypes.ts | 0 .../sql-mgr/code/routers/xc-ts/SwaggerXc.ts | 2 +- .../sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts | 2 +- .../sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts | 2 +- .../code/routes/xc-ts/ExpressXcTsRoutes.ts | 2 +- .../code/routes/xc-ts/ExpressXcTsRoutesBt.ts | 2 +- .../code/routes/xc-ts/ExpressXcTsRoutesHm.ts | 2 +- .../lib/{ => db}/sql-mgr/v2/ProjectMgrv2.ts | 4 +- .../src/lib/{ => db}/sql-mgr/v2/SqlMgrv2.ts | 4 +- .../lib/{ => db}/sql-mgr/v2/SqlMgrv2Trans.ts | 6 +-- .../{ => db}/sql-migrator/lib/KnexMigrator.ts | 2 +- .../sql-migrator/lib/KnexMigratorv2.ts | 8 +-- .../sql-migrator/lib/KnexMigratorv2Tans.ts | 8 +-- .../{ => db}/sql-migrator/lib/SqlMigrator.ts | 0 .../sql-migrator/lib/SqlMigratorFactory.ts | 0 .../lib/templates/mssql.template.ts | 0 .../lib/templates/mysql.template.ts | 0 .../sql-migrator/lib/templates/pg.template.ts | 0 .../lib/templates/sqlite.template.ts | 0 .../sql-migrator/tests/sqlmigrator.test.ts | 0 .../lib/{ => db}/sql-migrator/util/Debug.ts | 0 .../{ => db}/sql-migrator/util/DebugMgr.ts | 0 .../sql-migrator/util/FileCollection.ts | 0 .../lib/{ => db}/sql-migrator/util/Result.ts | 0 .../lib/{ => db}/sql-migrator/util/emit.ts | 0 .../{ => db}/sql-migrator/util/file.help.ts | 0 packages/nocodb/src/lib/index.ts | 4 +- .../src/lib/{noco => }/meta/MetaAPILogger.ts | 4 +- .../src/lib/{noco => }/meta/NcMetaIO.ts | 4 +- .../src/lib/{noco => }/meta/NcMetaIOImpl.ts | 12 ++--- .../src/lib/{noco => }/meta/NcMetaIOImplEE.ts | 0 .../src/lib/{noco => }/meta/NcMetaMgr.ts | 38 +++++++------- .../src/lib/{noco => }/meta/NcMetaMgrEE.ts | 0 .../src/lib/{noco => }/meta/NcMetaMgrv2.ts | 10 ++-- .../lib/{noco => }/meta/api/apiTokenApis.ts | 2 +- .../lib/{noco => }/meta/api/attachmentApis.ts | 2 +- .../src/lib/{noco => }/meta/api/auditApis.ts | 4 +- .../src/lib/{noco => }/meta/api/cacheApis.ts | 2 +- .../src/lib/{noco => }/meta/api/columnApis.ts | 20 ++++---- .../meta/api/dataApis/bulkDataAliasApis.ts | 6 +-- .../meta/api/dataApis/dataAliasApis.ts | 10 ++-- .../meta/api/dataApis/dataAliasExportApis.ts | 0 .../meta/api/dataApis/dataAliasNestedApis.ts | 6 +-- .../{noco => }/meta/api/dataApis/dataApis.ts | 10 ++-- .../{noco => }/meta/api/dataApis/helpers.ts | 18 +++---- .../lib/{noco => }/meta/api/dataApis/index.ts | 0 .../meta/api/dataApis/oldDataApis.ts | 12 ++--- .../src/lib/{noco => }/meta/api/exportApis.ts | 2 +- .../src/lib/{noco => }/meta/api/filterApis.ts | 8 +-- .../lib/{noco => }/meta/api/formViewApis.ts | 10 ++-- .../{noco => }/meta/api/formViewColumnApis.ts | 2 +- .../{noco => }/meta/api/galleryViewApis.ts | 4 +- .../lib/{noco => }/meta/api/gridViewApis.ts | 8 +-- .../{noco => }/meta/api/gridViewColumnApis.ts | 2 +- .../src/lib/{noco => }/meta/api/hookApis.ts | 4 +- .../lib/{noco => }/meta/api/hookFilterApis.ts | 8 +-- .../src/lib/{noco => }/meta/api/index.ts | 0 .../lib/{noco => }/meta/api/metaDiffApis.ts | 16 +++--- .../meta/api/modelVisibilityApis.ts | 6 +-- .../src/lib/{noco => }/meta/api/pluginApis.ts | 2 +- .../lib/{noco => }/meta/api/projectApis.ts | 18 +++---- .../{noco => }/meta/api/projectUserApis.ts | 10 ++-- .../{noco => }/meta/api/publicApis/index.ts | 0 .../meta/api/publicApis/publicDataApis.ts | 18 +++---- .../api/publicApis/publicDataExportApis.ts | 16 +++--- .../meta/api/publicApis/publicMetaApis.ts | 10 ++-- .../lib/{noco => }/meta/api/sharedBaseApis.ts | 2 +- .../src/lib/{noco => }/meta/api/sortApis.ts | 8 +-- .../meta/api/swagger/helpers/getPaths.ts | 8 +-- .../meta/api/swagger/helpers/getSchemas.ts | 8 +-- .../swagger/helpers/getSwaggerColumnMetas.ts | 8 +-- .../api/swagger/helpers/getSwaggerJSON.ts | 8 +-- .../api/swagger/helpers/swagger-base.json | 0 .../api/swagger/helpers/templates/headers.ts | 0 .../api/swagger/helpers/templates/params.ts | 2 +- .../api/swagger/helpers/templates/paths.ts | 0 .../api/swagger/helpers/templates/schemas.ts | 0 .../{noco => }/meta/api/swagger/redocHtml.ts | 0 .../meta/api/swagger/swaggerApis.ts | 4 +- .../meta/api/swagger/swaggerHtml.ts | 0 .../api/sync/helpers/NocoSyncDestAdapter.ts | 0 .../api/sync/helpers/NocoSyncSourceAdapter.ts | 0 .../meta/api/sync/helpers/fetchAT.ts | 0 .../{noco => }/meta/api/sync/helpers/job.ts | 0 .../api/sync/helpers/readAndProcessData.ts | 0 .../meta/api/sync/helpers/syncMap.ts | 0 .../{noco => }/meta/api/sync/importApis.ts | 4 +- .../meta/api/sync/syncSourceApis.ts | 2 +- .../src/lib/{noco => }/meta/api/tableApis.ts | 16 +++--- .../lib/{noco => }/meta/api/userApi/index.ts | 0 .../meta/api/userApi/initStrategies.ts | 14 +++--- .../meta/api/userApi/ui/auth/emailVerify.ts | 0 .../meta/api/userApi/ui/auth/resetPassword.ts | 0 .../ui/emailTemplates}/forgotPassword.ts | 0 .../api/userApi/ui/emailTemplates/invite.ts | 0 .../api/userApi/ui/emailTemplates}/verify.ts | 0 .../{noco => }/meta/api/userApi/userApis.ts | 6 +-- .../src/lib/{noco => }/meta/api/utilApis.ts | 6 +-- .../src/lib/{noco => }/meta/api/viewApis.ts | 8 +-- .../lib/{noco => }/meta/api/viewColumnApis.ts | 2 +- .../{noco => }/meta/handlers/xcMetaDiff.ts | 0 .../meta/handlersv2/ncCreateLookup.ts | 2 +- .../{noco => }/meta/handlersv2/ncGetMeta.ts | 2 +- .../{noco => }/meta/helpers/NcPluginMgrv2.ts | 42 ++++++++-------- .../{noco => }/meta/helpers/PagedResponse.ts | 0 .../helpers/addFormulaErrorIfMissingColumn.ts | 2 +- .../lib/{noco => }/meta/helpers/apiMetrics.ts | 0 .../lib/{noco => }/meta/helpers/catchError.ts | 0 .../extractProjectIdAndAuthenticate.ts | 20 ++++---- .../{noco => }/meta/helpers/extractProps.ts | 0 .../{noco => }/meta/helpers/formulaHelpers.ts | 0 .../meta/helpers/getColumnPropsFromUIDT.ts | 2 +- .../meta/helpers/getColumnUiType.ts | 6 +-- .../{noco => }/meta/helpers/getTableName.ts | 2 +- .../{noco => }/meta/helpers/getUniqueName.ts | 2 +- .../meta/helpers/mapDefaultPrimaryValue.ts | 0 .../{noco => }/meta/helpers/ncMetaAclMw.ts | 2 +- .../meta/helpers/populateSamplePayload.ts | 14 +++--- .../{noco => }/meta/helpers/syncMigration.ts | 4 +- .../{noco => }/meta/helpers/validateParams.ts | 0 .../{noco => }/meta/helpers/webhookHelpers.ts | 10 ++-- .../XcMigrationSource.ts | 24 ++++----- .../XcMigrationSourcev2.ts | 14 +++--- .../lib/migrations/{ => v1}/nc_001_init.ts | 6 +-- .../lib/migrations/{ => v1}/nc_002_add_m2m.ts | 0 .../{ => v1}/nc_003_add_fkn_column.ts | 0 .../{ => v1}/nc_004_add_view_type_column.ts | 0 .../{ => v1}/nc_005_add_view_name_column.ts | 0 .../{ => v1}/nc_006_alter_nc_shared_views.ts | 0 .../nc_007_alter_nc_shared_views_1.ts | 0 .../{ => v1}/nc_008_add_nc_shared_bases.ts | 0 .../{ => v1}/nc_009_add_model_order.ts | 0 .../nc_010_add_parent_title_column.ts | 0 .../{ => v1}/nc_011_remove_old_ses_plugin.ts | 2 +- .../{migrationsv2 => migrations/v2}/nc_011.ts | 2 +- .../v2}/nc_012_alter_column_data_types.ts | 2 +- .../v2}/nc_013_sync_source.ts | 2 +- .../v2}/nc_014_alter_column_data_types.ts | 2 +- .../nc_015_add_meta_col_in_column_table.ts | 2 +- .../v2}/nc_016_alter_hooklog_payload_types.ts | 2 +- packages/nocodb/src/lib/models/ApiToken.ts | 2 +- packages/nocodb/src/lib/models/Audit.ts | 2 +- packages/nocodb/src/lib/models/Base.ts | 4 +- packages/nocodb/src/lib/models/Column.ts | 6 +-- packages/nocodb/src/lib/models/Filter.ts | 2 +- packages/nocodb/src/lib/models/FormView.ts | 2 +- .../nocodb/src/lib/models/FormViewColumn.ts | 4 +- .../nocodb/src/lib/models/FormulaColumn.ts | 4 +- packages/nocodb/src/lib/models/GalleryView.ts | 2 +- .../src/lib/models/GalleryViewColumn.ts | 2 +- packages/nocodb/src/lib/models/GridView.ts | 2 +- .../nocodb/src/lib/models/GridViewColumn.ts | 4 +- packages/nocodb/src/lib/models/Hook.ts | 2 +- packages/nocodb/src/lib/models/HookFilter.ts | 2 +- packages/nocodb/src/lib/models/HookLog.ts | 4 +- packages/nocodb/src/lib/models/KanbanView.ts | 2 +- .../lib/models/LinkToAnotherRecordColumn.ts | 2 +- .../nocodb/src/lib/models/LookupColumn.ts | 2 +- packages/nocodb/src/lib/models/Model.ts | 8 +-- .../src/lib/models/ModelRoleVisibility.ts | 2 +- .../src/lib/models/MultiSelectColumn.ts | 2 +- packages/nocodb/src/lib/models/Plugin.ts | 2 +- packages/nocodb/src/lib/models/Project.ts | 4 +- packages/nocodb/src/lib/models/ProjectUser.ts | 2 +- .../nocodb/src/lib/models/RollupColumn.ts | 2 +- .../src/lib/models/SingleSelectColumn.ts | 2 +- packages/nocodb/src/lib/models/Sort.ts | 2 +- packages/nocodb/src/lib/models/SyncLogs.ts | 2 +- packages/nocodb/src/lib/models/SyncSource.ts | 4 +- packages/nocodb/src/lib/models/User.ts | 4 +- packages/nocodb/src/lib/models/View.ts | 4 +- .../{ => lib}/plugins/backblaze/Backblaze.ts | 0 .../plugins/backblaze/BackblazePlugin.ts | 0 .../src/{ => lib}/plugins/backblaze/index.ts | 0 .../src/{ => lib}/plugins/discord/Discord.ts | 0 .../plugins/discord/DiscordPlugin.ts | 0 .../src/{ => lib}/plugins/discord/index.ts | 0 .../nocodb/src/{ => lib}/plugins/gcs/Gcs.ts | 0 .../src/{ => lib}/plugins/gcs/GcsPlugin.ts | 0 .../nocodb/src/{ => lib}/plugins/gcs/index.ts | 0 .../plugins/linode/LinodeObjectStorage.ts | 0 .../linode/LinodeObjectStoragePlugin.ts | 0 .../src/{ => lib}/plugins/linode/index.ts | 0 .../plugins/mailerSend/MailerSend.ts | 2 +- .../plugins/mailerSend/MailerSendPlugin.ts | 0 .../src/{ => lib}/plugins/mailerSend/index.ts | 2 +- .../plugins/mattermost/Mattermost.ts | 0 .../plugins/mattermost/MattermostPlugin.ts | 0 .../src/{ => lib}/plugins/mattermost/index.ts | 0 .../src/{ => lib}/plugins/mino/Minio.ts | 4 +- .../src/{ => lib}/plugins/mino/MinioPlugin.ts | 0 .../src/{ => lib}/plugins/mino/index.ts | 0 .../{ => lib}/plugins/ovhCloud/OvhCloud.ts | 0 .../plugins/ovhCloud/OvhCloudPlugin.ts | 0 .../src/{ => lib}/plugins/ovhCloud/index.ts | 0 .../nocodb/src/{ => lib}/plugins/s3/S3.ts | 0 .../src/{ => lib}/plugins/s3/S3Plugin.ts | 0 .../nocodb/src/{ => lib}/plugins/s3/index.ts | 0 .../plugins/scaleway/ScalewayObjectStorage.ts | 0 .../scaleway/ScalewayObjectStoragePlugin.ts | 0 .../src/{ => lib}/plugins/scaleway/index.ts | 0 .../nocodb/src/{ => lib}/plugins/ses/SES.ts | 2 +- .../src/{ => lib}/plugins/ses/SESPlugin.ts | 0 .../nocodb/src/{ => lib}/plugins/ses/index.ts | 0 .../src/{ => lib}/plugins/slack/Slack.ts | 0 .../{ => lib}/plugins/slack/SlackPlugin.ts | 0 .../src/{ => lib}/plugins/slack/index.ts | 0 .../nocodb/src/{ => lib}/plugins/smtp/SMTP.ts | 2 +- .../src/{ => lib}/plugins/smtp/SMTPPlugin.ts | 0 .../src/{ => lib}/plugins/smtp/index.ts | 4 +- .../src/{ => lib}/plugins/spaces/Spaces.ts | 0 .../{ => lib}/plugins/spaces/SpacesPlugin.ts | 0 .../src/{ => lib}/plugins/spaces/index.ts | 0 .../src/{ => lib}/plugins/teams/Teams.ts | 0 .../{ => lib}/plugins/teams/TeamsPlugin.ts | 0 .../src/{ => lib}/plugins/teams/index.ts | 0 .../src/{ => lib}/plugins/twilio/Twilio.ts | 0 .../{ => lib}/plugins/twilio/TwilioPlugin.ts | 0 .../src/{ => lib}/plugins/twilio/index.ts | 0 .../plugins/twilioWhatsapp/TwilioWhatsapp.ts | 0 .../twilioWhatsapp/TwilioWhatsappPlugin.ts | 0 .../{ => lib}/plugins/twilioWhatsapp/index.ts | 0 .../plugins/upcloud/UpCloudPlugin.ts | 0 .../src/{ => lib}/plugins/upcloud/UpoCloud.ts | 0 .../src/{ => lib}/plugins/upcloud/index.ts | 0 .../src/{ => lib}/plugins/vultr/Vultr.ts | 0 .../{ => lib}/plugins/vultr/VultrPlugin.ts | 0 .../src/{ => lib}/plugins/vultr/index.ts | 0 .../{noco => utils}/common/BaseApiBuilder.ts | 16 +++--- .../lib/{noco => utils}/common/BaseModel.ts | 2 +- .../{noco => utils}/common/BaseProcedure.ts | 4 +- .../{noco => utils}/common/NcConnectionMgr.ts | 6 +-- .../common/NcConnectionMgrv2.ts | 6 +-- .../src/lib/{noco => utils}/common/XcAudit.ts | 2 +- .../src/lib/{noco => utils}/common/XcCron.ts | 2 +- .../lib/{noco => utils}/common/XcProcedure.ts | 0 .../common/formSubmissionEmailTemplate.ts | 0 .../common/handlers/xcMetaDiffSync.ts | 6 +-- .../addErrorOnColumnDeleteInFormula.ts | 0 .../common/helpers/jsepTreeToFormula.ts | 0 .../helpers/updateColumnNameInFormula.ts | 0 .../common/jobs/ncModelsOrderUpgrader.ts | 0 .../common/jobs/ncParentModelTitleUpgrader.ts | 0 .../jobs/ncRemoveDuplicatedRelationRows.ts | 0 .../{noco => v1-legacy}/NcProjectBuilder.ts | 8 +-- .../{noco => v1-legacy}/NcProjectBuilderEE.ts | 0 .../{noco => v1-legacy}/gql/GqlApiBuilder.ts | 12 ++--- .../gql/GqlAuthResolver.ts | 4 +- .../gql/GqlBaseResolver.ts | 0 .../gql/GqlCommonResolvers.ts | 2 +- .../{noco => v1-legacy}/gql/GqlMiddleware.ts | 0 .../gql/GqlProcedureResolver.ts | 4 +- .../{noco => v1-legacy}/gql/GqlResolver.ts | 4 +- .../{noco => v1-legacy}/gql/auth/schema.ts | 0 .../{noco => v1-legacy}/gql/common.schema.ts | 0 .../gql/emailTemplate}/forgotPassword.ts | 0 .../gql/emailTemplate}/verify.ts | 0 .../src/lib/{noco => v1-legacy}/nc.try.ts | 2 +- .../plugins/NcPluginMgr.ts | 42 ++++++++-------- .../plugins/adapters/cache/XcCache.ts | 0 .../plugins/adapters/discord/Discord.ts | 0 .../plugins/adapters/email/EmailFactory.ts | 0 .../plugins/adapters/email/SES.ts | 0 .../plugins/adapters/email/SMTP.ts | 0 .../plugins/adapters/mattermost/Mattermost.ts | 0 .../plugins/adapters/slack/Slack.ts | 0 .../plugins/adapters/storage/Local.ts | 0 .../plugins/adapters/twilio/Twilio.ts | 0 .../lib/{noco => v1-legacy}/plugins/azure.ts | 0 .../lib/{noco => v1-legacy}/plugins/brand.ts | 0 .../lib/{noco => v1-legacy}/plugins/cache.ts | 0 .../{noco => v1-legacy}/plugins/discord.ts | 0 .../src/lib/{noco => v1-legacy}/plugins/ee.ts | 0 .../{noco => v1-legacy}/plugins/githubAuth.ts | 0 .../{noco => v1-legacy}/plugins/googleAuth.ts | 0 .../{noco => v1-legacy}/plugins/mattermost.ts | 0 .../lib/{noco => v1-legacy}/plugins/ses.ts | 0 .../lib/{noco => v1-legacy}/plugins/slack.ts | 0 .../lib/{noco => v1-legacy}/plugins/smtp.ts | 4 +- .../lib/{noco => v1-legacy}/plugins/twilio.ts | 0 .../rest/RestApiBuilder.ts | 24 ++++----- .../{noco => v1-legacy}/rest/RestAuthCtrl.ts | 8 +-- .../rest/RestAuthCtrlEE.ts | 0 .../{noco => v1-legacy}/rest/RestBaseCtrl.ts | 0 .../lib/{noco => v1-legacy}/rest/RestCtrl.ts | 4 +- .../rest/RestCtrlBelongsTo.ts | 2 +- .../rest/RestCtrlCustom.ts | 2 +- .../rest/RestCtrlHasMany.ts | 2 +- .../{noco => v1-legacy}/rest/RestCtrlMin.ts | 2 +- .../rest/RestCtrlProcedure.ts | 4 +- .../{noco => v1-legacy}/rest/RestCtrlv2.ts | 6 +-- .../rest/registerRestCtrl.ts | 2 +- .../rest/ui/auth/emailVerify.ts | 0 .../rest/ui/auth/resetPassword.ts | 0 .../rest/ui/auth/signin.ts | 0 .../rest/ui/auth/signup.ts | 0 .../rest/ui/auth/swagger-base.xc.json | 0 .../rest/ui/auth/swagger.ts | 0 .../rest/ui/emailTemplates/forgotPassword.ts | 0 .../rest/ui/emailTemplates/invite.ts | 0 .../rest/ui/emailTemplates/verify.ts | 0 .../templates}/NcTemplateParser.ts | 0 .../NcUpgrader.ts | 10 ++-- .../ncProjectEnvUpgrader.ts | 2 +- .../ncProjectEnvUpgrader0011045.ts | 2 +- .../ncProjectUpgraderV2_0090000.ts | 50 +++++++++---------- .../src/{example => run}/deleteMetaDb.js | 0 .../nocodb/src/{example => run}/docker.ts | 2 +- .../src/{example => run}/dockerRunMysql.ts | 2 +- .../src/{example => run}/dockerRunPG.ts | 2 +- packages/nocodb/src/{example => run}/try.ts | 0 scripts/upgradeNcGui.js | 2 +- 371 files changed, 591 insertions(+), 591 deletions(-) rename packages/nocodb/src/lib/{noco => }/Noco.ts (95%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/README.md (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/conditionClause.test.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/conditionGraph.test.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/models/city.meta.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/models/city.model.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/models/country.meta.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/models/country.model.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/models/film.meta.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/models/film.model.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/models/index.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/sql.test.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/whereClause.test.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/__tests__/xSelect.test.js (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/index.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/BaseModel.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/DbFactory.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/BaseModelSql.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/BaseModelSqlv2.ts (98%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/CustomKnex.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/conditionV2.ts (97%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/customValidators.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/formulaQueryBuilderFromString.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts (98%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/functionMappings/commonFns.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/functionMappings/mssql.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/functionMappings/mysql.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/functionMappings/pg.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/functionMappings/sqlite.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/genRollupSelect.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/genRollupSelectv2.ts (93%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/helpers/getAst.ts (93%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/mapFunctionName.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-data-mapper/lib/sql/sortV2.ts (95%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/ProjectMgr.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/SqlMgr.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/BaseRender.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMssql.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMysql.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/gql-schema/xc-ts/schemaHelp.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/models/xc/BaseModelXcMeta.ts (97%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/models/xc/ModelXcMetaFactory.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/models/xc/ModelXcMetaMssql.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/models/xc/ModelXcMetaMysql.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/models/xc/ModelXcMetaOracle.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/models/xc/ModelXcMetaPg.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/models/xc/ModelXcMetaSqlite.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/policies/xc/ExpressXcPolicy.ts (97%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/routers/xc-ts/SwaggerTypes.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/routers/xc-ts/SwaggerXc.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts (98%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts (96%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/v2/ProjectMgrv2.ts (88%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/v2/SqlMgrv2.ts (96%) rename packages/nocodb/src/lib/{ => db}/sql-mgr/v2/SqlMgrv2Trans.ts (90%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/lib/KnexMigrator.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/lib/KnexMigratorv2.ts (99%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/lib/KnexMigratorv2Tans.ts (88%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/lib/SqlMigrator.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/lib/SqlMigratorFactory.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/lib/templates/mssql.template.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/lib/templates/mysql.template.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/lib/templates/pg.template.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/lib/templates/sqlite.template.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/tests/sqlmigrator.test.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/util/Debug.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/util/DebugMgr.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/util/FileCollection.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/util/Result.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/util/emit.ts (100%) rename packages/nocodb/src/lib/{ => db}/sql-migrator/util/file.help.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/MetaAPILogger.ts (96%) rename packages/nocodb/src/lib/{noco => }/meta/NcMetaIO.ts (98%) rename packages/nocodb/src/lib/{noco => }/meta/NcMetaIOImpl.ts (98%) rename packages/nocodb/src/lib/{noco => }/meta/NcMetaIOImplEE.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/NcMetaMgr.ts (99%) rename packages/nocodb/src/lib/{noco => }/meta/NcMetaMgrEE.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/NcMetaMgrv2.ts (97%) rename packages/nocodb/src/lib/{noco => }/meta/api/apiTokenApis.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/api/attachmentApis.ts (98%) rename packages/nocodb/src/lib/{noco => }/meta/api/auditApis.ts (96%) rename packages/nocodb/src/lib/{noco => }/meta/api/cacheApis.ts (92%) rename packages/nocodb/src/lib/{noco => }/meta/api/columnApis.ts (98%) rename packages/nocodb/src/lib/{noco => }/meta/api/dataApis/bulkDataAliasApis.ts (94%) rename packages/nocodb/src/lib/{noco => }/meta/api/dataApis/dataAliasApis.ts (96%) rename packages/nocodb/src/lib/{noco => }/meta/api/dataApis/dataAliasExportApis.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/dataApis/dataAliasNestedApis.ts (97%) rename packages/nocodb/src/lib/{noco => }/meta/api/dataApis/dataApis.ts (98%) rename packages/nocodb/src/lib/{noco => }/meta/api/dataApis/helpers.ts (89%) rename packages/nocodb/src/lib/{noco => }/meta/api/dataApis/index.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/dataApis/oldDataApis.ts (93%) rename packages/nocodb/src/lib/{noco => }/meta/api/exportApis.ts (94%) rename packages/nocodb/src/lib/{noco => }/meta/api/filterApis.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/api/formViewApis.ts (87%) rename packages/nocodb/src/lib/{noco => }/meta/api/formViewColumnApis.ts (90%) rename packages/nocodb/src/lib/{noco => }/meta/api/galleryViewApis.ts (93%) rename packages/nocodb/src/lib/{noco => }/meta/api/gridViewApis.ts (81%) rename packages/nocodb/src/lib/{noco => }/meta/api/gridViewColumnApis.ts (93%) rename packages/nocodb/src/lib/{noco => }/meta/api/hookApis.ts (97%) rename packages/nocodb/src/lib/{noco => }/meta/api/hookFilterApis.ts (93%) rename packages/nocodb/src/lib/{noco => }/meta/api/index.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/metaDiffApis.ts (98%) rename packages/nocodb/src/lib/{noco => }/meta/api/modelVisibilityApis.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/api/pluginApis.ts (97%) rename packages/nocodb/src/lib/{noco => }/meta/api/projectApis.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/api/projectUserApis.ts (97%) rename packages/nocodb/src/lib/{noco => }/meta/api/publicApis/index.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/publicApis/publicDataApis.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/api/publicApis/publicDataExportApis.ts (91%) rename packages/nocodb/src/lib/{noco => }/meta/api/publicApis/publicMetaApis.ts (90%) rename packages/nocodb/src/lib/{noco => }/meta/api/sharedBaseApis.ts (98%) rename packages/nocodb/src/lib/{noco => }/meta/api/sortApis.ts (91%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/helpers/getPaths.ts (87%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/helpers/getSchemas.ts (87%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/helpers/getSwaggerColumnMetas.ts (84%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/helpers/getSwaggerJSON.ts (87%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/helpers/swagger-base.json (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/helpers/templates/headers.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/helpers/templates/params.ts (98%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/helpers/templates/paths.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/helpers/templates/schemas.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/redocHtml.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/swaggerApis.ts (92%) rename packages/nocodb/src/lib/{noco => }/meta/api/swagger/swaggerHtml.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/sync/helpers/NocoSyncDestAdapter.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/sync/helpers/NocoSyncSourceAdapter.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/sync/helpers/fetchAT.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/sync/helpers/job.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/sync/helpers/readAndProcessData.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/sync/helpers/syncMap.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/sync/importApis.ts (96%) rename packages/nocodb/src/lib/{noco => }/meta/api/sync/syncSourceApis.ts (96%) rename packages/nocodb/src/lib/{noco => }/meta/api/tableApis.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/api/userApi/index.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/userApi/initStrategies.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/api/userApi/ui/auth/emailVerify.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/userApi/ui/auth/resetPassword.ts (100%) rename packages/nocodb/src/lib/{noco/gql/emailTemplate => meta/api/userApi/ui/emailTemplates}/forgotPassword.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/userApi/ui/emailTemplates/invite.ts (100%) rename packages/nocodb/src/lib/{noco/gql/emailTemplate => meta/api/userApi/ui/emailTemplates}/verify.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/api/userApi/userApis.ts (98%) rename packages/nocodb/src/lib/{noco => }/meta/api/utilApis.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/api/viewApis.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/api/viewColumnApis.ts (96%) rename packages/nocodb/src/lib/{noco => }/meta/handlers/xcMetaDiff.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/handlersv2/ncCreateLookup.ts (91%) rename packages/nocodb/src/lib/{noco => }/meta/handlersv2/ncGetMeta.ts (86%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/NcPluginMgrv2.ts (84%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/PagedResponse.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/addFormulaErrorIfMissingColumn.ts (93%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/apiMetrics.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/catchError.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/extractProjectIdAndAuthenticate.ts (90%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/extractProps.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/formulaHelpers.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/getColumnPropsFromUIDT.ts (95%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/getColumnUiType.ts (64%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/getTableName.ts (92%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/getUniqueName.ts (91%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/mapDefaultPrimaryValue.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/ncMetaAclMw.ts (97%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/populateSamplePayload.ts (92%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/syncMigration.ts (79%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/validateParams.ts (100%) rename packages/nocodb/src/lib/{noco => }/meta/helpers/webhookHelpers.ts (97%) rename packages/nocodb/src/lib/{noco/common => migrations}/XcMigrationSource.ts (72%) rename packages/nocodb/src/lib/{noco/common => migrations}/XcMigrationSourcev2.ts (77%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_001_init.ts (98%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_002_add_m2m.ts (100%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_003_add_fkn_column.ts (100%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_004_add_view_type_column.ts (100%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_005_add_view_name_column.ts (100%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_006_alter_nc_shared_views.ts (100%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_007_alter_nc_shared_views_1.ts (100%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_008_add_nc_shared_bases.ts (100%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_009_add_model_order.ts (100%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_010_add_parent_title_column.ts (100%) rename packages/nocodb/src/lib/migrations/{ => v1}/nc_011_remove_old_ses_plugin.ts (95%) rename packages/nocodb/src/lib/{migrationsv2 => migrations/v2}/nc_011.ts (99%) rename packages/nocodb/src/lib/{migrationsv2 => migrations/v2}/nc_012_alter_column_data_types.ts (97%) rename packages/nocodb/src/lib/{migrationsv2 => migrations/v2}/nc_013_sync_source.ts (97%) rename packages/nocodb/src/lib/{migrationsv2 => migrations/v2}/nc_014_alter_column_data_types.ts (97%) rename packages/nocodb/src/lib/{migrationsv2 => migrations/v2}/nc_015_add_meta_col_in_column_table.ts (95%) rename packages/nocodb/src/lib/{migrationsv2 => migrations/v2}/nc_016_alter_hooklog_payload_types.ts (96%) rename packages/nocodb/src/{ => lib}/plugins/backblaze/Backblaze.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/backblaze/BackblazePlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/backblaze/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/discord/Discord.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/discord/DiscordPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/discord/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/gcs/Gcs.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/gcs/GcsPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/gcs/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/linode/LinodeObjectStorage.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/linode/LinodeObjectStoragePlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/linode/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/mailerSend/MailerSend.ts (97%) rename packages/nocodb/src/{ => lib}/plugins/mailerSend/MailerSendPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/mailerSend/index.ts (96%) rename packages/nocodb/src/{ => lib}/plugins/mattermost/Mattermost.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/mattermost/MattermostPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/mattermost/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/mino/Minio.ts (98%) rename packages/nocodb/src/{ => lib}/plugins/mino/MinioPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/mino/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/ovhCloud/OvhCloud.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/ovhCloud/OvhCloudPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/ovhCloud/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/s3/S3.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/s3/S3Plugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/s3/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/scaleway/ScalewayObjectStorage.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/scaleway/ScalewayObjectStoragePlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/scaleway/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/ses/SES.ts (97%) rename packages/nocodb/src/{ => lib}/plugins/ses/SESPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/ses/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/slack/Slack.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/slack/SlackPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/slack/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/smtp/SMTP.ts (97%) rename packages/nocodb/src/{ => lib}/plugins/smtp/SMTPPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/smtp/index.ts (95%) rename packages/nocodb/src/{ => lib}/plugins/spaces/Spaces.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/spaces/SpacesPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/spaces/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/teams/Teams.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/teams/TeamsPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/teams/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/twilio/Twilio.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/twilio/TwilioPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/twilio/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/twilioWhatsapp/TwilioWhatsapp.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/twilioWhatsapp/TwilioWhatsappPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/twilioWhatsapp/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/upcloud/UpCloudPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/upcloud/UpoCloud.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/upcloud/index.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/vultr/Vultr.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/vultr/VultrPlugin.ts (100%) rename packages/nocodb/src/{ => lib}/plugins/vultr/index.ts (100%) rename packages/nocodb/src/lib/{noco => utils}/common/BaseApiBuilder.ts (99%) rename packages/nocodb/src/lib/{noco => utils}/common/BaseModel.ts (99%) rename packages/nocodb/src/lib/{noco => utils}/common/BaseProcedure.ts (92%) rename packages/nocodb/src/lib/{noco => utils}/common/NcConnectionMgr.ts (96%) rename packages/nocodb/src/lib/{noco => utils}/common/NcConnectionMgrv2.ts (96%) rename packages/nocodb/src/lib/{noco => utils}/common/XcAudit.ts (86%) rename packages/nocodb/src/lib/{noco => utils}/common/XcCron.ts (99%) rename packages/nocodb/src/lib/{noco => utils}/common/XcProcedure.ts (100%) rename packages/nocodb/src/lib/{noco => utils}/common/formSubmissionEmailTemplate.ts (100%) rename packages/nocodb/src/lib/{noco => utils}/common/handlers/xcMetaDiffSync.ts (99%) rename packages/nocodb/src/lib/{noco => utils}/common/helpers/addErrorOnColumnDeleteInFormula.ts (100%) rename packages/nocodb/src/lib/{noco => utils}/common/helpers/jsepTreeToFormula.ts (100%) rename packages/nocodb/src/lib/{noco => utils}/common/helpers/updateColumnNameInFormula.ts (100%) rename packages/nocodb/src/lib/{noco => utils}/common/jobs/ncModelsOrderUpgrader.ts (100%) rename packages/nocodb/src/lib/{noco => utils}/common/jobs/ncParentModelTitleUpgrader.ts (100%) rename packages/nocodb/src/lib/{noco => utils}/common/jobs/ncRemoveDuplicatedRelationRows.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/NcProjectBuilder.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/NcProjectBuilderEE.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/gql/GqlApiBuilder.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/gql/GqlAuthResolver.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/gql/GqlBaseResolver.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/gql/GqlCommonResolvers.ts (95%) rename packages/nocodb/src/lib/{noco => v1-legacy}/gql/GqlMiddleware.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/gql/GqlProcedureResolver.ts (96%) rename packages/nocodb/src/lib/{noco => v1-legacy}/gql/GqlResolver.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/gql/auth/schema.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/gql/common.schema.ts (100%) rename packages/nocodb/src/lib/{noco/meta/api/userApi/ui/emailTemplates => v1-legacy/gql/emailTemplate}/forgotPassword.ts (100%) rename packages/nocodb/src/lib/{noco/meta/api/userApi/ui/emailTemplates => v1-legacy/gql/emailTemplate}/verify.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/nc.try.ts (98%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/NcPluginMgr.ts (80%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/adapters/cache/XcCache.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/adapters/discord/Discord.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/adapters/email/EmailFactory.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/adapters/email/SES.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/adapters/email/SMTP.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/adapters/mattermost/Mattermost.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/adapters/slack/Slack.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/adapters/storage/Local.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/adapters/twilio/Twilio.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/azure.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/brand.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/cache.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/discord.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/ee.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/githubAuth.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/googleAuth.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/mattermost.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/ses.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/slack.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/smtp.ts (95%) rename packages/nocodb/src/lib/{noco => v1-legacy}/plugins/twilio.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestApiBuilder.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestAuthCtrl.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestAuthCtrlEE.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestBaseCtrl.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestCtrl.ts (98%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestCtrlBelongsTo.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestCtrlCustom.ts (97%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestCtrlHasMany.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestCtrlMin.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestCtrlProcedure.ts (98%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/RestCtrlv2.ts (93%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/registerRestCtrl.ts (99%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/ui/auth/emailVerify.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/ui/auth/resetPassword.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/ui/auth/signin.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/ui/auth/signup.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/ui/auth/swagger-base.xc.json (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/ui/auth/swagger.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/ui/emailTemplates/forgotPassword.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/ui/emailTemplates/invite.ts (100%) rename packages/nocodb/src/lib/{noco => v1-legacy}/rest/ui/emailTemplates/verify.ts (100%) rename packages/nocodb/src/lib/{template-parser => v1-legacy/templates}/NcTemplateParser.ts (100%) rename packages/nocodb/src/lib/{noco/upgrader => version-upgrader}/NcUpgrader.ts (92%) rename packages/nocodb/src/lib/{noco/upgrader/jobs => version-upgrader}/ncProjectEnvUpgrader.ts (90%) rename packages/nocodb/src/lib/{noco/upgrader/jobs => version-upgrader}/ncProjectEnvUpgrader0011045.ts (86%) rename packages/nocodb/src/lib/{noco/upgrader/jobs => version-upgrader}/ncProjectUpgraderV2_0090000.ts (96%) rename packages/nocodb/src/{example => run}/deleteMetaDb.js (100%) rename packages/nocodb/src/{example => run}/docker.ts (97%) rename packages/nocodb/src/{example => run}/dockerRunMysql.ts (98%) rename packages/nocodb/src/{example => run}/dockerRunPG.ts (98%) rename packages/nocodb/src/{example => run}/try.ts (100%) diff --git a/.run/Clear metadb.run.xml b/.run/Clear metadb.run.xml index 2fc4fdd987..b86ac7542d 100644 --- a/.run/Clear metadb.run.xml +++ b/.run/Clear metadb.run.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index ba8853b406..452e11d057 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -38,11 +38,11 @@ "reset": "git clean -dfx && git reset --hard && npm i", "clean": "trash build src/test", "prepare-release": "run-s reset src/test cov:check doc:html version doc:publish", - "start-graphql": "ts-node src/example/index.gql.ts", - "start-rest": "ts-node src/example/index.rest.ts", - "start-grpc": "ts-node src/example/index.grpc.ts", - "start-api": "ts-node src/example/index.ts", - "start-xc-tool-api": "ts-node src/example/xc-tool-apis.ts", + "start-graphql": "ts-node src/run/index.gql.ts", + "start-rest": "ts-node src/run/index.rest.ts", + "start-grpc": "ts-node src/run/index.grpc.ts", + "start-api": "ts-node src/run/index.ts", + "start-xc-tool-api": "ts-node src/run/xc-tool-apis.ts", "docker-test": "node docker/index.js", "test:dev:travis": "cross-env NODE_ENV=dev npm run test:rest && NODE_ENV=dev npm run test:graphql && NODE_ENV=dev npm run test:grpc", "test:travis": "cross-env NODE_ENV=test npm run test:rest && NODE_ENV=test npm run test:graphql && NODE_ENV=test npm run test:grpc", @@ -63,17 +63,17 @@ "docker:s3:build:publish:image": "npm run build && npm run docker:build && npm run docker:s3:image:build && npm run docker:s3:image:deploy", "docker:oracle:image:build": "docker build . -t xc-instant-oracle -f Dockerfile-ORACLE --no-cache", "help:a": "node docker/test", - "help:seed": "ts-node ./src/example/seedts.ts", + "help:seed": "ts-node src/run/seedts.ts", "help:c": "ts-node ./help/a", "watch:build": "nodemon -e ts,js -w ./src -x npm run build", "watch:serve": "nodemon -e ts -w ./build -x npm run debug-local ", - "watch:run": "cross-env NC_DISABLE_TELE1=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", - "watch:run:cypress": "cross-env EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/docker --log-error --project tsconfig.json\"", - "watch:run:mysql": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/dockerRunMysql --log-error --project tsconfig.json\"", - "watch:run:pg": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/example/dockerRunPG --log-error --project tsconfig.json\"", - "run": "ts-node src/example/docker", - "watch:try": "nodemon -e ts,js -w ./src -x \"ts-node src/example/try --log-error --project tsconfig.json\"", - "example:docker": "ts-node ./src/example/docker.ts" + "watch:run": "cross-env NC_DISABLE_TELE1=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/run/docker --log-error --project tsconfig.json\"", + "watch:run:cypress": "cross-env EE=true nodemon -e ts,js -w ./src -x \"ts-node src/run/docker --log-error --project tsconfig.json\"", + "watch:run:mysql": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/run/dockerRunMysql --log-error --project tsconfig.json\"", + "watch:run:pg": "cross-env NC_DISABLE_TELE=true EE=true nodemon -e ts,js -w ./src -x \"ts-node src/run/dockerRunPG --log-error --project tsconfig.json\"", + "run": "ts-node src/run/docker", + "watch:try": "nodemon -e ts,js -w ./src -x \"ts-node src/run/try --log-error --project tsconfig.json\"", + "example:docker": "ts-node src/run/docker.ts" }, "scripts-info": { "info": "Display information about the package scripts", @@ -256,4 +256,4 @@ "**/*.spec.js" ] } -} \ No newline at end of file +} diff --git a/packages/nocodb/src/__tests__/TemplateParser.test.ts b/packages/nocodb/src/__tests__/TemplateParser.test.ts index 8f932bcedb..6332f4cdee 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/template-parser/NcTemplateParser'; +import NcTemplateParser from '../lib/v1-legacy/templates/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 ba78bfd62c..41a677f9e4 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/sql-data-mapper/lib/sql/CustomKnex'; -import formulaQueryBuilderFromString from '../lib/sql-data-mapper/lib/sql/formulaQueryBuilderFromString'; +import knex from '../lib/db/sql-data-mapper/lib/sql/CustomKnex'; +import formulaQueryBuilderFromString from '../lib/db/sql-data-mapper/lib/sql/formulaQueryBuilderFromString'; process.env.TEST = 'test'; diff --git a/packages/nocodb/src/__tests__/graphql.test.ts b/packages/nocodb/src/__tests__/graphql.test.ts index 291ed5f43b..76a2833683 100644 --- a/packages/nocodb/src/__tests__/graphql.test.ts +++ b/packages/nocodb/src/__tests__/graphql.test.ts @@ -84,7 +84,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { // // it('Signup with valid email', function (done) { // request(app) - // .post('/v1/graphql') + // .post('/v1-legacy/graphql') // .send({ // query: `mutation{ SignUp(data : { email: "${EMAIL_ID}", password: "${VALID_PASSWORD}"}){ token }}` // }) @@ -104,7 +104,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { // // it('Signup with invalid email', function (done) { // request(app) - // .post('/v1/graphql') + // .post('/v1-legacy/graphql') // .send({ // query: `mutation{ SignUp(data : { email: "test", password: "${VALID_PASSWORD}"}){ token }}` // }) @@ -120,7 +120,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { // // it('Signin with valid email', function (done) { // request(app) - // .post('/v1/graphql') + // .post('/v1-legacy/graphql') // .send({ // query: `mutation{ SignIn(data : { email: "${EMAIL_ID}", password: "${VALID_PASSWORD}"}){ token }}` // }) @@ -140,7 +140,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { // // it('me', function (done) { // request(app) - // .post('/v1/graphql') + // .post('/v1-legacy/graphql') // .set({'xc-auth': token}) // .send({ // query: `{ Me{ email id }}` @@ -159,7 +159,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { // // it('Signin with invalid email', function (done) { // request(app) - // .post('/v1/graphql') + // .post('/v1-legacy/graphql') // .send({ // query: `mutation{ SignIn(data : { email: "abc@abcc.com", password: "randomPassord"}){ token }}` // }) @@ -175,7 +175,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { // // it('Forgot password with a non-existing email id', function (done) { // request(app) - // .post('/v1/graphql') + // .post('/v1-legacy/graphql') // .send({ // query: `mutation{ PasswordForgot(email: "abc@abcc.com")}` // }) @@ -190,7 +190,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { // // it('Forgot password with an existing email id', function (done) { // request(app) - // .post('/v1/graphql') + // .post('/v1-legacy/graphql') // .send({ // query: `mutation{ PasswordForgot(email: "${EMAIL_ID}")}` // }) @@ -204,7 +204,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { // // it('Email validate with an invalid token', function (done) { // request(app) - // .post('/v1/graphql') + // .post('/v1-legacy/graphql') // .send({ // query: `mutation{ EmailValidate(tokenId: "invalid-token-id")}` // }) @@ -218,7 +218,7 @@ describe('{Auth, CRUD, HasMany, Belongs} Tests', () => { // // it('Reset Password with an invalid token', function (done) { // request(app) - // .post('/v1/graphql') + // .post('/v1-legacy/graphql') // .send({ // query: `mutation{ PasswordReset(password:"somePassword",tokenId: "invalid-token-id")}` // }) diff --git a/packages/nocodb/src/lib/noco/Noco.ts b/packages/nocodb/src/lib/Noco.ts similarity index 95% rename from packages/nocodb/src/lib/noco/Noco.ts rename to packages/nocodb/src/lib/Noco.ts index 241a97d732..7b3df6ef5b 100644 --- a/packages/nocodb/src/lib/noco/Noco.ts +++ b/packages/nocodb/src/lib/Noco.ts @@ -15,32 +15,32 @@ import NcToolGui from 'nc-lib-gui'; import requestIp from 'request-ip'; import { v4 as uuidv4 } from 'uuid'; -import { NcConfig } from '../../interface/config'; -import Migrator from '../sql-migrator/lib/KnexMigrator'; -import NcConfigFactory from '../utils/NcConfigFactory'; +import { NcConfig } from '../interface/config'; +import Migrator from './db/sql-migrator/lib/KnexMigrator'; +import NcConfigFactory from './utils/NcConfigFactory'; -import NcProjectBuilderCE from './NcProjectBuilder'; -import NcProjectBuilderEE from './NcProjectBuilderEE'; -import { GqlApiBuilder } from './gql/GqlApiBuilder'; +import NcProjectBuilderCE from './v1-legacy/NcProjectBuilder'; +import NcProjectBuilderEE from './v1-legacy/NcProjectBuilderEE'; +import { GqlApiBuilder } from './v1-legacy/gql/GqlApiBuilder'; import NcMetaIO from './meta/NcMetaIO'; import NcMetaImplCE from './meta/NcMetaIOImpl'; import NcMetaImplEE from './meta/NcMetaIOImplEE'; import NcMetaMgrCE from './meta/NcMetaMgr'; import NcMetaMgrEE from './meta/NcMetaMgrEE'; -import { RestApiBuilder } from './rest/RestApiBuilder'; -import RestAuthCtrlCE from './rest/RestAuthCtrl'; -import RestAuthCtrlEE from './rest/RestAuthCtrlEE'; +import { RestApiBuilder } from './v1-legacy/rest/RestApiBuilder'; +import RestAuthCtrlCE from './v1-legacy/rest/RestAuthCtrl'; +import RestAuthCtrlEE from './v1-legacy/rest/RestAuthCtrlEE'; import mkdirp from 'mkdirp'; import MetaAPILogger from './meta/MetaAPILogger'; -import NcUpgrader from './upgrader/NcUpgrader'; +import NcUpgrader from './version-upgrader/NcUpgrader'; import NcMetaMgrv2 from './meta/NcMetaMgrv2'; -import NocoCache from '../cache/NocoCache'; +import NocoCache from './cache/NocoCache'; import registerMetaApis from './meta/api'; import NcPluginMgrv2 from './meta/helpers/NcPluginMgrv2'; -import User from '../models/User'; +import User from './models/User'; import { Tele } from 'nc-help'; import * as http from 'http'; -import weAreHiring from '../utils/weAreHiring'; +import weAreHiring from './utils/weAreHiring'; const log = debug('nc:app'); require('dotenv').config(); diff --git a/packages/nocodb/src/lib/sql-data-mapper/README.md b/packages/nocodb/src/lib/db/sql-data-mapper/README.md similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/README.md rename to packages/nocodb/src/lib/db/sql-data-mapper/README.md diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/conditionClause.test.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/conditionClause.test.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/conditionClause.test.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/conditionClause.test.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/conditionGraph.test.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/conditionGraph.test.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/conditionGraph.test.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/conditionGraph.test.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/city.meta.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/city.meta.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/models/city.meta.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/city.meta.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/city.model.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/city.model.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/models/city.model.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/city.model.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/country.meta.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/country.meta.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/models/country.meta.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/country.meta.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/country.model.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/country.model.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/models/country.model.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/country.model.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/film.meta.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/film.meta.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/models/film.meta.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/film.meta.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/film.model.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/film.model.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/models/film.model.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/film.model.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/models/index.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/index.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/models/index.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/models/index.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/sql.test.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/sql.test.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/sql.test.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/sql.test.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/whereClause.test.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/whereClause.test.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/whereClause.test.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/whereClause.test.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/__tests__/xSelect.test.js b/packages/nocodb/src/lib/db/sql-data-mapper/__tests__/xSelect.test.js similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/__tests__/xSelect.test.js rename to packages/nocodb/src/lib/db/sql-data-mapper/__tests__/xSelect.test.js diff --git a/packages/nocodb/src/lib/sql-data-mapper/index.ts b/packages/nocodb/src/lib/db/sql-data-mapper/index.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/index.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/index.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/BaseModel.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/BaseModel.ts similarity index 99% rename from packages/nocodb/src/lib/sql-data-mapper/lib/BaseModel.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/BaseModel.ts index 047a4aeb82..dd9ac2c4a1 100644 --- a/packages/nocodb/src/lib/sql-data-mapper/lib/BaseModel.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/BaseModel.ts @@ -838,13 +838,13 @@ abstract class BaseModel { * @param {String} [args.max] - maximum value * @param {String} [args.step] - step value * @returns {Promise} Distributions of column values in table - * @example + * @run * table.distribution({ * cn : 'price', * steps: '0,100,200,300,400', * func: 'sum,avg' * }) - * @example + * @run * table.distribution({ * cn : 'price', * min: '0', diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/DbFactory.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/DbFactory.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/DbFactory.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/DbFactory.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSql.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSql.ts similarity index 99% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSql.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSql.ts index aca9667e4f..14b927f8e1 100644 --- a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSql.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSql.ts @@ -1118,13 +1118,13 @@ class BaseModelSql extends BaseModel { * @param {String} [args.max] - maximum value * @param {String} [args.step] - step value * @returns {Promise} Distributions of column values in table - * @example + * @run * table.distribution({ * cn : 'price', * steps: '0,100,200,300,400', * func: 'sum,avg' * }) - * @example + * @run * table.distribution({ * cn : 'price', * min: '0', diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSqlv2.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts similarity index 98% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSqlv2.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts index b2c40b908d..b3d93c5b22 100644 --- a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/BaseModelSqlv2.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts @@ -1,23 +1,23 @@ import autoBind from 'auto-bind'; import _ from 'lodash'; -import Model from '../../../models/Model'; -import { XKnex } from '../..'; -import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; -import RollupColumn from '../../../models/RollupColumn'; -import LookupColumn from '../../../models/LookupColumn'; +import Model from '../../../../models/Model'; +import { XKnex } from '../../index'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; +import RollupColumn from '../../../../models/RollupColumn'; +import LookupColumn from '../../../../models/LookupColumn'; import DataLoader from 'dataloader'; -import Column from '../../../models/Column'; +import Column from '../../../../models/Column'; import { XcFilter, XcFilterWithAlias } from '../BaseModel'; import conditionV2 from './conditionV2'; -import Filter from '../../../models/Filter'; +import Filter from '../../../../models/Filter'; import sortV2 from './sortV2'; -import Sort from '../../../models/Sort'; -import FormulaColumn from '../../../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 '../../../models/View'; +import View from '../../../../models/View'; import { AuditOperationSubTypes, AuditOperationTypes, @@ -26,20 +26,20 @@ import { UITypes, ViewTypes } from 'nocodb-sdk'; -import formSubmissionEmailTemplate from '../../../noco/common/formSubmissionEmailTemplate'; +import formSubmissionEmailTemplate from '../../../../utils/common/formSubmissionEmailTemplate'; import ejs from 'ejs'; -import Audit from '../../../models/Audit'; -import FormView from '../../../models/FormView'; -import Hook from '../../../models/Hook'; -import NcPluginMgrv2 from '../../../noco/meta/helpers/NcPluginMgrv2'; +import Audit from '../../../../models/Audit'; +import FormView from '../../../../models/FormView'; +import Hook from '../../../../models/Hook'; +import NcPluginMgrv2 from '../../../../meta/helpers/NcPluginMgrv2'; import { _transformSubmittedFormDataForEmail, invokeWebhook, parseBody -} from '../../../noco/meta/helpers/webhookHelpers'; +} from '../../../../meta/helpers/webhookHelpers'; import Validator from 'validator'; import { customValidators } from './customValidators'; -import { NcError } from '../../../noco/meta/helpers/catchError'; +import { NcError } from '../../../../meta/helpers/catchError'; import { customAlphabet } from 'nanoid'; const GROUP_COL = '__nc_group_id'; diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/CustomKnex.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts similarity index 99% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/CustomKnex.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts index 0c3cb68eca..fe1a1ba6e2 100644 --- a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/CustomKnex.ts +++ b/packages/nocodb/src/lib/db/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 '../../../models/Filter'; +import Filter from '../../../../models/Filter'; const opMappingGen = { eq: '=', diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/conditionV2.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts similarity index 97% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/conditionV2.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts index 7055ee0727..4828369ecd 100644 --- a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/conditionV2.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts @@ -1,13 +1,13 @@ -import Filter from '../../../models/Filter'; -import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; +import Filter from '../../../../models/Filter'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; import { QueryBuilder } from 'knex'; -import { XKnex } from '../..'; -import Column from '../../../models/Column'; -import LookupColumn from '../../../models/LookupColumn'; +import { XKnex } from '../../index'; +import Column from '../../../../models/Column'; +import LookupColumn from '../../../../models/LookupColumn'; import genRollupSelectv2 from './genRollupSelectv2'; -import RollupColumn from '../../../models/RollupColumn'; +import RollupColumn from '../../../../models/RollupColumn'; import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; -import FormulaColumn from '../../../models/FormulaColumn'; +import FormulaColumn from '../../../../models/FormulaColumn'; import { RelationTypes, UITypes } from 'nocodb-sdk'; // import LookupColumn from '../../../models/LookupColumn'; diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/customValidators.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/customValidators.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/customValidators.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/customValidators.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulaQueryBuilderFromString.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulaQueryBuilderFromString.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulaQueryBuilderFromString.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulaQueryBuilderFromString.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts similarity index 98% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts index 982f4bbda0..36443d70a4 100644 --- a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts @@ -1,12 +1,12 @@ import jsep from 'jsep'; import mapFunctionName from '../mapFunctionName'; -import Model from '../../../../models/Model'; +import Model from '../../../../../models/Model'; import genRollupSelectv2 from '../genRollupSelectv2'; -import RollupColumn from '../../../../models/RollupColumn'; -import FormulaColumn from '../../../../models/FormulaColumn'; -import { XKnex } from '../../..'; -import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; -import LookupColumn from '../../../../models/LookupColumn'; +import RollupColumn from '../../../../../models/RollupColumn'; +import FormulaColumn from '../../../../../models/FormulaColumn'; +import { XKnex } from '../../../index'; +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/sql-data-mapper/lib/sql/functionMappings/commonFns.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/commonFns.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/commonFns.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/commonFns.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/mssql.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/mssql.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/mssql.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/mssql.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/mysql.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/mysql.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/mysql.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/mysql.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/pg.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/pg.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/pg.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/pg.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/sqlite.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/sqlite.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/functionMappings/sqlite.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/sqlite.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelect.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/genRollupSelect.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelect.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/genRollupSelect.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelectv2.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/genRollupSelectv2.ts similarity index 93% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelectv2.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/genRollupSelectv2.ts index 5215cf576d..57e60b0d3b 100644 --- a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/genRollupSelectv2.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/genRollupSelectv2.ts @@ -1,6 +1,6 @@ -import RollupColumn from '../../../models/RollupColumn'; -import { XKnex } from '../..'; -import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; +import RollupColumn from '../../../../models/RollupColumn'; +import { XKnex } from '../../index'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; import { QueryBuilder } from 'knex'; import { RelationTypes } from 'nocodb-sdk'; diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/helpers/getAst.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts similarity index 93% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/helpers/getAst.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts index d5d61a3dbb..0bee182d26 100644 --- a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/helpers/getAst.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts @@ -1,7 +1,7 @@ -import View from '../../../../models/View'; +import View from '../../../../../models/View'; import { isSystemColumn, UITypes } from 'nocodb-sdk'; -import Model from '../../../../models/Model'; -import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; +import Model from '../../../../../models/Model'; +import LinkToAnotherRecordColumn from '../../../../../models/LinkToAnotherRecordColumn'; const getAst = async ({ query, diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/mapFunctionName.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/mapFunctionName.ts similarity index 100% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/mapFunctionName.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/mapFunctionName.ts diff --git a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/sortV2.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/sortV2.ts similarity index 95% rename from packages/nocodb/src/lib/sql-data-mapper/lib/sql/sortV2.ts rename to packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/sortV2.ts index 07acd23d73..91a8efe1c6 100644 --- a/packages/nocodb/src/lib/sql-data-mapper/lib/sql/sortV2.ts +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/sortV2.ts @@ -1,12 +1,12 @@ import { QueryBuilder } from 'knex'; -import { XKnex } from '../..'; -import Sort from '../../../models/Sort'; -import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; +import { XKnex } from '../../index'; +import Sort from '../../../../models/Sort'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; import genRollupSelectv2 from './genRollupSelectv2'; -import RollupColumn from '../../../models/RollupColumn'; -import LookupColumn from '../../../models/LookupColumn'; +import RollupColumn from '../../../../models/RollupColumn'; +import LookupColumn from '../../../../models/LookupColumn'; import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; -import FormulaColumn from '../../../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/sql-mgr/ProjectMgr.ts b/packages/nocodb/src/lib/db/sql-mgr/ProjectMgr.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/ProjectMgr.ts rename to packages/nocodb/src/lib/db/sql-mgr/ProjectMgr.ts diff --git a/packages/nocodb/src/lib/sql-mgr/SqlMgr.ts b/packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/SqlMgr.ts rename to packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts index dab52119a0..9509a9c3f6 100644 --- a/packages/nocodb/src/lib/sql-mgr/SqlMgr.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/SqlMgr.ts @@ -13,7 +13,7 @@ import slash from 'slash'; const log = new Debug('SqlMgr'); import KnexMigrator from '../sql-migrator/lib/KnexMigrator'; // import {XKnex} from "../sql-data-mapper"; -import NcConnectionMgr from '../noco/common/NcConnectionMgr'; +import NcConnectionMgr from '../../utils/common/NcConnectionMgr'; import { customAlphabet } from 'nanoid'; const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 20); diff --git a/packages/nocodb/src/lib/sql-mgr/code/BaseRender.ts b/packages/nocodb/src/lib/db/sql-mgr/code/BaseRender.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/BaseRender.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/BaseRender.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts b/packages/nocodb/src/lib/db/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts index ce8e1a7f8e..b4f7cd0d0b 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql.ts @@ -20,7 +20,7 @@ class ExpressXcPolicyGql extends BaseRender { prepare(): any { let data = {}; - /* example of simple variable */ + /* run of simple variable */ data = this.ctx; return data; diff --git a/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts b/packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/BaseGqlXcTsSchema.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory.ts b/packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMssql.ts b/packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMssql.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMssql.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMssql.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMysql.ts b/packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMysql.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMysql.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaMysql.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts b/packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts index 24df516ac7..b3c17d2ba8 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaOracle.ts @@ -21,7 +21,7 @@ class GqlXcSchemaOracle extends BaseGqlXcTsSchema { const data:any = {}; - /!* example of simple variable *!/ + /!* run of simple variable *!/ data.tn = this.ctx.tn_camelize; data.columns = { diff --git a/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts b/packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaPg.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts b/packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/GqlXcTsSchemaSqlite.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/schemaHelp.ts b/packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/schemaHelp.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/gql-schema/xc-ts/schemaHelp.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/gql-schema/xc-ts/schemaHelp.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/models/xc/BaseModelXcMeta.ts b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/BaseModelXcMeta.ts similarity index 97% rename from packages/nocodb/src/lib/sql-mgr/code/models/xc/BaseModelXcMeta.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/models/xc/BaseModelXcMeta.ts index 05a97f1c61..b526bd6586 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/models/xc/BaseModelXcMeta.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/BaseModelXcMeta.ts @@ -1,5 +1,5 @@ import BaseRender from '../../BaseRender'; -import mapDefaultPrimaryValue from '../../../../noco/meta/helpers/mapDefaultPrimaryValue'; +import mapDefaultPrimaryValue from '../../../../../meta/helpers/mapDefaultPrimaryValue'; import { UITypes } from 'nocodb-sdk'; abstract class BaseModelXcMeta extends BaseRender { diff --git a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaFactory.ts b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaFactory.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaFactory.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaFactory.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMssql.ts b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaMssql.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMssql.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaMssql.ts index 02d85147f5..57117f2834 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMssql.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaMssql.ts @@ -19,7 +19,7 @@ class ModelXcMetaMssql extends BaseModelXcMeta { prepare() { const data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data.tn = this.ctx.tn; data.dbType = this.ctx.dbType; diff --git a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMysql.ts b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaMysql.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMysql.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaMysql.ts index 5ec694a12a..72a7115202 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaMysql.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaMysql.ts @@ -19,7 +19,7 @@ class ModelXcMetaMysql extends BaseModelXcMeta { prepare() { const data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data.tn = this.ctx.tn; data.dbType = this.ctx.dbType; diff --git a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaOracle.ts b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaOracle.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaOracle.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaOracle.ts index ea0543bf2b..120f3dd380 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaOracle.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaOracle.ts @@ -19,7 +19,7 @@ class ModelXcMetaOracle extends BaseModelXcMeta { prepare() { const data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data.tn = this.ctx.tn; data.dbType = this.ctx.dbType; diff --git a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaPg.ts b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaPg.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaPg.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaPg.ts index 418a2311aa..0a5450c0b5 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaPg.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaPg.ts @@ -19,7 +19,7 @@ class ModelXcMetaPg extends BaseModelXcMeta { prepare() { const data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data.tn = this.ctx.tn; data.dbType = this.ctx.dbType; diff --git a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaSqlite.ts b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaSqlite.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaSqlite.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaSqlite.ts index 90ec2a9ccf..766adbc14b 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/models/xc/ModelXcMetaSqlite.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/models/xc/ModelXcMetaSqlite.ts @@ -19,7 +19,7 @@ class ModelXcMetaSqlite extends BaseModelXcMeta { prepare() { const data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data.tn = this.ctx.tn; data.dbType = this.ctx.dbType; diff --git a/packages/nocodb/src/lib/sql-mgr/code/policies/xc/ExpressXcPolicy.ts b/packages/nocodb/src/lib/db/sql-mgr/code/policies/xc/ExpressXcPolicy.ts similarity index 97% rename from packages/nocodb/src/lib/sql-mgr/code/policies/xc/ExpressXcPolicy.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/policies/xc/ExpressXcPolicy.ts index 32e7f959fa..30ec95e988 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/policies/xc/ExpressXcPolicy.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/policies/xc/ExpressXcPolicy.ts @@ -1,6 +1,6 @@ import lodash from 'lodash'; -import { Acl } from '../../../../../interface/config'; +import { Acl } from '../../../../../../interface/config'; import BaseRender from '../../BaseRender'; class ExpressXcMiddleware extends BaseRender { @@ -23,7 +23,7 @@ class ExpressXcMiddleware extends BaseRender { prepare() { let data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data = this.ctx; /* for complex code provide a func and args - do derivation within the func cbk */ diff --git a/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerTypes.ts b/packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerTypes.ts similarity index 100% rename from packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerTypes.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerTypes.ts diff --git a/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXc.ts b/packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXc.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXc.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXc.ts index edbbbbe297..90808ff7fe 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXc.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXc.ts @@ -22,7 +22,7 @@ class SwaggerXc extends BaseRender { prepare() { let data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data = this.ctx; data.paths = {}; diff --git a/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts b/packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts similarity index 98% rename from packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts index a68dfb64b8..9e39ee4c58 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXcBt.ts @@ -20,7 +20,7 @@ class SwaggerXcBt extends BaseRender { prepare() { let data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data = this.ctx; data.definitions = { diff --git a/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts b/packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts index aef04eadc0..c6a6d94311 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/routers/xc-ts/SwaggerXcHm.ts @@ -20,7 +20,7 @@ class SwaggerXcHm extends BaseRender { prepare() { let data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data = this.ctx; data.definitions = { diff --git a/packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes.ts b/packages/nocodb/src/lib/db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes.ts index 02ffa270a9..72c5648010 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes.ts @@ -20,7 +20,7 @@ class ExpressXcTsRoutes extends BaseRender { prepare() { let data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data = this.ctx; return data; diff --git a/packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts b/packages/nocodb/src/lib/db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts similarity index 96% rename from packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts index 2d40ab68a6..65aab067d3 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt.ts @@ -20,7 +20,7 @@ class ExpressXcTsRoutesBt extends BaseRender { prepare() { let data: any = {}; - /* example of simple variable */ + /* run of simple variable */ data = this.ctx; return data; diff --git a/packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts b/packages/nocodb/src/lib/db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts similarity index 99% rename from packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts rename to packages/nocodb/src/lib/db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts index 065888a382..6c31ed1983 100644 --- a/packages/nocodb/src/lib/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm.ts @@ -20,7 +20,7 @@ class ExpressXcTsRoutesHm extends BaseRender { public prepare(): any { let data = {}; - /* example of simple variable */ + /* run of simple variable */ data = this.ctx; return data; diff --git a/packages/nocodb/src/lib/sql-mgr/v2/ProjectMgrv2.ts b/packages/nocodb/src/lib/db/sql-mgr/v2/ProjectMgrv2.ts similarity index 88% rename from packages/nocodb/src/lib/sql-mgr/v2/ProjectMgrv2.ts rename to packages/nocodb/src/lib/db/sql-mgr/v2/ProjectMgrv2.ts index a973c338ec..0662014e37 100644 --- a/packages/nocodb/src/lib/sql-mgr/v2/ProjectMgrv2.ts +++ b/packages/nocodb/src/lib/db/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 '../../models/Base'; +import NcMetaIO from '../../../meta/NcMetaIO'; +import Base from '../../../models/Base'; export default class ProjectMgrv2 { private static sqlMgrMap: { diff --git a/packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2.ts b/packages/nocodb/src/lib/db/sql-mgr/v2/SqlMgrv2.ts similarity index 96% rename from packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2.ts rename to packages/nocodb/src/lib/db/sql-mgr/v2/SqlMgrv2.ts index fa7cc676a4..ec1a2ba092 100644 --- a/packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/v2/SqlMgrv2.ts @@ -4,9 +4,9 @@ import { Debug, SqlClientFactory } from 'nc-help'; const log = new Debug('SqlMgr'); // import {XKnex} from "../sql-data-mapper"; -import NcConnectionMgrv2 from '../../noco/common/NcConnectionMgrv2'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; import KnexMigratorv2 from '../../sql-migrator/lib/KnexMigratorv2'; -import Base from '../../models/Base'; +import Base from '../../../models/Base'; export default class SqlMgrv2 { protected _migrator: KnexMigratorv2; diff --git a/packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2Trans.ts b/packages/nocodb/src/lib/db/sql-mgr/v2/SqlMgrv2Trans.ts similarity index 90% rename from packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2Trans.ts rename to packages/nocodb/src/lib/db/sql-mgr/v2/SqlMgrv2Trans.ts index 401482e051..59a83ccb3b 100644 --- a/packages/nocodb/src/lib/sql-mgr/v2/SqlMgrv2Trans.ts +++ b/packages/nocodb/src/lib/db/sql-mgr/v2/SqlMgrv2Trans.ts @@ -1,9 +1,9 @@ import SqlMgrv2 from './SqlMgrv2'; -import Base from '../../models/Base'; -import NcConnectionMgrv2 from '../../noco/common/NcConnectionMgrv2'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; import { Transaction } from 'knex'; import { XKnex } from '../../sql-data-mapper'; -import NcMetaIO from '../../noco/meta/NcMetaIO'; +import NcMetaIO from '../../../meta/NcMetaIO'; import KnexMigratorv2Tans from '../../sql-migrator/lib/KnexMigratorv2Tans'; export default class SqlMgrv2Trans extends SqlMgrv2 { diff --git a/packages/nocodb/src/lib/sql-migrator/lib/KnexMigrator.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigrator.ts similarity index 99% rename from packages/nocodb/src/lib/sql-migrator/lib/KnexMigrator.ts rename to packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigrator.ts index cac555276a..2050439018 100644 --- a/packages/nocodb/src/lib/sql-migrator/lib/KnexMigrator.ts +++ b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigrator.ts @@ -14,7 +14,7 @@ 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/sql-migrator/lib/KnexMigratorv2.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2.ts similarity index 99% rename from packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2.ts rename to packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2.ts index 96025728a4..e26b086a16 100644 --- a/packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2.ts +++ b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2.ts @@ -13,11 +13,11 @@ import * as fileHelp from '../util/file.help'; // import SqlMigrator from './SqlMigrator'; // import NcConfigFactory from '../../../utils/NcConfigFactory'; -import Noco from '../../noco/Noco'; +import Noco from '../../../Noco'; import { XKnex } from '../../sql-data-mapper'; -import Project from '../../models/Project'; -import Base from '../../models/Base'; -import NcConnectionMgrv2 from '../../noco/common/NcConnectionMgrv2'; +import Project from '../../../models/Project'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; const evt = new Emit(); const log = new Debug('KnexMigrator'); diff --git a/packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2Tans.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2Tans.ts similarity index 88% rename from packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2Tans.ts rename to packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2Tans.ts index d5879f57cf..25d7ab86a1 100644 --- a/packages/nocodb/src/lib/sql-migrator/lib/KnexMigratorv2Tans.ts +++ b/packages/nocodb/src/lib/db/sql-migrator/lib/KnexMigratorv2Tans.ts @@ -5,11 +5,11 @@ * @extends {SqlMigrator} */ import KnexMigratorv2 from './KnexMigratorv2'; -import Base from '../../models/Base'; -import NcConnectionMgrv2 from '../../noco/common/NcConnectionMgrv2'; -import Noco from '../../noco/Noco'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; +import Noco from '../../../Noco'; import { XKnex } from '../../sql-data-mapper'; -import NcMetaIO from '../../noco/meta/NcMetaIO'; +import NcMetaIO from '../../../meta/NcMetaIO'; export default class KnexMigratorv2Tans extends KnexMigratorv2 { protected sqlClient: any; diff --git a/packages/nocodb/src/lib/sql-migrator/lib/SqlMigrator.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/SqlMigrator.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/lib/SqlMigrator.ts rename to packages/nocodb/src/lib/db/sql-migrator/lib/SqlMigrator.ts diff --git a/packages/nocodb/src/lib/sql-migrator/lib/SqlMigratorFactory.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/SqlMigratorFactory.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/lib/SqlMigratorFactory.ts rename to packages/nocodb/src/lib/db/sql-migrator/lib/SqlMigratorFactory.ts diff --git a/packages/nocodb/src/lib/sql-migrator/lib/templates/mssql.template.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/templates/mssql.template.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/lib/templates/mssql.template.ts rename to packages/nocodb/src/lib/db/sql-migrator/lib/templates/mssql.template.ts diff --git a/packages/nocodb/src/lib/sql-migrator/lib/templates/mysql.template.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/templates/mysql.template.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/lib/templates/mysql.template.ts rename to packages/nocodb/src/lib/db/sql-migrator/lib/templates/mysql.template.ts diff --git a/packages/nocodb/src/lib/sql-migrator/lib/templates/pg.template.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/templates/pg.template.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/lib/templates/pg.template.ts rename to packages/nocodb/src/lib/db/sql-migrator/lib/templates/pg.template.ts diff --git a/packages/nocodb/src/lib/sql-migrator/lib/templates/sqlite.template.ts b/packages/nocodb/src/lib/db/sql-migrator/lib/templates/sqlite.template.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/lib/templates/sqlite.template.ts rename to packages/nocodb/src/lib/db/sql-migrator/lib/templates/sqlite.template.ts diff --git a/packages/nocodb/src/lib/sql-migrator/tests/sqlmigrator.test.ts b/packages/nocodb/src/lib/db/sql-migrator/tests/sqlmigrator.test.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/tests/sqlmigrator.test.ts rename to packages/nocodb/src/lib/db/sql-migrator/tests/sqlmigrator.test.ts diff --git a/packages/nocodb/src/lib/sql-migrator/util/Debug.ts b/packages/nocodb/src/lib/db/sql-migrator/util/Debug.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/util/Debug.ts rename to packages/nocodb/src/lib/db/sql-migrator/util/Debug.ts diff --git a/packages/nocodb/src/lib/sql-migrator/util/DebugMgr.ts b/packages/nocodb/src/lib/db/sql-migrator/util/DebugMgr.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/util/DebugMgr.ts rename to packages/nocodb/src/lib/db/sql-migrator/util/DebugMgr.ts diff --git a/packages/nocodb/src/lib/sql-migrator/util/FileCollection.ts b/packages/nocodb/src/lib/db/sql-migrator/util/FileCollection.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/util/FileCollection.ts rename to packages/nocodb/src/lib/db/sql-migrator/util/FileCollection.ts diff --git a/packages/nocodb/src/lib/sql-migrator/util/Result.ts b/packages/nocodb/src/lib/db/sql-migrator/util/Result.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/util/Result.ts rename to packages/nocodb/src/lib/db/sql-migrator/util/Result.ts diff --git a/packages/nocodb/src/lib/sql-migrator/util/emit.ts b/packages/nocodb/src/lib/db/sql-migrator/util/emit.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/util/emit.ts rename to packages/nocodb/src/lib/db/sql-migrator/util/emit.ts diff --git a/packages/nocodb/src/lib/sql-migrator/util/file.help.ts b/packages/nocodb/src/lib/db/sql-migrator/util/file.help.ts similarity index 100% rename from packages/nocodb/src/lib/sql-migrator/util/file.help.ts rename to packages/nocodb/src/lib/db/sql-migrator/util/file.help.ts diff --git a/packages/nocodb/src/lib/index.ts b/packages/nocodb/src/lib/index.ts index 1125daf349..b9a70bed48 100644 --- a/packages/nocodb/src/lib/index.ts +++ b/packages/nocodb/src/lib/index.ts @@ -1,5 +1,5 @@ -import Noco from './noco/Noco'; -import XcTry from './noco/nc.try'; +import Noco from './Noco'; +import XcTry from './v1-legacy/nc.try'; import NcConfigFactory from './utils/NcConfigFactory'; export default Noco; diff --git a/packages/nocodb/src/lib/noco/meta/MetaAPILogger.ts b/packages/nocodb/src/lib/meta/MetaAPILogger.ts similarity index 96% rename from packages/nocodb/src/lib/noco/meta/MetaAPILogger.ts rename to packages/nocodb/src/lib/meta/MetaAPILogger.ts index 37ef33f0f5..871667ae00 100644 --- a/packages/nocodb/src/lib/noco/meta/MetaAPILogger.ts +++ b/packages/nocodb/src/lib/meta/MetaAPILogger.ts @@ -1,4 +1,4 @@ -import { XKnex } from '../../sql-data-mapper'; +import { XKnex } from '../db/sql-data-mapper'; import { Request } from 'express'; export default class MetaAPILogger { @@ -74,7 +74,7 @@ class XcLoggerMigrationSource { // Migrations can be whatever you want, they will be passed as // arguments to getMigrationName and getMigration public getMigrations(): Promise { - // In this example we are just returning migration names + // In this run we are just returning migration names return Promise.resolve(['logger']); } diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaIO.ts b/packages/nocodb/src/lib/meta/NcMetaIO.ts similarity index 98% rename from packages/nocodb/src/lib/noco/meta/NcMetaIO.ts rename to packages/nocodb/src/lib/meta/NcMetaIO.ts index 06f535fd17..b0bbe3689d 100644 --- a/packages/nocodb/src/lib/noco/meta/NcMetaIO.ts +++ b/packages/nocodb/src/lib/meta/NcMetaIO.ts @@ -1,6 +1,6 @@ -import { NcConfig } from '../../../interface/config'; +import { NcConfig } from '../../interface/config'; import Noco from '../Noco'; -import { XKnex } from '../../sql-data-mapper'; +import { XKnex } from '../db/sql-data-mapper'; const META_TABLES = { graphql: [ diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts b/packages/nocodb/src/lib/meta/NcMetaIOImpl.ts similarity index 98% rename from packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts rename to packages/nocodb/src/lib/meta/NcMetaIOImpl.ts index 22f83ce15e..c48064f85b 100644 --- a/packages/nocodb/src/lib/noco/meta/NcMetaIOImpl.ts +++ b/packages/nocodb/src/lib/meta/NcMetaIOImpl.ts @@ -1,15 +1,15 @@ import CryptoJS from 'crypto-js'; import { customAlphabet } from 'nanoid'; -import { NcConfig } from '../../../interface/config'; -import { Knex, XKnex } from '../../sql-data-mapper'; +import { NcConfig } from '../../interface/config'; +import { Knex, XKnex } from '../db/sql-data-mapper'; import Noco from '../Noco'; -import XcMigrationSource from '../common/XcMigrationSource'; +import XcMigrationSource from '../migrations/XcMigrationSource'; import NcMetaIO, { META_TABLES } from './NcMetaIO'; -import NcConnectionMgr from '../common/NcConnectionMgr'; -import { MetaTable } from '../../utils/globals'; -import XcMigrationSourcev2 from '../common/XcMigrationSourcev2'; +import NcConnectionMgr from '../utils/common/NcConnectionMgr'; +import { MetaTable } from '../utils/globals'; +import XcMigrationSourcev2 from '../migrations/XcMigrationSourcev2'; // import { nanoid } from 'nanoid'; /*import { v4 as uuidv4 } from 'uuid';*/ diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaIOImplEE.ts b/packages/nocodb/src/lib/meta/NcMetaIOImplEE.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/NcMetaIOImplEE.ts rename to packages/nocodb/src/lib/meta/NcMetaIOImplEE.ts diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts b/packages/nocodb/src/lib/meta/NcMetaMgr.ts similarity index 99% rename from packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts rename to packages/nocodb/src/lib/meta/NcMetaMgr.ts index bcac3235c2..bc08693641 100644 --- a/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts +++ b/packages/nocodb/src/lib/meta/NcMetaMgr.ts @@ -16,28 +16,28 @@ import slash from 'slash'; import { v4 as uuidv4 } from 'uuid'; import { ncp } from 'ncp'; -import IEmailAdapter from '../../../interface/IEmailAdapter'; -import IStorageAdapter from '../../../interface/IStorageAdapter'; -import { NcConfig, Result } from '../../../interface/config'; -import { NcConfigFactory } from '../../index'; -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'; +import IEmailAdapter from '../../interface/IEmailAdapter'; +import IStorageAdapter from '../../interface/IStorageAdapter'; +import { NcConfig, Result } from '../../interface/config'; +import { NcConfigFactory } from '../index'; +import ProjectMgr from '../db/sql-mgr/ProjectMgr'; +import ExpressXcTsRoutes from '../db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes'; +import ExpressXcTsRoutesBt from '../db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt'; +import ExpressXcTsRoutesHm from '../db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm'; +import NcHelp from '../utils/NcHelp'; +import mimetypes, { mimeIcons } from '../utils/mimeTypes'; +import projectAcl from '../utils/projectAcl'; import Noco from '../Noco'; -import { GqlApiBuilder } from '../gql/GqlApiBuilder'; -import NcPluginMgr from '../plugins/NcPluginMgr'; -import XcCache from '../plugins/adapters/cache/XcCache'; -import { RestApiBuilder } from '../rest/RestApiBuilder'; -import RestAuthCtrl from '../rest/RestAuthCtrlEE'; +import { GqlApiBuilder } from '../v1-legacy/gql/GqlApiBuilder'; +import NcPluginMgr from '../v1-legacy/plugins/NcPluginMgr'; +import XcCache from '../v1-legacy/plugins/adapters/cache/XcCache'; +import { RestApiBuilder } from '../v1-legacy/rest/RestApiBuilder'; +import RestAuthCtrl from '../v1-legacy/rest/RestAuthCtrlEE'; import { packageVersion } from 'nc-help'; import NcMetaIO, { META_TABLES } from './NcMetaIO'; import { promisify } from 'util'; -import NcTemplateParser from '../../template-parser/NcTemplateParser'; -import { defaultConnectionConfig } from '../../utils/NcConfigFactory'; +import NcTemplateParser from '../v1-legacy/templates/NcTemplateParser'; +import { defaultConnectionConfig } from '../utils/NcConfigFactory'; import xcMetaDiff from './handlers/xcMetaDiff'; import { UITypes } from 'nocodb-sdk'; const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 10); @@ -5067,7 +5067,7 @@ export default class NcMetaMgr { // @ts-ignore protected xcVersionLetters(args) { - // const _vesions ={db:'v1'}; + // const _vesions ={db:'v1-legacy'}; // for(const {meta: {_dbAlias}} of this.projectConfigs[args.project_id].envs[args.env].db) { // // } diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaMgrEE.ts b/packages/nocodb/src/lib/meta/NcMetaMgrEE.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/NcMetaMgrEE.ts rename to packages/nocodb/src/lib/meta/NcMetaMgrEE.ts diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaMgrv2.ts b/packages/nocodb/src/lib/meta/NcMetaMgrv2.ts similarity index 97% rename from packages/nocodb/src/lib/noco/meta/NcMetaMgrv2.ts rename to packages/nocodb/src/lib/meta/NcMetaMgrv2.ts index 94e475350a..5f9f2ce625 100644 --- a/packages/nocodb/src/lib/noco/meta/NcMetaMgrv2.ts +++ b/packages/nocodb/src/lib/meta/NcMetaMgrv2.ts @@ -2,14 +2,14 @@ import bodyParser from 'body-parser'; import { Handler, Router } from 'express'; import multer from 'multer'; -import { NcConfig } from '../../../interface/config'; -import ProjectMgr from '../../sql-mgr/ProjectMgr'; -import projectAcl from '../../utils/projectAcl'; +import { NcConfig } from '../../interface/config'; +import ProjectMgr from '../db/sql-mgr/ProjectMgr'; +import projectAcl from '../utils/projectAcl'; import Noco from '../Noco'; -import NcPluginMgr from '../plugins/NcPluginMgr'; +import NcPluginMgr from '../v1-legacy/plugins/NcPluginMgr'; import { packageVersion } from 'nc-help'; import NcMetaIO from './NcMetaIO'; -import { defaultConnectionConfig } from '../../utils/NcConfigFactory'; +import { defaultConnectionConfig } from '../utils/NcConfigFactory'; import ncCreateLookup from './handlersv2/ncCreateLookup'; // import ncGetMeta from './handlersv2/ncGetMeta'; diff --git a/packages/nocodb/src/lib/noco/meta/api/apiTokenApis.ts b/packages/nocodb/src/lib/meta/api/apiTokenApis.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/api/apiTokenApis.ts rename to packages/nocodb/src/lib/meta/api/apiTokenApis.ts index d2699bb6eb..3afcf26cbe 100644 --- a/packages/nocodb/src/lib/noco/meta/api/apiTokenApis.ts +++ b/packages/nocodb/src/lib/meta/api/apiTokenApis.ts @@ -1,6 +1,6 @@ import { Request, Response, Router } from 'express'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; -import ApiToken from '../../../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/attachmentApis.ts b/packages/nocodb/src/lib/meta/api/attachmentApis.ts similarity index 98% rename from packages/nocodb/src/lib/noco/meta/api/attachmentApis.ts rename to packages/nocodb/src/lib/meta/api/attachmentApis.ts index 7cdb4b5a7f..dec18c2be4 100644 --- a/packages/nocodb/src/lib/noco/meta/api/attachmentApis.ts +++ b/packages/nocodb/src/lib/meta/api/attachmentApis.ts @@ -5,7 +5,7 @@ import { nanoid } from 'nanoid'; import { Tele } from 'nc-help'; import path from 'path'; import slash from 'slash'; -import mimetypes, { mimeIcons } from '../../../utils/mimeTypes'; +import mimetypes, { mimeIcons } from '../../utils/mimeTypes'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import catchError from '../helpers/catchError'; import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; diff --git a/packages/nocodb/src/lib/noco/meta/api/auditApis.ts b/packages/nocodb/src/lib/meta/api/auditApis.ts similarity index 96% rename from packages/nocodb/src/lib/noco/meta/api/auditApis.ts rename to packages/nocodb/src/lib/meta/api/auditApis.ts index 9295ff20dd..ed6e4f6c9e 100644 --- a/packages/nocodb/src/lib/noco/meta/api/auditApis.ts +++ b/packages/nocodb/src/lib/meta/api/auditApis.ts @@ -1,7 +1,7 @@ import { Request, Response, Router } from 'express'; -import Audit from '../../../models/Audit'; +import Audit from '../../models/Audit'; import { AuditOperationSubTypes, AuditOperationTypes } from 'nocodb-sdk'; -import Model from '../../../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/meta/api/cacheApis.ts similarity index 92% rename from packages/nocodb/src/lib/noco/meta/api/cacheApis.ts rename to packages/nocodb/src/lib/meta/api/cacheApis.ts index e9cc5d327a..d89de3fe04 100644 --- a/packages/nocodb/src/lib/noco/meta/api/cacheApis.ts +++ b/packages/nocodb/src/lib/meta/api/cacheApis.ts @@ -1,5 +1,5 @@ import catchError from '../helpers/catchError'; -import NocoCache from '../../../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/meta/api/columnApis.ts similarity index 98% rename from packages/nocodb/src/lib/noco/meta/api/columnApis.ts rename to packages/nocodb/src/lib/meta/api/columnApis.ts index 646dab3a85..2e942107f8 100644 --- a/packages/nocodb/src/lib/noco/meta/api/columnApis.ts +++ b/packages/nocodb/src/lib/meta/api/columnApis.ts @@ -1,13 +1,13 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../models/Model'; -import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; -import Base from '../../../models/Base'; -import Column from '../../../models/Column'; +import Model from '../../models/Model'; +import ProjectMgrv2 from '../../db/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 '../../../models/LinkToAnotherRecordColumn'; +import LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; import { getUniqueColumnAliasName, getUniqueColumnName @@ -23,18 +23,18 @@ import { TableType, UITypes } from 'nocodb-sdk'; -import Audit from '../../../models/Audit'; -import SqlMgrv2 from '../../../sql-mgr/v2/SqlMgrv2'; +import Audit from '../../models/Audit'; +import SqlMgrv2 from '../../db/sql-mgr/v2/SqlMgrv2'; import Noco from '../../Noco'; import NcMetaIO from '../NcMetaIO'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { NcError } from '../helpers/catchError'; import getColumnPropsFromUIDT from '../helpers/getColumnPropsFromUIDT'; import mapDefaultPrimaryValue from '../helpers/mapDefaultPrimaryValue'; -import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; +import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; import { metaApiMetrics } from '../helpers/apiMetrics'; -import FormulaColumn from '../../../models/FormulaColumn'; -import { MetaTable } from '../../../utils/globals'; +import FormulaColumn from '../../models/FormulaColumn'; +import { MetaTable } from '../../utils/globals'; const randomID = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 10); diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/bulkDataAliasApis.ts b/packages/nocodb/src/lib/meta/api/dataApis/bulkDataAliasApis.ts similarity index 94% rename from packages/nocodb/src/lib/noco/meta/api/dataApis/bulkDataAliasApis.ts rename to packages/nocodb/src/lib/meta/api/dataApis/bulkDataAliasApis.ts index eb19e3bbce..c3a5feb34e 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/bulkDataAliasApis.ts +++ b/packages/nocodb/src/lib/meta/api/dataApis/bulkDataAliasApis.ts @@ -1,7 +1,7 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../models/Model'; -import Base from '../../../../models/Base'; -import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; +import Model from '../../../models/Model'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import { getViewAndModelFromRequestByAliasOrId } from './helpers'; import apiMetrics from '../../helpers/apiMetrics'; diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts b/packages/nocodb/src/lib/meta/api/dataApis/dataAliasApis.ts similarity index 96% rename from packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts rename to packages/nocodb/src/lib/meta/api/dataApis/dataAliasApis.ts index a96eede04e..79199d3184 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts +++ b/packages/nocodb/src/lib/meta/api/dataApis/dataAliasApis.ts @@ -1,14 +1,14 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../models/Model'; +import Model from '../../../models/Model'; import { nocoExecute } from 'nc-help'; -import Base from '../../../../models/Base'; -import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; -import View from '../../../../models/View'; +import View from '../../../models/View'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import { getViewAndModelFromRequestByAliasOrId } from './helpers'; import apiMetrics from '../../helpers/apiMetrics'; -import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst'; +import getAst from '../../../db/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/dataAliasExportApis.ts b/packages/nocodb/src/lib/meta/api/dataApis/dataAliasExportApis.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasExportApis.ts rename to packages/nocodb/src/lib/meta/api/dataApis/dataAliasExportApis.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasNestedApis.ts b/packages/nocodb/src/lib/meta/api/dataApis/dataAliasNestedApis.ts similarity index 97% rename from packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasNestedApis.ts rename to packages/nocodb/src/lib/meta/api/dataApis/dataAliasNestedApis.ts index d0d839980e..a0340bef69 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasNestedApis.ts +++ b/packages/nocodb/src/lib/meta/api/dataApis/dataAliasNestedApis.ts @@ -1,7 +1,7 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../models/Model'; -import Base from '../../../../models/Base'; -import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; +import Model from '../../../models/Model'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; import { getViewAndModelFromRequestByAliasOrId } from './helpers'; diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataApis.ts b/packages/nocodb/src/lib/meta/api/dataApis/dataApis.ts similarity index 98% rename from packages/nocodb/src/lib/noco/meta/api/dataApis/dataApis.ts rename to packages/nocodb/src/lib/meta/api/dataApis/dataApis.ts index f733016cfd..c55bcbf3aa 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataApis.ts +++ b/packages/nocodb/src/lib/meta/api/dataApis/dataApis.ts @@ -1,14 +1,14 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../models/Model'; +import Model from '../../../models/Model'; import { nocoExecute } from 'nc-help'; -import Base from '../../../../models/Base'; -import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; -import View from '../../../../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 '../../../../sql-data-mapper/lib/sql/helpers/getAst'; +import getAst from '../../../db/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/meta/api/dataApis/helpers.ts similarity index 89% rename from packages/nocodb/src/lib/noco/meta/api/dataApis/helpers.ts rename to packages/nocodb/src/lib/meta/api/dataApis/helpers.ts index 7ba675b184..36f250b074 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/helpers.ts +++ b/packages/nocodb/src/lib/meta/api/dataApis/helpers.ts @@ -1,19 +1,19 @@ -import Project from '../../../../models/Project'; -import Model from '../../../../models/Model'; -import View from '../../../../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 '../../../../models/Base'; -import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; import { isSystemColumn, UITypes } from 'nocodb-sdk'; import { nocoExecute } from 'nc-help'; -import Column from '../../../../models/Column'; -import LookupColumn from '../../../../models/LookupColumn'; -import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; +import Column from '../../../models/Column'; +import LookupColumn from '../../../models/LookupColumn'; +import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import papaparse from 'papaparse'; -import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst'; +import getAst from '../../../db/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/index.ts b/packages/nocodb/src/lib/meta/api/dataApis/index.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/dataApis/index.ts rename to packages/nocodb/src/lib/meta/api/dataApis/index.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/oldDataApis.ts b/packages/nocodb/src/lib/meta/api/dataApis/oldDataApis.ts similarity index 93% rename from packages/nocodb/src/lib/noco/meta/api/dataApis/oldDataApis.ts rename to packages/nocodb/src/lib/meta/api/dataApis/oldDataApis.ts index 08f2f81358..84fe93cbe1 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/oldDataApis.ts +++ b/packages/nocodb/src/lib/meta/api/dataApis/oldDataApis.ts @@ -1,14 +1,14 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../models/Model'; +import Model from '../../../models/Model'; import { nocoExecute } from 'nc-help'; -import Base from '../../../../models/Base'; -import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; -import View from '../../../../models/View'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; +import View from '../../../models/View'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; -import Project from '../../../../models/Project'; +import Project from '../../../models/Project'; import { NcError } from '../../helpers/catchError'; import apiMetrics from '../../helpers/apiMetrics'; -import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst'; +import getAst from '../../../db/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/meta/api/exportApis.ts similarity index 94% rename from packages/nocodb/src/lib/noco/meta/api/exportApis.ts rename to packages/nocodb/src/lib/meta/api/exportApis.ts index 7a8b486c04..e298d8b0c7 100644 --- a/packages/nocodb/src/lib/noco/meta/api/exportApis.ts +++ b/packages/nocodb/src/lib/meta/api/exportApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import View from '../../../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/meta/api/filterApis.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/api/filterApis.ts rename to packages/nocodb/src/lib/meta/api/filterApis.ts index 86ea0a5929..bee658fcfb 100644 --- a/packages/nocodb/src/lib/noco/meta/api/filterApis.ts +++ b/packages/nocodb/src/lib/meta/api/filterApis.ts @@ -1,15 +1,15 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../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 '../../../sql-mgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../models/Project'; -import Filter from '../../../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/meta/api/formViewApis.ts similarity index 87% rename from packages/nocodb/src/lib/noco/meta/api/formViewApis.ts rename to packages/nocodb/src/lib/meta/api/formViewApis.ts index 47f55db4fc..d04a149b13 100644 --- a/packages/nocodb/src/lib/noco/meta/api/formViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewApis.ts @@ -1,15 +1,15 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../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 '../../../sql-mgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../models/Project'; -import View from '../../../models/View'; -import FormView from '../../../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/meta/api/formViewColumnApis.ts similarity index 90% rename from packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts rename to packages/nocodb/src/lib/meta/api/formViewColumnApis.ts index 12268866d4..711a589dfb 100644 --- a/packages/nocodb/src/lib/noco/meta/api/formViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/formViewColumnApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import FormViewColumn from '../../../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/meta/api/galleryViewApis.ts similarity index 93% rename from packages/nocodb/src/lib/noco/meta/api/galleryViewApis.ts rename to packages/nocodb/src/lib/meta/api/galleryViewApis.ts index b219847a15..d5e6381c44 100644 --- a/packages/nocodb/src/lib/noco/meta/api/galleryViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/galleryViewApis.ts @@ -1,7 +1,7 @@ import { Request, Response, Router } from 'express'; import { GalleryType, ViewTypes } from 'nocodb-sdk'; -import View from '../../../models/View'; -import GalleryView from '../../../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/meta/api/gridViewApis.ts similarity index 81% rename from packages/nocodb/src/lib/noco/meta/api/gridViewApis.ts rename to packages/nocodb/src/lib/meta/api/gridViewApis.ts index fcf919db01..4c53677cca 100644 --- a/packages/nocodb/src/lib/noco/meta/api/gridViewApis.ts +++ b/packages/nocodb/src/lib/meta/api/gridViewApis.ts @@ -1,14 +1,14 @@ import { Request, Router } from 'express'; // @ts-ignore -import Model from '../../../models/Model'; +import Model from '../../models/Model'; // @ts-ignore import { PagedResponseImpl } from '../helpers/PagedResponse'; import { ViewTypes } from 'nocodb-sdk'; // @ts-ignore -import ProjectMgrv2 from '../../../sql-mgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../models/Project'; -import View from '../../../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/meta/api/gridViewColumnApis.ts similarity index 93% rename from packages/nocodb/src/lib/noco/meta/api/gridViewColumnApis.ts rename to packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts index cd1779f4fe..6d30b387e3 100644 --- a/packages/nocodb/src/lib/noco/meta/api/gridViewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/gridViewColumnApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import GridViewColumn from '../../../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/meta/api/hookApis.ts similarity index 97% rename from packages/nocodb/src/lib/noco/meta/api/hookApis.ts rename to packages/nocodb/src/lib/meta/api/hookApis.ts index 9dc7e3e431..ee4d51887f 100644 --- a/packages/nocodb/src/lib/noco/meta/api/hookApis.ts +++ b/packages/nocodb/src/lib/meta/api/hookApis.ts @@ -1,10 +1,10 @@ import catchError from '../helpers/catchError'; import { Request, Response, Router } from 'express'; -import Hook from '../../../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 '../../../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/meta/api/hookFilterApis.ts similarity index 93% rename from packages/nocodb/src/lib/noco/meta/api/hookFilterApis.ts rename to packages/nocodb/src/lib/meta/api/hookFilterApis.ts index 2ace40b883..4656b00274 100644 --- a/packages/nocodb/src/lib/noco/meta/api/hookFilterApis.ts +++ b/packages/nocodb/src/lib/meta/api/hookFilterApis.ts @@ -1,15 +1,15 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../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 '../../../sql-mgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../models/Project'; -import Filter from '../../../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/index.ts b/packages/nocodb/src/lib/meta/api/index.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/index.ts rename to packages/nocodb/src/lib/meta/api/index.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/metaDiffApis.ts b/packages/nocodb/src/lib/meta/api/metaDiffApis.ts similarity index 98% rename from packages/nocodb/src/lib/noco/meta/api/metaDiffApis.ts rename to packages/nocodb/src/lib/meta/api/metaDiffApis.ts index de80b4ea70..9df02372a6 100644 --- a/packages/nocodb/src/lib/noco/meta/api/metaDiffApis.ts +++ b/packages/nocodb/src/lib/meta/api/metaDiffApis.ts @@ -1,17 +1,17 @@ // // Project CRUD import ncMetaAclMw from '../helpers/ncMetaAclMw'; -import Model from '../../../models/Model'; -import Project from '../../../models/Project'; -import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; +import Model from '../../models/Model'; +import Project from '../../models/Project'; +import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; import { isVirtualCol, ModelTypes, RelationTypes, UITypes } from 'nocodb-sdk'; import { Router } from 'express'; -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 Base from '../../models/Base'; +import ModelXcMetaFactory from '../../db/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 NcHelp from '../../utils/NcHelp'; import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; import mapDefaultPrimaryValue from '../helpers/mapDefaultPrimaryValue'; import { Tele } from 'nc-help'; diff --git a/packages/nocodb/src/lib/noco/meta/api/modelVisibilityApis.ts b/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/api/modelVisibilityApis.ts rename to packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts index 2a901abfc2..8e67762951 100644 --- a/packages/nocodb/src/lib/noco/meta/api/modelVisibilityApis.ts +++ b/packages/nocodb/src/lib/meta/api/modelVisibilityApis.ts @@ -1,9 +1,9 @@ -import Model from '../../../models/Model'; -import ModelRoleVisibility from '../../../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 '../../../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/meta/api/pluginApis.ts similarity index 97% rename from packages/nocodb/src/lib/noco/meta/api/pluginApis.ts rename to packages/nocodb/src/lib/meta/api/pluginApis.ts index 338608876f..d4b2ee5642 100644 --- a/packages/nocodb/src/lib/noco/meta/api/pluginApis.ts +++ b/packages/nocodb/src/lib/meta/api/pluginApis.ts @@ -1,6 +1,6 @@ import { Request, Response, Router } from 'express'; import { PagedResponseImpl } from '../helpers/PagedResponse'; -import Plugin from '../../../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/meta/api/projectApis.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/api/projectApis.ts rename to packages/nocodb/src/lib/meta/api/projectApis.ts index d7485a26ab..1b3a18c03c 100644 --- a/packages/nocodb/src/lib/noco/meta/api/projectApis.ts +++ b/packages/nocodb/src/lib/meta/api/projectApis.ts @@ -1,19 +1,19 @@ import { Request, Response } from 'express'; -import Project from '../../../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 '../../../models/Column'; -import Model from '../../../models/Model'; -import NcHelp from '../../../utils/NcHelp'; -import Base from '../../../models/Base'; -import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; +import { IGNORE_TABLES } from '../../utils/common/BaseApiBuilder'; +import Column from '../../models/Column'; +import Model from '../../models/Model'; +import NcHelp from '../../utils/NcHelp'; +import Base from '../../models/Base'; +import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; -import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; +import LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; import ncMetaAclMw from '../helpers/ncMetaAclMw'; -import ProjectUser from '../../../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/meta/api/projectUserApis.ts similarity index 97% rename from packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts rename to packages/nocodb/src/lib/meta/api/projectUserApis.ts index c686caec2c..42e6f273aa 100644 --- a/packages/nocodb/src/lib/noco/meta/api/projectUserApis.ts +++ b/packages/nocodb/src/lib/meta/api/projectUserApis.ts @@ -1,15 +1,15 @@ import ncMetaAclMw from '../helpers/ncMetaAclMw'; import { Router } from 'express'; import { PagedResponseImpl } from '../helpers/PagedResponse'; -import ProjectUser from '../../../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 '../../../models/User'; +import User from '../../models/User'; import { Tele } from 'nc-help'; -import Audit from '../../../models/Audit'; -import NocoCache from '../../../cache/NocoCache'; -import { CacheGetType, CacheScope, MetaTable } from '../../../utils/globals'; +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'; import Noco from '../../Noco'; diff --git a/packages/nocodb/src/lib/noco/meta/api/publicApis/index.ts b/packages/nocodb/src/lib/meta/api/publicApis/index.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/publicApis/index.ts rename to packages/nocodb/src/lib/meta/api/publicApis/index.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataApis.ts b/packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataApis.ts rename to packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts index 8122c71c56..bf730af93a 100644 --- a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataApis.ts +++ b/packages/nocodb/src/lib/meta/api/publicApis/publicDataApis.ts @@ -1,22 +1,22 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../../models/Model'; +import Model from '../../../models/Model'; import { nocoExecute } from 'nc-help'; -import Base from '../../../../models/Base'; -import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; import { PagedResponseImpl } from '../../helpers/PagedResponse'; -import View from '../../../../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 '../../../../models/Column'; -import LinkToAnotherRecordColumn from '../../../../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 { mimeIcons } from '../../../utils/mimeTypes'; import slash from 'slash'; import { sanitizeUrlPath } from '../attachmentApis'; -import getAst from '../../../../sql-data-mapper/lib/sql/helpers/getAst'; +import getAst from '../../../db/sql-data-mapper/lib/sql/helpers/getAst'; export async function dataList(req: Request, res: Response) { try { @@ -131,7 +131,7 @@ async function dataInsert( const fieldName = file?.fieldname?.replace(/^_|\[\d*]$/g, ''); const filePath = sanitizeUrlPath([ - 'noco', + 'v1', project.title, model.title, fieldName diff --git a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts b/packages/nocodb/src/lib/meta/api/publicApis/publicDataExportApis.ts similarity index 91% rename from packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts rename to packages/nocodb/src/lib/meta/api/publicApis/publicDataExportApis.ts index f2ae95db13..32d76b1028 100644 --- a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicDataExportApis.ts +++ b/packages/nocodb/src/lib/meta/api/publicApis/publicDataExportApis.ts @@ -1,16 +1,16 @@ import { Request, Response, Router } from 'express'; -import View from '../../../../models/View'; -import Model from '../../../../models/Model'; -import Base from '../../../../models/Base'; -import NcConnectionMgrv2 from '../../../common/NcConnectionMgrv2'; +import View from '../../../models/View'; +import Model from '../../../models/Model'; +import Base from '../../../models/Base'; +import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; import { nocoExecute } from 'nc-help'; import papaparse from 'papaparse'; import { ErrorMessages, isSystemColumn, UITypes, ViewTypes } from 'nocodb-sdk'; -import Column from '../../../../models/Column'; -import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; -import LookupColumn from '../../../../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 '../../../../sql-data-mapper/lib/sql/helpers/getAst'; +import getAst from '../../../db/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/meta/api/publicApis/publicMetaApis.ts similarity index 90% rename from packages/nocodb/src/lib/noco/meta/api/publicApis/publicMetaApis.ts rename to packages/nocodb/src/lib/meta/api/publicApis/publicMetaApis.ts index 54e1ac39b0..b4f2c343ee 100644 --- a/packages/nocodb/src/lib/noco/meta/api/publicApis/publicMetaApis.ts +++ b/packages/nocodb/src/lib/meta/api/publicApis/publicMetaApis.ts @@ -1,11 +1,11 @@ import { Request, Response, Router } from 'express'; import catchError, { NcError } from '../../helpers/catchError'; -import View from '../../../../models/View'; -import Model from '../../../../models/Model'; +import View from '../../../models/View'; +import Model from '../../../models/Model'; import { ErrorMessages, LinkToAnotherRecordType, UITypes } from 'nocodb-sdk'; -import Column from '../../../../models/Column'; -import Base from '../../../../models/Base'; -import Project from '../../../../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/meta/api/sharedBaseApis.ts similarity index 98% rename from packages/nocodb/src/lib/noco/meta/api/sharedBaseApis.ts rename to packages/nocodb/src/lib/meta/api/sharedBaseApis.ts index 77c5316b28..e39245fd43 100644 --- a/packages/nocodb/src/lib/noco/meta/api/sharedBaseApis.ts +++ b/packages/nocodb/src/lib/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 '../../../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/meta/api/sortApis.ts similarity index 91% rename from packages/nocodb/src/lib/noco/meta/api/sortApis.ts rename to packages/nocodb/src/lib/meta/api/sortApis.ts index 4f57112ec5..1eb632492b 100644 --- a/packages/nocodb/src/lib/noco/meta/api/sortApis.ts +++ b/packages/nocodb/src/lib/meta/api/sortApis.ts @@ -1,14 +1,14 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../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 '../../../sql-mgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../models/Project'; -import Sort from '../../../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/meta/api/swagger/helpers/getPaths.ts similarity index 87% rename from packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getPaths.ts rename to packages/nocodb/src/lib/meta/api/swagger/helpers/getPaths.ts index 9c8ae78796..1757c44817 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getPaths.ts +++ b/packages/nocodb/src/lib/meta/api/swagger/helpers/getPaths.ts @@ -1,6 +1,6 @@ import Noco from '../../../../Noco'; -import Model from '../../../../../models/Model'; -import Project from '../../../../../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'; @@ -22,7 +22,7 @@ export default async function getPaths( const swaggerPaths = await getModelPaths({ tableName: model.title, type: model.type, - orgs: 'noco', + orgs: 'v1', columns, projectName: project.title }); @@ -37,7 +37,7 @@ export default async function getPaths( tableName: model.title, viewName: view.title, type: model.type, - orgs: 'noco', + orgs: 'v1', columns: swaggerColumns, projectName: project.title }) diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSchemas.ts b/packages/nocodb/src/lib/meta/api/swagger/helpers/getSchemas.ts similarity index 87% rename from packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSchemas.ts rename to packages/nocodb/src/lib/meta/api/swagger/helpers/getSchemas.ts index 198206b0a8..ad7b14fb67 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSchemas.ts +++ b/packages/nocodb/src/lib/meta/api/swagger/helpers/getSchemas.ts @@ -1,6 +1,6 @@ import Noco from '../../../../Noco'; -import Model from '../../../../../models/Model'; -import Project from '../../../../../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'; @@ -21,7 +21,7 @@ export default async function getSchemas( ) { const swaggerSchemas = getModelSchemas({ tableName: model.title, - orgs: 'noco', + orgs: 'v1', projectName: project.title, columns }); @@ -35,7 +35,7 @@ export default async function getSchemas( getViewSchemas({ tableName: model.title, viewName: view.title, - orgs: 'noco', + orgs: 'v1', columns: swaggerColumns, projectName: project.title }) diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerColumnMetas.ts b/packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerColumnMetas.ts similarity index 84% rename from packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerColumnMetas.ts rename to packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerColumnMetas.ts index 377a048fa1..31715d07ae 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerColumnMetas.ts +++ b/packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerColumnMetas.ts @@ -1,9 +1,9 @@ import { UITypes } from 'nocodb-sdk'; -import LinkToAnotherRecordColumn from '../../../../../models/LinkToAnotherRecordColumn'; -import SwaggerTypes from '../../../../../sql-mgr/code/routers/xc-ts/SwaggerTypes'; -import Column from '../../../../../models/Column'; +import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; +import SwaggerTypes from '../../../../db/sql-mgr/code/routers/xc-ts/SwaggerTypes'; +import Column from '../../../../models/Column'; import Noco from '../../../../Noco'; -import Project from '../../../../../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/meta/api/swagger/helpers/getSwaggerJSON.ts similarity index 87% rename from packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerJSON.ts rename to packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerJSON.ts index 2657df4bc7..dca0da0293 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/getSwaggerJSON.ts +++ b/packages/nocodb/src/lib/meta/api/swagger/helpers/getSwaggerJSON.ts @@ -1,13 +1,13 @@ import Noco from '../../../../Noco'; -import Model from '../../../../../models/Model'; +import Model from '../../../../models/Model'; import swaggerBase from './swagger-base.json'; import getPaths from './getPaths'; import getSchemas from './getSchemas'; -import Project from '../../../../../models/Project'; +import Project from '../../../../models/Project'; import getSwaggerColumnMetas from './getSwaggerColumnMetas'; import { ViewTypes } from 'nocodb-sdk'; -import GridViewColumn from '../../../../../models/GridViewColumn'; -import View from '../../../../../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/swagger-base.json b/packages/nocodb/src/lib/meta/api/swagger/helpers/swagger-base.json similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/swagger/helpers/swagger-base.json rename to packages/nocodb/src/lib/meta/api/swagger/helpers/swagger-base.json diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/headers.ts b/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/headers.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/headers.ts rename to packages/nocodb/src/lib/meta/api/swagger/helpers/templates/headers.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/params.ts b/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/params.ts similarity index 98% rename from packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/params.ts rename to packages/nocodb/src/lib/meta/api/swagger/helpers/templates/params.ts index 7d32938953..3b9717f4f8 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/params.ts +++ b/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/params.ts @@ -1,6 +1,6 @@ import { SwaggerColumn } from '../getSwaggerColumnMetas'; import { RelationTypes, UITypes } from 'nocodb-sdk'; -import LinkToAnotherRecordColumn from '../../../../../../models/LinkToAnotherRecordColumn'; +import LinkToAnotherRecordColumn from '../../../../../models/LinkToAnotherRecordColumn'; export const rowIdParam = { schema: { diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/paths.ts b/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/paths.ts rename to packages/nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/schemas.ts b/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/schemas.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/swagger/helpers/templates/schemas.ts rename to packages/nocodb/src/lib/meta/api/swagger/helpers/templates/schemas.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/redocHtml.ts b/packages/nocodb/src/lib/meta/api/swagger/redocHtml.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/swagger/redocHtml.ts rename to packages/nocodb/src/lib/meta/api/swagger/redocHtml.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts b/packages/nocodb/src/lib/meta/api/swagger/swaggerApis.ts similarity index 92% rename from packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts rename to packages/nocodb/src/lib/meta/api/swagger/swaggerApis.ts index 9d52cbc432..6310ece5e6 100644 --- a/packages/nocodb/src/lib/noco/meta/api/swagger/swaggerApis.ts +++ b/packages/nocodb/src/lib/meta/api/swagger/swaggerApis.ts @@ -1,9 +1,9 @@ // @ts-ignore import catchError, { NcError } from '../../helpers/catchError'; import { Router } from 'express'; -import Model from '../../../../models/Model'; +import Model from '../../../models/Model'; import getSwaggerJSON from './helpers/getSwaggerJSON'; -import Project from '../../../../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/swagger/swaggerHtml.ts b/packages/nocodb/src/lib/meta/api/swagger/swaggerHtml.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/swagger/swaggerHtml.ts rename to packages/nocodb/src/lib/meta/api/swagger/swaggerHtml.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/helpers/NocoSyncDestAdapter.ts b/packages/nocodb/src/lib/meta/api/sync/helpers/NocoSyncDestAdapter.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/sync/helpers/NocoSyncDestAdapter.ts rename to packages/nocodb/src/lib/meta/api/sync/helpers/NocoSyncDestAdapter.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/helpers/NocoSyncSourceAdapter.ts b/packages/nocodb/src/lib/meta/api/sync/helpers/NocoSyncSourceAdapter.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/sync/helpers/NocoSyncSourceAdapter.ts rename to packages/nocodb/src/lib/meta/api/sync/helpers/NocoSyncSourceAdapter.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/helpers/fetchAT.ts b/packages/nocodb/src/lib/meta/api/sync/helpers/fetchAT.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/sync/helpers/fetchAT.ts rename to packages/nocodb/src/lib/meta/api/sync/helpers/fetchAT.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/helpers/job.ts b/packages/nocodb/src/lib/meta/api/sync/helpers/job.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/sync/helpers/job.ts rename to packages/nocodb/src/lib/meta/api/sync/helpers/job.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/helpers/readAndProcessData.ts b/packages/nocodb/src/lib/meta/api/sync/helpers/readAndProcessData.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/sync/helpers/readAndProcessData.ts rename to packages/nocodb/src/lib/meta/api/sync/helpers/readAndProcessData.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/helpers/syncMap.ts b/packages/nocodb/src/lib/meta/api/sync/helpers/syncMap.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/sync/helpers/syncMap.ts rename to packages/nocodb/src/lib/meta/api/sync/helpers/syncMap.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/sync/importApis.ts b/packages/nocodb/src/lib/meta/api/sync/importApis.ts similarity index 96% rename from packages/nocodb/src/lib/noco/meta/api/sync/importApis.ts rename to packages/nocodb/src/lib/meta/api/sync/importApis.ts index a2ce900154..2facc67270 100644 --- a/packages/nocodb/src/lib/noco/meta/api/sync/importApis.ts +++ b/packages/nocodb/src/lib/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 '../../../../jobs/NocoJobs'; +import NocoJobs from '../../../jobs/NocoJobs'; import job, { AirtableSyncConfig } from './helpers/job'; -import SyncSource from '../../../../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/meta/api/sync/syncSourceApis.ts similarity index 96% rename from packages/nocodb/src/lib/noco/meta/api/sync/syncSourceApis.ts rename to packages/nocodb/src/lib/meta/api/sync/syncSourceApis.ts index 8fd66611e5..2cab006a21 100644 --- a/packages/nocodb/src/lib/noco/meta/api/sync/syncSourceApis.ts +++ b/packages/nocodb/src/lib/meta/api/sync/syncSourceApis.ts @@ -1,7 +1,7 @@ import { Request, Response, Router } from 'express'; import { Tele } from 'nc-help'; -import SyncSource from '../../../../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/meta/api/tableApis.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/api/tableApis.ts rename to packages/nocodb/src/lib/meta/api/tableApis.ts index e05cc5fdb1..02bbad7773 100644 --- a/packages/nocodb/src/lib/noco/meta/api/tableApis.ts +++ b/packages/nocodb/src/lib/meta/api/tableApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import Model from '../../../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 '../../../sql-mgr/v2/ProjectMgrv2'; -import Project from '../../../models/Project'; -import Audit from '../../../models/Audit'; +import ProjectMgrv2 from '../../db/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 '../../../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 '../../../models/Column'; -import NcConnectionMgrv2 from '../../common/NcConnectionMgrv2'; +import Column from '../../models/Column'; +import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; import getColumnUiType from '../helpers/getColumnUiType'; -import LinkToAnotherRecordColumn from '../../../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/index.ts b/packages/nocodb/src/lib/meta/api/userApi/index.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/userApi/index.ts rename to packages/nocodb/src/lib/meta/api/userApi/index.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/userApi/initStrategies.ts b/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/api/userApi/initStrategies.ts rename to packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts index 97a70f1853..1ffe03e98c 100644 --- a/packages/nocodb/src/lib/noco/meta/api/userApi/initStrategies.ts +++ b/packages/nocodb/src/lib/meta/api/userApi/initStrategies.ts @@ -1,5 +1,5 @@ -import User from '../../../../models/User'; -import ProjectUser from '../../../../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 '../../../../models/Project'; -import NocoCache from '../../../../cache/NocoCache'; -import { CacheGetType, CacheScope } from '../../../../utils/globals'; -import ApiToken from '../../../../models/ApiToken'; +import Project from '../../../models/Project'; +import NocoCache from '../../../cache/NocoCache'; +import { CacheGetType, CacheScope } from '../../../utils/globals'; +import ApiToken from '../../../models/ApiToken'; import Noco from '../../../Noco'; -import Plugin from '../../../../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/ui/auth/emailVerify.ts b/packages/nocodb/src/lib/meta/api/userApi/ui/auth/emailVerify.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/userApi/ui/auth/emailVerify.ts rename to packages/nocodb/src/lib/meta/api/userApi/ui/auth/emailVerify.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/userApi/ui/auth/resetPassword.ts b/packages/nocodb/src/lib/meta/api/userApi/ui/auth/resetPassword.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/userApi/ui/auth/resetPassword.ts rename to packages/nocodb/src/lib/meta/api/userApi/ui/auth/resetPassword.ts diff --git a/packages/nocodb/src/lib/noco/gql/emailTemplate/forgotPassword.ts b/packages/nocodb/src/lib/meta/api/userApi/ui/emailTemplates/forgotPassword.ts similarity index 100% rename from packages/nocodb/src/lib/noco/gql/emailTemplate/forgotPassword.ts rename to packages/nocodb/src/lib/meta/api/userApi/ui/emailTemplates/forgotPassword.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/userApi/ui/emailTemplates/invite.ts b/packages/nocodb/src/lib/meta/api/userApi/ui/emailTemplates/invite.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/userApi/ui/emailTemplates/invite.ts rename to packages/nocodb/src/lib/meta/api/userApi/ui/emailTemplates/invite.ts diff --git a/packages/nocodb/src/lib/noco/gql/emailTemplate/verify.ts b/packages/nocodb/src/lib/meta/api/userApi/ui/emailTemplates/verify.ts similarity index 100% rename from packages/nocodb/src/lib/noco/gql/emailTemplate/verify.ts rename to packages/nocodb/src/lib/meta/api/userApi/ui/emailTemplates/verify.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/userApi/userApis.ts b/packages/nocodb/src/lib/meta/api/userApi/userApis.ts similarity index 98% rename from packages/nocodb/src/lib/noco/meta/api/userApi/userApis.ts rename to packages/nocodb/src/lib/meta/api/userApi/userApis.ts index eb7c2401b3..668d318e9b 100644 --- a/packages/nocodb/src/lib/noco/meta/api/userApi/userApis.ts +++ b/packages/nocodb/src/lib/meta/api/userApi/userApis.ts @@ -6,19 +6,19 @@ import * as ejs from 'ejs'; import bcrypt from 'bcryptjs'; import { promisify } from 'util'; -import User from '../../../../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 '../../../../models/Audit'; +import Audit from '../../../models/Audit'; import crypto from 'crypto'; import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; import passport from 'passport'; import extractProjectIdAndAuthenticate from '../../helpers/extractProjectIdAndAuthenticate'; import ncMetaAclMw from '../../helpers/ncMetaAclMw'; -import { MetaTable } from '../../../../utils/globals'; +import { MetaTable } from '../../../utils/globals'; import Noco from '../../../Noco'; export async function signup(req: Request, res: Response) { diff --git a/packages/nocodb/src/lib/noco/meta/api/utilApis.ts b/packages/nocodb/src/lib/meta/api/utilApis.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/api/utilApis.ts rename to packages/nocodb/src/lib/meta/api/utilApis.ts index 43349aaa75..730a54f0d2 100644 --- a/packages/nocodb/src/lib/noco/meta/api/utilApis.ts +++ b/packages/nocodb/src/lib/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 '../../../sql-mgr/v2/SqlMgrv2'; -import { defaultConnectionConfig } from '../../../utils/NcConfigFactory'; -import User from '../../../models/User'; +import SqlMgrv2 from '../../db/sql-mgr/v2/SqlMgrv2'; +import { defaultConnectionConfig } from '../../utils/NcConfigFactory'; +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/meta/api/viewApis.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/api/viewApis.ts rename to packages/nocodb/src/lib/meta/api/viewApis.ts index 44b23f3885..eb26e825a7 100644 --- a/packages/nocodb/src/lib/noco/meta/api/viewApis.ts +++ b/packages/nocodb/src/lib/meta/api/viewApis.ts @@ -1,15 +1,15 @@ import { Request, Response, Router } from 'express'; // @ts-ignore -import Model from '../../../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 '../../../sql-mgr/v2/ProjectMgrv2'; +import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; // @ts-ignore -import Project from '../../../models/Project'; -import View from '../../../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/meta/api/viewColumnApis.ts similarity index 96% rename from packages/nocodb/src/lib/noco/meta/api/viewColumnApis.ts rename to packages/nocodb/src/lib/meta/api/viewColumnApis.ts index 00e339764d..31c0577902 100644 --- a/packages/nocodb/src/lib/noco/meta/api/viewColumnApis.ts +++ b/packages/nocodb/src/lib/meta/api/viewColumnApis.ts @@ -1,5 +1,5 @@ import { Request, Response, Router } from 'express'; -import View from '../../../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/handlers/xcMetaDiff.ts b/packages/nocodb/src/lib/meta/handlers/xcMetaDiff.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/handlers/xcMetaDiff.ts rename to packages/nocodb/src/lib/meta/handlers/xcMetaDiff.ts diff --git a/packages/nocodb/src/lib/noco/meta/handlersv2/ncCreateLookup.ts b/packages/nocodb/src/lib/meta/handlersv2/ncCreateLookup.ts similarity index 91% rename from packages/nocodb/src/lib/noco/meta/handlersv2/ncCreateLookup.ts rename to packages/nocodb/src/lib/meta/handlersv2/ncCreateLookup.ts index 1aef11af4b..9821014d4f 100644 --- a/packages/nocodb/src/lib/noco/meta/handlersv2/ncCreateLookup.ts +++ b/packages/nocodb/src/lib/meta/handlersv2/ncCreateLookup.ts @@ -1,5 +1,5 @@ import { NcContextV2 } from '../NcMetaMgrv2'; -import Column from '../../../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/meta/handlersv2/ncGetMeta.ts similarity index 86% rename from packages/nocodb/src/lib/noco/meta/handlersv2/ncGetMeta.ts rename to packages/nocodb/src/lib/meta/handlersv2/ncGetMeta.ts index a94d252760..3886d67f16 100644 --- a/packages/nocodb/src/lib/noco/meta/handlersv2/ncGetMeta.ts +++ b/packages/nocodb/src/lib/meta/handlersv2/ncGetMeta.ts @@ -1,5 +1,5 @@ import { NcContextV2 } from '../NcMetaMgrv2'; -import Model from '../../../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/NcPluginMgrv2.ts b/packages/nocodb/src/lib/meta/helpers/NcPluginMgrv2.ts similarity index 84% rename from packages/nocodb/src/lib/noco/meta/helpers/NcPluginMgrv2.ts rename to packages/nocodb/src/lib/meta/helpers/NcPluginMgrv2.ts index 29ac33a6e4..0e5057887d 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/NcPluginMgrv2.ts +++ b/packages/nocodb/src/lib/meta/helpers/NcPluginMgrv2.ts @@ -8,28 +8,28 @@ import { // XcWebhookNotificationPlugin } from 'nc-plugin'; -import BackblazePluginConfig from '../../../../plugins/backblaze'; -import DiscordPluginConfig from '../../../../plugins/discord'; -import GcsPluginConfig from '../../../../plugins/gcs'; -import LinodePluginConfig from '../../../../plugins/linode'; -import MattermostPluginConfig from '../../../../plugins/mattermost'; -import MinioPluginConfig from '../../../../plugins/mino'; -import OvhCloudPluginConfig from '../../../../plugins/ovhCloud'; -import S3PluginConfig from '../../../../plugins/s3'; -import ScalewayPluginConfig from '../../../../plugins/scaleway'; -import SlackPluginConfig from '../../../../plugins/slack'; -import SMTPPluginConfig from '../../../../plugins/smtp'; -import MailerSendConfig from '../../../../plugins/mailerSend'; -import SpacesPluginConfig from '../../../../plugins/spaces'; -import TeamsPluginConfig from '../../../../plugins/teams'; -import TwilioPluginConfig from '../../../../plugins/twilio'; -import TwilioWhatsappPluginConfig from '../../../../plugins/twilioWhatsapp'; -import UpcloudPluginConfig from '../../../../plugins/upcloud'; -import VultrPluginConfig from '../../../../plugins/vultr'; -import SESPluginConfig from '../../../../plugins/ses'; +import BackblazePluginConfig from '../../plugins/backblaze'; +import DiscordPluginConfig from '../../plugins/discord'; +import GcsPluginConfig from '../../plugins/gcs'; +import LinodePluginConfig from '../../plugins/linode'; +import MattermostPluginConfig from '../../plugins/mattermost'; +import MinioPluginConfig from '../../plugins/mino'; +import OvhCloudPluginConfig from '../../plugins/ovhCloud'; +import S3PluginConfig from '../../plugins/s3'; +import ScalewayPluginConfig from '../../plugins/scaleway'; +import SlackPluginConfig from '../../plugins/slack'; +import SMTPPluginConfig from '../../plugins/smtp'; +import MailerSendConfig from '../../plugins/mailerSend'; +import SpacesPluginConfig from '../../plugins/spaces'; +import TeamsPluginConfig from '../../plugins/teams'; +import TwilioPluginConfig from '../../plugins/twilio'; +import TwilioWhatsappPluginConfig from '../../plugins/twilioWhatsapp'; +import UpcloudPluginConfig from '../../plugins/upcloud'; +import VultrPluginConfig from '../../plugins/vultr'; +import SESPluginConfig from '../../plugins/ses'; import Noco from '../../Noco'; -import Local from '../../plugins/adapters/storage/Local'; -import { MetaTable } from '../../../utils/globals'; +import Local from '../../v1-legacy/plugins/adapters/storage/Local'; +import { MetaTable } from '../../utils/globals'; import { PluginCategory } from 'nocodb-sdk'; const defaultPlugins = [ diff --git a/packages/nocodb/src/lib/noco/meta/helpers/PagedResponse.ts b/packages/nocodb/src/lib/meta/helpers/PagedResponse.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/helpers/PagedResponse.ts rename to packages/nocodb/src/lib/meta/helpers/PagedResponse.ts diff --git a/packages/nocodb/src/lib/noco/meta/helpers/addFormulaErrorIfMissingColumn.ts b/packages/nocodb/src/lib/meta/helpers/addFormulaErrorIfMissingColumn.ts similarity index 93% rename from packages/nocodb/src/lib/noco/meta/helpers/addFormulaErrorIfMissingColumn.ts rename to packages/nocodb/src/lib/meta/helpers/addFormulaErrorIfMissingColumn.ts index 6c6ce89a7e..e58297402d 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/addFormulaErrorIfMissingColumn.ts +++ b/packages/nocodb/src/lib/meta/helpers/addFormulaErrorIfMissingColumn.ts @@ -1,4 +1,4 @@ -import FormulaColumn from '../../../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/apiMetrics.ts b/packages/nocodb/src/lib/meta/helpers/apiMetrics.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/helpers/apiMetrics.ts rename to packages/nocodb/src/lib/meta/helpers/apiMetrics.ts diff --git a/packages/nocodb/src/lib/noco/meta/helpers/catchError.ts b/packages/nocodb/src/lib/meta/helpers/catchError.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/helpers/catchError.ts rename to packages/nocodb/src/lib/meta/helpers/catchError.ts diff --git a/packages/nocodb/src/lib/noco/meta/helpers/extractProjectIdAndAuthenticate.ts b/packages/nocodb/src/lib/meta/helpers/extractProjectIdAndAuthenticate.ts similarity index 90% rename from packages/nocodb/src/lib/noco/meta/helpers/extractProjectIdAndAuthenticate.ts rename to packages/nocodb/src/lib/meta/helpers/extractProjectIdAndAuthenticate.ts index 6e68f1779c..0cfd063bfd 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/extractProjectIdAndAuthenticate.ts +++ b/packages/nocodb/src/lib/meta/helpers/extractProjectIdAndAuthenticate.ts @@ -1,16 +1,16 @@ import { promisify } from 'util'; import passport from 'passport'; -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'; +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/extractProps.ts b/packages/nocodb/src/lib/meta/helpers/extractProps.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/helpers/extractProps.ts rename to packages/nocodb/src/lib/meta/helpers/extractProps.ts diff --git a/packages/nocodb/src/lib/noco/meta/helpers/formulaHelpers.ts b/packages/nocodb/src/lib/meta/helpers/formulaHelpers.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/helpers/formulaHelpers.ts rename to packages/nocodb/src/lib/meta/helpers/formulaHelpers.ts diff --git a/packages/nocodb/src/lib/noco/meta/helpers/getColumnPropsFromUIDT.ts b/packages/nocodb/src/lib/meta/helpers/getColumnPropsFromUIDT.ts similarity index 95% rename from packages/nocodb/src/lib/noco/meta/helpers/getColumnPropsFromUIDT.ts rename to packages/nocodb/src/lib/meta/helpers/getColumnPropsFromUIDT.ts index 0187eaf799..04c981d943 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/getColumnPropsFromUIDT.ts +++ b/packages/nocodb/src/lib/meta/helpers/getColumnPropsFromUIDT.ts @@ -1,5 +1,5 @@ import { ColumnReqType, SqlUIColumn, SqlUiFactory, UITypes } from 'nocodb-sdk'; -import Base from '../../../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/meta/helpers/getColumnUiType.ts similarity index 64% rename from packages/nocodb/src/lib/noco/meta/helpers/getColumnUiType.ts rename to packages/nocodb/src/lib/meta/helpers/getColumnUiType.ts index a1b4f1a659..444ec3df88 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/getColumnUiType.ts +++ b/packages/nocodb/src/lib/meta/helpers/getColumnUiType.ts @@ -1,7 +1,7 @@ -import Base from '../../../models/Base'; -import Column from '../../../models/Column'; +import Base from '../../models/Base'; +import Column from '../../models/Column'; import { ColumnType } from 'nocodb-sdk'; -import ModelXcMetaFactory from '../../../sql-mgr/code/models/xc/ModelXcMetaFactory'; +import ModelXcMetaFactory from '../../db/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/meta/helpers/getTableName.ts similarity index 92% rename from packages/nocodb/src/lib/noco/meta/helpers/getTableName.ts rename to packages/nocodb/src/lib/meta/helpers/getTableName.ts index befbf68fb9..cff2d54cbd 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/getTableName.ts +++ b/packages/nocodb/src/lib/meta/helpers/getTableName.ts @@ -1,5 +1,5 @@ import inflection from 'inflection'; -import Base from '../../../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/meta/helpers/getUniqueName.ts similarity index 91% rename from packages/nocodb/src/lib/noco/meta/helpers/getUniqueName.ts rename to packages/nocodb/src/lib/meta/helpers/getUniqueName.ts index c6d097412b..31091d3869 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/getUniqueName.ts +++ b/packages/nocodb/src/lib/meta/helpers/getUniqueName.ts @@ -1,4 +1,4 @@ -import Column from '../../../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/mapDefaultPrimaryValue.ts b/packages/nocodb/src/lib/meta/helpers/mapDefaultPrimaryValue.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/helpers/mapDefaultPrimaryValue.ts rename to packages/nocodb/src/lib/meta/helpers/mapDefaultPrimaryValue.ts diff --git a/packages/nocodb/src/lib/noco/meta/helpers/ncMetaAclMw.ts b/packages/nocodb/src/lib/meta/helpers/ncMetaAclMw.ts similarity index 97% rename from packages/nocodb/src/lib/noco/meta/helpers/ncMetaAclMw.ts rename to packages/nocodb/src/lib/meta/helpers/ncMetaAclMw.ts index 90e7687750..2164bb030f 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/ncMetaAclMw.ts +++ b/packages/nocodb/src/lib/meta/helpers/ncMetaAclMw.ts @@ -1,4 +1,4 @@ -import projectAcl from '../../../utils/projectAcl'; +import projectAcl from '../../utils/projectAcl'; import { NextFunction, Request, Response } from 'express'; import catchError, { NcError } from './catchError'; import extractProjectIdAndAuthenticate from './extractProjectIdAndAuthenticate'; diff --git a/packages/nocodb/src/lib/noco/meta/helpers/populateSamplePayload.ts b/packages/nocodb/src/lib/meta/helpers/populateSamplePayload.ts similarity index 92% rename from packages/nocodb/src/lib/noco/meta/helpers/populateSamplePayload.ts rename to packages/nocodb/src/lib/meta/helpers/populateSamplePayload.ts index b9be146d1f..eff2fe6a8c 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/populateSamplePayload.ts +++ b/packages/nocodb/src/lib/meta/helpers/populateSamplePayload.ts @@ -1,11 +1,11 @@ -import View from '../../../models/View'; -import Column from '../../../models/Column'; +import View from '../../models/View'; +import Column from '../../models/Column'; import { RelationTypes, UITypes } from 'nocodb-sdk'; -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'; +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/meta/helpers/syncMigration.ts similarity index 79% rename from packages/nocodb/src/lib/noco/meta/helpers/syncMigration.ts rename to packages/nocodb/src/lib/meta/helpers/syncMigration.ts index 45f5b823e2..3e106c009c 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/syncMigration.ts +++ b/packages/nocodb/src/lib/meta/helpers/syncMigration.ts @@ -1,5 +1,5 @@ -import Migrator from '../../../sql-migrator/lib/KnexMigratorv2'; -import Project from '../../../models/Project'; +import Migrator from '../../db/sql-migrator/lib/KnexMigratorv2'; +import Project from '../../models/Project'; export default async function syncMigration(project: Project): Promise { for (const base of await project.getBases()) { diff --git a/packages/nocodb/src/lib/noco/meta/helpers/validateParams.ts b/packages/nocodb/src/lib/meta/helpers/validateParams.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/helpers/validateParams.ts rename to packages/nocodb/src/lib/meta/helpers/validateParams.ts diff --git a/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts b/packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts similarity index 97% rename from packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts rename to packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts index dfa591f885..280d603ad5 100644 --- a/packages/nocodb/src/lib/noco/meta/helpers/webhookHelpers.ts +++ b/packages/nocodb/src/lib/meta/helpers/webhookHelpers.ts @@ -1,10 +1,10 @@ import Handlebars from 'handlebars'; -import Model from '../../../models/Model'; +import Model from '../../models/Model'; import NcPluginMgrv2 from './NcPluginMgrv2'; -import Column from '../../../models/Column'; -import Hook from '../../../models/Hook'; -import Filter from '../../../models/Filter'; -import HookLog from '../../../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/common/XcMigrationSource.ts b/packages/nocodb/src/lib/migrations/XcMigrationSource.ts similarity index 72% rename from packages/nocodb/src/lib/noco/common/XcMigrationSource.ts rename to packages/nocodb/src/lib/migrations/XcMigrationSource.ts index 6406da240c..e0625b2dc4 100644 --- a/packages/nocodb/src/lib/noco/common/XcMigrationSource.ts +++ b/packages/nocodb/src/lib/migrations/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 './v1/nc_001_init'; +import * as m2m from './v1/nc_002_add_m2m'; +import * as fkn from './v1/nc_003_add_fkn_column'; +import * as viewType from './v1/nc_004_add_view_type_column'; +import * as viewName from './v1/nc_005_add_view_name_column'; +import * as nc_006_alter_nc_shared_views from './v1/nc_006_alter_nc_shared_views'; +import * as nc_007_alter_nc_shared_views_1 from './v1/nc_007_alter_nc_shared_views_1'; +import * as nc_008_add_nc_shared_bases from './v1/nc_008_add_nc_shared_bases'; +import * as nc_009_add_model_order from './v1/nc_009_add_model_order'; +import * as nc_010_add_parent_title_column from './v1/nc_010_add_parent_title_column'; +import * as nc_011_remove_old_ses_plugin from './v1/nc_011_remove_old_ses_plugin'; // Create a custom migration source class export default class XcMigrationSource { @@ -16,7 +16,7 @@ export default class XcMigrationSource { // Migrations can be whatever you want, they will be passed as // arguments to getMigrationName and getMigration public getMigrations(): Promise { - // In this example we are just returning migration names + // In this run we are just returning migration names return Promise.resolve([ 'project', 'm2m', diff --git a/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts b/packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts similarity index 77% rename from packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts rename to packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts index faae32d1f9..7d0de4dc26 100644 --- a/packages/nocodb/src/lib/noco/common/XcMigrationSourcev2.ts +++ b/packages/nocodb/src/lib/migrations/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 './v2/nc_011'; +import * as nc_012_alter_column_data_types from './v2/nc_012_alter_column_data_types'; +import * as nc_013_sync_source from './v2/nc_013_sync_source'; +import * as nc_014_alter_column_data_types from './v2/nc_014_alter_column_data_types'; +import * as nc_015_add_meta_col_in_column_table from './v2/nc_015_add_meta_col_in_column_table'; +import * as nc_016_alter_hooklog_payload_types from './v2/nc_016_alter_hooklog_payload_types'; // Create a custom migration source class export default class XcMigrationSourcev2 { @@ -11,7 +11,7 @@ export default class XcMigrationSourcev2 { // Migrations can be whatever you want, they will be passed as // arguments to getMigrationName and getMigration public getMigrations(): Promise { - // In this example we are just returning migration names + // In this run we are just returning migration names return Promise.resolve([ 'nc_011', 'nc_012_alter_column_data_types', diff --git a/packages/nocodb/src/lib/migrations/nc_001_init.ts b/packages/nocodb/src/lib/migrations/v1/nc_001_init.ts similarity index 98% rename from packages/nocodb/src/lib/migrations/nc_001_init.ts rename to packages/nocodb/src/lib/migrations/v1/nc_001_init.ts index a64f0991ab..dcd02f7e53 100644 --- a/packages/nocodb/src/lib/migrations/nc_001_init.ts +++ b/packages/nocodb/src/lib/migrations/v1/nc_001_init.ts @@ -1,6 +1,6 @@ -import cache from '../noco/plugins/cache'; -import googleAuth from '../noco/plugins/googleAuth'; -import ses from '../noco/plugins/ses'; +import cache from '../../v1-legacy/plugins/cache'; +import googleAuth from '../../v1-legacy/plugins/googleAuth'; +import ses from '../../v1-legacy/plugins/ses'; const up = async knex => { await knex.schema.createTable('nc_projects', table => { diff --git a/packages/nocodb/src/lib/migrations/nc_002_add_m2m.ts b/packages/nocodb/src/lib/migrations/v1/nc_002_add_m2m.ts similarity index 100% rename from packages/nocodb/src/lib/migrations/nc_002_add_m2m.ts rename to packages/nocodb/src/lib/migrations/v1/nc_002_add_m2m.ts diff --git a/packages/nocodb/src/lib/migrations/nc_003_add_fkn_column.ts b/packages/nocodb/src/lib/migrations/v1/nc_003_add_fkn_column.ts similarity index 100% rename from packages/nocodb/src/lib/migrations/nc_003_add_fkn_column.ts rename to packages/nocodb/src/lib/migrations/v1/nc_003_add_fkn_column.ts diff --git a/packages/nocodb/src/lib/migrations/nc_004_add_view_type_column.ts b/packages/nocodb/src/lib/migrations/v1/nc_004_add_view_type_column.ts similarity index 100% rename from packages/nocodb/src/lib/migrations/nc_004_add_view_type_column.ts rename to packages/nocodb/src/lib/migrations/v1/nc_004_add_view_type_column.ts diff --git a/packages/nocodb/src/lib/migrations/nc_005_add_view_name_column.ts b/packages/nocodb/src/lib/migrations/v1/nc_005_add_view_name_column.ts similarity index 100% rename from packages/nocodb/src/lib/migrations/nc_005_add_view_name_column.ts rename to packages/nocodb/src/lib/migrations/v1/nc_005_add_view_name_column.ts diff --git a/packages/nocodb/src/lib/migrations/nc_006_alter_nc_shared_views.ts b/packages/nocodb/src/lib/migrations/v1/nc_006_alter_nc_shared_views.ts similarity index 100% rename from packages/nocodb/src/lib/migrations/nc_006_alter_nc_shared_views.ts rename to packages/nocodb/src/lib/migrations/v1/nc_006_alter_nc_shared_views.ts diff --git a/packages/nocodb/src/lib/migrations/nc_007_alter_nc_shared_views_1.ts b/packages/nocodb/src/lib/migrations/v1/nc_007_alter_nc_shared_views_1.ts similarity index 100% rename from packages/nocodb/src/lib/migrations/nc_007_alter_nc_shared_views_1.ts rename to packages/nocodb/src/lib/migrations/v1/nc_007_alter_nc_shared_views_1.ts diff --git a/packages/nocodb/src/lib/migrations/nc_008_add_nc_shared_bases.ts b/packages/nocodb/src/lib/migrations/v1/nc_008_add_nc_shared_bases.ts similarity index 100% rename from packages/nocodb/src/lib/migrations/nc_008_add_nc_shared_bases.ts rename to packages/nocodb/src/lib/migrations/v1/nc_008_add_nc_shared_bases.ts diff --git a/packages/nocodb/src/lib/migrations/nc_009_add_model_order.ts b/packages/nocodb/src/lib/migrations/v1/nc_009_add_model_order.ts similarity index 100% rename from packages/nocodb/src/lib/migrations/nc_009_add_model_order.ts rename to packages/nocodb/src/lib/migrations/v1/nc_009_add_model_order.ts diff --git a/packages/nocodb/src/lib/migrations/nc_010_add_parent_title_column.ts b/packages/nocodb/src/lib/migrations/v1/nc_010_add_parent_title_column.ts similarity index 100% rename from packages/nocodb/src/lib/migrations/nc_010_add_parent_title_column.ts rename to packages/nocodb/src/lib/migrations/v1/nc_010_add_parent_title_column.ts diff --git a/packages/nocodb/src/lib/migrations/nc_011_remove_old_ses_plugin.ts b/packages/nocodb/src/lib/migrations/v1/nc_011_remove_old_ses_plugin.ts similarity index 95% rename from packages/nocodb/src/lib/migrations/nc_011_remove_old_ses_plugin.ts rename to packages/nocodb/src/lib/migrations/v1/nc_011_remove_old_ses_plugin.ts index 4ee951490a..d75899a563 100644 --- a/packages/nocodb/src/lib/migrations/nc_011_remove_old_ses_plugin.ts +++ b/packages/nocodb/src/lib/migrations/v1/nc_011_remove_old_ses_plugin.ts @@ -1,5 +1,5 @@ import Knex from 'knex'; -import ses from '../noco/plugins/ses'; +import ses from '../../v1-legacy/plugins/ses'; const up = async (knex: Knex) => { await knex('nc_plugins').del().where({title: "SES"}); diff --git a/packages/nocodb/src/lib/migrationsv2/nc_011.ts b/packages/nocodb/src/lib/migrations/v2/nc_011.ts similarity index 99% rename from packages/nocodb/src/lib/migrationsv2/nc_011.ts rename to packages/nocodb/src/lib/migrations/v2/nc_011.ts index f180d26106..846c85ef2b 100644 --- a/packages/nocodb/src/lib/migrationsv2/nc_011.ts +++ b/packages/nocodb/src/lib/migrations/v2/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/migrationsv2/nc_012_alter_column_data_types.ts b/packages/nocodb/src/lib/migrations/v2/nc_012_alter_column_data_types.ts similarity index 97% rename from packages/nocodb/src/lib/migrationsv2/nc_012_alter_column_data_types.ts rename to packages/nocodb/src/lib/migrations/v2/nc_012_alter_column_data_types.ts index 5eaa2d5d19..1e6c965aa9 100644 --- a/packages/nocodb/src/lib/migrationsv2/nc_012_alter_column_data_types.ts +++ b/packages/nocodb/src/lib/migrations/v2/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/migrationsv2/nc_013_sync_source.ts b/packages/nocodb/src/lib/migrations/v2/nc_013_sync_source.ts similarity index 97% rename from packages/nocodb/src/lib/migrationsv2/nc_013_sync_source.ts rename to packages/nocodb/src/lib/migrations/v2/nc_013_sync_source.ts index e4de3664f7..638eab0eec 100644 --- a/packages/nocodb/src/lib/migrationsv2/nc_013_sync_source.ts +++ b/packages/nocodb/src/lib/migrations/v2/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/migrationsv2/nc_014_alter_column_data_types.ts b/packages/nocodb/src/lib/migrations/v2/nc_014_alter_column_data_types.ts similarity index 97% rename from packages/nocodb/src/lib/migrationsv2/nc_014_alter_column_data_types.ts rename to packages/nocodb/src/lib/migrations/v2/nc_014_alter_column_data_types.ts index 6061726ef1..a64de5bab0 100644 --- a/packages/nocodb/src/lib/migrationsv2/nc_014_alter_column_data_types.ts +++ b/packages/nocodb/src/lib/migrations/v2/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/migrationsv2/nc_015_add_meta_col_in_column_table.ts b/packages/nocodb/src/lib/migrations/v2/nc_015_add_meta_col_in_column_table.ts similarity index 95% rename from packages/nocodb/src/lib/migrationsv2/nc_015_add_meta_col_in_column_table.ts rename to packages/nocodb/src/lib/migrations/v2/nc_015_add_meta_col_in_column_table.ts index 57c3026014..aeb1d9f9d4 100644 --- a/packages/nocodb/src/lib/migrationsv2/nc_015_add_meta_col_in_column_table.ts +++ b/packages/nocodb/src/lib/migrations/v2/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/migrationsv2/nc_016_alter_hooklog_payload_types.ts b/packages/nocodb/src/lib/migrations/v2/nc_016_alter_hooklog_payload_types.ts similarity index 96% rename from packages/nocodb/src/lib/migrationsv2/nc_016_alter_hooklog_payload_types.ts rename to packages/nocodb/src/lib/migrations/v2/nc_016_alter_hooklog_payload_types.ts index 18bd9a616f..31126be296 100644 --- a/packages/nocodb/src/lib/migrationsv2/nc_016_alter_hooklog_payload_types.ts +++ b/packages/nocodb/src/lib/migrations/v2/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/models/ApiToken.ts b/packages/nocodb/src/lib/models/ApiToken.ts index c0e62373aa..c370c0ab51 100644 --- a/packages/nocodb/src/lib/models/ApiToken.ts +++ b/packages/nocodb/src/lib/models/ApiToken.ts @@ -4,7 +4,7 @@ import { CacheScope, MetaTable } from '../utils/globals'; -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { nanoid } from 'nanoid'; import NocoCache from '../cache/NocoCache'; diff --git a/packages/nocodb/src/lib/models/Audit.ts b/packages/nocodb/src/lib/models/Audit.ts index 6a1db21801..afcec94742 100644 --- a/packages/nocodb/src/lib/models/Audit.ts +++ b/packages/nocodb/src/lib/models/Audit.ts @@ -1,6 +1,6 @@ import { AuditOperationTypes, AuditType } from 'nocodb-sdk'; import { MetaTable } from '../utils/globals'; -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import Model from './Model'; export default class Audit implements AuditType { diff --git a/packages/nocodb/src/lib/models/Base.ts b/packages/nocodb/src/lib/models/Base.ts index 4c2d25b30f..10eea541d3 100644 --- a/packages/nocodb/src/lib/models/Base.ts +++ b/packages/nocodb/src/lib/models/Base.ts @@ -1,4 +1,4 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import Project from './Project'; import { CacheDelDirection, @@ -10,7 +10,7 @@ import Model from './Model'; import { BaseType } from 'nocodb-sdk'; import NocoCache from '../cache/NocoCache'; import CryptoJS from 'crypto-js'; -import extractProps from '../noco/meta/helpers/extractProps'; +import extractProps from '../meta/helpers/extractProps'; // todo: hide credentials export default class Base implements BaseType { diff --git a/packages/nocodb/src/lib/models/Column.ts b/packages/nocodb/src/lib/models/Column.ts index 46e7580df9..431e4061c3 100644 --- a/packages/nocodb/src/lib/models/Column.ts +++ b/packages/nocodb/src/lib/models/Column.ts @@ -14,11 +14,11 @@ import { MetaTable } from '../utils/globals'; import View from './View'; -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import Sort from './Sort'; import Filter from './Filter'; -import addFormulaErrorIfMissingColumn from '../noco/meta/helpers/addFormulaErrorIfMissingColumn'; -import { NcError } from '../noco/meta/helpers/catchError'; +import addFormulaErrorIfMissingColumn from '../meta/helpers/addFormulaErrorIfMissingColumn'; +import { NcError } from '../meta/helpers/catchError'; export default class Column implements ColumnType { public fk_model_id: string; diff --git a/packages/nocodb/src/lib/models/Filter.ts b/packages/nocodb/src/lib/models/Filter.ts index 5d4d74b6d5..504a36c76a 100644 --- a/packages/nocodb/src/lib/models/Filter.ts +++ b/packages/nocodb/src/lib/models/Filter.ts @@ -1,4 +1,4 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; import Model from './Model'; import Column from './Column'; import { diff --git a/packages/nocodb/src/lib/models/FormView.ts b/packages/nocodb/src/lib/models/FormView.ts index c74e288dd8..086007ece4 100644 --- a/packages/nocodb/src/lib/models/FormView.ts +++ b/packages/nocodb/src/lib/models/FormView.ts @@ -1,4 +1,4 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { FormType } from 'nocodb-sdk'; import FormViewColumn from './FormViewColumn'; diff --git a/packages/nocodb/src/lib/models/FormViewColumn.ts b/packages/nocodb/src/lib/models/FormViewColumn.ts index aad0f4eb84..f759e04788 100644 --- a/packages/nocodb/src/lib/models/FormViewColumn.ts +++ b/packages/nocodb/src/lib/models/FormViewColumn.ts @@ -1,9 +1,9 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { FormColumnType } from 'nocodb-sdk'; import View from './View'; import NocoCache from '../cache/NocoCache'; -import extractProps from '../noco/meta/helpers/extractProps'; +import extractProps from '../meta/helpers/extractProps'; export default class FormViewColumn implements FormColumnType { id?: string; diff --git a/packages/nocodb/src/lib/models/FormulaColumn.ts b/packages/nocodb/src/lib/models/FormulaColumn.ts index 332b4b45db..eca2ff1e67 100644 --- a/packages/nocodb/src/lib/models/FormulaColumn.ts +++ b/packages/nocodb/src/lib/models/FormulaColumn.ts @@ -1,7 +1,7 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import NocoCache from '../cache/NocoCache'; -import extractProps from '../noco/meta/helpers/extractProps'; +import extractProps from '../meta/helpers/extractProps'; export default class FormulaColumn { formula: string; diff --git a/packages/nocodb/src/lib/models/GalleryView.ts b/packages/nocodb/src/lib/models/GalleryView.ts index 0bec164992..307194ea87 100644 --- a/packages/nocodb/src/lib/models/GalleryView.ts +++ b/packages/nocodb/src/lib/models/GalleryView.ts @@ -1,4 +1,4 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { GalleryColumnType, GalleryType, UITypes } from 'nocodb-sdk'; import View from './View'; diff --git a/packages/nocodb/src/lib/models/GalleryViewColumn.ts b/packages/nocodb/src/lib/models/GalleryViewColumn.ts index 73a1582b95..acd48d3a36 100644 --- a/packages/nocodb/src/lib/models/GalleryViewColumn.ts +++ b/packages/nocodb/src/lib/models/GalleryViewColumn.ts @@ -1,4 +1,4 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import View from './View'; import NocoCache from '../cache/NocoCache'; diff --git a/packages/nocodb/src/lib/models/GridView.ts b/packages/nocodb/src/lib/models/GridView.ts index 9a3b057228..12e06f810a 100644 --- a/packages/nocodb/src/lib/models/GridView.ts +++ b/packages/nocodb/src/lib/models/GridView.ts @@ -1,4 +1,4 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import GridViewColumn from './GridViewColumn'; import View from './View'; diff --git a/packages/nocodb/src/lib/models/GridViewColumn.ts b/packages/nocodb/src/lib/models/GridViewColumn.ts index ffba656947..fb70243517 100644 --- a/packages/nocodb/src/lib/models/GridViewColumn.ts +++ b/packages/nocodb/src/lib/models/GridViewColumn.ts @@ -1,7 +1,7 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import { GridColumnType } from 'nocodb-sdk'; -import extractProps from '../noco/meta/helpers/extractProps'; +import extractProps from '../meta/helpers/extractProps'; import View from './View'; import NocoCache from '../cache/NocoCache'; diff --git a/packages/nocodb/src/lib/models/Hook.ts b/packages/nocodb/src/lib/models/Hook.ts index e998d3a471..e6a78e391d 100644 --- a/packages/nocodb/src/lib/models/Hook.ts +++ b/packages/nocodb/src/lib/models/Hook.ts @@ -5,7 +5,7 @@ import { CacheScope, MetaTable } from '../utils/globals'; -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import Model from './Model'; import NocoCache from '../cache/NocoCache'; import Filter from './Filter'; diff --git a/packages/nocodb/src/lib/models/HookFilter.ts b/packages/nocodb/src/lib/models/HookFilter.ts index 140c7d7539..e073b2bf3c 100644 --- a/packages/nocodb/src/lib/models/HookFilter.ts +++ b/packages/nocodb/src/lib/models/HookFilter.ts @@ -1,4 +1,4 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; import Model from './Model'; import Column from './Column'; import { diff --git a/packages/nocodb/src/lib/models/HookLog.ts b/packages/nocodb/src/lib/models/HookLog.ts index 8638b1432f..257848e57b 100644 --- a/packages/nocodb/src/lib/models/HookLog.ts +++ b/packages/nocodb/src/lib/models/HookLog.ts @@ -1,6 +1,6 @@ import { MetaTable } from '../utils/globals'; -import Noco from '../noco/Noco'; -import extractProps from '../noco/meta/helpers/extractProps'; +import Noco from '../Noco'; +import extractProps from '../meta/helpers/extractProps'; import Hook from './Hook'; import { HookLogType } from 'nocodb-sdk'; diff --git a/packages/nocodb/src/lib/models/KanbanView.ts b/packages/nocodb/src/lib/models/KanbanView.ts index 46f9fbd4aa..e966990210 100644 --- a/packages/nocodb/src/lib/models/KanbanView.ts +++ b/packages/nocodb/src/lib/models/KanbanView.ts @@ -1,4 +1,4 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { MetaTable } from '../utils/globals'; export default class KanbanView { diff --git a/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts index ee175732a6..c1f8b0cb9d 100644 --- a/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts +++ b/packages/nocodb/src/lib/models/LinkToAnotherRecordColumn.ts @@ -1,4 +1,4 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; import Column from './Column'; import Model from './Model'; // import NocoCache from '../cache/NocoCache'; diff --git a/packages/nocodb/src/lib/models/LookupColumn.ts b/packages/nocodb/src/lib/models/LookupColumn.ts index 32179295ec..973759ced5 100644 --- a/packages/nocodb/src/lib/models/LookupColumn.ts +++ b/packages/nocodb/src/lib/models/LookupColumn.ts @@ -1,4 +1,4 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; // import NocoCache from '../cache/NocoCache'; import Column from './Column'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; diff --git a/packages/nocodb/src/lib/models/Model.ts b/packages/nocodb/src/lib/models/Model.ts index 5a1dd7d2bf..5f2e111f81 100644 --- a/packages/nocodb/src/lib/models/Model.ts +++ b/packages/nocodb/src/lib/models/Model.ts @@ -1,8 +1,8 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; import Column from './Column'; import NocoCache from '../cache/NocoCache'; -import { XKnex } from '../sql-data-mapper'; -import { BaseModelSqlv2 } from '../sql-data-mapper/lib/sql/BaseModelSqlv2'; +import { XKnex } from '../db/sql-data-mapper'; +import { BaseModelSqlv2 } from '../db/sql-data-mapper/lib/sql/BaseModelSqlv2'; import { isVirtualCol, ModelTypes, @@ -18,7 +18,7 @@ import { MetaTable } from '../utils/globals'; import View from './View'; -import { NcError } from '../noco/meta/helpers/catchError'; +import { NcError } from '../meta/helpers/catchError'; import Audit from './Audit'; export default class Model implements TableType { diff --git a/packages/nocodb/src/lib/models/ModelRoleVisibility.ts b/packages/nocodb/src/lib/models/ModelRoleVisibility.ts index 92a34c970f..111aefacf9 100644 --- a/packages/nocodb/src/lib/models/ModelRoleVisibility.ts +++ b/packages/nocodb/src/lib/models/ModelRoleVisibility.ts @@ -1,5 +1,5 @@ import { ModelRoleVisibilityType } from 'nocodb-sdk'; -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { CacheDelDirection, CacheGetType, diff --git a/packages/nocodb/src/lib/models/MultiSelectColumn.ts b/packages/nocodb/src/lib/models/MultiSelectColumn.ts index ab01a0f757..05c48f644c 100644 --- a/packages/nocodb/src/lib/models/MultiSelectColumn.ts +++ b/packages/nocodb/src/lib/models/MultiSelectColumn.ts @@ -1,4 +1,4 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; import NocoCache from '../cache/NocoCache'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; diff --git a/packages/nocodb/src/lib/models/Plugin.ts b/packages/nocodb/src/lib/models/Plugin.ts index 5b6834f452..ee08013651 100644 --- a/packages/nocodb/src/lib/models/Plugin.ts +++ b/packages/nocodb/src/lib/models/Plugin.ts @@ -1,6 +1,6 @@ import { PluginType } from 'nocodb-sdk'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import NocoCache from '../cache/NocoCache'; export default class Plugin implements PluginType { diff --git a/packages/nocodb/src/lib/models/Project.ts b/packages/nocodb/src/lib/models/Project.ts index f620bea5cc..5765e57251 100644 --- a/packages/nocodb/src/lib/models/Project.ts +++ b/packages/nocodb/src/lib/models/Project.ts @@ -1,5 +1,5 @@ import Base from './/Base'; -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { ProjectType } from 'nocodb-sdk'; import { CacheDelDirection, @@ -7,7 +7,7 @@ import { CacheScope, MetaTable } from '../utils/globals'; -import extractProps from '../noco/meta/helpers/extractProps'; +import extractProps from '../meta/helpers/extractProps'; import NocoCache from '../cache/NocoCache'; export default class Project implements ProjectType { diff --git a/packages/nocodb/src/lib/models/ProjectUser.ts b/packages/nocodb/src/lib/models/ProjectUser.ts index fa04375206..5fc6c07d4a 100644 --- a/packages/nocodb/src/lib/models/ProjectUser.ts +++ b/packages/nocodb/src/lib/models/ProjectUser.ts @@ -4,7 +4,7 @@ import { CacheScope, MetaTable } from '../utils/globals'; -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import NocoCache from '../cache/NocoCache'; import User from './User'; diff --git a/packages/nocodb/src/lib/models/RollupColumn.ts b/packages/nocodb/src/lib/models/RollupColumn.ts index 0ca20fc7e9..1e93382a31 100644 --- a/packages/nocodb/src/lib/models/RollupColumn.ts +++ b/packages/nocodb/src/lib/models/RollupColumn.ts @@ -1,4 +1,4 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; import Column from './Column'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; import NocoCache from '../cache/NocoCache'; diff --git a/packages/nocodb/src/lib/models/SingleSelectColumn.ts b/packages/nocodb/src/lib/models/SingleSelectColumn.ts index 2c0b973168..193fed6a16 100644 --- a/packages/nocodb/src/lib/models/SingleSelectColumn.ts +++ b/packages/nocodb/src/lib/models/SingleSelectColumn.ts @@ -1,4 +1,4 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; import NocoCache from '../cache/NocoCache'; import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; diff --git a/packages/nocodb/src/lib/models/Sort.ts b/packages/nocodb/src/lib/models/Sort.ts index 1dac3d3d6f..5a527a4afd 100644 --- a/packages/nocodb/src/lib/models/Sort.ts +++ b/packages/nocodb/src/lib/models/Sort.ts @@ -1,4 +1,4 @@ -import Noco from '../../lib/noco/Noco'; +import Noco from '../Noco'; import Model from './Model'; import Column from './Column'; import { diff --git a/packages/nocodb/src/lib/models/SyncLogs.ts b/packages/nocodb/src/lib/models/SyncLogs.ts index 53a5b805bc..bb7157f181 100644 --- a/packages/nocodb/src/lib/models/SyncLogs.ts +++ b/packages/nocodb/src/lib/models/SyncLogs.ts @@ -1,4 +1,4 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { MetaTable } from '../utils/globals'; export default class SyncLogs { diff --git a/packages/nocodb/src/lib/models/SyncSource.ts b/packages/nocodb/src/lib/models/SyncSource.ts index 254abbc40e..dc9f8fc6cb 100644 --- a/packages/nocodb/src/lib/models/SyncSource.ts +++ b/packages/nocodb/src/lib/models/SyncSource.ts @@ -1,6 +1,6 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { MetaTable } from '../utils/globals'; -import extractProps from '../noco/meta/helpers/extractProps'; +import extractProps from '../meta/helpers/extractProps'; import User from './User'; export default class SyncSource { diff --git a/packages/nocodb/src/lib/models/User.ts b/packages/nocodb/src/lib/models/User.ts index 17023bbb7d..bfb4d20272 100644 --- a/packages/nocodb/src/lib/models/User.ts +++ b/packages/nocodb/src/lib/models/User.ts @@ -1,7 +1,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 Noco from '../Noco'; +import extractProps from '../meta/helpers/extractProps'; import NocoCache from '../cache/NocoCache'; export default class User implements UserType { id: number; diff --git a/packages/nocodb/src/lib/models/View.ts b/packages/nocodb/src/lib/models/View.ts index 1eaf1f50a5..196951594c 100644 --- a/packages/nocodb/src/lib/models/View.ts +++ b/packages/nocodb/src/lib/models/View.ts @@ -1,4 +1,4 @@ -import Noco from '../noco/Noco'; +import Noco from '../Noco'; import { CacheDelDirection, CacheGetType, @@ -18,7 +18,7 @@ import GalleryViewColumn from './GalleryViewColumn'; import FormViewColumn from './FormViewColumn'; import Column from './Column'; import NocoCache from '../cache/NocoCache'; -import extractProps from '../noco/meta/helpers/extractProps'; +import extractProps from '../meta/helpers/extractProps'; const { v4: uuidv4 } = require('uuid'); export default class View implements ViewType { diff --git a/packages/nocodb/src/plugins/backblaze/Backblaze.ts b/packages/nocodb/src/lib/plugins/backblaze/Backblaze.ts similarity index 100% rename from packages/nocodb/src/plugins/backblaze/Backblaze.ts rename to packages/nocodb/src/lib/plugins/backblaze/Backblaze.ts diff --git a/packages/nocodb/src/plugins/backblaze/BackblazePlugin.ts b/packages/nocodb/src/lib/plugins/backblaze/BackblazePlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/backblaze/BackblazePlugin.ts rename to packages/nocodb/src/lib/plugins/backblaze/BackblazePlugin.ts diff --git a/packages/nocodb/src/plugins/backblaze/index.ts b/packages/nocodb/src/lib/plugins/backblaze/index.ts similarity index 100% rename from packages/nocodb/src/plugins/backblaze/index.ts rename to packages/nocodb/src/lib/plugins/backblaze/index.ts diff --git a/packages/nocodb/src/plugins/discord/Discord.ts b/packages/nocodb/src/lib/plugins/discord/Discord.ts similarity index 100% rename from packages/nocodb/src/plugins/discord/Discord.ts rename to packages/nocodb/src/lib/plugins/discord/Discord.ts diff --git a/packages/nocodb/src/plugins/discord/DiscordPlugin.ts b/packages/nocodb/src/lib/plugins/discord/DiscordPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/discord/DiscordPlugin.ts rename to packages/nocodb/src/lib/plugins/discord/DiscordPlugin.ts diff --git a/packages/nocodb/src/plugins/discord/index.ts b/packages/nocodb/src/lib/plugins/discord/index.ts similarity index 100% rename from packages/nocodb/src/plugins/discord/index.ts rename to packages/nocodb/src/lib/plugins/discord/index.ts diff --git a/packages/nocodb/src/plugins/gcs/Gcs.ts b/packages/nocodb/src/lib/plugins/gcs/Gcs.ts similarity index 100% rename from packages/nocodb/src/plugins/gcs/Gcs.ts rename to packages/nocodb/src/lib/plugins/gcs/Gcs.ts diff --git a/packages/nocodb/src/plugins/gcs/GcsPlugin.ts b/packages/nocodb/src/lib/plugins/gcs/GcsPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/gcs/GcsPlugin.ts rename to packages/nocodb/src/lib/plugins/gcs/GcsPlugin.ts diff --git a/packages/nocodb/src/plugins/gcs/index.ts b/packages/nocodb/src/lib/plugins/gcs/index.ts similarity index 100% rename from packages/nocodb/src/plugins/gcs/index.ts rename to packages/nocodb/src/lib/plugins/gcs/index.ts diff --git a/packages/nocodb/src/plugins/linode/LinodeObjectStorage.ts b/packages/nocodb/src/lib/plugins/linode/LinodeObjectStorage.ts similarity index 100% rename from packages/nocodb/src/plugins/linode/LinodeObjectStorage.ts rename to packages/nocodb/src/lib/plugins/linode/LinodeObjectStorage.ts diff --git a/packages/nocodb/src/plugins/linode/LinodeObjectStoragePlugin.ts b/packages/nocodb/src/lib/plugins/linode/LinodeObjectStoragePlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/linode/LinodeObjectStoragePlugin.ts rename to packages/nocodb/src/lib/plugins/linode/LinodeObjectStoragePlugin.ts diff --git a/packages/nocodb/src/plugins/linode/index.ts b/packages/nocodb/src/lib/plugins/linode/index.ts similarity index 100% rename from packages/nocodb/src/plugins/linode/index.ts rename to packages/nocodb/src/lib/plugins/linode/index.ts diff --git a/packages/nocodb/src/plugins/mailerSend/MailerSend.ts b/packages/nocodb/src/lib/plugins/mailerSend/MailerSend.ts similarity index 97% rename from packages/nocodb/src/plugins/mailerSend/MailerSend.ts rename to packages/nocodb/src/lib/plugins/mailerSend/MailerSend.ts index a0911fd2f9..f82c68f86b 100644 --- a/packages/nocodb/src/plugins/mailerSend/MailerSend.ts +++ b/packages/nocodb/src/lib/plugins/mailerSend/MailerSend.ts @@ -1,7 +1,7 @@ import { IEmailAdapter } from 'nc-plugin'; import MailerSend, { EmailParams, Recipient } from 'mailersend'; -import { XcEmail } from '../../interface/IEmailAdapter'; +import { XcEmail } from '../../../interface/IEmailAdapter'; export default class Mailer implements IEmailAdapter { private mailersend: MailerSend; diff --git a/packages/nocodb/src/plugins/mailerSend/MailerSendPlugin.ts b/packages/nocodb/src/lib/plugins/mailerSend/MailerSendPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/mailerSend/MailerSendPlugin.ts rename to packages/nocodb/src/lib/plugins/mailerSend/MailerSendPlugin.ts diff --git a/packages/nocodb/src/plugins/mailerSend/index.ts b/packages/nocodb/src/lib/plugins/mailerSend/index.ts similarity index 96% rename from packages/nocodb/src/plugins/mailerSend/index.ts rename to packages/nocodb/src/lib/plugins/mailerSend/index.ts index 55dd197482..da6e3df49e 100644 --- a/packages/nocodb/src/plugins/mailerSend/index.ts +++ b/packages/nocodb/src/lib/plugins/mailerSend/index.ts @@ -26,7 +26,7 @@ const config: XcPluginConfig = { { key: 'from', label: 'From', - placeholder: 'eg: admin@example.com', + placeholder: 'eg: admin@run.com', type: XcType.SingleLineText, required: true }, diff --git a/packages/nocodb/src/plugins/mattermost/Mattermost.ts b/packages/nocodb/src/lib/plugins/mattermost/Mattermost.ts similarity index 100% rename from packages/nocodb/src/plugins/mattermost/Mattermost.ts rename to packages/nocodb/src/lib/plugins/mattermost/Mattermost.ts diff --git a/packages/nocodb/src/plugins/mattermost/MattermostPlugin.ts b/packages/nocodb/src/lib/plugins/mattermost/MattermostPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/mattermost/MattermostPlugin.ts rename to packages/nocodb/src/lib/plugins/mattermost/MattermostPlugin.ts diff --git a/packages/nocodb/src/plugins/mattermost/index.ts b/packages/nocodb/src/lib/plugins/mattermost/index.ts similarity index 100% rename from packages/nocodb/src/plugins/mattermost/index.ts rename to packages/nocodb/src/lib/plugins/mattermost/index.ts diff --git a/packages/nocodb/src/plugins/mino/Minio.ts b/packages/nocodb/src/lib/plugins/mino/Minio.ts similarity index 98% rename from packages/nocodb/src/plugins/mino/Minio.ts rename to packages/nocodb/src/lib/plugins/mino/Minio.ts index 23107e726f..beff4bed57 100644 --- a/packages/nocodb/src/plugins/mino/Minio.ts +++ b/packages/nocodb/src/lib/plugins/mino/Minio.ts @@ -27,7 +27,7 @@ export default class Minio implements IStorageAdapterV2 { const metaData = { 'Content-Type': file.mimetype // 'X-Amz-Meta-Testing': 1234, - // 'example': 5678 + // 'run': 5678 }; // call S3 to retrieve upload file to specified bucket this.minioClient @@ -111,7 +111,7 @@ export default class Minio implements IStorageAdapterV2 { const metaData = { // 'Content-Type': file.mimetype // 'X-Amz-Meta-Testing': 1234, - // 'example': 5678 + // 'run': 5678 }; // call S3 to retrieve upload file to specified bucket this.minioClient diff --git a/packages/nocodb/src/plugins/mino/MinioPlugin.ts b/packages/nocodb/src/lib/plugins/mino/MinioPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/mino/MinioPlugin.ts rename to packages/nocodb/src/lib/plugins/mino/MinioPlugin.ts diff --git a/packages/nocodb/src/plugins/mino/index.ts b/packages/nocodb/src/lib/plugins/mino/index.ts similarity index 100% rename from packages/nocodb/src/plugins/mino/index.ts rename to packages/nocodb/src/lib/plugins/mino/index.ts diff --git a/packages/nocodb/src/plugins/ovhCloud/OvhCloud.ts b/packages/nocodb/src/lib/plugins/ovhCloud/OvhCloud.ts similarity index 100% rename from packages/nocodb/src/plugins/ovhCloud/OvhCloud.ts rename to packages/nocodb/src/lib/plugins/ovhCloud/OvhCloud.ts diff --git a/packages/nocodb/src/plugins/ovhCloud/OvhCloudPlugin.ts b/packages/nocodb/src/lib/plugins/ovhCloud/OvhCloudPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/ovhCloud/OvhCloudPlugin.ts rename to packages/nocodb/src/lib/plugins/ovhCloud/OvhCloudPlugin.ts diff --git a/packages/nocodb/src/plugins/ovhCloud/index.ts b/packages/nocodb/src/lib/plugins/ovhCloud/index.ts similarity index 100% rename from packages/nocodb/src/plugins/ovhCloud/index.ts rename to packages/nocodb/src/lib/plugins/ovhCloud/index.ts diff --git a/packages/nocodb/src/plugins/s3/S3.ts b/packages/nocodb/src/lib/plugins/s3/S3.ts similarity index 100% rename from packages/nocodb/src/plugins/s3/S3.ts rename to packages/nocodb/src/lib/plugins/s3/S3.ts diff --git a/packages/nocodb/src/plugins/s3/S3Plugin.ts b/packages/nocodb/src/lib/plugins/s3/S3Plugin.ts similarity index 100% rename from packages/nocodb/src/plugins/s3/S3Plugin.ts rename to packages/nocodb/src/lib/plugins/s3/S3Plugin.ts diff --git a/packages/nocodb/src/plugins/s3/index.ts b/packages/nocodb/src/lib/plugins/s3/index.ts similarity index 100% rename from packages/nocodb/src/plugins/s3/index.ts rename to packages/nocodb/src/lib/plugins/s3/index.ts diff --git a/packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts b/packages/nocodb/src/lib/plugins/scaleway/ScalewayObjectStorage.ts similarity index 100% rename from packages/nocodb/src/plugins/scaleway/ScalewayObjectStorage.ts rename to packages/nocodb/src/lib/plugins/scaleway/ScalewayObjectStorage.ts diff --git a/packages/nocodb/src/plugins/scaleway/ScalewayObjectStoragePlugin.ts b/packages/nocodb/src/lib/plugins/scaleway/ScalewayObjectStoragePlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/scaleway/ScalewayObjectStoragePlugin.ts rename to packages/nocodb/src/lib/plugins/scaleway/ScalewayObjectStoragePlugin.ts diff --git a/packages/nocodb/src/plugins/scaleway/index.ts b/packages/nocodb/src/lib/plugins/scaleway/index.ts similarity index 100% rename from packages/nocodb/src/plugins/scaleway/index.ts rename to packages/nocodb/src/lib/plugins/scaleway/index.ts diff --git a/packages/nocodb/src/plugins/ses/SES.ts b/packages/nocodb/src/lib/plugins/ses/SES.ts similarity index 97% rename from packages/nocodb/src/plugins/ses/SES.ts rename to packages/nocodb/src/lib/plugins/ses/SES.ts index 212cd80339..c7b71c9c07 100644 --- a/packages/nocodb/src/plugins/ses/SES.ts +++ b/packages/nocodb/src/lib/plugins/ses/SES.ts @@ -2,7 +2,7 @@ import { IEmailAdapter } from 'nc-plugin'; import nodemailer from 'nodemailer'; import Mail from 'nodemailer/lib/mailer'; import AWS from 'aws-sdk'; -import { XcEmail } from '../../interface/IEmailAdapter'; +import { XcEmail } from '../../../interface/IEmailAdapter'; export default class SES implements IEmailAdapter { private transporter: Mail; diff --git a/packages/nocodb/src/plugins/ses/SESPlugin.ts b/packages/nocodb/src/lib/plugins/ses/SESPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/ses/SESPlugin.ts rename to packages/nocodb/src/lib/plugins/ses/SESPlugin.ts diff --git a/packages/nocodb/src/plugins/ses/index.ts b/packages/nocodb/src/lib/plugins/ses/index.ts similarity index 100% rename from packages/nocodb/src/plugins/ses/index.ts rename to packages/nocodb/src/lib/plugins/ses/index.ts diff --git a/packages/nocodb/src/plugins/slack/Slack.ts b/packages/nocodb/src/lib/plugins/slack/Slack.ts similarity index 100% rename from packages/nocodb/src/plugins/slack/Slack.ts rename to packages/nocodb/src/lib/plugins/slack/Slack.ts diff --git a/packages/nocodb/src/plugins/slack/SlackPlugin.ts b/packages/nocodb/src/lib/plugins/slack/SlackPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/slack/SlackPlugin.ts rename to packages/nocodb/src/lib/plugins/slack/SlackPlugin.ts diff --git a/packages/nocodb/src/plugins/slack/index.ts b/packages/nocodb/src/lib/plugins/slack/index.ts similarity index 100% rename from packages/nocodb/src/plugins/slack/index.ts rename to packages/nocodb/src/lib/plugins/slack/index.ts diff --git a/packages/nocodb/src/plugins/smtp/SMTP.ts b/packages/nocodb/src/lib/plugins/smtp/SMTP.ts similarity index 97% rename from packages/nocodb/src/plugins/smtp/SMTP.ts rename to packages/nocodb/src/lib/plugins/smtp/SMTP.ts index f5ff2d6c17..9f566641f7 100644 --- a/packages/nocodb/src/plugins/smtp/SMTP.ts +++ b/packages/nocodb/src/lib/plugins/smtp/SMTP.ts @@ -2,7 +2,7 @@ import { IEmailAdapter } from 'nc-plugin'; import nodemailer from 'nodemailer'; import Mail from 'nodemailer/lib/mailer'; -import { XcEmail } from '../../interface/IEmailAdapter'; +import { XcEmail } from '../../../interface/IEmailAdapter'; export default class SMTP implements IEmailAdapter { private transporter: Mail; diff --git a/packages/nocodb/src/plugins/smtp/SMTPPlugin.ts b/packages/nocodb/src/lib/plugins/smtp/SMTPPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/smtp/SMTPPlugin.ts rename to packages/nocodb/src/lib/plugins/smtp/SMTPPlugin.ts diff --git a/packages/nocodb/src/plugins/smtp/index.ts b/packages/nocodb/src/lib/plugins/smtp/index.ts similarity index 95% rename from packages/nocodb/src/plugins/smtp/index.ts rename to packages/nocodb/src/lib/plugins/smtp/index.ts index 453ca84b1e..4a13d1835d 100644 --- a/packages/nocodb/src/plugins/smtp/index.ts +++ b/packages/nocodb/src/lib/plugins/smtp/index.ts @@ -20,14 +20,14 @@ const config: XcPluginConfig = { { key: 'from', label: 'From', - placeholder: 'eg: admin@example.com', + placeholder: 'eg: admin@run.com', type: XcType.SingleLineText, required: true }, { key: 'host', label: 'Host', - placeholder: 'eg: smtp.example.com', + placeholder: 'eg: smtp.run.com', type: XcType.SingleLineText, required: true }, diff --git a/packages/nocodb/src/plugins/spaces/Spaces.ts b/packages/nocodb/src/lib/plugins/spaces/Spaces.ts similarity index 100% rename from packages/nocodb/src/plugins/spaces/Spaces.ts rename to packages/nocodb/src/lib/plugins/spaces/Spaces.ts diff --git a/packages/nocodb/src/plugins/spaces/SpacesPlugin.ts b/packages/nocodb/src/lib/plugins/spaces/SpacesPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/spaces/SpacesPlugin.ts rename to packages/nocodb/src/lib/plugins/spaces/SpacesPlugin.ts diff --git a/packages/nocodb/src/plugins/spaces/index.ts b/packages/nocodb/src/lib/plugins/spaces/index.ts similarity index 100% rename from packages/nocodb/src/plugins/spaces/index.ts rename to packages/nocodb/src/lib/plugins/spaces/index.ts diff --git a/packages/nocodb/src/plugins/teams/Teams.ts b/packages/nocodb/src/lib/plugins/teams/Teams.ts similarity index 100% rename from packages/nocodb/src/plugins/teams/Teams.ts rename to packages/nocodb/src/lib/plugins/teams/Teams.ts diff --git a/packages/nocodb/src/plugins/teams/TeamsPlugin.ts b/packages/nocodb/src/lib/plugins/teams/TeamsPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/teams/TeamsPlugin.ts rename to packages/nocodb/src/lib/plugins/teams/TeamsPlugin.ts diff --git a/packages/nocodb/src/plugins/teams/index.ts b/packages/nocodb/src/lib/plugins/teams/index.ts similarity index 100% rename from packages/nocodb/src/plugins/teams/index.ts rename to packages/nocodb/src/lib/plugins/teams/index.ts diff --git a/packages/nocodb/src/plugins/twilio/Twilio.ts b/packages/nocodb/src/lib/plugins/twilio/Twilio.ts similarity index 100% rename from packages/nocodb/src/plugins/twilio/Twilio.ts rename to packages/nocodb/src/lib/plugins/twilio/Twilio.ts diff --git a/packages/nocodb/src/plugins/twilio/TwilioPlugin.ts b/packages/nocodb/src/lib/plugins/twilio/TwilioPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/twilio/TwilioPlugin.ts rename to packages/nocodb/src/lib/plugins/twilio/TwilioPlugin.ts diff --git a/packages/nocodb/src/plugins/twilio/index.ts b/packages/nocodb/src/lib/plugins/twilio/index.ts similarity index 100% rename from packages/nocodb/src/plugins/twilio/index.ts rename to packages/nocodb/src/lib/plugins/twilio/index.ts diff --git a/packages/nocodb/src/plugins/twilioWhatsapp/TwilioWhatsapp.ts b/packages/nocodb/src/lib/plugins/twilioWhatsapp/TwilioWhatsapp.ts similarity index 100% rename from packages/nocodb/src/plugins/twilioWhatsapp/TwilioWhatsapp.ts rename to packages/nocodb/src/lib/plugins/twilioWhatsapp/TwilioWhatsapp.ts diff --git a/packages/nocodb/src/plugins/twilioWhatsapp/TwilioWhatsappPlugin.ts b/packages/nocodb/src/lib/plugins/twilioWhatsapp/TwilioWhatsappPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/twilioWhatsapp/TwilioWhatsappPlugin.ts rename to packages/nocodb/src/lib/plugins/twilioWhatsapp/TwilioWhatsappPlugin.ts diff --git a/packages/nocodb/src/plugins/twilioWhatsapp/index.ts b/packages/nocodb/src/lib/plugins/twilioWhatsapp/index.ts similarity index 100% rename from packages/nocodb/src/plugins/twilioWhatsapp/index.ts rename to packages/nocodb/src/lib/plugins/twilioWhatsapp/index.ts diff --git a/packages/nocodb/src/plugins/upcloud/UpCloudPlugin.ts b/packages/nocodb/src/lib/plugins/upcloud/UpCloudPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/upcloud/UpCloudPlugin.ts rename to packages/nocodb/src/lib/plugins/upcloud/UpCloudPlugin.ts diff --git a/packages/nocodb/src/plugins/upcloud/UpoCloud.ts b/packages/nocodb/src/lib/plugins/upcloud/UpoCloud.ts similarity index 100% rename from packages/nocodb/src/plugins/upcloud/UpoCloud.ts rename to packages/nocodb/src/lib/plugins/upcloud/UpoCloud.ts diff --git a/packages/nocodb/src/plugins/upcloud/index.ts b/packages/nocodb/src/lib/plugins/upcloud/index.ts similarity index 100% rename from packages/nocodb/src/plugins/upcloud/index.ts rename to packages/nocodb/src/lib/plugins/upcloud/index.ts diff --git a/packages/nocodb/src/plugins/vultr/Vultr.ts b/packages/nocodb/src/lib/plugins/vultr/Vultr.ts similarity index 100% rename from packages/nocodb/src/plugins/vultr/Vultr.ts rename to packages/nocodb/src/lib/plugins/vultr/Vultr.ts diff --git a/packages/nocodb/src/plugins/vultr/VultrPlugin.ts b/packages/nocodb/src/lib/plugins/vultr/VultrPlugin.ts similarity index 100% rename from packages/nocodb/src/plugins/vultr/VultrPlugin.ts rename to packages/nocodb/src/lib/plugins/vultr/VultrPlugin.ts diff --git a/packages/nocodb/src/plugins/vultr/index.ts b/packages/nocodb/src/lib/plugins/vultr/index.ts similarity index 100% rename from packages/nocodb/src/plugins/vultr/index.ts rename to packages/nocodb/src/lib/plugins/vultr/index.ts diff --git a/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts b/packages/nocodb/src/lib/utils/common/BaseApiBuilder.ts similarity index 99% rename from packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts rename to packages/nocodb/src/lib/utils/common/BaseApiBuilder.ts index 70f6156416..75ced1b111 100644 --- a/packages/nocodb/src/lib/noco/common/BaseApiBuilder.ts +++ b/packages/nocodb/src/lib/utils/common/BaseApiBuilder.ts @@ -14,14 +14,14 @@ import { import XcDynamicChanges from '../../../interface/XcDynamicChanges'; import { Acls, DbConfig, NcConfig } from '../../../interface/config'; -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'; -import NcMetaIO from '../meta/NcMetaIO'; -import XcCache from '../plugins/adapters/cache/XcCache'; +import { BaseModelSql, XKnex } from '../../db/sql-data-mapper'; +import ModelXcMetaFactory from '../../db/sql-mgr/code/models/xc/ModelXcMetaFactory'; +import ExpressXcPolicy from '../../db/sql-mgr/code/policies/xc/ExpressXcPolicy'; +import NcHelp from '../NcHelp'; +import NcProjectBuilder from '../../v1-legacy/NcProjectBuilder'; +import Noco from '../../Noco'; +import NcMetaIO from '../../meta/NcMetaIO'; +import XcCache from '../../v1-legacy/plugins/adapters/cache/XcCache'; import BaseModel from './BaseModel'; import { XcCron } from './XcCron'; diff --git a/packages/nocodb/src/lib/noco/common/BaseModel.ts b/packages/nocodb/src/lib/utils/common/BaseModel.ts similarity index 99% rename from packages/nocodb/src/lib/noco/common/BaseModel.ts rename to packages/nocodb/src/lib/utils/common/BaseModel.ts index 51b79d36f0..7efbb92129 100644 --- a/packages/nocodb/src/lib/noco/common/BaseModel.ts +++ b/packages/nocodb/src/lib/utils/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 '../../sql-data-mapper'; +import { BaseModelSql } from '../../db/sql-data-mapper'; // import axios from "axios"; import BaseApiBuilder from './BaseApiBuilder'; diff --git a/packages/nocodb/src/lib/noco/common/BaseProcedure.ts b/packages/nocodb/src/lib/utils/common/BaseProcedure.ts similarity index 92% rename from packages/nocodb/src/lib/noco/common/BaseProcedure.ts rename to packages/nocodb/src/lib/utils/common/BaseProcedure.ts index 311ab5eeee..f452867aa1 100644 --- a/packages/nocodb/src/lib/noco/common/BaseProcedure.ts +++ b/packages/nocodb/src/lib/utils/common/BaseProcedure.ts @@ -1,5 +1,5 @@ -import { GqlApiBuilder } from '../gql/GqlApiBuilder'; -import { RestApiBuilder } from '../rest/RestApiBuilder'; +import { GqlApiBuilder } from '../../v1-legacy/gql/GqlApiBuilder'; +import { RestApiBuilder } from '../../v1-legacy/rest/RestApiBuilder'; import XcProcedure from './XcProcedure'; diff --git a/packages/nocodb/src/lib/noco/common/NcConnectionMgr.ts b/packages/nocodb/src/lib/utils/common/NcConnectionMgr.ts similarity index 96% rename from packages/nocodb/src/lib/noco/common/NcConnectionMgr.ts rename to packages/nocodb/src/lib/utils/common/NcConnectionMgr.ts index 28a0a1d2e1..c81f2a961b 100644 --- a/packages/nocodb/src/lib/noco/common/NcConnectionMgr.ts +++ b/packages/nocodb/src/lib/utils/common/NcConnectionMgr.ts @@ -1,11 +1,11 @@ -import { XKnex } from '../../sql-data-mapper'; +import { XKnex } from '../../db/sql-data-mapper'; import { NcConfig } from '../../../interface/config'; import fs from 'fs'; import Knex from 'knex'; import { SqlClientFactory } from 'nc-help'; -import NcMetaIO from '../meta/NcMetaIO'; -import { defaultConnectionConfig } from '../../utils/NcConfigFactory'; +import NcMetaIO from '../../meta/NcMetaIO'; +import { defaultConnectionConfig } from '../NcConfigFactory'; export default class NcConnectionMgr { private static connectionRefs: { diff --git a/packages/nocodb/src/lib/noco/common/NcConnectionMgrv2.ts b/packages/nocodb/src/lib/utils/common/NcConnectionMgrv2.ts similarity index 96% rename from packages/nocodb/src/lib/noco/common/NcConnectionMgrv2.ts rename to packages/nocodb/src/lib/utils/common/NcConnectionMgrv2.ts index 1a23dac973..05607a50a7 100644 --- a/packages/nocodb/src/lib/noco/common/NcConnectionMgrv2.ts +++ b/packages/nocodb/src/lib/utils/common/NcConnectionMgrv2.ts @@ -1,13 +1,13 @@ -import { XKnex } from '../../sql-data-mapper'; +import { XKnex } from '../../db/sql-data-mapper'; // import { NcConfig } from '../../../interface/config'; // import fs from 'fs'; // import Knex from 'knex'; import { SqlClientFactory } from 'nc-help'; // import NcMetaIO from '../meta/NcMetaIO'; -import { defaultConnectionConfig } from '../../utils/NcConfigFactory'; +import { defaultConnectionConfig } from '../NcConfigFactory'; import Base from '../../models/Base'; -import Noco from '../Noco'; +import Noco from '../../Noco'; export default class NcConnectionMgrv2 { private static connectionRefs: { diff --git a/packages/nocodb/src/lib/noco/common/XcAudit.ts b/packages/nocodb/src/lib/utils/common/XcAudit.ts similarity index 86% rename from packages/nocodb/src/lib/noco/common/XcAudit.ts rename to packages/nocodb/src/lib/utils/common/XcAudit.ts index bf7fb1c5f2..afdeb624f9 100644 --- a/packages/nocodb/src/lib/noco/common/XcAudit.ts +++ b/packages/nocodb/src/lib/utils/common/XcAudit.ts @@ -1,4 +1,4 @@ -import Noco from '../Noco'; +import Noco from '../../Noco'; export default class XcAudit { public static init(app: Noco) { diff --git a/packages/nocodb/src/lib/noco/common/XcCron.ts b/packages/nocodb/src/lib/utils/common/XcCron.ts similarity index 99% rename from packages/nocodb/src/lib/noco/common/XcCron.ts rename to packages/nocodb/src/lib/utils/common/XcCron.ts index c93ac0177a..60f8df1f53 100644 --- a/packages/nocodb/src/lib/noco/common/XcCron.ts +++ b/packages/nocodb/src/lib/utils/common/XcCron.ts @@ -1,7 +1,7 @@ import { CronJob } from 'cron'; import { NcConfig } from '../../../interface/config'; -import Noco from '../Noco'; +import Noco from '../../Noco'; import BaseApiBuilder from './BaseApiBuilder'; diff --git a/packages/nocodb/src/lib/noco/common/XcProcedure.ts b/packages/nocodb/src/lib/utils/common/XcProcedure.ts similarity index 100% rename from packages/nocodb/src/lib/noco/common/XcProcedure.ts rename to packages/nocodb/src/lib/utils/common/XcProcedure.ts diff --git a/packages/nocodb/src/lib/noco/common/formSubmissionEmailTemplate.ts b/packages/nocodb/src/lib/utils/common/formSubmissionEmailTemplate.ts similarity index 100% rename from packages/nocodb/src/lib/noco/common/formSubmissionEmailTemplate.ts rename to packages/nocodb/src/lib/utils/common/formSubmissionEmailTemplate.ts diff --git a/packages/nocodb/src/lib/noco/common/handlers/xcMetaDiffSync.ts b/packages/nocodb/src/lib/utils/common/handlers/xcMetaDiffSync.ts similarity index 99% rename from packages/nocodb/src/lib/noco/common/handlers/xcMetaDiffSync.ts rename to packages/nocodb/src/lib/utils/common/handlers/xcMetaDiffSync.ts index 3323793d10..9e2d53ebea 100644 --- a/packages/nocodb/src/lib/noco/common/handlers/xcMetaDiffSync.ts +++ b/packages/nocodb/src/lib/utils/common/handlers/xcMetaDiffSync.ts @@ -2,9 +2,9 @@ import BaseApiBuilder, { XcTablesPopulateParams } from '../BaseApiBuilder'; import xcMetaDiff, { NcMetaDiff as NcMetaDiffType, XcMetaDiffType -} from '../../meta/handlers/xcMetaDiff'; -import XcCache from '../../plugins/adapters/cache/XcCache'; -import { GqlApiBuilder } from '../../gql/GqlApiBuilder'; +} from '../../../meta/handlers/xcMetaDiff'; +import XcCache from '../../../v1-legacy/plugins/adapters/cache/XcCache'; +import { GqlApiBuilder } from '../../../v1-legacy/gql/GqlApiBuilder'; // @ts-ignore export default async function(this: BaseApiBuilder | any) { diff --git a/packages/nocodb/src/lib/noco/common/helpers/addErrorOnColumnDeleteInFormula.ts b/packages/nocodb/src/lib/utils/common/helpers/addErrorOnColumnDeleteInFormula.ts similarity index 100% rename from packages/nocodb/src/lib/noco/common/helpers/addErrorOnColumnDeleteInFormula.ts rename to packages/nocodb/src/lib/utils/common/helpers/addErrorOnColumnDeleteInFormula.ts diff --git a/packages/nocodb/src/lib/noco/common/helpers/jsepTreeToFormula.ts b/packages/nocodb/src/lib/utils/common/helpers/jsepTreeToFormula.ts similarity index 100% rename from packages/nocodb/src/lib/noco/common/helpers/jsepTreeToFormula.ts rename to packages/nocodb/src/lib/utils/common/helpers/jsepTreeToFormula.ts diff --git a/packages/nocodb/src/lib/noco/common/helpers/updateColumnNameInFormula.ts b/packages/nocodb/src/lib/utils/common/helpers/updateColumnNameInFormula.ts similarity index 100% rename from packages/nocodb/src/lib/noco/common/helpers/updateColumnNameInFormula.ts rename to packages/nocodb/src/lib/utils/common/helpers/updateColumnNameInFormula.ts diff --git a/packages/nocodb/src/lib/noco/common/jobs/ncModelsOrderUpgrader.ts b/packages/nocodb/src/lib/utils/common/jobs/ncModelsOrderUpgrader.ts similarity index 100% rename from packages/nocodb/src/lib/noco/common/jobs/ncModelsOrderUpgrader.ts rename to packages/nocodb/src/lib/utils/common/jobs/ncModelsOrderUpgrader.ts diff --git a/packages/nocodb/src/lib/noco/common/jobs/ncParentModelTitleUpgrader.ts b/packages/nocodb/src/lib/utils/common/jobs/ncParentModelTitleUpgrader.ts similarity index 100% rename from packages/nocodb/src/lib/noco/common/jobs/ncParentModelTitleUpgrader.ts rename to packages/nocodb/src/lib/utils/common/jobs/ncParentModelTitleUpgrader.ts diff --git a/packages/nocodb/src/lib/noco/common/jobs/ncRemoveDuplicatedRelationRows.ts b/packages/nocodb/src/lib/utils/common/jobs/ncRemoveDuplicatedRelationRows.ts similarity index 100% rename from packages/nocodb/src/lib/noco/common/jobs/ncRemoveDuplicatedRelationRows.ts rename to packages/nocodb/src/lib/utils/common/jobs/ncRemoveDuplicatedRelationRows.ts diff --git a/packages/nocodb/src/lib/noco/NcProjectBuilder.ts b/packages/nocodb/src/lib/v1-legacy/NcProjectBuilder.ts similarity index 99% rename from packages/nocodb/src/lib/noco/NcProjectBuilder.ts rename to packages/nocodb/src/lib/v1-legacy/NcProjectBuilder.ts index 24a19324f5..4dc93ab1b6 100644 --- a/packages/nocodb/src/lib/noco/NcProjectBuilder.ts +++ b/packages/nocodb/src/lib/v1-legacy/NcProjectBuilder.ts @@ -6,13 +6,13 @@ import { Router } from 'express'; import { SqlClientFactory, Tele } from 'nc-help'; import { NcConfig } from '../../interface/config'; -import Migrator from '../sql-migrator/lib/KnexMigrator'; +import Migrator from '../db/sql-migrator/lib/KnexMigrator'; -import Noco from './Noco'; +import Noco from '../Noco'; import { GqlApiBuilder } from './gql/GqlApiBuilder'; -import { XCEeError } from './meta/NcMetaMgr'; +import { XCEeError } from '../meta/NcMetaMgr'; import { RestApiBuilder } from './rest/RestApiBuilder'; -import NcConnectionMgr from './common/NcConnectionMgr'; +import NcConnectionMgr from '../utils/common/NcConnectionMgr'; export default class NcProjectBuilder { public readonly id: string; diff --git a/packages/nocodb/src/lib/noco/NcProjectBuilderEE.ts b/packages/nocodb/src/lib/v1-legacy/NcProjectBuilderEE.ts similarity index 100% rename from packages/nocodb/src/lib/noco/NcProjectBuilderEE.ts rename to packages/nocodb/src/lib/v1-legacy/NcProjectBuilderEE.ts diff --git a/packages/nocodb/src/lib/noco/gql/GqlApiBuilder.ts b/packages/nocodb/src/lib/v1-legacy/gql/GqlApiBuilder.ts similarity index 99% rename from packages/nocodb/src/lib/noco/gql/GqlApiBuilder.ts rename to packages/nocodb/src/lib/v1-legacy/gql/GqlApiBuilder.ts index 9ccc8eb388..3d7b8aaddf 100644 --- a/packages/nocodb/src/lib/noco/gql/GqlApiBuilder.ts +++ b/packages/nocodb/src/lib/v1-legacy/gql/GqlApiBuilder.ts @@ -8,16 +8,16 @@ import { BaseType } from 'xc-core-ts'; import XcMetaMgr from '../../../interface/XcMetaMgr'; import { DbConfig, NcConfig } from '../../../interface/config'; -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 ExpressXcTsPolicyGql from '../../db/sql-mgr/code/gql-policies/xc-ts/ExpressXcTsPolicyGql'; +import GqlXcSchemaFactory from '../../db/sql-mgr/code/gql-schema/xc-ts/GqlXcSchemaFactory'; +import ModelXcMetaFactory from '../../db/sql-mgr/code/models/xc/ModelXcMetaFactory'; import NcHelp from '../../utils/NcHelp'; import NcProjectBuilder from '../NcProjectBuilder'; -import Noco from '../Noco'; +import Noco from '../../Noco'; import BaseApiBuilder, { XcTablesPopulateParams -} from '../common/BaseApiBuilder'; -import NcMetaIO from '../meta/NcMetaIO'; +} from '../../utils/common/BaseApiBuilder'; +import NcMetaIO from '../../meta/NcMetaIO'; import { m2mNotChildren, m2mNotChildrenCount } from './GqlCommonResolvers'; import GqlMiddleware from './GqlMiddleware'; diff --git a/packages/nocodb/src/lib/noco/gql/GqlAuthResolver.ts b/packages/nocodb/src/lib/v1-legacy/gql/GqlAuthResolver.ts similarity index 99% rename from packages/nocodb/src/lib/noco/gql/GqlAuthResolver.ts rename to packages/nocodb/src/lib/v1-legacy/gql/GqlAuthResolver.ts index 4b02339355..95c0bab929 100644 --- a/packages/nocodb/src/lib/noco/gql/GqlAuthResolver.ts +++ b/packages/nocodb/src/lib/v1-legacy/gql/GqlAuthResolver.ts @@ -8,8 +8,8 @@ import { ExtractJwt, Strategy } from 'passport-jwt'; import IEmailAdapter from '../../../interface/IEmailAdapter'; import { DbConfig, NcConfig } from '../../../interface/config'; -import { Knex, XKnex } from '../../sql-data-mapper'; -import Noco from '../Noco'; +import { Knex, XKnex } from '../../db/sql-data-mapper'; +import Noco from '../../Noco'; import authSchema from './auth/schema'; diff --git a/packages/nocodb/src/lib/noco/gql/GqlBaseResolver.ts b/packages/nocodb/src/lib/v1-legacy/gql/GqlBaseResolver.ts similarity index 100% rename from packages/nocodb/src/lib/noco/gql/GqlBaseResolver.ts rename to packages/nocodb/src/lib/v1-legacy/gql/GqlBaseResolver.ts diff --git a/packages/nocodb/src/lib/noco/gql/GqlCommonResolvers.ts b/packages/nocodb/src/lib/v1-legacy/gql/GqlCommonResolvers.ts similarity index 95% rename from packages/nocodb/src/lib/noco/gql/GqlCommonResolvers.ts rename to packages/nocodb/src/lib/v1-legacy/gql/GqlCommonResolvers.ts index a0bedf4466..7fdc6aa05e 100644 --- a/packages/nocodb/src/lib/noco/gql/GqlCommonResolvers.ts +++ b/packages/nocodb/src/lib/v1-legacy/gql/GqlCommonResolvers.ts @@ -1,4 +1,4 @@ -import { BaseModelSql } from '../../sql-data-mapper'; +import { BaseModelSql } from '../../db/sql-data-mapper'; export const m2mNotChildren = ({ models = {} diff --git a/packages/nocodb/src/lib/noco/gql/GqlMiddleware.ts b/packages/nocodb/src/lib/v1-legacy/gql/GqlMiddleware.ts similarity index 100% rename from packages/nocodb/src/lib/noco/gql/GqlMiddleware.ts rename to packages/nocodb/src/lib/v1-legacy/gql/GqlMiddleware.ts diff --git a/packages/nocodb/src/lib/noco/gql/GqlProcedureResolver.ts b/packages/nocodb/src/lib/v1-legacy/gql/GqlProcedureResolver.ts similarity index 96% rename from packages/nocodb/src/lib/noco/gql/GqlProcedureResolver.ts rename to packages/nocodb/src/lib/v1-legacy/gql/GqlProcedureResolver.ts index 861b67cc58..a60b5d2c25 100644 --- a/packages/nocodb/src/lib/noco/gql/GqlProcedureResolver.ts +++ b/packages/nocodb/src/lib/v1-legacy/gql/GqlProcedureResolver.ts @@ -1,7 +1,7 @@ import autoBind from 'auto-bind'; -import BaseProcedure from '../common/BaseProcedure'; -import XcProcedure from '../common/XcProcedure'; +import BaseProcedure from '../../utils/common/BaseProcedure'; +import XcProcedure from '../../utils/common/XcProcedure'; import { GqlApiBuilder } from './GqlApiBuilder'; import GqlBaseResolver from './GqlBaseResolver'; diff --git a/packages/nocodb/src/lib/noco/gql/GqlResolver.ts b/packages/nocodb/src/lib/v1-legacy/gql/GqlResolver.ts similarity index 99% rename from packages/nocodb/src/lib/noco/gql/GqlResolver.ts rename to packages/nocodb/src/lib/v1-legacy/gql/GqlResolver.ts index e99c00181d..6abeed95e8 100644 --- a/packages/nocodb/src/lib/noco/gql/GqlResolver.ts +++ b/packages/nocodb/src/lib/v1-legacy/gql/GqlResolver.ts @@ -1,8 +1,8 @@ import autoBind from 'auto-bind'; import { Acls } from '../../../interface/config'; -import { BaseModelSql } from '../../sql-data-mapper'; -import Noco from '../Noco'; +import { BaseModelSql } from '../../db/sql-data-mapper'; +import Noco from '../../Noco'; import GqlBaseResolver from './GqlBaseResolver'; import GqlMiddleware from './GqlMiddleware'; diff --git a/packages/nocodb/src/lib/noco/gql/auth/schema.ts b/packages/nocodb/src/lib/v1-legacy/gql/auth/schema.ts similarity index 100% rename from packages/nocodb/src/lib/noco/gql/auth/schema.ts rename to packages/nocodb/src/lib/v1-legacy/gql/auth/schema.ts diff --git a/packages/nocodb/src/lib/noco/gql/common.schema.ts b/packages/nocodb/src/lib/v1-legacy/gql/common.schema.ts similarity index 100% rename from packages/nocodb/src/lib/noco/gql/common.schema.ts rename to packages/nocodb/src/lib/v1-legacy/gql/common.schema.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/userApi/ui/emailTemplates/forgotPassword.ts b/packages/nocodb/src/lib/v1-legacy/gql/emailTemplate/forgotPassword.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/userApi/ui/emailTemplates/forgotPassword.ts rename to packages/nocodb/src/lib/v1-legacy/gql/emailTemplate/forgotPassword.ts diff --git a/packages/nocodb/src/lib/noco/meta/api/userApi/ui/emailTemplates/verify.ts b/packages/nocodb/src/lib/v1-legacy/gql/emailTemplate/verify.ts similarity index 100% rename from packages/nocodb/src/lib/noco/meta/api/userApi/ui/emailTemplates/verify.ts rename to packages/nocodb/src/lib/v1-legacy/gql/emailTemplate/verify.ts diff --git a/packages/nocodb/src/lib/noco/nc.try.ts b/packages/nocodb/src/lib/v1-legacy/nc.try.ts similarity index 98% rename from packages/nocodb/src/lib/noco/nc.try.ts rename to packages/nocodb/src/lib/v1-legacy/nc.try.ts index 1d0271d655..7387ae4a04 100644 --- a/packages/nocodb/src/lib/noco/nc.try.ts +++ b/packages/nocodb/src/lib/v1-legacy/nc.try.ts @@ -3,7 +3,7 @@ import express from 'express'; import NcConfigFactory from '../utils/NcConfigFactory'; -import Noco from './Noco'; +import Noco from '../Noco'; export default async function(dbUrl): Promise { const server = express(); diff --git a/packages/nocodb/src/lib/noco/plugins/NcPluginMgr.ts b/packages/nocodb/src/lib/v1-legacy/plugins/NcPluginMgr.ts similarity index 80% rename from packages/nocodb/src/lib/noco/plugins/NcPluginMgr.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/NcPluginMgr.ts index 9377afafa9..52bbb4cb13 100644 --- a/packages/nocodb/src/lib/noco/plugins/NcPluginMgr.ts +++ b/packages/nocodb/src/lib/v1-legacy/plugins/NcPluginMgr.ts @@ -8,27 +8,27 @@ import { XcWebhookNotificationPlugin } from 'nc-plugin'; -import BackblazePluginConfig from '../../../plugins/backblaze'; -import DiscordPluginConfig from '../../../plugins/discord'; -import GcsPluginConfig from '../../../plugins/gcs'; -import LinodePluginConfig from '../../../plugins/linode'; -import MattermostPluginConfig from '../../../plugins/mattermost'; -import MinioPluginConfig from '../../../plugins/mino'; -import OvhCloudPluginConfig from '../../../plugins/ovhCloud'; -import ScalewayPluginConfig from '../../../plugins/scaleway'; -import S3PluginConfig from '../../../plugins/s3'; -import SlackPluginConfig from '../../../plugins/slack'; -import SMTPPluginConfig from '../../../plugins/smtp'; -import MailerSendConfig from '../../../plugins/mailerSend'; -import SpacesPluginConfig from '../../../plugins/spaces'; -import TeamsPluginConfig from '../../../plugins/teams'; -import TwilioPluginConfig from '../../../plugins/twilio'; -import TwilioWhatsappPluginConfig from '../../../plugins/twilioWhatsapp'; -import UpcloudPluginConfig from '../../../plugins/upcloud'; -import VultrPluginConfig from '../../../plugins/vultr'; -import SESPluginConfig from '../../../plugins/ses'; -import Noco from '../Noco'; -import NcMetaIO from '../meta/NcMetaIO'; +import BackblazePluginConfig from '../../plugins/backblaze'; +import DiscordPluginConfig from '../../plugins/discord'; +import GcsPluginConfig from '../../plugins/gcs'; +import LinodePluginConfig from '../../plugins/linode'; +import MattermostPluginConfig from '../../plugins/mattermost'; +import MinioPluginConfig from '../../plugins/mino'; +import OvhCloudPluginConfig from '../../plugins/ovhCloud'; +import ScalewayPluginConfig from '../../plugins/scaleway'; +import S3PluginConfig from '../../plugins/s3'; +import SlackPluginConfig from '../../plugins/slack'; +import SMTPPluginConfig from '../../plugins/smtp'; +import MailerSendConfig from '../../plugins/mailerSend'; +import SpacesPluginConfig from '../../plugins/spaces'; +import TeamsPluginConfig from '../../plugins/teams'; +import TwilioPluginConfig from '../../plugins/twilio'; +import TwilioWhatsappPluginConfig from '../../plugins/twilioWhatsapp'; +import UpcloudPluginConfig from '../../plugins/upcloud'; +import VultrPluginConfig from '../../plugins/vultr'; +import SESPluginConfig from '../../plugins/ses'; +import Noco from '../../Noco'; +import NcMetaIO from '../../meta/NcMetaIO'; import Local from './adapters/storage/Local'; diff --git a/packages/nocodb/src/lib/noco/plugins/adapters/cache/XcCache.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/cache/XcCache.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/adapters/cache/XcCache.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/adapters/cache/XcCache.ts diff --git a/packages/nocodb/src/lib/noco/plugins/adapters/discord/Discord.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/discord/Discord.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/adapters/discord/Discord.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/adapters/discord/Discord.ts diff --git a/packages/nocodb/src/lib/noco/plugins/adapters/email/EmailFactory.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/email/EmailFactory.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/adapters/email/EmailFactory.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/adapters/email/EmailFactory.ts diff --git a/packages/nocodb/src/lib/noco/plugins/adapters/email/SES.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/email/SES.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/adapters/email/SES.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/adapters/email/SES.ts diff --git a/packages/nocodb/src/lib/noco/plugins/adapters/email/SMTP.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/email/SMTP.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/adapters/email/SMTP.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/adapters/email/SMTP.ts diff --git a/packages/nocodb/src/lib/noco/plugins/adapters/mattermost/Mattermost.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/mattermost/Mattermost.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/adapters/mattermost/Mattermost.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/adapters/mattermost/Mattermost.ts diff --git a/packages/nocodb/src/lib/noco/plugins/adapters/slack/Slack.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/slack/Slack.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/adapters/slack/Slack.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/adapters/slack/Slack.ts diff --git a/packages/nocodb/src/lib/noco/plugins/adapters/storage/Local.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/storage/Local.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/adapters/storage/Local.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/adapters/storage/Local.ts diff --git a/packages/nocodb/src/lib/noco/plugins/adapters/twilio/Twilio.ts b/packages/nocodb/src/lib/v1-legacy/plugins/adapters/twilio/Twilio.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/adapters/twilio/Twilio.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/adapters/twilio/Twilio.ts diff --git a/packages/nocodb/src/lib/noco/plugins/azure.ts b/packages/nocodb/src/lib/v1-legacy/plugins/azure.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/azure.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/azure.ts diff --git a/packages/nocodb/src/lib/noco/plugins/brand.ts b/packages/nocodb/src/lib/v1-legacy/plugins/brand.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/brand.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/brand.ts diff --git a/packages/nocodb/src/lib/noco/plugins/cache.ts b/packages/nocodb/src/lib/v1-legacy/plugins/cache.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/cache.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/cache.ts diff --git a/packages/nocodb/src/lib/noco/plugins/discord.ts b/packages/nocodb/src/lib/v1-legacy/plugins/discord.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/discord.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/discord.ts diff --git a/packages/nocodb/src/lib/noco/plugins/ee.ts b/packages/nocodb/src/lib/v1-legacy/plugins/ee.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/ee.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/ee.ts diff --git a/packages/nocodb/src/lib/noco/plugins/githubAuth.ts b/packages/nocodb/src/lib/v1-legacy/plugins/githubAuth.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/githubAuth.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/githubAuth.ts diff --git a/packages/nocodb/src/lib/noco/plugins/googleAuth.ts b/packages/nocodb/src/lib/v1-legacy/plugins/googleAuth.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/googleAuth.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/googleAuth.ts diff --git a/packages/nocodb/src/lib/noco/plugins/mattermost.ts b/packages/nocodb/src/lib/v1-legacy/plugins/mattermost.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/mattermost.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/mattermost.ts diff --git a/packages/nocodb/src/lib/noco/plugins/ses.ts b/packages/nocodb/src/lib/v1-legacy/plugins/ses.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/ses.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/ses.ts diff --git a/packages/nocodb/src/lib/noco/plugins/slack.ts b/packages/nocodb/src/lib/v1-legacy/plugins/slack.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/slack.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/slack.ts diff --git a/packages/nocodb/src/lib/noco/plugins/smtp.ts b/packages/nocodb/src/lib/v1-legacy/plugins/smtp.ts similarity index 95% rename from packages/nocodb/src/lib/noco/plugins/smtp.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/smtp.ts index 80dae8e18f..77365ab191 100644 --- a/packages/nocodb/src/lib/noco/plugins/smtp.ts +++ b/packages/nocodb/src/lib/v1-legacy/plugins/smtp.ts @@ -6,14 +6,14 @@ const input: XcForm = { { key: 'from', label: 'From', - placeholder: 'eg: admin@example.com', + placeholder: 'eg: admin@run.com', type: XcType.SingleLineText, required: true }, { key: 'host', label: 'Host', - placeholder: 'eg: smtp.example.com', + placeholder: 'eg: smtp.run.com', type: XcType.SingleLineText, required: true }, diff --git a/packages/nocodb/src/lib/noco/plugins/twilio.ts b/packages/nocodb/src/lib/v1-legacy/plugins/twilio.ts similarity index 100% rename from packages/nocodb/src/lib/noco/plugins/twilio.ts rename to packages/nocodb/src/lib/v1-legacy/plugins/twilio.ts diff --git a/packages/nocodb/src/lib/noco/rest/RestApiBuilder.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestApiBuilder.ts similarity index 99% rename from packages/nocodb/src/lib/noco/rest/RestApiBuilder.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestApiBuilder.ts index 64cfce2e80..f14f869d61 100644 --- a/packages/nocodb/src/lib/noco/rest/RestApiBuilder.ts +++ b/packages/nocodb/src/lib/v1-legacy/rest/RestApiBuilder.ts @@ -10,22 +10,22 @@ import mkdirp from 'mkdirp'; import { URL } from 'url'; import { DbConfig, NcConfig } from '../../../interface/config'; -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 ModelXcMetaFactory from '../../db/sql-mgr/code/models/xc/ModelXcMetaFactory'; +import SwaggerXc from '../../db/sql-mgr/code/routers/xc-ts/SwaggerXc'; +import SwaggerXcBt from '../../db/sql-mgr/code/routers/xc-ts/SwaggerXcBt'; +import SwaggerXcHm from '../../db/sql-mgr/code/routers/xc-ts/SwaggerXcHm'; +import ExpressXcTsRoutes from '../../db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutes'; +import ExpressXcTsRoutesBt from '../../db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesBt'; +import ExpressXcTsRoutesHm from '../../db/sql-mgr/code/routes/xc-ts/ExpressXcTsRoutesHm'; import NcHelp from '../../utils/NcHelp'; import NcProjectBuilder from '../NcProjectBuilder'; -import Noco from '../Noco'; +import Noco from '../../Noco'; import BaseApiBuilder, { IGNORE_TABLES, NcMetaData, XcTablesPopulateParams -} from '../common/BaseApiBuilder'; -import NcMetaIO from '../meta/NcMetaIO'; +} from '../../utils/common/BaseApiBuilder'; +import NcMetaIO from '../../meta/NcMetaIO'; import { RestCtrl } from './RestCtrl'; import { RestCtrlBelongsTo } from './RestCtrlBelongsTo'; @@ -33,8 +33,8 @@ import { RestCtrlCustom } from './RestCtrlCustom'; import { RestCtrlHasMany } from './RestCtrlHasMany'; import { RestCtrlProcedure } from './RestCtrlProcedure'; import Column from '../../models/Column'; -// import NocoTypeGenerator from '../noco-resolver/NocoTypeGenerator'; -// import NocoResolverGenerator from '../noco-resolver/NocoResolverGenerator'; +// import NocoTypeGenerator from '../v1-legacy-resolver/NocoTypeGenerator'; +// import NocoResolverGenerator from '../v1-legacy-resolver/NocoResolverGenerator'; // import { RestCtrlv2 } from './RestCtrlv2'; // import registerRestCtrl from './registerRestCtrl'; import { MetaTable } from '../../utils/globals'; diff --git a/packages/nocodb/src/lib/noco/rest/RestAuthCtrl.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts similarity index 99% rename from packages/nocodb/src/lib/noco/rest/RestAuthCtrl.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts index 649b2c16ae..f7c0a2fc7e 100644 --- a/packages/nocodb/src/lib/noco/rest/RestAuthCtrl.ts +++ b/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrl.ts @@ -12,8 +12,8 @@ import { ExtractJwt, Strategy } from 'passport-jwt'; import validator from 'validator'; import { DbConfig, NcConfig } from '../../../interface/config'; -import { Knex } from '../../sql-data-mapper'; -import Noco from '../Noco'; +import { Knex } from '../../db/sql-data-mapper'; +import Noco from '../../Noco'; const autoBind = require('auto-bind'); const PassportLocalStrategy = require('passport-local').Strategy; @@ -23,7 +23,7 @@ const { v4: uuidv4 } = require('uuid'); import * as crypto from 'crypto'; -import NcMetaIO from '../meta/NcMetaIO'; +import NcMetaIO from '../../meta/NcMetaIO'; const { isEmail } = require('validator'); @@ -569,7 +569,7 @@ export default class RestAuthCtrl { // you will need a jwt-package like https://github.com/auth0/node-jsonwebtoken to decode id_token and get waad profile const waadProfile = profile || jwt.decode(params.id_token); - // this is just an example: here you would provide a model *User* with the function *findOrCreate* + // this is just an run: here you would provide a model *User* with the function *findOrCreate* done(waadProfile) }));*/ } diff --git a/packages/nocodb/src/lib/noco/rest/RestAuthCtrlEE.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrlEE.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/RestAuthCtrlEE.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestAuthCtrlEE.ts diff --git a/packages/nocodb/src/lib/noco/rest/RestBaseCtrl.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestBaseCtrl.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/RestBaseCtrl.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestBaseCtrl.ts diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrl.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestCtrl.ts similarity index 98% rename from packages/nocodb/src/lib/noco/rest/RestCtrl.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestCtrl.ts index f9af7096ad..b6da94c7ae 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrl.ts +++ b/packages/nocodb/src/lib/v1-legacy/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 '../../sql-data-mapper'; +import { BaseModelSql } from '../../db/sql-data-mapper'; import { RestBaseCtrl } from './RestBaseCtrl'; -import { BaseModelSqlv2 } from '../../sql-data-mapper/lib/sql/BaseModelSqlv2'; +import { BaseModelSqlv2 } from '../../db/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/v1-legacy/rest/RestCtrlBelongsTo.ts similarity index 99% rename from packages/nocodb/src/lib/noco/rest/RestCtrlBelongsTo.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestCtrlBelongsTo.ts index 6cde6fafe1..9fa922e657 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlBelongsTo.ts +++ b/packages/nocodb/src/lib/v1-legacy/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 '../../sql-data-mapper'; +import { BaseModelSql } from '../../db/sql-data-mapper'; import { RestBaseCtrl } from './RestBaseCtrl'; diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlCustom.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestCtrlCustom.ts similarity index 97% rename from packages/nocodb/src/lib/noco/rest/RestCtrlCustom.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestCtrlCustom.ts index 87dcc541b3..de26b7c277 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlCustom.ts +++ b/packages/nocodb/src/lib/v1-legacy/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 '../../sql-data-mapper'; +import { BaseModelSql } from '../../db/sql-data-mapper'; import { RestBaseCtrl } from './RestBaseCtrl'; diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlHasMany.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestCtrlHasMany.ts similarity index 99% rename from packages/nocodb/src/lib/noco/rest/RestCtrlHasMany.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestCtrlHasMany.ts index 1f4a9ab77f..68a753ce29 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlHasMany.ts +++ b/packages/nocodb/src/lib/v1-legacy/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 '../../sql-data-mapper'; +import { BaseModelSql } from '../../db/sql-data-mapper'; import { RestBaseCtrl } from './RestBaseCtrl'; diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlMin.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestCtrlMin.ts similarity index 99% rename from packages/nocodb/src/lib/noco/rest/RestCtrlMin.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestCtrlMin.ts index d878acbf6c..eb031fa3a7 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlMin.ts +++ b/packages/nocodb/src/lib/v1-legacy/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 '../../sql-data-mapper'; +import { BaseModelSql } from '../../db/sql-data-mapper'; function parseHrtimeToSeconds(hrtime) { const seconds = (hrtime[0] + hrtime[1] / 1e6).toFixed(3); diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlProcedure.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestCtrlProcedure.ts similarity index 98% rename from packages/nocodb/src/lib/noco/rest/RestCtrlProcedure.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestCtrlProcedure.ts index e9e411346d..8b7bb90019 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlProcedure.ts +++ b/packages/nocodb/src/lib/v1-legacy/rest/RestCtrlProcedure.ts @@ -1,8 +1,8 @@ import autoBind from 'auto-bind'; import { Handler, NextFunction, Request, Response, Router } from 'express'; -import BaseProcedure from '../common/BaseProcedure'; -import XcProcedure from '../common/XcProcedure'; +import BaseProcedure from '../../utils/common/BaseProcedure'; +import XcProcedure from '../../utils/common/XcProcedure'; import { RestApiBuilder } from './RestApiBuilder'; diff --git a/packages/nocodb/src/lib/noco/rest/RestCtrlv2.ts b/packages/nocodb/src/lib/v1-legacy/rest/RestCtrlv2.ts similarity index 93% rename from packages/nocodb/src/lib/noco/rest/RestCtrlv2.ts rename to packages/nocodb/src/lib/v1-legacy/rest/RestCtrlv2.ts index 428406ddab..0c2b7f4d15 100644 --- a/packages/nocodb/src/lib/noco/rest/RestCtrlv2.ts +++ b/packages/nocodb/src/lib/v1-legacy/rest/RestCtrlv2.ts @@ -2,10 +2,10 @@ import autoBind from 'auto-bind'; import { Router } from 'express'; import { Acls } from '../../../interface/config'; -import { BaseModelSql } from '../../sql-data-mapper'; +import { BaseModelSql } from '../../db/sql-data-mapper'; -import { BaseModelSqlv2 } from '../../sql-data-mapper/lib/sql/BaseModelSqlv2'; -// import { nocoExecute } from '../noco-resolver/NocoExecute'; +import { BaseModelSqlv2 } from '../../db/sql-data-mapper/lib/sql/BaseModelSqlv2'; +// import { nocoExecute } from '../v1-legacy-resolver/NocoExecute'; // function parseHrtimeToSeconds(hrtime) { // const seconds = (hrtime[0] + hrtime[1] / 1e6).toFixed(3); diff --git a/packages/nocodb/src/lib/noco/rest/registerRestCtrl.ts b/packages/nocodb/src/lib/v1-legacy/rest/registerRestCtrl.ts similarity index 99% rename from packages/nocodb/src/lib/noco/rest/registerRestCtrl.ts rename to packages/nocodb/src/lib/v1-legacy/rest/registerRestCtrl.ts index 79e492c5eb..a1650ff906 100644 --- a/packages/nocodb/src/lib/noco/rest/registerRestCtrl.ts +++ b/packages/nocodb/src/lib/v1-legacy/rest/registerRestCtrl.ts @@ -1,4 +1,4 @@ -// import { nocoExecute } from '../noco-resolver/NocoExecute'; +// import { nocoExecute } from '../v1-legacy-resolver/NocoExecute'; // import { Router } from 'express'; // import Model from '../../models/Model'; // import Column from '../../models/Column'; diff --git a/packages/nocodb/src/lib/noco/rest/ui/auth/emailVerify.ts b/packages/nocodb/src/lib/v1-legacy/rest/ui/auth/emailVerify.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/ui/auth/emailVerify.ts rename to packages/nocodb/src/lib/v1-legacy/rest/ui/auth/emailVerify.ts diff --git a/packages/nocodb/src/lib/noco/rest/ui/auth/resetPassword.ts b/packages/nocodb/src/lib/v1-legacy/rest/ui/auth/resetPassword.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/ui/auth/resetPassword.ts rename to packages/nocodb/src/lib/v1-legacy/rest/ui/auth/resetPassword.ts diff --git a/packages/nocodb/src/lib/noco/rest/ui/auth/signin.ts b/packages/nocodb/src/lib/v1-legacy/rest/ui/auth/signin.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/ui/auth/signin.ts rename to packages/nocodb/src/lib/v1-legacy/rest/ui/auth/signin.ts diff --git a/packages/nocodb/src/lib/noco/rest/ui/auth/signup.ts b/packages/nocodb/src/lib/v1-legacy/rest/ui/auth/signup.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/ui/auth/signup.ts rename to packages/nocodb/src/lib/v1-legacy/rest/ui/auth/signup.ts diff --git a/packages/nocodb/src/lib/noco/rest/ui/auth/swagger-base.xc.json b/packages/nocodb/src/lib/v1-legacy/rest/ui/auth/swagger-base.xc.json similarity index 100% rename from packages/nocodb/src/lib/noco/rest/ui/auth/swagger-base.xc.json rename to packages/nocodb/src/lib/v1-legacy/rest/ui/auth/swagger-base.xc.json diff --git a/packages/nocodb/src/lib/noco/rest/ui/auth/swagger.ts b/packages/nocodb/src/lib/v1-legacy/rest/ui/auth/swagger.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/ui/auth/swagger.ts rename to packages/nocodb/src/lib/v1-legacy/rest/ui/auth/swagger.ts diff --git a/packages/nocodb/src/lib/noco/rest/ui/emailTemplates/forgotPassword.ts b/packages/nocodb/src/lib/v1-legacy/rest/ui/emailTemplates/forgotPassword.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/ui/emailTemplates/forgotPassword.ts rename to packages/nocodb/src/lib/v1-legacy/rest/ui/emailTemplates/forgotPassword.ts diff --git a/packages/nocodb/src/lib/noco/rest/ui/emailTemplates/invite.ts b/packages/nocodb/src/lib/v1-legacy/rest/ui/emailTemplates/invite.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/ui/emailTemplates/invite.ts rename to packages/nocodb/src/lib/v1-legacy/rest/ui/emailTemplates/invite.ts diff --git a/packages/nocodb/src/lib/noco/rest/ui/emailTemplates/verify.ts b/packages/nocodb/src/lib/v1-legacy/rest/ui/emailTemplates/verify.ts similarity index 100% rename from packages/nocodb/src/lib/noco/rest/ui/emailTemplates/verify.ts rename to packages/nocodb/src/lib/v1-legacy/rest/ui/emailTemplates/verify.ts diff --git a/packages/nocodb/src/lib/template-parser/NcTemplateParser.ts b/packages/nocodb/src/lib/v1-legacy/templates/NcTemplateParser.ts similarity index 100% rename from packages/nocodb/src/lib/template-parser/NcTemplateParser.ts rename to packages/nocodb/src/lib/v1-legacy/templates/NcTemplateParser.ts diff --git a/packages/nocodb/src/lib/noco/upgrader/NcUpgrader.ts b/packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts similarity index 92% rename from packages/nocodb/src/lib/noco/upgrader/NcUpgrader.ts rename to packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts index 61ef25aaf0..5784672575 100644 --- a/packages/nocodb/src/lib/noco/upgrader/NcUpgrader.ts +++ b/packages/nocodb/src/lib/version-upgrader/NcUpgrader.ts @@ -1,12 +1,12 @@ -import { NcConfig } from '../../../interface/config'; +import { NcConfig } from '../../interface/config'; import debug from 'debug'; import NcMetaIO from '../meta/NcMetaIO'; -import ncProjectEnvUpgrader from './jobs/ncProjectEnvUpgrader'; -import ncProjectEnvUpgrader0011045 from './jobs/ncProjectEnvUpgrader0011045'; -import ncProjectUpgraderV2_0090000 from './jobs/ncProjectUpgraderV2_0090000'; +import ncProjectEnvUpgrader from './ncProjectEnvUpgrader'; +import ncProjectEnvUpgrader0011045 from './ncProjectEnvUpgrader0011045'; +import ncProjectUpgraderV2_0090000 from './ncProjectUpgraderV2_0090000'; -const log = debug('nc:upgrader'); +const log = debug('nc:version-upgrader'); import { Tele } from 'nc-help'; import boxen from 'boxen'; diff --git a/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectEnvUpgrader.ts b/packages/nocodb/src/lib/version-upgrader/ncProjectEnvUpgrader.ts similarity index 90% rename from packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectEnvUpgrader.ts rename to packages/nocodb/src/lib/version-upgrader/ncProjectEnvUpgrader.ts index c369b97f35..8e71498a50 100644 --- a/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectEnvUpgrader.ts +++ b/packages/nocodb/src/lib/version-upgrader/ncProjectEnvUpgrader.ts @@ -1,4 +1,4 @@ -import { NcUpgraderCtx } from '../NcUpgrader'; +import { NcUpgraderCtx } from './NcUpgrader'; export default async function(ctx: NcUpgraderCtx) { const projects = await ctx.ncMeta.projectList(); diff --git a/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectEnvUpgrader0011045.ts b/packages/nocodb/src/lib/version-upgrader/ncProjectEnvUpgrader0011045.ts similarity index 86% rename from packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectEnvUpgrader0011045.ts rename to packages/nocodb/src/lib/version-upgrader/ncProjectEnvUpgrader0011045.ts index 54ef96a6bd..63c662eeb7 100644 --- a/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectEnvUpgrader0011045.ts +++ b/packages/nocodb/src/lib/version-upgrader/ncProjectEnvUpgrader0011045.ts @@ -1,4 +1,4 @@ -import { NcUpgraderCtx } from '../NcUpgrader'; +import { NcUpgraderCtx } from './NcUpgrader'; export default async function(ctx: NcUpgraderCtx) { const projects = await ctx.ncMeta.projectList(); diff --git a/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts b/packages/nocodb/src/lib/version-upgrader/ncProjectUpgraderV2_0090000.ts similarity index 96% rename from packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts rename to packages/nocodb/src/lib/version-upgrader/ncProjectUpgraderV2_0090000.ts index 651b93ed45..09f1ee9828 100644 --- a/packages/nocodb/src/lib/noco/upgrader/jobs/ncProjectUpgraderV2_0090000.ts +++ b/packages/nocodb/src/lib/version-upgrader/ncProjectUpgraderV2_0090000.ts @@ -1,34 +1,34 @@ -import { NcUpgraderCtx } from '../NcUpgrader'; -import Noco from '../../Noco'; -import User from '../../../models/User'; -import Project from '../../../models/Project'; -import ProjectUser from '../../../models/ProjectUser'; -import Model from '../../../models/Model'; +import { NcUpgraderCtx } from './NcUpgrader'; +import Noco from '../Noco'; +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 '../../../models/Column'; -import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; -import NcHelp from '../../../utils/NcHelp'; -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 '../../../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 '../../../models/Audit'; +import Column from '../models/Column'; +import LinkToAnotherRecordColumn from '../models/LinkToAnotherRecordColumn'; +import NcHelp from '../utils/NcHelp'; +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 '../models/Hook'; +import FormViewColumn from '../models/FormViewColumn'; +import GridViewColumn from '../models/GridViewColumn'; +import { getUniqueColumnAliasName } from '../meta/helpers/getUniqueName'; +import NcProjectBuilderEE from '../v1-legacy/NcProjectBuilderEE'; +import Audit from '../models/Audit'; export default async function(ctx: NcUpgraderCtx) { const ncMeta = ctx.ncMeta; diff --git a/packages/nocodb/src/example/deleteMetaDb.js b/packages/nocodb/src/run/deleteMetaDb.js similarity index 100% rename from packages/nocodb/src/example/deleteMetaDb.js rename to packages/nocodb/src/run/deleteMetaDb.js diff --git a/packages/nocodb/src/example/docker.ts b/packages/nocodb/src/run/docker.ts similarity index 97% rename from packages/nocodb/src/example/docker.ts rename to packages/nocodb/src/run/docker.ts index e10d2c6a4f..43ef29dcfb 100644 --- a/packages/nocodb/src/example/docker.ts +++ b/packages/nocodb/src/run/docker.ts @@ -1,7 +1,7 @@ import cors from 'cors'; import express from 'express'; -import Noco from '../lib/noco/Noco'; +import Noco from '../lib/Noco'; process.env.NC_VERSION = '0009044'; const server = express(); diff --git a/packages/nocodb/src/example/dockerRunMysql.ts b/packages/nocodb/src/run/dockerRunMysql.ts similarity index 98% rename from packages/nocodb/src/example/dockerRunMysql.ts rename to packages/nocodb/src/run/dockerRunMysql.ts index 24a6187eb1..c632d97f8f 100644 --- a/packages/nocodb/src/example/dockerRunMysql.ts +++ b/packages/nocodb/src/run/dockerRunMysql.ts @@ -1,7 +1,7 @@ import cors from 'cors'; import express from 'express'; -import Noco from '../lib/noco/Noco'; +import Noco from '../lib/Noco'; process.env.NC_VERSION = '0009044'; const server = express(); diff --git a/packages/nocodb/src/example/dockerRunPG.ts b/packages/nocodb/src/run/dockerRunPG.ts similarity index 98% rename from packages/nocodb/src/example/dockerRunPG.ts rename to packages/nocodb/src/run/dockerRunPG.ts index 890e3f4726..50075b15a8 100644 --- a/packages/nocodb/src/example/dockerRunPG.ts +++ b/packages/nocodb/src/run/dockerRunPG.ts @@ -1,7 +1,7 @@ import cors from 'cors'; import express from 'express'; -import Noco from '../lib/noco/Noco'; +import Noco from '../lib/Noco'; process.env.NC_VERSION = '0009044'; const server = express(); diff --git a/packages/nocodb/src/example/try.ts b/packages/nocodb/src/run/try.ts similarity index 100% rename from packages/nocodb/src/example/try.ts rename to packages/nocodb/src/run/try.ts diff --git a/scripts/upgradeNcGui.js b/scripts/upgradeNcGui.js index e5122f9a00..dea97d6fe3 100644 --- a/scripts/upgradeNcGui.js +++ b/scripts/upgradeNcGui.js @@ -39,7 +39,7 @@ if (process.env.targetEnv === 'DEV') { path.join(__dirname, '..', 'packages', 'nocodb', 'litestream', 'Dockerfile'), path.join(__dirname, '..', 'packages', 'nocodb', 'package.json'), path.join(__dirname, '..', 'packages', 'nocodb', 'README.md'), - path.join(__dirname, '..', 'packages', 'nocodb', 'src', 'lib', 'noco', 'Noco.ts'), + path.join(__dirname, '..', 'packages', 'nocodb', 'src', 'lib', 'Noco.ts'), ] Promise.all(filePaths.map(filePath => { return replacePackageName(filePath) })).then(() => { bumbVersionAndSave();