mirror of https://github.com/nocodb/nocodb
Pranav C
2 years ago
78 changed files with 430 additions and 430 deletions
@ -1,11 +1,11 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import { OrgUserRoles } from 'nocodb-sdk'; |
import { OrgUserRoles } from 'nocodb-sdk'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import { NcError } from '../helpers/catchError'; |
import { NcError } from '../meta/helpers/catchError'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import ApiToken from '../../models/ApiToken'; |
import ApiToken from '../models/ApiToken'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
export async function apiTokenList(req: Request, res: Response) { |
export async function apiTokenList(req: Request, res: Response) { |
||||||
res.json(await ApiToken.list(req['user'].id)); |
res.json(await ApiToken.list(req['user'].id)); |
@ -1,12 +1,12 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import Audit from '../../models/Audit'; |
import Audit from '../models/Audit'; |
||||||
import { AuditOperationSubTypes, AuditOperationTypes } from 'nocodb-sdk'; |
import { AuditOperationSubTypes, AuditOperationTypes } from 'nocodb-sdk'; |
||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
|
|
||||||
import DOMPurify from 'isomorphic-dompurify'; |
import DOMPurify from 'isomorphic-dompurify'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
export async function commentRow(req: Request<any, any>, res) { |
export async function commentRow(req: Request<any, any>, res) { |
||||||
res.json( |
res.json( |
@ -1,13 +1,13 @@ |
|||||||
import { Request, Response } from 'express'; |
import { Request, Response } from 'express'; |
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import { BaseListType } from 'nocodb-sdk'; |
import { BaseListType } from 'nocodb-sdk'; |
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import { syncBaseMigration } from '../helpers/syncMigration'; |
import { syncBaseMigration } from '../meta/helpers/syncMigration'; |
||||||
import Base from '../../models/Base'; |
import Base from '../models/Base'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw, populateMeta } from './helpers'; |
import { getAjvValidatorMw, populateMeta } from '../meta/api/helpers'; |
||||||
|
|
||||||
export async function baseGet( |
export async function baseGet( |
||||||
req: Request<any, any, any>, |
req: Request<any, any, any>, |
@ -1,5 +1,5 @@ |
|||||||
import catchError from '../helpers/catchError'; |
import catchError from '../meta/helpers/catchError'; |
||||||
import NocoCache from '../../cache/NocoCache'; |
import NocoCache from '../cache/NocoCache'; |
||||||
import { Router } from 'express'; |
import { Router } from 'express'; |
||||||
|
|
||||||
export async function cacheGet(_, res) { |
export async function cacheGet(_, res) { |
@ -1,11 +1,11 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import { BaseModelSqlv2 } from '../../../db/sql-data-mapper/lib/sql/BaseModelSqlv2'; |
import { BaseModelSqlv2 } from '../../db/sql-data-mapper/lib/sql/BaseModelSqlv2'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import Base from '../../../models/Base'; |
import Base from '../../models/Base'; |
||||||
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
||||||
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw'; |
||||||
import { getViewAndModelFromRequestByAliasOrId } from './helpers'; |
import { getViewAndModelFromRequestByAliasOrId } from './helpers'; |
||||||
import apiMetrics from '../../helpers/apiMetrics'; |
import apiMetrics from '../../meta/helpers/apiMetrics'; |
||||||
|
|
||||||
type BulkOperation = |
type BulkOperation = |
||||||
| 'bulkInsert' |
| 'bulkInsert' |
@ -1,16 +1,16 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import { nocoExecute } from 'nc-help'; |
import { nocoExecute } from 'nc-help'; |
||||||
import Base from '../../../models/Base'; |
import Base from '../../models/Base'; |
||||||
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
||||||
import { NcError } from '../../helpers/catchError'; |
import { NcError } from '../../meta/helpers/catchError'; |
||||||
import { PagedResponseImpl } from '../../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../../meta/helpers/PagedResponse'; |
||||||
import View from '../../../models/View'; |
import View from '../../models/View'; |
||||||
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw'; |
||||||
import { getViewAndModelFromRequestByAliasOrId } from './helpers'; |
import { getViewAndModelFromRequestByAliasOrId } from './helpers'; |
||||||
import apiMetrics from '../../helpers/apiMetrics'; |
import apiMetrics from '../../meta/helpers/apiMetrics'; |
||||||
import getAst from '../../../db/sql-data-mapper/lib/sql/helpers/getAst'; |
import getAst from '../../db/sql-data-mapper/lib/sql/helpers/getAst'; |
||||||
import { parseHrtimeToSeconds } from '../helpers'; |
import { parseHrtimeToSeconds } from '../../meta/api/helpers'; |
||||||
|
|
||||||
// todo: Handle the error case where view doesnt belong to model
|
// todo: Handle the error case where view doesnt belong to model
|
||||||
async function dataList(req: Request, res: Response) { |
async function dataList(req: Request, res: Response) { |
@ -1,13 +1,13 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import * as XLSX from 'xlsx'; |
import * as XLSX from 'xlsx'; |
||||||
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw'; |
||||||
import { |
import { |
||||||
extractCsvData, |
extractCsvData, |
||||||
extractXlsxData, |
extractXlsxData, |
||||||
getViewAndModelFromRequestByAliasOrId, |
getViewAndModelFromRequestByAliasOrId, |
||||||
} from './helpers'; |
} from './helpers'; |
||||||
import apiMetrics from '../../helpers/apiMetrics'; |
import apiMetrics from '../../meta/helpers/apiMetrics'; |
||||||
import View from '../../../models/View'; |
import View from '../../models/View'; |
||||||
|
|
||||||
async function excelDataExport(req: Request, res: Response) { |
async function excelDataExport(req: Request, res: Response) { |
||||||
const { model, view } = await getViewAndModelFromRequestByAliasOrId(req); |
const { model, view } = await getViewAndModelFromRequestByAliasOrId(req); |
@ -1,15 +1,15 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import Base from '../../../models/Base'; |
import Base from '../../models/Base'; |
||||||
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
||||||
import { PagedResponseImpl } from '../../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../../meta/helpers/PagedResponse'; |
||||||
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw'; |
||||||
import { |
import { |
||||||
getColumnByIdOrName, |
getColumnByIdOrName, |
||||||
getViewAndModelFromRequestByAliasOrId, |
getViewAndModelFromRequestByAliasOrId, |
||||||
} from './helpers'; |
} from './helpers'; |
||||||
import { NcError } from '../../helpers/catchError'; |
import { NcError } from '../../meta/helpers/catchError'; |
||||||
import apiMetrics from '../../helpers/apiMetrics'; |
import apiMetrics from '../../meta/helpers/apiMetrics'; |
||||||
|
|
||||||
// todo: handle case where the given column is not ltar
|
// todo: handle case where the given column is not ltar
|
||||||
export async function mmList(req: Request, res: Response, next) { |
export async function mmList(req: Request, res: Response, next) { |
@ -1,14 +1,14 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import { nocoExecute } from 'nc-help'; |
import { nocoExecute } from 'nc-help'; |
||||||
import Base from '../../../models/Base'; |
import Base from '../../models/Base'; |
||||||
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
||||||
import { PagedResponseImpl } from '../../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../../meta/helpers/PagedResponse'; |
||||||
import View from '../../../models/View'; |
import View from '../../models/View'; |
||||||
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw'; |
||||||
import { NcError } from '../../helpers/catchError'; |
import { NcError } from '../../meta/helpers/catchError'; |
||||||
import apiMetrics from '../../helpers/apiMetrics'; |
import apiMetrics from '../../meta/helpers/apiMetrics'; |
||||||
import getAst from '../../../db/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) { |
export async function dataList(req: Request, res: Response, next) { |
||||||
const view = await View.get(req.params.viewId); |
const view = await View.get(req.params.viewId); |
@ -1,20 +1,20 @@ |
|||||||
import Project from '../../../models/Project'; |
import Project from '../../models/Project'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import View from '../../../models/View'; |
import View from '../../models/View'; |
||||||
import { NcError } from '../../helpers/catchError'; |
import { NcError } from '../../meta/helpers/catchError'; |
||||||
import { Request } from 'express'; |
import { Request } from 'express'; |
||||||
import Base from '../../../models/Base'; |
import Base from '../../models/Base'; |
||||||
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
||||||
import { isSystemColumn, UITypes } from 'nocodb-sdk'; |
import { isSystemColumn, UITypes } from 'nocodb-sdk'; |
||||||
|
|
||||||
import { nocoExecute } from 'nc-help'; |
import { nocoExecute } from 'nc-help'; |
||||||
import * as XLSX from 'xlsx'; |
import * as XLSX from 'xlsx'; |
||||||
import Column from '../../../models/Column'; |
import Column from '../../models/Column'; |
||||||
import LookupColumn from '../../../models/LookupColumn'; |
import LookupColumn from '../../models/LookupColumn'; |
||||||
import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; |
import LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; |
||||||
|
|
||||||
import papaparse from 'papaparse'; |
import papaparse from 'papaparse'; |
||||||
import getAst from '../../../db/sql-data-mapper/lib/sql/helpers/getAst'; |
import getAst from '../../db/sql-data-mapper/lib/sql/helpers/getAst'; |
||||||
export async function getViewAndModelFromRequestByAliasOrId( |
export async function getViewAndModelFromRequestByAliasOrId( |
||||||
req: |
req: |
||||||
| Request<{ projectName: string; tableName: string; viewName?: string }> |
| Request<{ projectName: string; tableName: string; viewName?: string }> |
@ -1,14 +1,14 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import { nocoExecute } from 'nc-help'; |
import { nocoExecute } from 'nc-help'; |
||||||
import Base from '../../../models/Base'; |
import Base from '../../models/Base'; |
||||||
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
||||||
import View from '../../../models/View'; |
import View from '../../models/View'; |
||||||
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw'; |
||||||
import Project from '../../../models/Project'; |
import Project from '../../models/Project'; |
||||||
import { NcError } from '../../helpers/catchError'; |
import { NcError } from '../../meta/helpers/catchError'; |
||||||
import apiMetrics from '../../helpers/apiMetrics'; |
import apiMetrics from '../../meta/helpers/apiMetrics'; |
||||||
import getAst from '../../../db/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) { |
export async function dataList(req: Request, res: Response) { |
||||||
const { model, view } = await getViewAndModelFromRequest(req); |
const { model, view } = await getViewAndModelFromRequest(req); |
@ -1,6 +1,6 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import View from '../../models/View'; |
import View from '../models/View'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { extractCsvData } from './dataApis/helpers'; |
import { extractCsvData } from './dataApis/helpers'; |
||||||
|
|
||||||
async function exportCsv(req: Request, res: Response) { |
async function exportCsv(req: Request, res: Response) { |
@ -1,19 +1,19 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk'; |
import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; |
import ProjectMgrv2 from '../db/sql-mgr/v2/ProjectMgrv2'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import Filter from '../../models/Filter'; |
import Filter from '../models/Filter'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export async function filterGet(req: Request, res: Response, next) { |
export async function filterGet(req: Request, res: Response, next) { |
@ -1,19 +1,19 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import { FormType, ViewTypes } from 'nocodb-sdk'; |
import { FormType, ViewTypes } from 'nocodb-sdk'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; |
import ProjectMgrv2 from '../db/sql-mgr/v2/ProjectMgrv2'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import View from '../../models/View'; |
import View from '../models/View'; |
||||||
import FormView from '../../models/FormView'; |
import FormView from '../models/FormView'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export async function formViewGet(req: Request, res: Response<FormType>) { |
export async function formViewGet(req: Request, res: Response<FormType>) { |
@ -1,9 +1,9 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import FormViewColumn from '../../models/FormViewColumn'; |
import FormViewColumn from '../models/FormViewColumn'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
export async function columnUpdate(req: Request, res: Response) { |
export async function columnUpdate(req: Request, res: Response) { |
||||||
Tele.emit('evt', { evt_type: 'formViewColumn:updated' }); |
Tele.emit('evt', { evt_type: 'formViewColumn:updated' }); |
@ -1,11 +1,11 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import { GalleryType, ViewTypes } from 'nocodb-sdk'; |
import { GalleryType, ViewTypes } from 'nocodb-sdk'; |
||||||
import View from '../../models/View'; |
import View from '../models/View'; |
||||||
import GalleryView from '../../models/GalleryView'; |
import GalleryView from '../models/GalleryView'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
export async function galleryViewGet(req: Request, res: Response<GalleryType>) { |
export async function galleryViewGet(req: Request, res: Response<GalleryType>) { |
||||||
res.json(await GalleryView.get(req.params.galleryViewId)); |
res.json(await GalleryView.get(req.params.galleryViewId)); |
||||||
} |
} |
@ -1,19 +1,19 @@ |
|||||||
import { Request, Router } from 'express'; |
import { Request, Router } from 'express'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import { ViewTypes } from 'nocodb-sdk'; |
import { ViewTypes } from 'nocodb-sdk'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; |
import ProjectMgrv2 from '../db/sql-mgr/v2/ProjectMgrv2'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import View from '../../models/View'; |
import View from '../models/View'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import GridView from '../../models/GridView'; |
import GridView from '../models/GridView'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export async function gridViewCreate(req: Request<any, any>, res) { |
export async function gridViewCreate(req: Request<any, any>, res) { |
@ -1,9 +1,9 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import GridViewColumn from '../../models/GridViewColumn'; |
import GridViewColumn from '../models/GridViewColumn'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
export async function columnList(req: Request, res: Response) { |
export async function columnList(req: Request, res: Response) { |
||||||
res.json(await GridViewColumn.list(req.params.gridViewId)); |
res.json(await GridViewColumn.list(req.params.gridViewId)); |
@ -1,15 +1,15 @@ |
|||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import catchError from '../helpers/catchError'; |
import catchError from '../meta/helpers/catchError'; |
||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import Hook from '../../models/Hook'; |
import Hook from '../models/Hook'; |
||||||
import { HookListType, HookType } from 'nocodb-sdk'; |
import { HookListType, HookType } from 'nocodb-sdk'; |
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import { invokeWebhook } from '../helpers/webhookHelpers'; |
import { invokeWebhook } from '../meta/helpers/webhookHelpers'; |
||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import populateSamplePayload from '../helpers/populateSamplePayload'; |
import populateSamplePayload from '../meta/helpers/populateSamplePayload'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
export async function hookList( |
export async function hookList( |
||||||
req: Request<any, any, any>, |
req: Request<any, any, any>, |
@ -1,19 +1,19 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk'; |
import { Table, TableList, TableListParams, TableReq } from 'nocodb-sdk'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; |
import ProjectMgrv2 from '../db/sql-mgr/v2/ProjectMgrv2'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import Filter from '../../models/Filter'; |
import Filter from '../models/Filter'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export async function filterGet(req: Request, res: Response, next) { |
export async function filterGet(req: Request, res: Response, next) { |
@ -1,11 +1,11 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import { KanbanType, ViewTypes } from 'nocodb-sdk'; |
import { KanbanType, ViewTypes } from 'nocodb-sdk'; |
||||||
import View from '../../models/View'; |
import View from '../models/View'; |
||||||
import KanbanView from '../../models/KanbanView'; |
import KanbanView from '../models/KanbanView'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
export async function kanbanViewGet(req: Request, res: Response<KanbanType>) { |
export async function kanbanViewGet(req: Request, res: Response<KanbanType>) { |
||||||
res.json(await KanbanView.get(req.params.kanbanViewId)); |
res.json(await KanbanView.get(req.params.kanbanViewId)); |
@ -1,10 +1,10 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import { MapType, ViewTypes } from 'nocodb-sdk'; |
import { MapType, ViewTypes } from 'nocodb-sdk'; |
||||||
import View from '../../models/View'; |
import View from '../models/View'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import MapView from '../../models/MapView'; |
import MapView from '../models/MapView'; |
||||||
|
|
||||||
export async function mapViewGet(req: Request, res: Response<MapType>) { |
export async function mapViewGet(req: Request, res: Response<MapType>) { |
||||||
res.json(await MapView.get(req.params.mapViewId)); |
res.json(await MapView.get(req.params.mapViewId)); |
@ -1,22 +1,22 @@ |
|||||||
// // Project CRUD
|
// // Project CRUD
|
||||||
|
|
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../utils/common/NcConnectionMgrv2'; |
||||||
import { isVirtualCol, ModelTypes, RelationTypes, UITypes } from 'nocodb-sdk'; |
import { isVirtualCol, ModelTypes, RelationTypes, UITypes } from 'nocodb-sdk'; |
||||||
import { Router } from 'express'; |
import { Router } from 'express'; |
||||||
import Base from '../../models/Base'; |
import Base from '../models/Base'; |
||||||
import ModelXcMetaFactory from '../../db/sql-mgr/code/models/xc/ModelXcMetaFactory'; |
import ModelXcMetaFactory from '../db/sql-mgr/code/models/xc/ModelXcMetaFactory'; |
||||||
import Column from '../../models/Column'; |
import Column from '../models/Column'; |
||||||
import LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; |
import LinkToAnotherRecordColumn from '../models/LinkToAnotherRecordColumn'; |
||||||
import { getUniqueColumnAliasName } from '../helpers/getUniqueName'; |
import { getUniqueColumnAliasName } from '../meta/helpers/getUniqueName'; |
||||||
import NcHelp from '../../utils/NcHelp'; |
import NcHelp from '../utils/NcHelp'; |
||||||
import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName'; |
import getTableNameAlias, { getColumnNameAlias } from '../meta/helpers/getTableName'; |
||||||
import mapDefaultDisplayValue from '../helpers/mapDefaultDisplayValue'; |
import mapDefaultDisplayValue from '../meta/helpers/mapDefaultDisplayValue'; |
||||||
import getColumnUiType from '../helpers/getColumnUiType'; |
import getColumnUiType from '../meta/helpers/getColumnUiType'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
|
|
||||||
export enum MetaDiffType { |
export enum MetaDiffType { |
||||||
TABLE_NEW = 'TABLE_NEW', |
TABLE_NEW = 'TABLE_NEW', |
@ -1,10 +1,10 @@ |
|||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import ModelRoleVisibility from '../../models/ModelRoleVisibility'; |
import ModelRoleVisibility from '../models/ModelRoleVisibility'; |
||||||
import { Router } from 'express'; |
import { Router } from 'express'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
async function xcVisibilityMetaSetAll(req, res) { |
async function xcVisibilityMetaSetAll(req, res) { |
||||||
Tele.emit('evt', { evt_type: 'uiAcl:updated' }); |
Tele.emit('evt', { evt_type: 'uiAcl:updated' }); |
||||||
for (const d of req.body) { |
for (const d of req.body) { |
@ -1,11 +1,11 @@ |
|||||||
import { Router } from 'express'; |
import { Router } from 'express'; |
||||||
import { OrgUserRoles } from 'nocodb-sdk'; |
import { OrgUserRoles } from 'nocodb-sdk'; |
||||||
import { NC_LICENSE_KEY } from '../../constants'; |
import { NC_LICENSE_KEY } from '../constants'; |
||||||
import Store from '../../models/Store'; |
import Store from '../models/Store'; |
||||||
import Noco from '../../Noco'; |
import Noco from '../Noco'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
async function licenseGet(_req, res) { |
async function licenseGet(_req, res) { |
||||||
const license = await Store.get(NC_LICENSE_KEY); |
const license = await Store.get(NC_LICENSE_KEY); |
@ -1,14 +1,14 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import { OrgUserRoles } from 'nocodb-sdk'; |
import { OrgUserRoles } from 'nocodb-sdk'; |
||||||
import ApiToken from '../../models/ApiToken'; |
import ApiToken from '../models/ApiToken'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { NcError } from '../helpers/catchError'; |
import { NcError } from '../meta/helpers/catchError'; |
||||||
import getHandler from '../helpers/getHandler'; |
import getHandler from '../meta/helpers/getHandler'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import { apiTokenListEE } from './ee/orgTokenApis'; |
import { apiTokenListEE } from '../meta/api/ee/orgTokenApis'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
async function apiTokenList(req, res) { |
async function apiTokenList(req, res) { |
||||||
const fk_user_id = req.user.id; |
const fk_user_id = req.user.id; |
@ -1,12 +1,12 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import Plugin from '../../models/Plugin'; |
import Plugin from '../models/Plugin'; |
||||||
import { PluginType } from 'nocodb-sdk'; |
import { PluginType } from 'nocodb-sdk'; |
||||||
import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; |
import NcPluginMgrv2 from '../meta/helpers/NcPluginMgrv2'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
export async function pluginList(_req: Request, res: Response) { |
export async function pluginList(_req: Request, res: Response) { |
||||||
res.json(new PagedResponseImpl(await Plugin.list())); |
res.json(new PagedResponseImpl(await Plugin.list())); |
@ -1,25 +1,25 @@ |
|||||||
import { Request, Response } from 'express'; |
import { Request, Response } from 'express'; |
||||||
import { OrgUserRoles, ProjectType } from 'nocodb-sdk'; |
import { OrgUserRoles, ProjectType } from 'nocodb-sdk'; |
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import { ProjectListType } from 'nocodb-sdk'; |
import { ProjectListType } from 'nocodb-sdk'; |
||||||
import DOMPurify from 'isomorphic-dompurify'; |
import DOMPurify from 'isomorphic-dompurify'; |
||||||
import { packageVersion } from '../../utils/packageVersion'; |
import { packageVersion } from '../utils/packageVersion'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import syncMigration from '../helpers/syncMigration'; |
import syncMigration from '../meta/helpers/syncMigration'; |
||||||
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../utils/common/NcConnectionMgrv2'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import ProjectUser from '../../models/ProjectUser'; |
import ProjectUser from '../models/ProjectUser'; |
||||||
import { customAlphabet } from 'nanoid'; |
import { customAlphabet } from 'nanoid'; |
||||||
import Noco from '../../Noco'; |
import Noco from '../Noco'; |
||||||
import isDocker from 'is-docker'; |
import isDocker from 'is-docker'; |
||||||
import { NcError } from '../helpers/catchError'; |
import { NcError } from '../meta/helpers/catchError'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { extractPropsAndSanitize } from '../helpers/extractProps'; |
import { extractPropsAndSanitize } from '../meta/helpers/extractProps'; |
||||||
import NcConfigFactory from '../../utils/NcConfigFactory'; |
import NcConfigFactory from '../utils/NcConfigFactory'; |
||||||
import { promisify } from 'util'; |
import { promisify } from 'util'; |
||||||
import { getAjvValidatorMw, populateMeta } from './helpers'; |
import { getAjvValidatorMw, populateMeta } from '../meta/api/helpers'; |
||||||
import Filter from '../../models/Filter'; |
import Filter from '../models/Filter'; |
||||||
|
|
||||||
const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 4); |
const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz_', 4); |
||||||
|
|
@ -1,23 +1,23 @@ |
|||||||
import { OrgUserRoles } from 'nocodb-sdk'; |
import { OrgUserRoles } from 'nocodb-sdk'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { Router } from 'express'; |
import { Router } from 'express'; |
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import ProjectUser from '../../models/ProjectUser'; |
import ProjectUser from '../models/ProjectUser'; |
||||||
import validator from 'validator'; |
import validator from 'validator'; |
||||||
import { NcError } from '../helpers/catchError'; |
import { NcError } from '../meta/helpers/catchError'; |
||||||
import { v4 as uuidv4 } from 'uuid'; |
import { v4 as uuidv4 } from 'uuid'; |
||||||
import User from '../../models/User'; |
import User from '../models/User'; |
||||||
import Audit from '../../models/Audit'; |
import Audit from '../models/Audit'; |
||||||
import NocoCache from '../../cache/NocoCache'; |
import NocoCache from '../cache/NocoCache'; |
||||||
import { CacheGetType, CacheScope, MetaTable } from '../../utils/globals'; |
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals'; |
||||||
import * as ejs from 'ejs'; |
import * as ejs from 'ejs'; |
||||||
import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; |
import NcPluginMgrv2 from '../meta/helpers/NcPluginMgrv2'; |
||||||
import Noco from '../../Noco'; |
import Noco from '../Noco'; |
||||||
import { PluginCategory } from 'nocodb-sdk'; |
import { PluginCategory } from 'nocodb-sdk'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { randomTokenString } from '../helpers/stringHelpers'; |
import { randomTokenString } from '../meta/helpers/stringHelpers'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
async function userList(req, res) { |
async function userList(req, res) { |
||||||
res.json({ |
res.json({ |
@ -1,24 +1,24 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import { nocoExecute } from 'nc-help'; |
import { nocoExecute } from 'nc-help'; |
||||||
import Base from '../../../models/Base'; |
import Base from '../../models/Base'; |
||||||
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
||||||
import { PagedResponseImpl } from '../../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../../meta/helpers/PagedResponse'; |
||||||
import View from '../../../models/View'; |
import View from '../../models/View'; |
||||||
import catchError, { NcError } from '../../helpers/catchError'; |
import catchError, { NcError } from '../../meta/helpers/catchError'; |
||||||
import multer from 'multer'; |
import multer from 'multer'; |
||||||
import { ErrorMessages, UITypes, ViewTypes } from 'nocodb-sdk'; |
import { ErrorMessages, UITypes, ViewTypes } from 'nocodb-sdk'; |
||||||
import Column from '../../../models/Column'; |
import Column from '../../models/Column'; |
||||||
import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; |
import LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; |
||||||
import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; |
import NcPluginMgrv2 from '../../meta/helpers/NcPluginMgrv2'; |
||||||
import path from 'path'; |
import path from 'path'; |
||||||
import { nanoid } from 'nanoid'; |
import { nanoid } from 'nanoid'; |
||||||
import { mimeIcons } from '../../../utils/mimeTypes'; |
import { mimeIcons } from '../../utils/mimeTypes'; |
||||||
import slash from 'slash'; |
import slash from 'slash'; |
||||||
import { sanitizeUrlPath } from '../attachmentApis'; |
import { sanitizeUrlPath } from '../attachmentApis'; |
||||||
import getAst from '../../../db/sql-data-mapper/lib/sql/helpers/getAst'; |
import getAst from '../../db/sql-data-mapper/lib/sql/helpers/getAst'; |
||||||
import { getColumnByIdOrName } from '../dataApis/helpers'; |
import { getColumnByIdOrName } from '../dataApis/helpers'; |
||||||
import { NC_ATTACHMENT_FIELD_SIZE } from '../../../constants'; |
import { NC_ATTACHMENT_FIELD_SIZE } from '../../constants'; |
||||||
|
|
||||||
export async function dataList(req: Request, res: Response) { |
export async function dataList(req: Request, res: Response) { |
||||||
try { |
try { |
@ -1,17 +1,17 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import * as XLSX from 'xlsx'; |
import * as XLSX from 'xlsx'; |
||||||
import View from '../../../models/View'; |
import View from '../../models/View'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import Base from '../../../models/Base'; |
import Base from '../../models/Base'; |
||||||
import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; |
import NcConnectionMgrv2 from '../../utils/common/NcConnectionMgrv2'; |
||||||
import { nocoExecute } from 'nc-help'; |
import { nocoExecute } from 'nc-help'; |
||||||
import papaparse from 'papaparse'; |
import papaparse from 'papaparse'; |
||||||
import { ErrorMessages, isSystemColumn, UITypes, ViewTypes } from 'nocodb-sdk'; |
import { ErrorMessages, isSystemColumn, UITypes, ViewTypes } from 'nocodb-sdk'; |
||||||
import Column from '../../../models/Column'; |
import Column from '../../models/Column'; |
||||||
import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; |
import LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; |
||||||
import LookupColumn from '../../../models/LookupColumn'; |
import LookupColumn from '../../models/LookupColumn'; |
||||||
import catchError, { NcError } from '../../helpers/catchError'; |
import catchError, { NcError } from '../../meta/helpers/catchError'; |
||||||
import getAst from '../../../db/sql-data-mapper/lib/sql/helpers/getAst'; |
import getAst from '../../db/sql-data-mapper/lib/sql/helpers/getAst'; |
||||||
|
|
||||||
async function exportExcel(req: Request, res: Response) { |
async function exportExcel(req: Request, res: Response) { |
||||||
const view = await View.getByUUID(req.params.publicDataUuid); |
const view = await View.getByUUID(req.params.publicDataUuid); |
@ -1,17 +1,17 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import catchError, { NcError } from '../../helpers/catchError'; |
import catchError, { NcError } from '../../meta/helpers/catchError'; |
||||||
import View from '../../../models/View'; |
import View from '../../models/View'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import { |
import { |
||||||
ErrorMessages, |
ErrorMessages, |
||||||
LinkToAnotherRecordType, |
LinkToAnotherRecordType, |
||||||
RelationTypes, |
RelationTypes, |
||||||
UITypes, |
UITypes, |
||||||
} from 'nocodb-sdk'; |
} from 'nocodb-sdk'; |
||||||
import Column from '../../../models/Column'; |
import Column from '../../models/Column'; |
||||||
import Base from '../../../models/Base'; |
import Base from '../../models/Base'; |
||||||
import Project from '../../../models/Project'; |
import Project from '../../models/Project'; |
||||||
import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; |
import LinkToAnotherRecordColumn from '../../models/LinkToAnotherRecordColumn'; |
||||||
|
|
||||||
export async function viewMetaGet(req: Request, res: Response) { |
export async function viewMetaGet(req: Request, res: Response) { |
||||||
const view: View & { |
const view: View & { |
@ -1,10 +1,10 @@ |
|||||||
import { Router } from 'express'; |
import { Router } from 'express'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { v4 as uuidv4 } from 'uuid'; |
import { v4 as uuidv4 } from 'uuid'; |
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import { NcError } from '../helpers/catchError'; |
import { NcError } from '../meta/helpers/catchError'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
// todo: load from config
|
// todo: load from config
|
||||||
const config = { |
const config = { |
||||||
dashboardPath: '/nc', |
dashboardPath: '/nc', |
@ -1,18 +1,18 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
import { SortListType, SortType, TableType } from 'nocodb-sdk'; |
import { SortListType, SortType, TableType } from 'nocodb-sdk'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; |
import ProjectMgrv2 from '../db/sql-mgr/v2/ProjectMgrv2'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import Sort from '../../models/Sort'; |
import Sort from '../models/Sort'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
import { getAjvValidatorMw } from './helpers'; |
import { getAjvValidatorMw } from '../meta/api/helpers'; |
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export async function sortGet(req: Request, res: Response<TableType>) {} |
export async function sortGet(req: Request, res: Response<TableType>) {} |
@ -1,6 +1,6 @@ |
|||||||
import Noco from '../../../../Noco'; |
import Noco from '../../../Noco'; |
||||||
import Model from '../../../../models/Model'; |
import Model from '../../../models/Model'; |
||||||
import Project from '../../../../models/Project'; |
import Project from '../../../models/Project'; |
||||||
import { getModelPaths, getViewPaths } from './templates/paths'; |
import { getModelPaths, getViewPaths } from './templates/paths'; |
||||||
import { SwaggerColumn } from './getSwaggerColumnMetas'; |
import { SwaggerColumn } from './getSwaggerColumnMetas'; |
||||||
import { SwaggerView } from './getSwaggerJSON'; |
import { SwaggerView } from './getSwaggerJSON'; |
@ -1,6 +1,6 @@ |
|||||||
import Noco from '../../../../Noco'; |
import Noco from '../../../Noco'; |
||||||
import Model from '../../../../models/Model'; |
import Model from '../../../models/Model'; |
||||||
import Project from '../../../../models/Project'; |
import Project from '../../../models/Project'; |
||||||
import { getModelSchemas, getViewSchemas } from './templates/schemas'; |
import { getModelSchemas, getViewSchemas } from './templates/schemas'; |
||||||
import { SwaggerColumn } from './getSwaggerColumnMetas'; |
import { SwaggerColumn } from './getSwaggerColumnMetas'; |
||||||
import { SwaggerView } from './getSwaggerJSON'; |
import { SwaggerView } from './getSwaggerJSON'; |
@ -1,9 +1,9 @@ |
|||||||
import { UITypes } from 'nocodb-sdk'; |
import { UITypes } from 'nocodb-sdk'; |
||||||
import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; |
import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; |
||||||
import SwaggerTypes from '../../../../db/sql-mgr/code/routers/xc-ts/SwaggerTypes'; |
import SwaggerTypes from '../../../db/sql-mgr/code/routers/xc-ts/SwaggerTypes'; |
||||||
import Column from '../../../../models/Column'; |
import Column from '../../../models/Column'; |
||||||
import Noco from '../../../../Noco'; |
import Noco from '../../../Noco'; |
||||||
import Project from '../../../../models/Project'; |
import Project from '../../../models/Project'; |
||||||
|
|
||||||
export default async ( |
export default async ( |
||||||
columns: Column[], |
columns: Column[], |
@ -1,15 +1,15 @@ |
|||||||
import FormViewColumn from '../../../../models/FormViewColumn'; |
import FormViewColumn from '../../../models/FormViewColumn'; |
||||||
import GalleryViewColumn from '../../../../models/GalleryViewColumn'; |
import GalleryViewColumn from '../../../models/GalleryViewColumn'; |
||||||
import Noco from '../../../../Noco'; |
import Noco from '../../../Noco'; |
||||||
import Model from '../../../../models/Model'; |
import Model from '../../../models/Model'; |
||||||
import swaggerBase from './swagger-base.json'; |
import swaggerBase from './swagger-base.json'; |
||||||
import getPaths from './getPaths'; |
import getPaths from './getPaths'; |
||||||
import getSchemas from './getSchemas'; |
import getSchemas from './getSchemas'; |
||||||
import Project from '../../../../models/Project'; |
import Project from '../../../models/Project'; |
||||||
import getSwaggerColumnMetas from './getSwaggerColumnMetas'; |
import getSwaggerColumnMetas from './getSwaggerColumnMetas'; |
||||||
import { ViewTypes } from 'nocodb-sdk'; |
import { ViewTypes } from 'nocodb-sdk'; |
||||||
import GridViewColumn from '../../../../models/GridViewColumn'; |
import GridViewColumn from '../../../models/GridViewColumn'; |
||||||
import View from '../../../../models/View'; |
import View from '../../../models/View'; |
||||||
|
|
||||||
export default async function getSwaggerJSON( |
export default async function getSwaggerJSON( |
||||||
project: Project, |
project: Project, |
@ -1,6 +1,6 @@ |
|||||||
import { SwaggerColumn } from '../getSwaggerColumnMetas'; |
import { SwaggerColumn } from '../getSwaggerColumnMetas'; |
||||||
import { RelationTypes, UITypes } from 'nocodb-sdk'; |
import { RelationTypes, UITypes } from 'nocodb-sdk'; |
||||||
import LinkToAnotherRecordColumn from '../../../../../models/LinkToAnotherRecordColumn'; |
import LinkToAnotherRecordColumn from '../../../../models/LinkToAnotherRecordColumn'; |
||||||
|
|
||||||
export const rowIdParam = { |
export const rowIdParam = { |
||||||
schema: { |
schema: { |
@ -1,10 +1,10 @@ |
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import catchError, { NcError } from '../../helpers/catchError'; |
import catchError, { NcError } from '../../meta/helpers/catchError'; |
||||||
import { Router } from 'express'; |
import { Router } from 'express'; |
||||||
import Model from '../../../models/Model'; |
import Model from '../../models/Model'; |
||||||
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw'; |
||||||
import getSwaggerJSON from './helpers/getSwaggerJSON'; |
import getSwaggerJSON from './helpers/getSwaggerJSON'; |
||||||
import Project from '../../../models/Project'; |
import Project from '../../models/Project'; |
||||||
import getSwaggerHtml from './swaggerHtml'; |
import getSwaggerHtml from './swaggerHtml'; |
||||||
import getRedocHtml from './redocHtml'; |
import getRedocHtml from './redocHtml'; |
||||||
|
|
@ -1,12 +1,12 @@ |
|||||||
import { Request, Router } from 'express'; |
import { Request, Router } from 'express'; |
||||||
// import { Queue } from 'bullmq';
|
// import { Queue } from 'bullmq';
|
||||||
// import axios from 'axios';
|
// import axios from 'axios';
|
||||||
import catchError, { NcError } from '../../helpers/catchError'; |
import catchError, { NcError } from '../../meta/helpers/catchError'; |
||||||
import { Server } from 'socket.io'; |
import { Server } from 'socket.io'; |
||||||
import NocoJobs from '../../../jobs/NocoJobs'; |
import NocoJobs from '../../jobs/NocoJobs'; |
||||||
import job, { AirtableSyncConfig } from './helpers/job'; |
import job, { AirtableSyncConfig } from './helpers/job'; |
||||||
import SyncSource from '../../../models/SyncSource'; |
import SyncSource from '../../models/SyncSource'; |
||||||
import Noco from '../../../Noco'; |
import Noco from '../../Noco'; |
||||||
import { genJwt } from '../userApi/helpers'; |
import { genJwt } from '../userApi/helpers'; |
||||||
const AIRTABLE_IMPORT_JOB = 'AIRTABLE_IMPORT_JOB'; |
const AIRTABLE_IMPORT_JOB = 'AIRTABLE_IMPORT_JOB'; |
||||||
const AIRTABLE_PROGRESS_JOB = 'AIRTABLE_PROGRESS_JOB'; |
const AIRTABLE_PROGRESS_JOB = 'AIRTABLE_PROGRESS_JOB'; |
@ -1,10 +1,10 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
|
|
||||||
import SyncSource from '../../../models/SyncSource'; |
import SyncSource from '../../models/SyncSource'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import { PagedResponseImpl } from '../../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../../meta/helpers/PagedResponse'; |
||||||
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw'; |
||||||
import Project from '../../../models/Project'; |
import Project from '../../models/Project'; |
||||||
|
|
||||||
export async function syncSourceList(req: Request, res: Response) { |
export async function syncSourceList(req: Request, res: Response) { |
||||||
// todo: pagination
|
// todo: pagination
|
@ -1,5 +1,5 @@ |
|||||||
import { Request, Router } from 'express'; |
import { Request, Router } from 'express'; |
||||||
import { TestResetService } from '../../services/test/TestResetService'; |
import { TestResetService } from '../services/test/TestResetService'; |
||||||
|
|
||||||
export async function reset(req: Request<any, any>, res) { |
export async function reset(req: Request<any, any>, res) { |
||||||
const service = new TestResetService({ |
const service = new TestResetService({ |
@ -1,7 +1,7 @@ |
|||||||
import * as jwt from 'jsonwebtoken'; |
import * as jwt from 'jsonwebtoken'; |
||||||
import crypto from 'crypto'; |
import crypto from 'crypto'; |
||||||
import User from '../../../models/User'; |
import User from '../../models/User'; |
||||||
import { NcConfig } from '../../../../interface/config'; |
import { NcConfig } from '../../../interface/config'; |
||||||
|
|
||||||
export function genJwt(user: User, config: NcConfig) { |
export function genJwt(user: User, config: NcConfig) { |
||||||
return jwt.sign( |
return jwt.sign( |
@ -1,14 +1,14 @@ |
|||||||
import User from '../../../models/User'; |
import User from '../../models/User'; |
||||||
import { v4 as uuidv4 } from 'uuid'; |
import { v4 as uuidv4 } from 'uuid'; |
||||||
import { promisify } from 'util'; |
import { promisify } from 'util'; |
||||||
|
|
||||||
import bcrypt from 'bcryptjs'; |
import bcrypt from 'bcryptjs'; |
||||||
import Noco from '../../../Noco'; |
import Noco from '../../Noco'; |
||||||
import { CacheScope, MetaTable } from '../../../utils/globals'; |
import { CacheScope, MetaTable } from '../../utils/globals'; |
||||||
import ProjectUser from '../../../models/ProjectUser'; |
import ProjectUser from '../../models/ProjectUser'; |
||||||
import { validatePassword } from 'nocodb-sdk'; |
import { validatePassword } from 'nocodb-sdk'; |
||||||
import boxen from 'boxen'; |
import boxen from 'boxen'; |
||||||
import NocoCache from '../../../cache/NocoCache'; |
import NocoCache from '../../cache/NocoCache'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
|
|
||||||
const { isEmail } = require('validator'); |
const { isEmail } = require('validator'); |
@ -1,30 +1,30 @@ |
|||||||
import { Request, Response } from 'express'; |
import { Request, Response } from 'express'; |
||||||
import { TableType, validatePassword } from 'nocodb-sdk'; |
import { TableType, validatePassword } from 'nocodb-sdk'; |
||||||
import { OrgUserRoles } from 'nocodb-sdk'; |
import { OrgUserRoles } from 'nocodb-sdk'; |
||||||
import { NC_APP_SETTINGS } from '../../../constants'; |
import { NC_APP_SETTINGS } from '../../constants'; |
||||||
import Store from '../../../models/Store'; |
import Store from '../../models/Store'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import catchError, { NcError } from '../../helpers/catchError'; |
import catchError, { NcError } from '../../meta/helpers/catchError'; |
||||||
|
|
||||||
const { isEmail } = require('validator'); |
const { isEmail } = require('validator'); |
||||||
import * as ejs from 'ejs'; |
import * as ejs from 'ejs'; |
||||||
|
|
||||||
import bcrypt from 'bcryptjs'; |
import bcrypt from 'bcryptjs'; |
||||||
import { promisify } from 'util'; |
import { promisify } from 'util'; |
||||||
import User from '../../../models/User'; |
import User from '../../models/User'; |
||||||
|
|
||||||
const { v4: uuidv4 } = require('uuid'); |
const { v4: uuidv4 } = require('uuid'); |
||||||
import Audit from '../../../models/Audit'; |
import Audit from '../../models/Audit'; |
||||||
import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2'; |
import NcPluginMgrv2 from '../../meta/helpers/NcPluginMgrv2'; |
||||||
|
|
||||||
import passport from 'passport'; |
import passport from 'passport'; |
||||||
import extractProjectIdAndAuthenticate from '../../helpers/extractProjectIdAndAuthenticate'; |
import extractProjectIdAndAuthenticate from '../../meta/helpers/extractProjectIdAndAuthenticate'; |
||||||
import ncMetaAclMw from '../../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../../meta/helpers/ncMetaAclMw'; |
||||||
import { MetaTable } from '../../../utils/globals'; |
import { MetaTable } from '../../utils/globals'; |
||||||
import Noco from '../../../Noco'; |
import Noco from '../../Noco'; |
||||||
import { getAjvValidatorMw } from '../helpers'; |
import { getAjvValidatorMw } from '../../meta/api/helpers'; |
||||||
import { genJwt } from './helpers'; |
import { genJwt } from './helpers'; |
||||||
import { randomTokenString } from '../../helpers/stringHelpers'; |
import { randomTokenString } from '../../meta/helpers/stringHelpers'; |
||||||
|
|
||||||
export async function registerNewUserIfAllowed({ |
export async function registerNewUserIfAllowed({ |
||||||
firstname, |
firstname, |
@ -1,19 +1,19 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Model from '../../models/Model'; |
import Model from '../models/Model'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { PagedResponseImpl } from '../helpers/PagedResponse'; |
import { PagedResponseImpl } from '../meta/helpers/PagedResponse'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import { Table, TableReq, ViewList } from 'nocodb-sdk'; |
import { Table, TableReq, ViewList } from 'nocodb-sdk'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import ProjectMgrv2 from '../../db/sql-mgr/v2/ProjectMgrv2'; |
import ProjectMgrv2 from '../db/sql-mgr/v2/ProjectMgrv2'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Project from '../../models/Project'; |
import Project from '../models/Project'; |
||||||
import View from '../../models/View'; |
import View from '../models/View'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { xcVisibilityMetaGet } from './modelVisibilityApis'; |
import { xcVisibilityMetaGet } from './modelVisibilityApis'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export async function viewGet(req: Request, res: Response<Table>) {} |
export async function viewGet(req: Request, res: Response<Table>) {} |
||||||
|
|
@ -1,8 +1,8 @@ |
|||||||
import { Request, Response, Router } from 'express'; |
import { Request, Response, Router } from 'express'; |
||||||
import View from '../../models/View'; |
import View from '../models/View'; |
||||||
import { Tele } from 'nc-help'; |
import { Tele } from 'nc-help'; |
||||||
import ncMetaAclMw from '../helpers/ncMetaAclMw'; |
import ncMetaAclMw from '../meta/helpers/ncMetaAclMw'; |
||||||
import { metaApiMetrics } from '../helpers/apiMetrics'; |
import { metaApiMetrics } from '../meta/helpers/apiMetrics'; |
||||||
|
|
||||||
export async function columnList(req: Request, res: Response) { |
export async function columnList(req: Request, res: Response) { |
||||||
res.json(await View.getColumns(req.params.viewId)); |
res.json(await View.getColumns(req.params.viewId)); |
Loading…
Reference in new issue