mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 02:35:12 +00:00
refactor: folder structure
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Drop metadb" type="NodeJSConfigurationType" path-to-js-file="deleteMetaDb.js" working-dir="$PROJECT_DIR$/packages/nocodb/src/example">
|
||||
<configuration default="false" name="Drop metadb" type="NodeJSConfigurationType" path-to-js-file="$PROJECT_DIR$/packages/nocodb/src/run/deleteMetaDb.js" working-dir="$PROJECT_DIR$/packages/nocodb/src/run">
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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")}`
|
||||
// })
|
||||
|
||||
@@ -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();
|
||||
@@ -838,13 +838,13 @@ abstract class BaseModel {
|
||||
* @param {String} [args.max] - maximum value
|
||||
* @param {String} [args.step] - step value
|
||||
* @returns {Promise<object[]>} 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',
|
||||
@@ -1118,13 +1118,13 @@ class BaseModelSql extends BaseModel {
|
||||
* @param {String} [args.max] - maximum value
|
||||
* @param {String} [args.step] - step value
|
||||
* @returns {Promise<Object[]>} 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',
|
||||
@@ -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';
|
||||
@@ -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: '=',
|
||||
@@ -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';
|
||||
|
||||
@@ -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
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
@@ -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(
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -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 = {
|
||||
@@ -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 {
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
@@ -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 = {};
|
||||
|
||||
@@ -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 = {
|
||||
@@ -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 = {
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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: {
|
||||
@@ -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;
|
||||
@@ -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 {
|
||||
@@ -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');
|
||||
@@ -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');
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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<any> {
|
||||
// In this example we are just returning migration names
|
||||
// In this run we are just returning migration names
|
||||
return Promise.resolve(['logger']);
|
||||
}
|
||||
|
||||
@@ -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: [
|
||||
@@ -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';*/
|
||||
@@ -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) {
|
||||
//
|
||||
// }
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
@@ -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';
|
||||
|
||||
@@ -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) {
|
||||
@@ -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);
|
||||
|
||||
@@ -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';
|
||||
@@ -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);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user